![]() |
PURIFY
Next-generation radio interferometric imaging
|
Classes | |
struct | header_params |
Functions | |
void | write_key (fitsfile *fptr, const std::string &key, const std::string &value, const std::string &comment, int *status) |
write key to fits file header More... | |
void | write_key (fitsfile *fptr, const std::string &key, const char *value, const std::string &comment, int *status) |
void | write_history (fitsfile *fptr, const std::string &context, const std::string &history, int *status) |
write history to fits file More... | |
void | write2d (const Image< t_real > &eigen_image, const pfitsio::header_params &header, const bool &overwrite) |
Write image to fits file. More... | |
void | write2d (const Image< t_real > &image, const std::string &fits_name, const std::string &pix_units="Jy/Beam", const bool &overwrite=true) |
Write image to fits file. More... | |
void | write3d (const std::vector< Image< t_real >> &image, const pfitsio::header_params &header, const bool &overwrite=true) |
Write cube to fits file using header information. More... | |
void | write3d (const std::vector< Image< t_real >> &image, const std::string &fits_name, const std::string &pix_units="Jy/Beam", const bool &overwrite=true) |
Write cube to fits file. More... | |
std::vector< Image< t_complex > > | read3d (const std::string &fits_name) |
Read cube from fits file. More... | |
Image< t_complex > | read2d (const std::string &fits_name) |
Read image from fits file. More... | |
template<class T > | |
std::enable_if< std::is_scalar< T >::value, void >::type | write_history (fitsfile *fptr, const std::string &context, const T &history, int *status) |
template<class T > | |
std::enable_if< std::is_scalar< T >::value, void >::type | write_key (fitsfile *fptr, const std::string &key, const T &value, const std::string &comment, int *status) |
template<typename T > | |
T | read_key (fitsfile *fptr, const std::string &key, int *status) |
read fits key and return as tuple More... | |
template<typename DERIVED > | |
void | write2d (const Eigen::EigenBase< DERIVED > &input, int nx, int ny, const std::string &fits_name, const std::string &pix_units="Jy/Beam", const bool &overwrite=true) |
template<typename DERIVED > | |
void | write2d (const Eigen::EigenBase< DERIVED > &input, int nx, int ny, const pfitsio::header_params &header, const bool overwrite=true) |
template<typename DERIVED > | |
void | write3d (const std::vector< Eigen::EigenBase< DERIVED >> &input, int nx, int ny, const std::string &fits_name, const std::string &pix_units="Jy/Beam", const bool &overwrite=true) |
template<typename DERIVED > | |
void | write3d (const std::vector< Eigen::EigenBase< DERIVED >> &input, int nx, int ny, const pfitsio::header_params &header, const bool &overwrite=true) |
template<typename T > | |
std::enable_if< std::is_same< t_real, typename T::Scalar >::value, void >::type | write3d (const Eigen::EigenBase< T > &image, const t_int rows, const t_int cols, const t_int chans, const std::string &fits_name, const std::string &pix_units="Jy/Beam", const bool &overwrite=true) |
template<typename T > | |
std::enable_if< std::is_same< t_real, typename T::Scalar >::value, void >::type | write3d (const Eigen::EigenBase< T > &image, const t_int rows, const t_int cols, const t_int chans, const pfitsio::header_params &header, const bool &overwrite) |
write 3d fits cube with header More... | |
template<typename T , typename = std::enable_if_t<std::is_same_v<double, typename T::Scalar>>> | |
void | read3d (const std::string &fits_name, Eigen::EigenBase< T > &output, int &rows, int &cols, int &channels, int &pols) |
utilities::vis_params | read_uvfits (const std::vector< std::string > &names, const bool flag=true, const stokes pol=stokes::I) |
Read uvfits files from name of vector. More... | |
utilities::vis_params | read_uvfits (const std::string &vis_name2, const utilities::vis_params &u1, const bool flag=true, const stokes pol=stokes::I) |
Reads in combine visiblities from uvfits files. More... | |
utilities::vis_params | read_uvfits (const std::string &filename, const bool flag=true, const stokes pol=stokes::I) |
Read uvfits file. More... | |
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=[](const t_real, const t_real, const t_real, const t_complex vis1, const t_complex weight1, const t_real, const t_real, const t_real, const t_complex vis2, const t_complex weight2) { return(weight1.real() > 0.) and(weight2.real() > 0.) and(std::abs(vis1) > 1e-20) and(std::abs(vis2) > 1e-20) and(!std::isnan(vis1.real()) and !std::isnan(vis1.imag())) and(!std::isnan(vis2.real()) and !std::isnan(vis2.imag()));}) |
Remove visibilities with zero weighting. More... | |
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 More... | |
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 More... | |
Vector< t_real > | read_uvfits_freq (fitsfile *fptr, int *status, const int &col) |
read frequencies for each channel More... | |
void | read_uvfits_freq (fitsfile *fptr, int *status, Vector< t_real > &output, const int &col) |
Vector< t_real > | read_uvfits_data (fitsfile *fptr, int *status, const std::vector< int > &naxis, const int &baselines) |
read data from uvfits file More... | |
void | read_uvfits_data (fitsfile *fptr, int *status, const std::vector< int > &naxis, const int &baselines, Vector< t_real > &output) |
Matrix< t_real > | read_uvfits_coords (fitsfile *fptr, int *status, const int &groups, const int &pcount) |
read coordinates from uvfits file More... | |
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 More... | |
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 More... | |
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 More... | |
void | read_uvfits_coords (fitsfile *fptr, int *status, const int &pcount, const int &groups, Matrix< t_real > &output) |
void | read_fits_keys (fitsfile *fptr, int *status) |
Read uvfits keys out. More... | |
utilities::vis_params purify::pfitsio::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.
Definition at line 175 of file uvfits.cc.
References purify::utilities::vis_params::average_frequency, purify::utilities::vis_params::baseline, purify::utilities::vis_params::dec, purify::utilities::vis_params::frequencies, PURIFY_LOW_LOG, purify::utilities::vis_params::ra, purify::utilities::vis_params::size(), purify::utilities::vis_params::time, purify::utilities::vis_params::u, purify::utilities::vis_params::units, purify::utilities::vis_params::v, purify::utilities::vis_params::vis, purify::utilities::vis_params::w, and purify::utilities::vis_params::weights.
Image< t_complex > purify::pfitsio::read2d | ( | const std::string & | fits_name | ) |
Read image from fits file.
Definition at line 109 of file pfitsio.cc.
References read3d().
Referenced by getInputData(), main(), and TEST_CASE().
std::vector< Image< t_complex > > purify::pfitsio::read3d | ( | const std::string & | fits_name | ) |
Read cube from fits file.
Definition at line 95 of file pfitsio.cc.
Referenced by getInputData(), and read2d().
void purify::pfitsio::read3d | ( | const std::string & | fits_name, |
Eigen::EigenBase< T > & | output, | ||
int & | rows, | ||
int & | cols, | ||
int & | channels, | ||
int & | pols | ||
) |
void purify::pfitsio::read_fits_keys | ( | fitsfile * | fptr, |
int * | status | ||
) |
T purify::pfitsio::read_key | ( | fitsfile * | fptr, |
const std::string & | key, | ||
int * | status | ||
) |
utilities::vis_params purify::pfitsio::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
Definition at line 284 of file uvfits.cc.
References purify::utilities::vis_params::average_frequency, purify::utilities::vis_params::baseline, purify::constant::c, purify::utilities::vis_params::frequencies, purify::utilities::lambda, read_vis_from_data(), read_weight_from_data(), purify::utilities::vis_params::time, purify::utilities::vis_params::u, purify::utilities::vis_params::units, purify::utilities::vis_params::v, purify::utilities::vis_params::vis, purify::utilities::vis_params::w, and purify::utilities::vis_params::weights.
utilities::vis_params purify::pfitsio::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
Definition at line 225 of file uvfits.cc.
References purify::utilities::vis_params::average_frequency, purify::utilities::vis_params::baseline, purify::constant::c, purify::utilities::vis_params::frequencies, purify::utilities::lambda, PURIFY_LOW_LOG, PURIFY_MEDIUM_LOG, read_vis_from_data(), read_weight_from_data(), purify::utilities::vis_params::time, purify::utilities::vis_params::u, purify::utilities::vis_params::units, purify::utilities::vis_params::v, purify::utilities::vis_params::vis, purify::utilities::vis_params::w, and purify::utilities::vis_params::weights.
Referenced by read_uvfits().
utilities::vis_params purify::pfitsio::read_uvfits | ( | const std::string & | filename, |
const bool | flag, | ||
const stokes | pol | ||
) |
Read uvfits file.
Definition at line 49 of file uvfits.cc.
References purify::I, PURIFY_LOW_LOG, PURIFY_MEDIUM_LOG, purify::Q, purify::utilities::vis_params::ra, read_polarisation_with_flagging(), read_uvfits_coords(), read_uvfits_data(), read_uvfits_freq(), purify::U, and purify::V.
utilities::vis_params purify::pfitsio::read_uvfits | ( | const std::string & | vis_name2, |
const utilities::vis_params & | uv1, | ||
const bool | flag, | ||
const stokes | pol | ||
) |
Reads in combine visiblities from uvfits files.
Definition at line 20 of file uvfits.cc.
References purify::utilities::vis_params::dec, purify::utilities::vis_params::ra, read_uvfits(), purify::utilities::vis_params::size(), purify::utilities::vis_params::u, purify::utilities::vis_params::v, purify::utilities::vis_params::vis, purify::utilities::vis_params::w, and purify::utilities::vis_params::weights.
utilities::vis_params purify::pfitsio::read_uvfits | ( | const std::vector< std::string > & | names, |
const bool | flag, | ||
const stokes | pol | ||
) |
Read uvfits files from name of vector.
Definition at line 12 of file uvfits.cc.
Referenced by main(), purify::read_measurements::read_measurements(), read_uvfits(), and TEST_CASE().
Matrix< t_real > purify::pfitsio::read_uvfits_coords | ( | fitsfile * | fptr, |
int * | status, | ||
const int & | groups, | ||
const int & | pcount | ||
) |
read coordinates from uvfits file
Definition at line 367 of file uvfits.cc.
Referenced by read_uvfits().
void purify::pfitsio::read_uvfits_coords | ( | fitsfile * | fptr, |
int * | status, | ||
const int & | pcount, | ||
const int & | groups, | ||
Matrix< t_real > & | output | ||
) |
Vector< t_real > purify::pfitsio::read_uvfits_data | ( | fitsfile * | fptr, |
int * | status, | ||
const std::vector< int > & | naxis, | ||
const int & | baselines | ||
) |
void purify::pfitsio::read_uvfits_data | ( | fitsfile * | fptr, |
int * | status, | ||
const std::vector< int > & | naxis, | ||
const int & | baselines, | ||
Vector< t_real > & | output | ||
) |
Vector< t_real > purify::pfitsio::read_uvfits_freq | ( | fitsfile * | fptr, |
int * | status, | ||
const int & | col | ||
) |
read frequencies for each channel
Definition at line 320 of file uvfits.cc.
Referenced by read_uvfits().
void purify::pfitsio::read_uvfits_freq | ( | fitsfile * | fptr, |
int * | status, | ||
Vector< t_real > & | output, | ||
const int & | col | ||
) |
t_real purify::pfitsio::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
Definition at line 374 of file uvfits.cc.
Referenced by read_vis_from_data(), and read_weight_from_data().
t_complex purify::pfitsio::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
Definition at line 381 of file uvfits.cc.
References read_value_from_data().
Referenced by read_polarisation(), and read_polarisation_with_flagging().
t_complex purify::pfitsio::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
Definition at line 388 of file uvfits.cc.
References read_value_from_data().
Referenced by read_polarisation(), and read_polarisation_with_flagging().
void purify::pfitsio::write2d | ( | const Eigen::EigenBase< DERIVED > & | input, |
int | nx, | ||
int | ny, | ||
const pfitsio::header_params & | header, | ||
const bool | overwrite = true |
||
) |
Definition at line 165 of file pfitsio.h.
References write2d().
void purify::pfitsio::write2d | ( | const Eigen::EigenBase< DERIVED > & | input, |
int | nx, | ||
int | ny, | ||
const std::string & | fits_name, | ||
const std::string & | pix_units = "Jy/Beam" , |
||
const bool & | overwrite = true |
||
) |
void purify::pfitsio::write2d | ( | const Image< t_real > & | eigen_image, |
const pfitsio::header_params & | header, | ||
const bool & | overwrite | ||
) |
Write image to fits file.
Write image to fits file using header information.
Definition at line 30 of file pfitsio.cc.
References write3d().
Referenced by purify::factory::add_updater(), main(), padmm(), padmm_factory(), saveDirtyImage(), saveMeasurementEigenVector(), savePSF(), TEST_CASE(), and write2d().
void purify::pfitsio::write2d | ( | const Image< t_real > & | eigen_image, |
const std::string & | fits_name, | ||
const std::string & | pix_units, | ||
const bool & | overwrite | ||
) |
Write image to fits file.
Definition at line 44 of file pfitsio.cc.
References purify::pfitsio::header_params::fits_name, purify::pfitsio::header_params::pix_units, and write2d().
std::enable_if<std::is_same<t_real, typename T::Scalar>::value, void>::type purify::pfitsio::write3d | ( | const Eigen::EigenBase< T > & | image, |
const t_int | rows, | ||
const t_int | cols, | ||
const t_int | chans, | ||
const pfitsio::header_params & | header, | ||
const bool & | overwrite | ||
) |
write 3d fits cube with header
Definition at line 214 of file pfitsio.h.
References purify::pfitsio::header_params::cell_x, purify::pfitsio::header_params::cell_y, purify::pfitsio::header_params::channel_width, purify::pfitsio::header_params::dec, purify::pfitsio::header_params::epsilon, purify::pfitsio::header_params::fits_name, purify::pfitsio::header_params::hasconverged, purify::pfitsio::header_params::mean_frequency, purify::pfitsio::header_params::niters, purify::constant::pi, purify::pfitsio::header_params::pix_units, PURIFY_LOW_LOG, PURIFY_MACRO, purify::pfitsio::header_params::ra, purify::pfitsio::header_params::relative_variation, purify::pfitsio::header_params::residual_convergence, and write_history().
std::enable_if<std::is_same<t_real, typename T::Scalar>::value, void>::type purify::pfitsio::write3d | ( | const Eigen::EigenBase< T > & | image, |
const t_int | rows, | ||
const t_int | cols, | ||
const t_int | chans, | ||
const std::string & | fits_name, | ||
const std::string & | pix_units = "Jy/Beam" , |
||
const bool & | overwrite = true |
||
) |
Definition at line 202 of file pfitsio.h.
References purify::pfitsio::header_params::fits_name, and purify::pfitsio::header_params::pix_units.
void purify::pfitsio::write3d | ( | const std::vector< Eigen::EigenBase< DERIVED >> & | input, |
int | nx, | ||
int | ny, | ||
const pfitsio::header_params & | header, | ||
const bool & | overwrite = true |
||
) |
Definition at line 191 of file pfitsio.h.
References write3d().
void purify::pfitsio::write3d | ( | const std::vector< Eigen::EigenBase< DERIVED >> & | input, |
int | nx, | ||
int | ny, | ||
const std::string & | fits_name, | ||
const std::string & | pix_units = "Jy/Beam" , |
||
const bool & | overwrite = true |
||
) |
void purify::pfitsio::write3d | ( | const std::vector< Image< t_real >> & | eigen_images, |
const pfitsio::header_params & | header, | ||
const bool & | overwrite | ||
) |
void purify::pfitsio::write3d | ( | const std::vector< Image< t_real >> & | eigen_images, |
const std::string & | fits_name, | ||
const std::string & | pix_units, | ||
const bool & | overwrite | ||
) |
Write cube to fits file.
Definition at line 77 of file pfitsio.cc.
References purify::pfitsio::header_params::fits_name, purify::pfitsio::header_params::pix_units, and write3d().
void purify::pfitsio::write_history | ( | fitsfile * | fptr, |
const std::string & | context, | ||
const std::string & | history, | ||
int * | status | ||
) |
write history to fits file
Definition at line 22 of file pfitsio.cc.
Referenced by write3d(), and write_history().
std::enable_if<std::is_scalar<T>::value, void>::type purify::pfitsio::write_history | ( | fitsfile * | fptr, |
const std::string & | context, | ||
const T & | history, | ||
int * | status | ||
) |
Definition at line 88 of file pfitsio.h.
References write_history().
void purify::pfitsio::write_key | ( | fitsfile * | fptr, |
const std::string & | key, | ||
const char * | value, | ||
const std::string & | comment, | ||
int * | status | ||
) |
Definition at line 17 of file pfitsio.cc.
References write_key().
void purify::pfitsio::write_key | ( | fitsfile * | fptr, |
const std::string & | key, | ||
const std::string & | value, | ||
const std::string & | comment, | ||
int * | status | ||
) |