|
DP3
|
Namespaces | |
| DP3MS | |
| test | |
Classes | |
| class | BaselineSelection |
| Class containing a few static functions to parse a baseline selection string. More... | |
| class | BdaBuffer |
| class | ComponentInfo |
| Class for visitors that visit model component to extract information. More... | |
| class | const_cursor |
| class | cursor |
| Multi-dimensional iterators. More... | |
| struct | Direction |
| A direction on the celestial sphere. More... | |
| class | DPBuffer |
| Buffer holding the data of a timeslot/band. More... | |
| class | DPInfo |
| General info about DP3 data processing attributes like averaging. More... | |
| class | FlagCounter |
| Class to keep counts of nr of flagged points. More... | |
| class | GainCalAlgorithm |
| DPPP step class to apply a calibration correction to the data. More... | |
| class | GaussianSource |
| Gaussian source model component. More... | |
| class | LogAntennaParseErrors |
| RAII object for temporarily overriding MSAntennaParse::thisMSAErrorHandler. More... | |
| class | ModelComponent |
| Base class for model components. More... | |
| class | ModelComponentVisitor |
| Base class for visitors that visit model component hierarchies. More... | |
| class | ParsetATerms |
| Parses the parameter settings (parset) related to the aterm settings in an EveryBeam-acceptable format. More... | |
| class | PointSource |
| Point source model component with optional spectral index and rotation measure. More... | |
| class | PredictBuffer |
| class | PredictModel |
| class | ProgressMeter |
| Visual indication of a tasks progress. More... | |
| class | RcuMode |
| struct | StManParsetKeys |
| class | Stokes |
| Complex Stokes vector. More... | |
| class | SubtableWriter |
| class | UVWCalculator |
| Class to calculate UVW coordinates. More... | |
Typedefs | |
| typedef std::pair< size_t, size_t > | Baseline |
| typedef std::complex< double > | dcomplex |
Enumerations | |
| enum class | CalType { kScalar , kScalarAmplitude , kScalarPhase , kDiagonal , kDiagonalAmplitude , kDiagonalPhase , kFullJones , kTec , kTecAndDelay , kTecAndPhase , kTecPhaseAndDelay , kTecScreen , kRotationAndDiagonal , kRotation , kFaradayRotation , kLeakage , kLeakageAmplitude } |
| enum class | SiscoMode { Full , Diagonal , StokesI } |
Functions | |
| template<typename T > | |
| const_cursor< T > | casa_const_cursor (const casacore::Array< T > &array) |
| template<typename T > | |
| cursor< T > | casa_cursor (casacore::Array< T > &array) |
| bool | estimate (size_t nDirection, size_t nStation, size_t nBaseline, size_t nChannel, const_cursor< Baseline > baselines, std::vector< const_cursor< std::complex< float >>> data, std::vector< const_cursor< std::complex< double >>> model, const_cursor< bool > flag, const_cursor< float > weight, const_cursor< std::complex< double >> mix, double *unknowns, size_t maxiter=50) |
| void | Execute (const std::string &parsetName, const std::vector< std::string > &arguments={}) |
| void | ExecuteFromCommandLine (const std::vector< std::string > &arguments) |
| Command-line interface. More... | |
| void | ExecuteFromCommandLine (int argc, char *argv[]) |
| Command-line interface. More... | |
| std::vector< size_t > | GetBaselineSelection (size_t n_antennas, const std::vector< size_t > &bl_idx_sorted, const std::vector< int > &antennas1, const std::vector< int > &antennas2) |
| std::vector< size_t > | GetBaselinesSortedByLength (const std::vector< int > &antennas1, const std::vector< int > &antennas2, const std::vector< std::array< double, 3 >> &antenna_positions) |
| dp3::common::Fields | GetChainRequiredFields (std::shared_ptr< steps::Step > first_step) |
| std::string | GetCompressionString (const StManParsetKeys &st_man_keys) |
| constexpr size_t | GetNPolarizations (CalType cal_type) |
| size_t | GetNThreads () |
| SiscoMode | GetSiscoMode (const std::string &mode_str) |
| std::unique_ptr< everybeam::telescope::Telescope > | GetTelescope (const std::string &ms_name, const everybeam::ElementResponseModel element_response_model, bool use_channel_frequency, const std::string &coefficients_file) |
| bool | IsHomogeneous (const everybeam::telescope::Telescope &telescope) |
| void | makeIndex (std::size_t n_direction, std::size_t n_station, const Baseline &baseline, unsigned int *index) |
| std::shared_ptr< steps::InputStep > | MakeMainSteps (const common::ParameterSet &parset) |
| std::shared_ptr< steps::Step > | MakeSingleStep (const std::string &type, const common::ParameterSet &parset, const std::string &prefix, steps::Step::MsType input_type) |
| std::shared_ptr< steps::Step > | MakeStepsFromParset (const common::ParameterSet &parset, const std::string &prefix, const std::string &step_names_key, const std::string &input_ms_name, bool terminateChain, steps::Step::MsType initial_step_output) |
| void | radec2lmn (const Direction &reference, const Direction &direction, double *lmn) |
| std::string | ReadAntennaSet (const casacore::MeasurementSet &ms) |
| void | rotateUVW (const Direction &from, const Direction &to, size_t nUVW, double *uvw) |
| std::vector< size_t > | SelectStationIndices (const everybeam::telescope::Telescope &telescope, const std::vector< std::string > &station_names) |
| dp3::common::Fields | SetChainProvidedFields (std::shared_ptr< steps::Step > first_step, dp3::common::Fields provided_fields=dp3::common::Fields()) |
| void | SetNThreads (size_t n_threads) |
| std::vector< int > | SetupUvwSplitting (unsigned int nant, const std::vector< int > &ant1, const std::vector< int > &ant2) |
| std::vector< int > | SetupUvwSplitting (unsigned int nant, const std::vector< int > &ant1, const std::vector< int > &ant2, const std::vector< std::array< double, 3 >> &antenna_positions) |
| void | ShowUsage () |
| void | simulate (const Direction &reference, const std::shared_ptr< const sky_model::Patch > &patch, size_t nStation, size_t nBaseline, size_t nChannel, const_cursor< Baseline > baselines, const_cursor< double > freq, const_cursor< double > uvw, cursor< std::complex< double >> buffer) |
| void | SplitUvw (const std::vector< int > &baseline_indices, const std::vector< Baseline > &baselines, const DPBuffer::UvwType &uvw_bl, xt::xtensor< double, 2 > &uvw_ant) |
| CalType | StringToCalType (const std::string &mode) |
| Convert string to a CalType. More... | |
| void | subtract (size_t nBaseline, size_t nChannel, const_cursor< Baseline > baselines, cursor< std::complex< float >> data, const_cursor< std::complex< double >> model, const_cursor< std::complex< double >> weight, float &var_before, float &var_after) |
| std::string | ToString (CalType caltype) |
| Convert CalType to a string. More... | |
| std::string | ToString (SiscoMode mode) |
| void | apply (size_t nBaseline, size_t nChannel, const_cursor< Baseline > baselines, const_cursor< double > coeff, cursor< std::complex< double >> data) |
| Apply station Jones matrices to a set of visibilities. More... | |
This code was taken from https://git.astron.nl/RD/aartfaac-tools/-/raw/master/common/aartfaac/aartfaacmode.h?ref_type=heads and adapted to fit into DP3 codebase.
The Receiver Unit Mode, hereafter RCU mode, is the mode in which the receiver units are set in a LOFAR station. The mode determines the amount of frequency ranges the RCU is sensitive towards. The RcuMode class provides the the frequency, bandwidth, antenna type, and a descriptive string of the RCU mode given a mode code. A reference for this modes can be found in https://science.astron.nl/telescopes/lofar/lofar-system-overview/technical-specification/frequency-subband-selection-and-rfi/.
This class is responsible to create ancillary tables such as ANTENNA or SPECTRAL_WINDOW In the future this could be part of the DP3 writer step it was a choice to keep it separate to avoid changing core DP3 functionalities Most of this code was taken from https://git.astron.nl/RD/aartfaac-tools.git and adapted to fit into the DP3 codebase.
| typedef std::pair<size_t, size_t> dp3::base::Baseline |
| typedef std::complex<double> dp3::base::dcomplex |
|
strong |
|
strong |
| void dp3::base::apply | ( | size_t | nBaseline, |
| size_t | nChannel, | ||
| const_cursor< Baseline > | baselines, | ||
| const_cursor< double > | coeff, | ||
| cursor< std::complex< double >> | data | ||
| ) |
Apply station Jones matrices to a set of visibilities.
Apply station Jones matrices to a set of visibilities.
| [in] | nBaseline | Number of baselines. |
| [in] | nChannel | Number of frequency channels. |
| [in] | baselines | A cursor for a 1-D buffer of baselines of shape (nBaseline). |
| [in] | coeff | A cursor for a 2-D buffer of Jones matrix coefficients of shape (No. of stations, 8). Each station index contained in baselines should be a valid index for the first axis of coeff. |
| [in] | data | A cursor for a 3-D buffer of visibilities of shape (nBaseline, nChannel, 4). |
| const_cursor<T> dp3::base::casa_const_cursor | ( | const casacore::Array< T > & | array | ) |
| cursor<T> dp3::base::casa_cursor | ( | casacore::Array< T > & | array | ) |
| bool dp3::base::estimate | ( | size_t | nDirection, |
| size_t | nStation, | ||
| size_t | nBaseline, | ||
| size_t | nChannel, | ||
| const_cursor< Baseline > | baselines, | ||
| std::vector< const_cursor< std::complex< float >>> | data, | ||
| std::vector< const_cursor< std::complex< double >>> | model, | ||
| const_cursor< bool > | flag, | ||
| const_cursor< float > | weight, | ||
| const_cursor< std::complex< double >> | mix, | ||
| double * | unknowns, | ||
| size_t | maxiter = 50 |
||
| ) |
Estimate Jones matrices for several directions simultaneously. A separate data stream is used for each direction. The mixing coefficients quantify the influence of each direction on each of the other directions (including time and frequency smearing).
| [in] | nDirection | Number of directions to estimate Jones matrices for. |
| [in] | nStation | Number of stations. |
| [in] | nBaseline | Number of baselines. |
| [in] | nChannel | Number of frequency channels. |
| [in] | data | Vector of length nDirection of cursors for 3-D buffers of observed visiblity data of shape (nBaseline, nChannel, 4). |
| [in] | model | Vector of length nDirection of cursors for 3-D buffers of simulated visiblity data of shape (nBaseline, nChannel, 4). |
| [in] | baselines | A cursor for a 1-D buffer of baselines of shape (nBaseline). |
| [in] | flag | A cursor for a 3-D buffer of observed visibility flags of shape (nBaseline, nChannel, 4). |
| [in] | weight | A cursor for a 3-D buffer of observed visibility weights of shape (nBaseline, nChannel, 4). |
| [in] | mix | A cursor for a 5-D buffer of mixing weights of shape (nBaseline, nChannel, 4, nDirection, nDirection). |
| [in] | unknowns | A pointer to a buffer of unknowns of size nDirection * nStation * 8. |
| void dp3::base::Execute | ( | const std::string & | parsetName, |
| const std::vector< std::string > & | arguments = {} |
||
| ) |
Execute the steps defined in the parset file. Possible parameters given at the command line are taken into account.
| void dp3::base::ExecuteFromCommandLine | ( | const std::vector< std::string > & | arguments | ) |
Command-line interface.
| void dp3::base::ExecuteFromCommandLine | ( | int | argc, |
| char * | argv[] | ||
| ) |
Command-line interface.
| std::vector<size_t> dp3::base::GetBaselineSelection | ( | size_t | n_antennas, |
| const std::vector< size_t > & | bl_idx_sorted, | ||
| const std::vector< int > & | antennas1, | ||
| const std::vector< int > & | antennas2 | ||
| ) |
Helper function for SetupUvwSplitting(). Was put in header so it can be tested.
| std::vector<size_t> dp3::base::GetBaselinesSortedByLength | ( | const std::vector< int > & | antennas1, |
| const std::vector< int > & | antennas2, | ||
| const std::vector< std::array< double, 3 >> & | antenna_positions | ||
| ) |
Helper function for SetupUvwSplitting(). Was put in header so it can be tested.
| dp3::common::Fields dp3::base::GetChainRequiredFields | ( | std::shared_ptr< steps::Step > | first_step | ) |
Go through the steps to define which fields of the measurement set should be read by the input step.
| first_step | The first step of a chain of steps. |
|
inline |
|
constexpr |
| size_t dp3::base::GetNThreads | ( | ) |
Get the number of threads used in DP3. This function is needed since each library / application has its own aocommon Threadpool object.
|
inline |
|
inline |
Retrieve the everybeam telescope from a Measurement Set.
| bool dp3::base::IsHomogeneous | ( | const everybeam::telescope::Telescope & | telescope | ) |
| void dp3::base::makeIndex | ( | std::size_t | n_direction, |
| std::size_t | n_station, | ||
| const Baseline & | baseline, | ||
| unsigned int * | index | ||
| ) |
Compute a map that contains the index of the unknowns related to the specified baseline in the list of all unknowns.
| [in] | n_direction | |
| [in] | n_station | |
| [in] | baseline | A tuple of baseline station ids |
| [out] | index | A vector of size 4*8*n_direction to store the indices |
| std::shared_ptr<steps::InputStep> dp3::base::MakeMainSteps | ( | const common::ParameterSet & | parset | ) |
Create a chain of step objects that are connected together. A writer will be added to the steps if it is not defined, and a terminating NullStep is added.
| std::shared_ptr<steps::Step> dp3::base::MakeSingleStep | ( | const std::string & | type, |
| const common::ParameterSet & | parset, | ||
| const std::string & | prefix, | ||
| steps::Step::MsType | input_type | ||
| ) |
Create a step
| type | Type of the step. |
| parset | ParameterSet containing the configuration for the step. |
| prefix | Prefix, including trailing dot ("."), to use for looking up parameters in the ParameterSet. |
| input_type | Type of input data, BDA or regular. |
| std::shared_ptr<steps::Step> dp3::base::MakeStepsFromParset | ( | const common::ParameterSet & | parset, |
| const std::string & | prefix, | ||
| const std::string & | step_names_key, | ||
| const std::string & | input_ms_name, | ||
| bool | terminateChain, | ||
| steps::Step::MsType | initial_step_output | ||
| ) |
Create a chain of step objects that are connected together. Unlike MakeMainSteps(), this does neither add a writer nor terminate the chain with a NullStep.
| step_names_key | Parset key for getting the step names. |
|
inline |
Compute LMN coordinates of direction relative to reference.
| [in] | reference | Reference direction on the celestial sphere. |
| [in] | direction | Direction of interest on the celestial sphere. |
| [out] | lmn | Pointer to a buffer of (at least) length three into which the computed LMN coordinates will be written. |
\begin{eqnarray*} \ell &= \cos(\delta) \sin(\alpha - \alpha_0) \\ m &= \sin(\delta) \cos(\delta_0) - \cos(\delta) \sin(\delta_0) \cos(\alpha - \alpha_0) \end{eqnarray*}
| std::string dp3::base::ReadAntennaSet | ( | const casacore::MeasurementSet & | ms | ) |
Read the antenna set (e.g. LBA_OUTER, HBA_DUAL_INNER) from the OBSERVATION table in the MS. This is a LOFAR-specific extension.
| ms | A measurement set, which may contain the antenna set field. |
| void dp3::base::rotateUVW | ( | const Direction & | from, |
| const Direction & | to, | ||
| size_t | nUVW, | ||
| double * | uvw | ||
| ) |
Transform UVW coordinates from phase reference position from to phase reference position to. The transformation is performed in place.
| [in] | from | Current phase reference position for the UVW coordinates. |
| [in] | to | New phase reference position for the UVW coordinates. |
| [in] | nUVW | The number of UVW coordinates to transform. |
| [in] | uvw | A 2-D buffer of UVW coordinates of shape (UVW, 3). |
| std::vector<size_t> dp3::base::SelectStationIndices | ( | const everybeam::telescope::Telescope & | telescope, |
| const std::vector< std::string > & | station_names | ||
| ) |
Find stations in a telescope by name and return their indices.
| telescope | The telescope, which contains antennae / stations. |
| station_names | A list of station names. The order of the names in this list should match the order in which they occur in the telescope. |
| dp3::common::Fields dp3::base::SetChainProvidedFields | ( | std::shared_ptr< steps::Step > | first_step, |
| dp3::common::Fields | provided_fields = dp3::common::Fields() |
||
| ) |
Go through a step chain, combine provided fields of non-output steps and call SetFieldsToWrite for all output steps.
| first_step | The first step of a chain of steps. |
| provided_fields | The provided fields before the step chain. Steps that have sub-steps should use this argument. |
| void dp3::base::SetNThreads | ( | size_t | n_threads | ) |
Set the number of threads used in DP3. This function is needed since each library / application has its own aocommon Threadpool object.
| std::vector<int> dp3::base::SetupUvwSplitting | ( | unsigned int | nant, |
| const std::vector< int > & | ant1, | ||
| const std::vector< int > & | ant2 | ||
| ) |
Setup the splitting of the baseline UVWs into station UVWs. It returns the indices of the baselines needed to split the baseline UVWs into station UVWs. They are in such an order that the UVW of a station is known before used in another baseline to derive the UVW of the other station. It can handle cases where baselines occur in disjoint station groups like 0-1, 0-2, 1-2 and 3-4, 4-5, 5-6. Note that the first station of a group gets UVW=0. All other station UVWs are relative to it using the baseline UVWs. Also note that nr of groups can be derived from the size of the returned vector (because it contains no entry for the first antenna in a group).
| std::vector<int> dp3::base::SetupUvwSplitting | ( | unsigned int | nant, |
| const std::vector< int > & | ant1, | ||
| const std::vector< int > & | ant2, | ||
| const std::vector< std::array< double, 3 >> & | antenna_positions | ||
| ) |
Same as the other SetupUvwSplitting() overload, except that this version accepts antenna_positions as extra argument. It uses the antenna positions to select the long baselines. This is needed in case of BDA data to prevent loss of information. See UVW splitting of BDA expanded data for details.
| void dp3::base::ShowUsage | ( | ) |
| void dp3::base::simulate | ( | const Direction & | reference, |
| const std::shared_ptr< const sky_model::Patch > & | patch, | ||
| size_t | nStation, | ||
| size_t | nBaseline, | ||
| size_t | nChannel, | ||
| const_cursor< Baseline > | baselines, | ||
| const_cursor< double > | freq, | ||
| const_cursor< double > | uvw, | ||
| cursor< std::complex< double >> | buffer | ||
| ) |
Simulate visibilities for a patch of sources. The computed visibilities are added to vis.
| [in] | reference | Phase reference position. |
| [in] | patch | Patch of sources to simulate visibilities for. |
| [in] | nStation | The number of stations. |
| [in] | nBaseline | The number of baselines. |
| [in] | nChannel | The number of frequency channels. |
| [in] | baselines | A cursor for a 1-D buffer of baselines of shape (nBaseline). |
| [in] | freq | A cursor for a 1-D buffer of channel frequencies of shape (nChannel). |
| [in] | uvw | A cursor for a 2-D buffer of station UVW coordinates of shape (nStation, 3). |
| [in] | buffer | A cursor for a 3-D buffer of shape (nBaseline, nChannel, 4) into which the simulated visibilities will be written. |
| void dp3::base::SplitUvw | ( | const std::vector< int > & | baseline_indices, |
| const std::vector< Baseline > & | baselines, | ||
| const DPBuffer::UvwType & | uvw_bl, | ||
| xt::xtensor< double, 2 > & | uvw_ant | ||
| ) |
Do the actual splitting of baseline UVWs into station UVWs using the index vector generated by SetupUvwSplitting.
| CalType dp3::base::StringToCalType | ( | const std::string & | mode | ) |
Convert string to a CalType.
| void dp3::base::subtract | ( | size_t | nBaseline, |
| size_t | nChannel, | ||
| const_cursor< Baseline > | baselines, | ||
| cursor< std::complex< float >> | data, | ||
| const_cursor< std::complex< double >> | model, | ||
| const_cursor< std::complex< double >> | weight, | ||
| float & | var_before, | ||
| float & | var_after | ||
| ) |
Subtract visibilities from a buffer after weighting by mixing coefficients.
| [in] | nBaseline | Number of baselines. |
| [in] | nChannel | Number of frequency channels. |
| [in] | baselines | A cursor for a 1-D buffer of baselines of shape (nBaseline). |
| [in] | data | A cursor for a 3-D buffer of observed visibilities of shape (nBaseline, nChannel, 4). |
| [in] | model | A cursor for a 3-D buffer of simulated visibilities of shape (nBaseline, nChannel, 4). |
| [in] | weight | A cursor for a 3-D buffer of mixing weight of shape (nBaseline, nChannel, 4). |
| [out] | var_before | variance before subtraction |
| [out] | var_after | variance after subtraction |
| std::string dp3::base::ToString | ( | CalType | caltype | ) |
Convert CalType to a string.
|
inline |