Converts floating point values to N-bit PSRFITS search-mode format. More...

#include <FITSDigitizer.h>

Inheritance diagram for dsp::FITSDigitizer:
dsp::Digitizer dsp::Transformation< TimeSeries, BitSeries > dsp::Operation dsp::HasInput< TimeSeries > dsp::HasOutput< BitSeries > OwnStream Reference::Able Reference::HeapTracked

Public Member Functions

 FITSDigitizer (unsigned _nbit)
 Default constructor.
 
 ~FITSDigitizer ()
 Default destructor.
 
unsigned get_nbit () const
 
void set_rescale_samples (unsigned nsamp)
 Set the number of samples to rescale before digitization. More...
 
void set_rescale_nblock (unsigned nsamp)
 Set the number of blocks to remember when computing scales. More...
 
void set_rescale_constant (bool rconst)
 If true, leave scales/offsets constant after first measurement.
 
void set_upper_sideband_output (bool usb)
 Set the channel ordering of the output.
 
void pack ()
 Pack the data. More...
 
uint64_t get_minimum_samples ()
 Return minimum samples.
 
void get_scales (std::vector< float > *dat_scl, std::vector< float > *dat_offs)
 
void set_engine (Engine *)
 
- Public Member Functions inherited from dsp::Digitizer
 Digitizer (const char *name="Digitizer")
 Constructor.
 
virtual void set_nbit (int)
 Set the number of bits per sample (FITS BITPIX convention)
 
int get_nbit () const
 Get the number of bits per sample (FITS BITPIX convention)
 
virtual void prepare ()
 Copy the input attributes to the output.
 
virtual void reserve ()
 Resize the output.
 
- Public Member Functions inherited from dsp::Transformation< TimeSeries, BitSeries >
 Transformation (const char *_name, Behaviour _type)
 All sub-classes must specify name and capacity for inplace operation.
 
virtual ~Transformation ()
 Destructor.
 
void reserve ()
 Set the size of the output to that of the input by default.
 
void set_input (const TimeSeries *input)
 Set the container from which input data will be read.
 
void set_output (BitSeries *output)
 Set the container into which output data will be written.
 
Behaviour get_type () const
 Return the Transformation type.
 
virtual void set_buffering_policy (BufferingPolicy *policy)
 Set the policy for buffering input and/or output data.
 
bool has_buffering_policy () const
 Returns true if buffering_policy is set.
 
BufferingPolicyget_buffering_policy () const
 
void reset_min_samps ()
 Reset minimum_samps_can_process.
 
std::string name (const std::string &function) const
 String preceding output in verbose mode.
 
virtual void set_cerr (std::ostream &os) const
 Set verbosity ostream.
 
- Public Member Functions inherited from dsp::Operation
 Operation (const char *name)
 All sub-classes must specify a unique name. More...
 
 Operation (const Operation &)
 Copy constructor.
 
virtual ~Operation ()
 Virtual destructor.
 
virtual bool operate ()
 Call this method to operate on data Returns false on failure. More...
 
virtual void add_extensions (Extensions *)
 Add any extensions.
 
virtual void combine (const Operation *)
 Combine accumulated results with another operation. More...
 
virtual void report () const
 Report operation statistics.
 
virtual void reset ()
 Reset accumulated results to intial values. More...
 
std::string get_name () const
 Return the unique name of this operation.
 
double get_total_time () const
 Return the total time spent on this Operation in seconds.
 
double get_elapsed_time () const
 Get the time spent in the last invocation of operate()
 
virtual uint64_t get_total_weights () const
 Return the total number of timesample weights encountered. More...
 
virtual uint64_t get_discarded_weights () const
 Return the number of invalid timesample weights encountered.
 
int get_id ()
 Inquire the unique instantiation id.
 
virtual Function get_function () const
 Get the function classification of this operation.
 
virtual double get_delay_time () const
 Get the time delay of this operation, if any, in seconds.
 
virtual void set_scratch (Scratch *)
 Set the scratch space.
 
bool scratch_was_set () const
 
virtual uint64_t bytes_storage () const
 The number of bytes of additional storage used by the operation.
 
virtual uint64_t bytes_scratch () const
 The number of bytes of scratch space used by the operation. More...
 
- Public Member Functions inherited from OwnStream
 OwnStream (const OwnStream &)
 
const OwnStreamoperator= (const OwnStream &)
 
virtual void set_cout (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
 
- Public Member Functions inherited from dsp::HasInput< TimeSeries >
virtual ~HasInput ()
 Destructor.
 
const TimeSeriesget_input () const
 Return pointer to the container from which input data will be read.
 
bool has_input () const
 Returns true if input is set.
 
- Public Member Functions inherited from dsp::HasOutput< BitSeries >
virtual ~HasOutput ()
 Destructor.
 
virtual BitSeriesget_output () const
 Return pointer to the container into which output data will be written.
 
bool has_output () const
 Returns true if output is set.
 

Public Attributes

Callback< FITSDigitizer * > update
 
- Public Attributes inherited from dsp::Transformation< TimeSeries, BitSeries >
Callback< Transformation * > pre_transformation
 Functions called before the transformation takes place.
 
Callback< Transformation * > post_transformation
 Functions called after the transformation takes place.
 

Protected Member Functions

void set_nbit (unsigned)
 Set the number of bits per sample.
 
void rescale_pack ()
 rescale input based on mean / variance
 
void init ()
 
void measure_scale ()
 
void set_digi_scales ()
 
- Protected Member Functions inherited from dsp::Digitizer
virtual void transformation ()
 Initialize and resize the output before calling unpack.
 
- Protected Member Functions inherited from dsp::Transformation< TimeSeries, BitSeries >
virtual bool can_operate ()
 Return false if the input doesn't have enough data to proceed.
 
virtual void operation ()
 Define the Operation pure virtual method.
 
virtual void vchecks ()
 Makes sure input & output are okay before calling transformation()
 
- Protected Member Functions inherited from dsp::Operation
virtual void set_name (const std::string &_name)
 Set the name!
 
int timers_index (const std::string &op_name)
 Returns the index in the 'timers' array of a particular timer.
 
- Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
 
void __dereference (bool auto_delete=true) const
 

Protected Attributes

unsigned rescale_nsamp
 keep track of first time through scale-measuring procedure
 
unsigned rescale_idx
 
unsigned rescale_nblock
 
unsigned rescale_counter
 
bool rescale_constant
 Keep scaling/offset constant after first estimate.
 
float digi_mean
 
float digi_scale
 
int digi_min
 
int digi_max
 
double * freq_totalsq
 arrays for accumulating and storing scales
 
double * freq_total
 
double * scale
 
double * offset
 
Reference::To< Engine > engine
 
bool upper_sideband_output
 
- Protected Attributes inherited from dsp::Digitizer
int nbit
 
- Protected Attributes inherited from dsp::Transformation< TimeSeries, BitSeries >
Reference::To< BufferingPolicybuffering_policy
 The buffering policy in place (if any)
 
int64_t minimum_samps_can_process
 If input doesn't have this many samples, operate() returns false.
 
- Protected Attributes inherited from dsp::Operation
Scratchscratch
 Shared scratch space, if needed.
 
bool set_scratch_called
 
std::string name
 Operation name.
 
uint64_t discarded_weights
 Number of time sample weights encountered that are flagged invalid.
 
uint64_t total_weights
 Total number of time sample weights encountered.
 
RealTimer optime
 Stop watch records the amount of time spent performing this operation.
 
int id
 Unique instantiation id.
 
bool prepared
 Set true when preparation optimizations are completed.
 
- Protected Attributes inherited from dsp::HasInput< TimeSeries >
Reference::To< const TimeSeriesinput
 Container from which input data will be read.
 
- Protected Attributes inherited from dsp::HasOutput< BitSeries >
Reference::To< BitSeriesoutput
 Container into which output data will be written.
 

Additional Inherited Members

- Public Types inherited from dsp::Operation
enum  Function { Producer, Procedural, Structural }
 The function of the operator. More...
 
- 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 ()
 
- Static Public Attributes inherited from dsp::Operation
static bool record_time = false
 Global flag enables stopwatch to record the time spent operating. More...
 
static bool report_time = true
 Global flag enables report of time spent in operation on descruction. More...
 
static bool verbose = false
 Global verbosity flag.
 
static int operation_status = 0
 Operations can set this to non-zero in operation() if they fail.
 
static bool check_state = true
 Operations should perform internal consistency checks.
 
static int instantiation_count = 0
 Counts how many Operation instantiations there have been Used for setting the unique instantiation ID. More...
 

Detailed Description

Converts floating point values to N-bit PSRFITS search-mode format.

Member Function Documentation

◆ pack()

void dsp::FITSDigitizer::pack ( )
virtual

Pack the data.

PSRFITS search mode data are in TPF order, whereas the native buffer class (DataSeries) is in FPT(d).

Implements dsp::Digitizer.

References dsp::TimeSeries::OrderFPT, and dsp::TimeSeries::OrderTFP.

◆ set_rescale_nblock()

void dsp::FITSDigitizer::set_rescale_nblock ( unsigned  nsamp)

Set the number of blocks to remember when computing scales.

The default is 1, corresponding to no memory.

Referenced by dsp::LoadToFITS::construct().

◆ set_rescale_samples()

void dsp::FITSDigitizer::set_rescale_samples ( unsigned  nsamp)

Set the number of samples to rescale before digitization.

Set the rescaling interval in samples.

The default is 0, i.e. rescaling must be done elsewhere.

Referenced by dsp::LoadToFITS::construct().


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

Generated using doxygen 1.8.17