Represents a product of Response instances. More...

#include <ResponseProduct.h>

Inheritance diagram for dsp::ResponseProduct:
dsp::Response dsp::Shape OwnStream Reference::Able Reference::HeapTracked

Public Member Functions

 ResponseProduct ()
 Default constructor.
 
 ~ResponseProduct ()
 Destructor.
 
void match (const Observation *input, unsigned nchan)
 Create a product to match the input.
 
void match (const Response *response)
 Create a product to match the response.
 
void add_response (Response *response)
 Add a response to the product.
 
void set_copy_index (unsigned i)
 Set the element that is copied.
 
void set_match_index (unsigned i)
 Set the element to which all others are matched.
 
- Public Member Functions inherited from dsp::Response
 Response ()
 Default constructor.
 
virtual ~Response ()
 Destructor.
 
 Response (const Response &)
 Copy constructor.
 
const Responseoperator= (const Response &)
 Assignment operator.
 
const Responseoperator*= (const Response &)
 Multiplication operator.
 
virtual void prepare (const Observation *input, unsigned channels=0)
 Calculate the impulse_pos and impulse_neg attributes.
 
unsigned get_input_nchan () const
 Get the number of input channels.
 
void set_input_nchan (unsigned _input_nchan)
 Set the number of input channels.
 
unsigned get_impulse_pos () const
 Get the size of the positive half of the impulse response, $m_+$. More...
 
unsigned get_impulse_neg () const
 Get the size of the negative half of the impulse response, $m_-$. More...
 
void set_impulse_pos (unsigned _impulse_pos)
 Set the size of the positive half of the impulse response, $m_+$. More...
 
void set_impulse_neg (unsigned _impulse_neg)
 Set the size of the negative half of the impulse response, $m_-$. More...
 
virtual void set_dc_centred (bool dc_centred)
 Set the flag for a bin-centred spectrum.
 
bool get_dc_centred () const
 Get the flag for a bin-centred spectrum.
 
virtual void set_swap (bool flag)
 Set the flag for a band-swapped spectrum.
 
bool get_swap () const
 Get the flag for a band-swapped spectrum.
 
unsigned get_minimum_ndat () const
 Return the minimum useable ndat. More...
 
void set_optimal_ndat ()
 Resize with ndat set to the optimal value. More...
 
void set_optimal_fft (OptimalFFT *)
 Set the policy used to compute the optimal FFT length.
 
OptimalFFTget_optimal_fft () const
 
bool has_optimal_fft () const
 
void check_ndat () const
 Given impulse_pos and impulse_neg, check that ndat is large enough.
 
std::vector< float > get_passband (unsigned ipol, int ichan=-1) const
 Get the passband.
 
void set (const std::vector< std::complex< float > > &phasors)
 Construct frequency response from complex phasors.
 
void set (const std::vector< Jones< float > > &jones)
 Construct frequency response from jones matrices.
 
void operate (float *spectrum, unsigned poln=0, int ichan=-1) const
 Multiply spectrum by complex frequency response. More...
 
void operate (float *spectrum, unsigned poln, int ichan_start, unsigned nchan_op) const
 Multiply spectrum by complex frequency response. More...
 
void operate (float *input_spectrum, float *output_spectrum, unsigned poln, int ichan_start, unsigned nchan_op) const
 Multiply spectrum by complex frequency response, out-of-place. More...
 
void operate (float *spectrum1, float *spectrum2, int ichan=-1) const
 Multiply spectrum vector by complex matrix frequency response.
 
void integrate (float *spectrum, unsigned poln=0, int ichan=-1)
 Integrate the power of spectrum into self. More...
 
void integrate (float *spectrum1, float *spectrum2, int ichan=-1)
 Integrate coherency matrix of vector spectrum into self.
 
virtual bool matches (const Shape *response)
 Returns true if the dimension and ordering match.
 
virtual void mark (Observation *output)
 Modify the out Observation information as seen fit by sub-classes.
 
void naturalize ()
 Re-organize frequency bins to reflect natural ordering (DC->Nyq)
 
virtual bool state_is_valid (std::string &reason)
 Enable Response to be used in Transformation template.
 
void flagswap (unsigned divisions=1)
 Set flags that response should be swapped.
 
float get_nbyte () const
 Requires zero bytes per time sample.
 
void check_finite (const char *name)
 Worker function checks that every value in response is finite.
 
- Public Member Functions inherited from dsp::Shape
 Shape ()
 Default constructor.
 
virtual ~Shape ()
 Destructor.
 
 Shape (const Shape &)
 Copy constructor.
 
const Shapeoperator= (const Shape &)
 Assignment operator.
 
virtual void resize (unsigned npol, unsigned nchan, unsigned ndat, unsigned ndim)
 Set the dimensions of the data.
 
unsigned get_npol () const
 Get the number of polarizations.
 
unsigned get_nchan () const
 Get the number of frequency channels.
 
unsigned get_ndat () const
 Get the number of datum in each of the nchan*npol divisions.
 
unsigned get_ndim () const
 Get the dimension of each datum (e.g. 2=complex 8=Jones)
 
void scrunch_to (unsigned ndat)
 Scrunch each dimension to a new ndat.
 
void rotate (int npt)
 Rotate data so that Shape[i] = Shape[i+npt].
 
void zero ()
 Set all values to zero.
 
void zero_dimensions ()
 Set all dimnensions to zero; allocated memory unaffected.
 
void borrow (const Shape &, unsigned ichan=0)
 Borrow the data from the specified channel of another Shape.
 
const Shapeoperator/= (float factor)
 Divide each point by factor.
 
const Shapeoperator*= (float factor)
 Multiply each point by factor.
 
const Shapeoperator+= (const Shape &)
 Add another Shape to this one.
 
float * get_datptr (unsigned ichan, unsigned ipol)
 Provide access to the data for the specified polarization.
 
const float * get_datptr (unsigned ichan, unsigned ipol) const
 Provide access to the data for the specified polarization.
 
- Public Member Functions inherited from OwnStream
 OwnStream (const OwnStream &)
 
const OwnStreamoperator= (const OwnStream &)
 
virtual void set_cout (std::ostream &) const
 
virtual void set_cerr (std::ostream &) const
 
- Public Member Functions inherited from Reference::Able
 Able (const Able &)
 
Ableoperator= (const Able &)
 
unsigned get_reference_count () const
 
- Public Member Functions inherited from Reference::HeapTracked
 HeapTracked (const HeapTracked &)
 
HeapTrackedoperator= (const HeapTracked &)
 
bool __is_on_heap () const
 

Protected Member Functions

void set_component_changed (const Response &response)
 Called when a component has changed.
 
void build ()
 The builder.
 
- Protected Member Functions inherited from dsp::Response
void calc_lcf (unsigned a, unsigned b, const Rational &osf, std::vector< unsigned > &result)
 
void calc_oversampled_discard_region (unsigned *_discard_neg, unsigned *_discard_pos, unsigned _nchan, const Rational &osf)
 
void calc_oversampled_fft_length (unsigned *_fft_length, unsigned _nchan, const Rational &osf, int direction=-1)
 
void doswap (unsigned divisions=1)
 Swap halves of bandpass(es)
 
- Protected Member Functions inherited from dsp::Shape
void init ()
 
void size_dataspace ()
 
void destroy ()
 
- Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
 
void __dereference (bool auto_delete=true) const
 

Protected Attributes

std::vector< Reference::To< Response > > response
 The responses.
 
bool component_changed
 Flag set true when a component has changed.
 
unsigned copy_index
 
unsigned match_index
 
- Protected Attributes inherited from dsp::Response
unsigned step
 
Reference::To< OptimalFFToptimal_fft
 
unsigned impulse_pos
 Complex time samples in t>0 half of corresponding impulse response.
 
unsigned impulse_neg
 Complex time samples in t<0 half of corresponding impulse response.
 
bool whole_swapped
 Toggled every time Response::doswap(1) is called (default: false)
 
unsigned swap_divisions
 Toggled every time Response::doswap(divisions > 1) is called.
 
bool dc_centred
 Toggled when built for a bin-centred spectrum.
 
unsigned input_nchan
 number of input channels. Used by some derived classes
 
- Protected Attributes inherited from dsp::Shape
float * buffer
 Data points.
 
unsigned bufsize
 Size of the data buffer.
 
unsigned offset
 Offset between datum from each polarization.
 
unsigned npol
 Number of polarizations.
 
unsigned nchan
 Number of frequency divisions (channels)
 
unsigned ndat
 Number of datum in each of the npol*nchan divisions.
 
unsigned ndim
 Dimension of each datum.
 
bool borrowed
 Flag that data are borrowed from another Shape.
 

Additional Inherited Members

- Static Public Member Functions inherited from Reference::Able
static size_t get_instance_count ()
 
- Static Public Member Functions inherited from Reference::HeapTracked
static void * operator new (size_t size, void *ptr=0)
 
static void operator delete (void *location, void *ptr)
 
static void operator delete (void *location)
 
static size_t get_heap_queue_size ()
 
- Public Attributes inherited from dsp::Response
Callback< Responsechanged
 Called when the Response has been changed.
 
- Static Public Attributes inherited from dsp::Response
static unsigned ndat_max = 0
 Maximum ndat allowed. More...
 
- Static Public Attributes inherited from dsp::Shape
static bool verbose = false
 

Detailed Description

Represents a product of Response instances.

The dimensions of the product will contain the dimensions of each term in the product, as defined by:

  • the largest number of frequency channels
  • the largest dimension: matrix > dual polarization > single; complex > real

The documentation for this class was generated from the following files:

Generated using doxygen 1.8.17