casa
5.7.0-16
|
#include <SingleDishMS.h>
Public Member Functions | |
SingleDishMS () | |
Default constructor. More... | |
SingleDishMS (string const &ms_name) | |
Construct from casacore::MS name string. More... | |
~SingleDishMS () | |
Destructor. More... | |
string | name () const |
bool | close () |
void | setSelection (casacore::Record const &selection, bool const verbose=true) |
void | setAverage (casacore::Record const &average, bool const verbose=true) |
void | setPolAverage (casacore::Record const &average, bool const verbose=true) |
void | subtractBaseline (string const &in_column_name, string const &out_ms_name, string const &out_bloutput_name, bool const &do_subtract, string const &in_spw, string const &blfunc, int const order, float const clip_threshold_sigma, int const num_fitting_max, bool const linefinding, float const threshold, int const avg_limit, int const minwidth, std::vector< int > const &edge) |
Invoke baseline subtraction (polynomial, write results in new casacore::MS) More... | |
void | subtractBaselineCspline (string const &in_column_name, string const &out_ms_name, string const &out_bloutput_name, bool const &do_subtract, string const &in_spw, int const npiece, float const clip_threshold_sigma, int const num_fitting_max, bool const linefinding, float const threshold, int const avg_limit, int const minwidth, std::vector< int > const &edge) |
Cubicspline. More... | |
void | subtractBaselineSinusoid (string const &in_column_name, string const &out_ms_name, string const &out_bloutput_name, bool const &do_subtract, string const &in_spw, string const &addwn0, string const &rejwn0, bool const applyfft, string const fftmethod, string const fftthresh, float const clip_threshold_sigma, int const num_fitting_max, bool const linefinding, float const threshold, int const avg_limit, int const minwidth, std::vector< int > const &edge) |
Sinusoid. More... | |
void | subtractBaselineVariable (string const &in_column_name, string const &out_ms_name, string const &out_bloutput_name, bool const &do_subtract, string const &in_spw, string const ¶m_file, bool const &verbose=true) |
variable fitting parameters stored in a text file More... | |
void | applyBaselineTable (string const &in_column_name, string const &in_bltable_name, string const &in_spw, string const &out_ms_name) |
apply baseline table More... | |
void | fitLine (string const &in_column_name, string const &in_spw, string const &in_pol, string const &fitfunc, string const &in_nfit, bool const linefinding, float const threshold, int const avg_limit, int const minwidth, std::vector< int > const &edge, string const &tempfile_name, string const &temp_out_ms_name) |
fit line profile More... | |
void | smooth (string const &kernelType, float const kernelWidth, string const &columnName, string const &outMsName) |
smooth data with arbitrary smoothing kernel smoothing kernels currently supported include gaussian and boxcar More... | |
Static Public Member Functions | |
static bool | importAsap (string const &infile, string const &outfile, bool const parallel=false) |
static bool | importNRO (string const &infile, string const &outfile, bool const parallel=false) |
Private Member Functions | |
void | initialize () |
Utility functions ///. More... | |
void | format_selection (casacore::Record &selection) |
casacore::String | get_field_as_casa_string (casacore::Record const &in_data, string const &field_name) |
retrieve a field by name from casacore::Record as casa::String. More... | |
bool | prepare_for_process (string const &in_column_name, string const &out_ms_name) |
bool | prepare_for_process (string const &in_column_name, string const &out_ms_name, casacore::Block< casacore::Int > const &sortColumns, bool const addDefaultSortCols=false) |
void | finalize_process () |
bool | set_column (casacore::MSMainEnums::PredefinedColumns const &in, casacore::MSMainEnums::PredefinedColumns &out) |
check column 'in' is in input casacore::MS and set to 'out' if it exists. More... | |
void | convertArrayC2F (casacore::Array< casacore::Float > &from, casacore::Array< casacore::Complex > const &to) |
Convert a casacore::Complex casacore::Array to casacore::Float Array. More... | |
std::vector< string > | split_string (string const &s, char delim) |
Split a string with given delimiter. More... | |
bool | file_exists (string const &filename) |
examine if a file with specified name exists More... | |
void | parse_spw (string const &in_spw, casacore::Vector< casacore::Int > &spw, casacore::Matrix< casacore::Int > &chan, casacore::Vector< size_t > &nchan, casacore::Vector< casacore::Vector< casacore::Bool > > &mask, casacore::Vector< bool > &nchan_set) |
void | get_nchan_and_mask (casacore::Vector< casacore::Int > const &rec_spw, casacore::Vector< casacore::Int > const &data_spw, casacore::Matrix< casacore::Int > const &rec_chan, size_t const num_chan, casacore::Vector< size_t > &nchan, casacore::Vector< casacore::Vector< casacore::Bool > > &mask, casacore::Vector< bool > &nchan_set, bool &new_nchan) |
void | get_mask_from_rec (casacore::Int spwid, casacore::Matrix< casacore::Int > const &rec_chan, casacore::Vector< casacore::Bool > &mask, bool initialize=true) |
void | get_masklist_from_mask (size_t const num_chan, bool const *mask, casacore::Vector< casacore::uInt > &masklist) |
void | get_baseline_context (size_t const bltype, uint16_t order, size_t num_chan, casacore::Vector< size_t > const &nchan, casacore::Vector< bool > const &nchan_set, casacore::Vector< size_t > &ctx_indices, std::vector< LIBSAKURA_SYMBOL(LSQFitContextFloat)* > &bl_contexts) |
Create a set of baseline contexts (if necessary) More... | |
void | get_baseline_context (size_t const bltype, uint16_t order, size_t num_chan, size_t ispw, casacore::Vector< size_t > &ctx_indices, std::vector< size_t > &ctx_nchans, std::vector< LIBSAKURA_SYMBOL(LSQFitContextFloat)* > &bl_contexts) |
void | destroy_baseline_contexts (std::vector< LIBSAKURA_SYMBOL(LSQFitContextFloat)* > &bl_contexts) |
Destroy a set of baseline contexts. More... | |
void | check_sakura_status (string const &name, LIBSAKURA_SYMBOL(Status) const status) |
void | check_baseline_status (LIBSAKURA_SYMBOL(LSQFitStatus) const bl_status) |
template<typename T , typename U > | |
void | set_matrix_for_bltable (size_t const num_pol, size_t const num_data_max, std::vector< std::vector< T > > const &in_data, casacore::Array< U > &out_data) |
template<typename T , typename U > | |
void | set_array_for_bltable (size_t const ipol, size_t const num_data, T const *in_data, casacore::Array< U > &out_data) |
size_t | get_num_coeff_bloutput (size_t const bltype, size_t order, size_t &num_coeff_max) |
std::vector< int > | string_to_list (string const &wn_str, char const delim) |
void | get_effective_nwave (std::vector< int > const &addwn, std::vector< int > const &rejwn, int const wn_ulimit, std::vector< int > &effwn) |
void | finalise_effective_nwave (std::vector< int > const &blparam_eff_base, std::vector< int > const &blparam_exclude, int const &blparam_upperlimit, size_t const &num_chan, float const *spec, bool const *mask, bool const &applyfft, string const &fftmethod, string const &fftthresh, std::vector< size_t > &blparam_eff) |
void | parse_fftthresh (string const &fftthresh_str, string &fftthresh_attr, float &fftthresh_sigma, int &fftthresh_top) |
void | select_wavenumbers_via_fft (size_t const num_chan, float const *spec, bool const *mask, string const &fftmethod, string const &fftthresh_attr, float const fftthresh_sigma, int const fftthresh_top, int const blparam_upperlimit, std::vector< int > &blparam_fft) |
void | exec_fft (size_t const num_chan, float const *in_spec, bool const *in_mask, bool const get_real_imag, bool const get_ampl_only, std::vector< float > &fourier_spec) |
void | interpolate_constant (int const num_chan, float const *in_spec, bool const *in_mask, casacore::Vector< casacore::Float > &spec) |
void | merge_wavenumbers (std::vector< int > const &blparam_eff_base, std::vector< int > const &blparam_fft, std::vector< int > const &blparam_exclude, std::vector< size_t > &blparam_eff) |
list< pair< size_t, size_t > > | findLineAndGetRanges (size_t const num_data, float const data[], bool mask[], float const threshold, int const avg_limit, int const minwidth, std::vector< int > const &edge, bool const invert) |
void | findLineAndGetMask (size_t const num_data, float const data[], bool const in_mask[], float const threshold, int const avg_limit, int const minwidth, std::vector< int > const &edge, bool const invert, bool out_mask[]) |
template<typename Func0 , typename Func1 , typename Func2 , typename Func3 > | |
void | doSubtractBaseline (string const &in_column_name, string const &out_ms_name, string const &out_bloutput_name, bool const &do_subtract, string const &in_spw, LIBSAKURA_SYMBOL(Status)&status, std::vector< LIBSAKURA_SYMBOL(LSQFitContextFloat)* > &bl_contexts, size_t const bltype, std::vector< int > const &blparam, std::vector< int > const &blparam_exclude, bool const &applyfft, string const &fftmethod, string const &fftthresh, float const clip_threshold_sigma, int const num_fitting_max, bool const linefinding, float const threshold, int const avg_limit, int const minwidth, std::vector< int > const &edge, Func0 func0, Func1 func1, Func2 func2, Func3 func3, casacore::LogIO os) |
void | get_data_cube_float (vi::VisBuffer2 const &vb, casacore::Cube< casacore::Float > &data_cube) |
get data cube (npol*nchan*nvirow) in in_column_ from visbuffer and convert it to float cube More... | |
void | get_flag_cube (vi::VisBuffer2 const &vb, casacore::Cube< casacore::Bool > &flag_cube) |
get flag cube (npol*nchan*nvirow) from visbuffer More... | |
void | get_flag_from_cube (casacore::Cube< casacore::Bool > &flag_cube, size_t const row, size_t const plane, size_t const num_flag, bool out_flag[]) |
retrieve a flag at the row and plane (polarization) from flag cube More... | |
void | set_flag_to_cube (casacore::Cube< casacore::Bool > &flag_cube, size_t const row, size_t const plane, size_t const num_flag, bool in_flag[]) |
set a flag at the row and plane (polarization) to flag cube More... | |
void | flag_spectrum_in_cube (casacore::Cube< casacore::Bool > &flag_cube, size_t const row, size_t const plane) |
flag all channels in a supectrum in cube at the row and plane (polarization) More... | |
bool | allchannels_flagged (size_t const num_flag, bool const *flag) |
return true if all channels are flagged More... | |
size_t | NValidMask (size_t const num_mask, bool const *mask) |
returns the number of channels with true in input mask More... | |
void | split_bloutputname (string str) |
split the name More... | |
Private Attributes | |
the name of input MS *string | msname_ |
casacore::Array execution functions /// More... | |
casacore::MSMainEnums::PredefinedColumns | in_column_ |
columns to read and save data More... | |
casacore::Record | selection_ |
casacore::Record of selection More... | |
casacore::Record | average_ |
casacore::Record of average More... | |
casacore::Record | pol_average_ |
Record of polarization average. More... | |
SDMSManager * | sdh_ |
SDMSManager. More... | |
void(* | visCubeAccessor_ )(vi::VisBuffer2 const &vb, casacore::Cube< casacore::Float > &cube) |
pointer to accessor function More... | |
casacore::Bool | doSmoothing_ |
smoothing flag More... | |
string | bloutputname_csv |
string | bloutputname_text |
string | bloutputname_table |
Static Private Attributes | |
static constexpr casacore::Int | kNRowBlocking |
max number of rows to get in each iteration More... | |
Definition at line 46 of file SingleDishMS.h.
casa::SingleDishMS::SingleDishMS | ( | ) |
Default constructor.
casa::SingleDishMS::SingleDishMS | ( | string const & | ms_name | ) |
Construct from casacore::MS name string.
casa::SingleDishMS::~SingleDishMS | ( | ) |
Destructor.
|
private |
return true if all channels are flagged
void casa::SingleDishMS::applyBaselineTable | ( | string const & | in_column_name, |
string const & | in_bltable_name, | ||
string const & | in_spw, | ||
string const & | out_ms_name | ||
) |
apply baseline table
|
private |
|
private |
bool casa::SingleDishMS::close | ( | ) |
|
private |
Convert a casacore::Complex casacore::Array to casacore::Float Array.
|
private |
Destroy a set of baseline contexts.
|
private |
|
private |
|
private |
examine if a file with specified name exists
|
private |
|
private |
|
private |
|
private |
void casa::SingleDishMS::fitLine | ( | string const & | in_column_name, |
string const & | in_spw, | ||
string const & | in_pol, | ||
string const & | fitfunc, | ||
string const & | in_nfit, | ||
bool const | linefinding, | ||
float const | threshold, | ||
int const | avg_limit, | ||
int const | minwidth, | ||
std::vector< int > const & | edge, | ||
string const & | tempfile_name, | ||
string const & | temp_out_ms_name | ||
) |
fit line profile
|
private |
flag all channels in a supectrum in cube at the row and plane (polarization)
|
private |
|
private |
Create a set of baseline contexts (if necessary)
|
private |
|
private |
get data cube (npol*nchan*nvirow) in in_column_ from visbuffer and convert it to float cube
|
private |
|
private |
retrieve a field by name from casacore::Record as casa::String.
|
private |
get flag cube (npol*nchan*nvirow) from visbuffer
|
private |
retrieve a flag at the row and plane (polarization) from flag cube
|
private |
|
private |
|
private |
|
private |
|
static |
|
static |
|
private |
Utility functions ///.
|
private |
|
private |
|
inline |
Definition at line 59 of file SingleDishMS.h.
References msname_.
|
private |
returns the number of channels with true in input mask
|
private |
|
private |
|
private |
|
private |
|
private |
|
inlineprivate |
Definition at line 274 of file SingleDishMS.h.
|
private |
check column 'in' is in input casacore::MS and set to 'out' if it exists.
if not, out is set to casacore::MS::UNDEFINED_COLUMN
|
private |
set a flag at the row and plane (polarization) to flag cube
|
inlineprivate |
Definition at line 261 of file SingleDishMS.h.
References casacore::ArrayBase::size().
void casa::SingleDishMS::setAverage | ( | casacore::Record const & | average, |
bool const | verbose = true |
||
) |
void casa::SingleDishMS::setPolAverage | ( | casacore::Record const & | average, |
bool const | verbose = true |
||
) |
void casa::SingleDishMS::setSelection | ( | casacore::Record const & | selection, |
bool const | verbose = true |
||
) |
void casa::SingleDishMS::smooth | ( | string const & | kernelType, |
float const | kernelWidth, | ||
string const & | columnName, | ||
string const & | outMsName | ||
) |
smooth data with arbitrary smoothing kernel smoothing kernels currently supported include gaussian and boxcar
|
private |
split the name
|
private |
Split a string with given delimiter.
|
private |
void casa::SingleDishMS::subtractBaseline | ( | string const & | in_column_name, |
string const & | out_ms_name, | ||
string const & | out_bloutput_name, | ||
bool const & | do_subtract, | ||
string const & | in_spw, | ||
string const & | blfunc, | ||
int const | order, | ||
float const | clip_threshold_sigma, | ||
int const | num_fitting_max, | ||
bool const | linefinding, | ||
float const | threshold, | ||
int const | avg_limit, | ||
int const | minwidth, | ||
std::vector< int > const & | edge | ||
) |
Invoke baseline subtraction (polynomial, write results in new casacore::MS)
void casa::SingleDishMS::subtractBaselineCspline | ( | string const & | in_column_name, |
string const & | out_ms_name, | ||
string const & | out_bloutput_name, | ||
bool const & | do_subtract, | ||
string const & | in_spw, | ||
int const | npiece, | ||
float const | clip_threshold_sigma, | ||
int const | num_fitting_max, | ||
bool const | linefinding, | ||
float const | threshold, | ||
int const | avg_limit, | ||
int const | minwidth, | ||
std::vector< int > const & | edge | ||
) |
Cubicspline.
void casa::SingleDishMS::subtractBaselineSinusoid | ( | string const & | in_column_name, |
string const & | out_ms_name, | ||
string const & | out_bloutput_name, | ||
bool const & | do_subtract, | ||
string const & | in_spw, | ||
string const & | addwn0, | ||
string const & | rejwn0, | ||
bool const | applyfft, | ||
string const | fftmethod, | ||
string const | fftthresh, | ||
float const | clip_threshold_sigma, | ||
int const | num_fitting_max, | ||
bool const | linefinding, | ||
float const | threshold, | ||
int const | avg_limit, | ||
int const | minwidth, | ||
std::vector< int > const & | edge | ||
) |
Sinusoid.
void casa::SingleDishMS::subtractBaselineVariable | ( | string const & | in_column_name, |
string const & | out_ms_name, | ||
string const & | out_bloutput_name, | ||
bool const & | do_subtract, | ||
string const & | in_spw, | ||
string const & | param_file, | ||
bool const & | verbose = true |
||
) |
variable fitting parameters stored in a text file
|
private |
casacore::Record of average
Definition at line 408 of file SingleDishMS.h.
|
private |
Definition at line 418 of file SingleDishMS.h.
|
private |
Definition at line 420 of file SingleDishMS.h.
|
private |
Definition at line 419 of file SingleDishMS.h.
|
private |
smoothing flag
Definition at line 416 of file SingleDishMS.h.
|
private |
columns to read and save data
Definition at line 404 of file SingleDishMS.h.
|
staticprivate |
max number of rows to get in each iteration
Definition at line 426 of file SingleDishMS.h.
casacore::Array execution functions ///
Member vairables ///
Definition at line 402 of file SingleDishMS.h.
Referenced by name().
|
private |
Record of polarization average.
Definition at line 410 of file SingleDishMS.h.
|
private |
Definition at line 412 of file SingleDishMS.h.
|
private |
casacore::Record of selection
Definition at line 406 of file SingleDishMS.h.
|
private |
pointer to accessor function
Definition at line 414 of file SingleDishMS.h.