2 #ifndef PURIFY_PUVFITS_H
3 #define PURIFY_PUVFITS_H
4 #include "purify/config.h"
17 utilities::vis_params
read_uvfits(
const std::string &filename,
const bool flag =
true,
20 utilities::vis_params
read_uvfits(
const std::vector<std::string> &names,
const bool flag =
true,
23 utilities::vis_params
read_uvfits(
const std::string &vis_name2,
const utilities::vis_params &u1,
27 const utilities::vis_params &input,
const utilities::vis_params &input2,
28 const Vector<t_complex> &stokes_transform,
29 const std::function<
bool(t_real, t_real, t_real, t_complex, t_complex, t_real, t_real, t_real,
30 t_complex, t_complex)> &filter =
31 [](
const t_real,
const t_real,
const t_real,
const t_complex vis1,
const t_complex weight1,
32 const t_real,
const t_real,
const t_real,
const t_complex vis2,
33 const t_complex weight2) {
34 return (weight1.real() > 0.) and (weight2.real() > 0.) and (std::abs(vis1) > 1e-20) and
35 (std::abs(vis2) > 1e-20) and
36 (!std::isnan(vis1.real()) and !std::isnan(vis1.imag())) and
37 (!std::isnan(vis2.real()) and !std::isnan(vis2.imag()));
41 const Vector<t_real> &data,
const Matrix<t_real> &coords,
const Vector<t_real> &frequencies,
42 const t_uint pol_index1,
const t_uint pol_index2,
const t_uint pols,
const t_uint baselines,
43 const t_uint channels,
const Vector<t_complex> stokes_transform,
44 const std::function<
bool(t_complex, t_complex, t_complex, t_complex)> &filter);
48 Vector<t_real>
read_uvfits_freq(fitsfile *fptr,
int *status,
const int &col);
49 void read_uvfits_freq(fitsfile *fptr,
int *status, Vector<t_real> &output,
const int &col);
53 void read_uvfits_coords(fitsfile *fptr,
int *status,
const int &groups,
const int &pcount,
54 Matrix<t_real> &output);
56 utilities::vis_params
read_polarisation(
const Vector<t_real> &data,
const Matrix<t_real> &coords,
57 const Vector<t_real> &frequencies,
const t_uint pol_index1,
58 const t_uint pols,
const t_uint baselines,
59 const t_uint channels);
61 Vector<t_real>
read_uvfits_data(fitsfile *fptr,
int *status,
const std::vector<int> &naxis,
62 const int &baselines);
63 void read_uvfits_data(fitsfile *fptr,
int *status,
const std::vector<int> &naxis,
64 const int &baselines, Vector<t_real> &output);
67 const t_uint pols,
const t_uint chan,
const t_uint chans,
68 const t_uint baseline,
const t_uint baselines);
70 t_complex
read_vis_from_data(
const Vector<t_real> &data,
const t_uint pol,
const t_uint pols,
71 const t_uint chan,
const t_uint chans,
const t_uint baseline,
72 const t_uint baselines);
75 const t_uint chan,
const t_uint chans,
const t_uint baseline,
76 const t_uint baselines);
utilities::vis_params filter_and_combine(const utilities::vis_params &input, const utilities::vis_params &input2, const Vector< t_complex > &stokes_transform, const std::function< bool(t_real, t_real, t_real, t_complex, t_complex, t_real, t_real, t_real, t_complex, t_complex)> &filter)
Remove visibilities with zero weighting.
utilities::vis_params read_polarisation_with_flagging(const Vector< t_real > &data, const Matrix< t_real > &coords, const Vector< t_real > &frequencies, const t_uint pol_index1, const t_uint pol_index2, const t_uint pols, const t_uint baselines, const t_uint channels, const Vector< t_complex > stokes_transform, const std::function< bool(t_complex, t_complex, t_complex, t_complex)> &filter)
read polarisation with flaggging
t_real read_value_from_data(const Vector< t_real > &data, const t_uint col, const t_uint pol, const t_uint pols, const t_uint chan, const t_uint chans, const t_uint baseline, const t_uint baselines)
read value from data
t_complex read_weight_from_data(const Vector< t_real > &data, const t_uint pol, const t_uint pols, const t_uint chan, const t_uint chans, const t_uint baseline, const t_uint baselines)
return weight for given baseline
void read_fits_keys(fitsfile *fptr, int *status)
Read uvfits keys out.
Matrix< t_real > read_uvfits_coords(fitsfile *fptr, int *status, const int &groups, const int &pcount)
read coordinates from uvfits file
utilities::vis_params read_uvfits(const std::vector< std::string > &names, const bool flag, const stokes pol)
Read uvfits files from name of vector.
Vector< t_real > read_uvfits_freq(fitsfile *fptr, int *status, const int &col)
read frequencies for each channel
Vector< t_real > read_uvfits_data(fitsfile *fptr, int *status, const std::vector< int > &naxis, const int &baselines)
read data from uvfits file
utilities::vis_params read_polarisation(const Vector< t_real > &data, const Matrix< t_real > &coords, const Vector< t_real > &frequencies, const t_uint pol_index1, const t_uint pols, const t_uint baselines, const t_uint channels)
read polarisation data from uvfits data
t_complex read_vis_from_data(const Vector< t_real > &data, const t_uint pol, const t_uint pols, const t_uint chan, const t_uint chans, const t_uint baseline, const t_uint baselines)
return visibility for given baseline