LoadToFITS.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2015 by Matthew Kerr
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // cribbed from LoadToFil
10 
11 #ifndef __dspsr_LoadToFITS_h
12 #define __dspsr_LoadToFITS_h
13 
14 #include "dsp/SingleThread.h"
15 #include "dsp/TimeSeries.h"
16 #include "dsp/Filterbank.h"
17 #include "dsp/FilterbankConfig.h"
18 #include "dsp/Dedispersion.h"
19 #include "dsp/OutputFile.h"
20 
21 namespace dsp {
22 
24  class LoadToFITS : public SingleThread
25  {
26 
27  public:
28 
30  class Config;
31 
33  void set_configuration (Config*);
34 
36  LoadToFITS (Config* config = 0);
37 
39  void construct ();
40 
42  void prepare ();
43 
46 
49 
52 
55 
58 
60  static bool verbose;
61 
62  friend class LoadToFITSN;
63  };
64 
67  {
68  public:
69 
70  // Sets default values
71  Config ();
72 
73  // set block size to this factor times the minimum possible
74  void set_times_minimum_ndat (unsigned);
75  unsigned get_times_minimum_ndat () const { return times_minimum_ndat; }
76 
77  // set block_size to result in at least this much RAM usage
78  void set_maximum_RAM (uint64_t);
79  uint64_t get_maximum_RAM () const { return maximum_RAM; }
80 
81  // input data block size in MB
82  double block_size;
83 
84  // order in which the unpacker will output time samples
86 
88  Filterbank::Config filterbank;
89 
92 
94  unsigned times_minimum_ndat;
95 
97  double maximum_RAM;
98 
100  double dispersion_measure;
101 
103  bool dedisperse;
104 
107 
109  bool coherent_derotation = false;
110 
112  double start_time_delay;
113 
115  unsigned tscrunch_factor;
116 
118  unsigned fscrunch_factor;
119 
121  int npol;
122 
124  double rescale_seconds;
125 
127  bool rescale_constant;
128 
130  double integration_length;
131 
133  int nbits;
134 
136  double tsamp;
137 
139  unsigned nsblk;
140 
142  std::string output_filename;
143 
146 
148  virtual void set_quiet ();
149 
151  virtual void set_verbose();
152 
154  virtual void set_very_verbose();
155 
156  };
157 }
158 
159 #endif // !defined(__LoadToFITS_h)
160 
161 
162 
163 
164 
virtual void set_verbose()
Set verbose.
Definition: LoadToFITS.C:145
bool rescale_constant
hold offset and scale constant after first update
Definition: LoadToFITS.h:132
int nbits
number of bits used to re-digitize the floating point time series
Definition: LoadToFITS.h:138
void set_upper_sideband_output(bool usb)
Set the channel ordering of the output.
Definition: FITSDigitizer.h:54
Reference::To< Filterbank > filterbank
The filterbank in use.
Definition: LoadToFITS.h:58
Produces TimeSeries data by integrating an Input with an Unpacker.
Definition: IOManager.h:26
void set_rescale_nblock(unsigned nsamp)
Set the number of blocks to remember when computing scales.
Definition: FITSDigitizer.C:110
void set_output_state(Signal::State _state)
Set the state of the output data.
Definition: Detection.C:42
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
Detects phase-coherent TimeSeries data.
Definition: Detection.h:38
void set_nsblk(unsigned nblk)
Set the number of samples per output block.
Definition: FITSOutputFile.C:150
void set_input(const In *input)
Set the container from which input data will be read.
Definition: Transformation.h:258
void set_rescale_samples(unsigned nsamp)
Set the number of samples to rescale before digitization.
Definition: FITSDigitizer.C:102
virtual void set_quiet()
Set quiet mode.
Definition: LoadToFITS.C:139
void set_rescale_constant(bool rconst)
If true, leave scales/offsets constant after first measurement.
Definition: FITSDigitizer.C:121
unsigned get_ndim() const
Return the dimension of each datum.
Definition: Observation.h:80
bool coherent_dedispersion
coherently dedisperse along with filterbank
Definition: LoadToFITS.h:111
Reference::To< OutputFile > outputFile
The output file.
Definition: LoadToFITS.h:67
Signal::State get_state() const
Return the state of the signal.
Definition: Observation.h:70
virtual void set_very_verbose()
Set very verbose.
Definition: LoadToFITS.C:151
Order
Order of the dimensions.
Definition: TimeSeries.h:39
Reference::To< Dedispersion > kernel
The dedispersion kernel.
Definition: LoadToFITS.h:61
Per-thread configuration options.
Definition: SingleThread.h:185
virtual void set_buffering_policy(BufferingPolicy *policy)
Set the policy for buffering input and/or output data.
Definition: Transformation.h:85
unsigned tscrunch_factor
integrate in time before digitization
Definition: LoadToFITS.h:120
double get_rate() const
Return the sampling rate (time samples per second in Hz)
Definition: Observation.h:157
bool dedisperse
removed inter-channel dispersion delays
Definition: LoadToFITS.h:108
Reference::To< Convolution > convolution
The convolution operation.
Definition: LoadToFITS.h:64
void convolution_block_constraints(Pipeline *pipeline, typename Pipeline::Config *config, const std::string &app, bool report_vitals)
Configures the minimum_samples and input_overlap for LoadToFold and LoadToFITS.
Definition: convolution_block_constraints.h:24
Scratch space that can be shared between Operations.
Definition: Scratch.h:27
virtual void set_dispersion_measure(double dm)
Set the pulsar dispersion mesure.
Definition: Observation.h:202
Decimates a TimeSeries in the time domain.
Definition: TScrunch.h:28
PScrunch all channels and polarizations.
Definition: PScrunch.h:25
unsigned get_npol() const
Return the number of polarizations.
Definition: Observation.h:90
Filterbank::Config filterbank
Filterbank config options.
Definition: LoadToFITS.h:93
void set_configuration(Config *)
Set the configuration to be used in prepare and run.
Definition: LoadToFITS.C:72
Stores information about digital, band-limited, time-varying signals.
Definition: Observation.h:33
Decimates a TimeSeries in the frequency domain.
Definition: FScrunch.h:23
writes BitSeries data to a PSRFITS "search mode" file
Definition: FITSOutputFile.h:41
void set_nbit(unsigned _nbit)
Set the number of bits per output sample.
Definition: FITSOutputFile.C:158
virtual void set_input(const In *_input)
Set the container from which input data will be read.
Definition: HasInput.h:38
bool coherent_derotation
phase-coherent Faraday rotation correction (not implemented)
Definition: LoadToFITS.h:114
Arrays of consecutive samples for each polarization and frequency channel.
Definition: TimeSeries.h:29
Load, unpack, filterbank, re-digitize, and write to FITS.
Definition: LoadToFITS.h:71
void construct()
Create the pipeline.
Definition: LoadToFITS.C:158
Convolves a TimeSeries using a frequency response function.
Definition: Convolution.h:64
double get_bandwidth() const
Return the bandwidth of signal in MHz (-ve = lsb; +ve = usb)
Definition: Observation.h:147
unsigned fscrunch_factor
integrate in frequency before digitization
Definition: LoadToFITS.h:123
double rescale_seconds
time interval (in seconds) between offset and scale updates
Definition: LoadToFITS.h:129
static bool verbose
Verbose output.
Definition: LoadToFITS.h:70
bool upper_sideband_output
produce upper sideband output
Definition: LoadToFITS.h:150
bool get_detected() const
Returns true if state is Detected, Coherence, or Stokes.
Definition: Observation.C:144
std::string get_source() const
Return the source name.
Definition: Observation.h:122
std::string output_filename
Name of the output file.
Definition: LoadToFITS.h:147
unsigned nsblk
number of samples per output data block
Definition: LoadToFITS.h:144
A container for storing digitized (generally not floating point) data
Definition: BitSeries.h:35
double maximum_RAM
Maximum RAM to use (per thread)
Definition: LoadToFITS.h:102
double tsamp
integration time per output sample
Definition: LoadToFITS.h:141
void set_dispersion_measure(double dm)
Set the dispersion measure in .
Definition: Dedispersion.C:43
virtual void set_memory(Memory *)
Set the memory manager.
Definition: Scratch.C:36
double get_centre_frequency() const
Return the centre frequency of the band-limited signal in MHz.
Definition: Observation.h:134
Multiple LoadToFITS threads.
Definition: LoadToFITSN.h:22
Converts floating point values to N-bit PSRFITS search-mode format.
Definition: FITSDigitizer.h:25
void set_output(Out *output)
Set the container into which output data will be written.
Definition: Transformation.h:275
bool apply_FITS_scale_and_offset
when unpacking FITS data, denormalize using DAT_SCL and DAT_OFFS
Definition: LoadToFITS.h:96
int npol
polarizations (Intensity, AABB, or Coherency)
Definition: LoadToFITS.h:126
void prepare()
Final preparations before running.
Definition: LoadToFITS.C:650
Manages CUDA pinned memory allocation and destruction.
Definition: MemoryCUDA.h:24
virtual void set_memory(Memory *)
Set the memory manager.
Definition: DataSeries.C:53
void set_max_length(double)
Set length of output file (seconds)
Definition: FITSOutputFile.C:145
double integration_length
set maximum length for a file
Definition: LoadToFITS.h:135
LoadToFITS(Config *config=0)
Constructor.
Definition: LoadToFITS.C:65
MJD get_start_time() const
Return the start time of the leading edge of the first time sample.
Definition: Observation.h:152
Phase-coherent dispersion removal frequency response function.
Definition: Dedispersion.h:25
unsigned times_minimum_ndat
set block size to this factor times the minimum possible
Definition: LoadToFITS.h:99
double dispersion_measure
dispersion measure set in output file
Definition: LoadToFITS.h:105
Reference::To< Config > config
Configuration parameters.
Definition: LoadToFITS.h:55
@ OrderTFP
Time, Frequency, Polarization (better for many things)
Definition: TimeSeries.h:50
double start_time_delay
artificial delay to the start time in seconds
Definition: LoadToFITS.h:117
void set_upper_sideband_output(bool)
Set the output to upper sideband.
Definition: FITSOutputFile.C:135
unsigned get_nchan() const
Return the number of channels into which the band is divided.
Definition: Observation.h:85

Generated using doxygen 1.8.17