Archive.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2002 - 2022 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Base/Classes/Pulsar/Archive.h
10 
11 #ifndef __Pulsar_Archive_h
12 #define __Pulsar_Archive_h
13 
14 #include "Pulsar/IntegrationManager.h"
15 #include "Pulsar/Config.h"
16 
17 #include "sky_coord.h"
18 #include "MJD.h"
19 
20 #include "Functor.h"
21 #include "Estimate.h"
22 #include "Types.h"
23 
24 #include <iostream>
25 
26 template<typename T> class Jones;
27 
28 namespace Pulsar
29 {
30  class Receiver;
31  class Integration;
32  class Profile;
33  class PhaseWeight;
34 
35  class Predictor;
36  class Parameters;
37 
38  class StrategySet;
39 
41 
45  class Archive : public IntegrationManager
46  {
47 
48  public:
49 
50  // //////////////////////////////////////////////////////////////////
51  //
52  //
53  // //////////////////////////////////////////////////////////////////
54 
56  Archive ();
57 
59  Archive (const Archive& archive);
60 
62  virtual ~Archive ();
63 
65  Archive& operator = (const Archive& a);
66 
67 
68  // //////////////////////////////////////////////////////////////////
69  //
70  // Factories, loading, unloading, and refreshing
71  //
72  // //////////////////////////////////////////////////////////////////
73 
79 
81  static Archive* new_Archive (const std::string& class_name);
82 
84  static Archive* load (const std::string& name);
85 
87  static unsigned get_instance_count ();
88 
90 
96 
98  virtual bool can_unload () const = 0;
99 
101  void unload (const char* filename = 0) const;
102 
104  void unload (const std::string& filename) const
105  { unload (filename.c_str()); }
106 
108  std::string get_filename () const { return unload_filename; }
109 
111 
114  void set_filename (const std::string& filename)
115  { unload_filename = filename; }
116 
118  void update ();
119 
121  void refresh ();
122 
124 
125  // //////////////////////////////////////////////////////////////////
126  //
127  // Copying and cloning
128  //
129  // //////////////////////////////////////////////////////////////////
130 
138 
140  void copy (const Archive&);
141  void copy (const Archive*);
142 
144 
145  virtual Archive* clone () const = 0;
146 
148  Archive* total (bool tscrunch = true) const;
149 
151 
152  Archive* tscrunched () const;
153 
155  Archive* extract (std::vector<unsigned>& subints) const;
156 
158 
159  // //////////////////////////////////////////////////////////////////
160  //
161  // Dimension Attributes
162  //
163  // //////////////////////////////////////////////////////////////////
164 
172 
174  virtual unsigned get_nbin () const = 0;
175 
177  virtual unsigned get_nchan () const = 0;
178 
180  virtual unsigned get_npol () const = 0;
181 
183  virtual void resize (unsigned nsubint,
184  unsigned npol = 0,
185  unsigned nchan = 0,
186  unsigned nbin = 0);
187 
189  virtual void erase (unsigned isubint);
190 
192  void reverse_chan ();
193 
195 
196  // //////////////////////////////////////////////////////////////////
197  //
198  // Common Attributes
199  //
200  // //////////////////////////////////////////////////////////////////
201 
208 
210  virtual std::string get_telescope () const = 0;
212  virtual void set_telescope (const std::string& code) = 0;
213 
215  virtual Signal::State get_state () const = 0;
217  virtual void set_state (Signal::State state) = 0;
218 
220  virtual Signal::Scale get_scale () const = 0;
222  virtual void set_scale (Signal::Scale scale) = 0;
223 
225  virtual Signal::Source get_type () const = 0;
227  virtual void set_type (Signal::Source type) = 0;
228 
230  virtual std::string get_source () const = 0;
232  virtual void set_source (const std::string& source) = 0;
233 
235  virtual sky_coord get_coordinates () const = 0;
237  virtual void set_coordinates (const sky_coord& coordinates) = 0;
238 
240  virtual double get_centre_frequency () const = 0;
242  virtual void set_centre_frequency (double cf) = 0;
243 
245  virtual double get_bandwidth () const = 0;
247  virtual void set_bandwidth (double bw) = 0;
248 
250  virtual double get_dispersion_measure () const = 0;
252  virtual void set_dispersion_measure (double dm) = 0;
253 
255  virtual bool get_dedispersed () const = 0;
257  virtual void set_dedispersed (bool done = true) = 0;
258 
260  virtual double get_rotation_measure () const = 0;
262  virtual void set_rotation_measure (double rm) = 0;
263 
265  virtual bool get_faraday_corrected () const = 0;
267  virtual void set_faraday_corrected (bool done = true) = 0;
268 
270  virtual bool get_poln_calibrated () const = 0;
272  virtual void set_poln_calibrated (bool done = true) = 0;
273 
275 
276 
277  // //////////////////////////////////////////////////////////////////
278  //
279  // Access to data
280  //
281  // //////////////////////////////////////////////////////////////////
282 
290 
292  Profile* get_Profile (unsigned subint, unsigned pol, unsigned chan);
293 
295  const Profile*
296  get_Profile (unsigned subint, unsigned pol, unsigned chan) const;
297 
299 
300 
301  // //////////////////////////////////////////////////////////////////
302  //
303  // Pulsar Ephemeris and Predictor
304  //
305  // //////////////////////////////////////////////////////////////////
306 
313 
315  void set_ephemeris (const Parameters* ephemeris, bool update = true);
316 
318  const Parameters* get_ephemeris() const;
319 
321  bool has_ephemeris () const { return ephemeris; }
322 
324  void set_model (const Predictor* model, bool apply = true);
325 
327  const Predictor* get_model() const;
328 
330  bool has_model() const { return model; }
331 
333  void update_model ();
334 
336 
337  // //////////////////////////////////////////////////////////////////
338  //
339  // Basic algorithms
340  //
341  // //////////////////////////////////////////////////////////////////
342 
344  void bscrunch (unsigned nscrunch);
345 
347  void fold (unsigned nfold);
348 
350  void pscrunch();
351 
353  void fscrunch (unsigned nscrunch=0);
354 
356  void tscrunch (unsigned nscrunch=0);
357 
359  void rotate (double time);
360 
362  void rotate_phase (double phase);
363 
365  void append (const Archive* archive);
366 
368  void remove_chan(unsigned first, unsigned last);
369 
372 
374  void centre (double phase_offset = 0.5);
375 
377  void centre_max_bin (double phase_offset = 0.5);
378 
380  void convert_state (Signal::State state);
381 
383  Signal::Basis get_basis () const;
384 
386  void dedisperse ();
387 
389  void defaraday ();
390 
392  void transform (const Jones<float>&);
393 
395  void transform (const std::vector< Jones<float> >&);
396 
398  void transform (const std::vector< std::vector< Jones<float> > >&);
399 
401  void invint ();
402 
404  PhaseWeight* baseline () const;
405 
407  void remove_baseline ();
408 
410  void uniform_weight (float new_weight = 1.0);
411 
413  bool standard_match (const Archive* arch, std::string& reason) const;
414 
416  bool calibrator_match (const Archive* arch, std::string& reason) const;
417 
419  bool processing_match (const Archive* arch, std::string& reason) const;
420 
422  bool mixable (const Archive* arch, std::string& reason) const;
423 
425  double weighted_frequency (unsigned ichan,
426  unsigned start, unsigned end) const;
427 
429  void bscrunch_to_nbin (unsigned new_nbin);
430 
432  void fscrunch_to_nchan (unsigned new_nchan);
433 
435  void tscrunch_to_nsub (unsigned new_nsub);
436 
438  MJD start_time () const;
439 
441  MJD end_time () const;
442 
444  double integration_length() const;
445 
447  bool type_is_cal () const;
448 
450  void find_transitions (int& hi2lo, int& lo2hi, int& buffer) const;
451 
453  void find_peak_edges (int& rise, int& fall) const;
454 
456  float find_max_phase () const;
457 
459  float find_min_phase (float dc = 0.15) const;
460 
462  float rms_baseline (float dc = 0.4);
463 
465  class Interface;
466 
468  virtual Interface* get_interface ();
469 
470  // //////////////////////////////////////////////////////////////////
471  //
472  // Archive Extension interface
473  //
474  // //////////////////////////////////////////////////////////////////
475 
483 
485  class Extension;
486 
488  virtual unsigned get_nextension () const;
489 
491  virtual const Extension* get_extension (unsigned iextension) const;
492 
494  virtual Extension* get_extension (unsigned iextension);
495 
497  template<class ExtensionType>
498  const ExtensionType* get () const;
499 
501  template<class ExtensionType>
502  ExtensionType* get ();
503 
505  template<class ExtensionType>
506  ExtensionType* getadd ();
507 
509 
511  virtual void add_extension (Extension* extension);
512 
514 
515  // //////////////////////////////////////////////////////////////////
516  //
517  // Class members
518  //
519  // //////////////////////////////////////////////////////////////////
520 
522  static void agent_report ();
523 
525  static void agent_list ();
526 
528  static void set_verbosity (unsigned level);
529 
531  class Check;
532 
533  // //////////////////////////////////////////////////////////////////
534  //
535  // Expert interface
536  //
537  // //////////////////////////////////////////////////////////////////
538 
540  class Expert;
541 
543  Expert* expert ();
544  const Expert* expert () const;
545 
546  // //////////////////////////////////////////////////////////////////
547  //
548  // Matching policies
549  //
550  // //////////////////////////////////////////////////////////////////
551 
553  class Match;
554 
556  const Match* get_standard_match () const;
557  void set_standard_match (Match*);
558 
560  const Match* get_calibrator_match () const;
561  void set_calibrator_match (Match*);
562 
564  const Match* get_processing_match () const;
565  void set_processing_match (Match*);
566 
568  const Match* get_mixable () const;
569  void set_mixable (Match*);
570 
573 
575  StrategySet* get_strategy() const;
576 
577  protected:
578 
579  friend class Expert;
580 
582  static std::string get_revision (const char* revision);
583 
584  // //////////////////////////////////////////////////////////////////
585  //
586  // File I/O
587  //
588  // //////////////////////////////////////////////////////////////////
589 
597 
600 
603 
605  virtual void load_header (const char* filename) = 0;
606 
608  virtual Integration*
609  load_Integration (const char* filename, unsigned subint) = 0;
610 
612  virtual void unload_file (const char* filename) const = 0;
613 
615 
617  std::string unload_filename;
618 
619  // //////////////////////////////////////////////////////////////////
620  //
621  // Dimension Attributes
622  //
623  // //////////////////////////////////////////////////////////////////
624 
631 
633  virtual void set_nbin (unsigned numbins) = 0;
634 
636  virtual void set_nchan (unsigned numchan) = 0;
637 
639  virtual void set_npol (unsigned numpol) = 0;
640 
642 
645 
648 
651 
653  void init_Integration (Integration* subint, bool check_phase = false);
654 
656  void resize_Integration (Integration* integration);
657 
659  void apply_model (Integration* subint, const Predictor* old = 0);
660 
662  void update_model (unsigned old_nsubint, bool clear_model = false);
663 
665  void update_model (const MJD& time, bool clear_model = false);
666 
668  void create_updated_model (bool clear_model);
669 
671  bool good_model (const Predictor* test_model) const;
672 
674  bool zero_phase_aligned () const;
675 
678 
681 
686 
687  private:
688 
690  mutable std::vector< Reference::To<Extension> > extension;
691 
693  mutable Reference::To<StrategySet> strategy;
694 
696 
700  std::string __load_filename;
701 
703  mutable std::vector<unsigned>* copy_subints;
704  unsigned copy_nsubint () const;
705  unsigned copy_isubint (unsigned) const;
706 
708  Integration* load_Integration (unsigned isubint);
709 
711  void init ();
712 
714  void correct ();
715 
717  void verify () const;
718 
719  // Advocates the use of an Archive derived class
720  class Agent;
721 
722  protected:
723 
724  // Advocates the use of Plugin
725  template<class Plugin> class Advocate;
726 
727  };
728 
730  bool in_frequency_order (const Archive* A, const Archive* B);
731 
732 }
733 
734 #endif
735 
virtual unsigned get_npol() const =0
Get the number of polarizations.
void refresh()
Completely reload the archive, deleting all data.
Definition: Archive.C:243
void update_model()
Create a new predictor and align the Integrations to the new model.
Definition: Archive_update_model.C:31
Archive * extract(std::vector< unsigned > &subints) const
Return pointer to a new instance with only the specified subints.
Definition: Archive_extract.C:18
virtual void set_centre_frequency(double cf)=0
Set the centre frequency of the observation.
bool calibrator_match(const Archive *arch, std::string &reason) const
Test if arch matches (enough for a pulsar - calibrator match)
Definition: Archive_match.C:47
void phase(Profile *input)
Compute the phase of the input complex-valued Profile.
Definition: Fourier.C:135
Integration * use_Integration(Integration *)
Return the given Integration ready for use.
Definition: Archive_init_Integration.C:18
virtual const Extension * get_extension(unsigned iextension) const
Return a pointer to the specified extension.
Definition: Archive.C:158
void tscrunch_to_nsub(unsigned new_nsub)
Call tscrunch with the appropriate value.
Definition: Archive_tscrunch.C:32
virtual void unload_file(const char *filename) const =0
Unload the Archive (header and Integration data) to filename.
virtual double get_rotation_measure() const =0
Get the rotation measure (in )
void convert_state(Signal::State state)
Convert data to the specified state.
Definition: Archive_convert_state.C:14
virtual void resize(unsigned nsubint, unsigned npol=0, unsigned nchan=0, unsigned nbin=0)
Resize the Integration vector with new_Integration instances.
Definition: Archive_resize.C:26
virtual Interface * get_interface()
Return a text interface that can be used to access this instance.
Definition: Archive.C:52
virtual Signal::Source get_type() const =0
Get the observation type (psr, cal)
friend class Expert
The default baseline removal strategy.
Definition: Archive.h:579
virtual void add_extension(Extension *extension)
Add an Extension to the Archive instance.
Definition: Archive.C:186
virtual std::string get_source() const =0
Get the source name.
float rms_baseline(float dc=0.4)
Returns geometric mean of baseline RMS for each Integration.
Definition: Archive_rms_baseline.C:17
void remove_baseline()
Remove the baseline from all profiles.
Definition: Archive_remove_baseline.C:17
virtual void set_coordinates(const sky_coord &coordinates)=0
Set the coordinates of the source.
Reference::To< Parameters > ephemeris
The pulsar ephemeris, as used by TEMPO.
Definition: Archive.h:644
static void agent_list()
List the successfully loaded plugins.
Definition: Archive.C:125
void defaraday()
Correct the Faraday rotation of Q into U.
Definition: Archive_defaraday.C:26
Provides a text interface to get and set Archive attributes.
Definition: ArchiveInterface.h:26
void set_mixable(Match *)
The default baseline removal strategy.
Definition: Archive_match.C:95
Reference::To< Match > standard_match_policy
The pulsar ephemeris, as used by TEMPO.
Definition: Archive.h:682
Reference::To< Predictor > model
The pulsar phase model, as created using TEMPO.
Definition: Archive.h:647
const Match * get_mixable() const
Policy determines if data can be combined/integrated.
Definition: Archive_match.C:89
void set_filename(const std::string &filename)
Set the filename of the Archive.
Definition: Archive.h:114
virtual void set_nchan(unsigned numchan)=0
Set the number of frequency channels.
void remove_chan(unsigned first, unsigned last)
Delete the specified inclusive channel range from the Archive.
Definition: Archive_remove_chan.C:12
void fscrunch_to_nchan(unsigned new_nchan)
Call fscrunch with the appropriate value.
Definition: Archive_fscrunch.C:31
virtual std::string get_short_name() const
Return an abbreviated name that can be typed relatively quickly.
Definition: Archive.C:150
virtual void set_bandwidth(double bw)=0
Set the overall bandwidth of the observation.
const Integration * get_Integration(const Archive *data, Index subint)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:118
virtual void set_npol(unsigned numpol)=0
Set the number of polarization measurements.
virtual Signal::Scale get_scale() const =0
Get the scale in which flux density is measured.
void init_Integration(Integration *subint, bool check_phase=false)
Initialize an Integration to reflect Archive attributes.
Definition: Archive_init_Integration.C:29
Archive()
Default constructor.
Definition: Archive.C:67
Stores a weight for each Profile phase bin.
Definition: PhaseWeight.h:29
float find_max_phase() const
Returns the centre phase of the region with maximum total intensity.
Definition: Archive_find.C:72
virtual void set_type(Signal::Source type)=0
Set the observation type (psr, cal)
static unsigned get_instance_count()
Returns the number of Archive instances currently in existence.
Definition: Archive.C:62
static void agent_report()
Report on the status of the plugins.
Definition: Archive.C:120
Definition: Archive.h:26
void centre(double phase_offset=0.5)
Phase rotate pulsar Integrations so that pulse phase zero is centred.
Definition: Archive_centre.C:18
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
Extension(const char *name)
Construct with a name.
Definition: Archive.C:137
The primary interface to pulsar observational data.
Definition: Archive.h:45
bool processing_match(const Archive *arch, std::string &reason) const
Test if arch matches (enough for a pulsar - pulsar match)
Definition: Archive_match.C:40
Reference::To< Expert > expert_interface
Expert interface.
Definition: Archive.h:677
static Archive * load(const std::string &name)
Factory returns a new instance loaded from filename.
Definition: Archive_load.C:28
Reference::To< Interface > text_interface
Text interface.
Definition: Archive.h:680
Contains information about the receiver and receiver platform.
Definition: Receiver.h:28
void copy(const Archive &)
Copy all base class attributes, Extensions, and Integrations.
Definition: Archive_copy.C:24
void centre_max_bin(double phase_offset=0.5)
Phase rotate pulsar Integrations so centre the maximum amplitude.
Definition: Archive_centre_max_bin.C:16
static void set_verbosity(unsigned level)
Set the verbosity level (0 to 3)
Definition: Archive_verbose.C:19
void find_transitions(int &hi2lo, int &lo2hi, int &buffer) const
Find the transitions between high and low states in total intensity.
Definition: Archive_find.C:23
const Parameters * get_ephemeris() const
Return a pointer to the current archive ephemeris.
Definition: Archive.C:281
virtual ~Extension()
Destructor.
Definition: Archive.C:142
void update_centre_frequency()
Update the centre frequency.
Definition: Archive_update_centre_frequency.C:15
Reference::To< Match > mixable_policy
The pulsar ephemeris, as used by TEMPO.
Definition: Archive.h:685
Provides access to private and protected member of Archive.
Definition: ArchiveExpert.h:35
bool good_model(const Predictor *test_model) const
Returns true if the given model spans the Integration set.
Definition: Archive_good_model.C:23
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
Signal::Basis get_basis() const
Get the basis of the feed receptors.
Definition: Receiver.h:100
static Archive * new_Archive(const std::string &class_name)
Factory returns a null-constructed instance of the named class.
Definition: Archive.C:104
virtual unsigned get_nchan() const =0
Get the number of frequency channels used.
bool has_model() const
Returns true if the Archive has a model.
Definition: Archive.h:330
virtual void set_poln_calibrated(bool done=true)=0
Set the value to be returned by get_poln_calibrated.
void bscrunch(unsigned nscrunch)
Integrate pulse profiles in phase.
Definition: Archive_bscrunch.C:31
virtual Signal::State get_state() const =0
Get the state of the profile data.
static Option< std::string > unload_class
Name of class to which data are converted if unload_file unimplemented.
Definition: Archive.h:599
void uniform_weight(float new_weight=1.0)
Set the weight of each profile to the given number.
Definition: Archive.C:338
virtual Integration * load_Integration(const char *filename, unsigned subint)=0
Load the specified Integration from filename, returning new instance.
virtual void set_dispersion_measure(double dm)=0
Set the dispersion measure (in )
const Match * get_processing_match() const
Policy determines if data were processed identically.
Definition: Archive_match.C:77
virtual void set_dedispersed(bool done=true)=0
Set the value to be returned by get_dedispersed.
virtual bool get_poln_calibrated() const =0
Data has been calibrated for polarimetric response of instrument.
virtual double get_centre_frequency() const =0
Get the centre frequency of the observation.
static Functor< void(Archive *) > remove_baseline_strategy
The default baseline removal strategy.
Definition: Archive.h:572
virtual bool get_faraday_corrected() const =0
Data has been corrected for ISM faraday rotation.
void unload(const std::string &filename) const
Convenience interface to Archive::unload (const char*)
Definition: Archive.h:104
bool mixable(const Archive *arch, std::string &reason) const
Test if arch is mixable (enough for append)
Definition: Archive_match.C:29
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
static List & get_registry()
virtual bool can_unload() const =0
Return true if the unload method is implemented.
double integration_length() const
Returns the total time integrated into all Integrations (in seconds)
Definition: Archive.C:317
static std::string get_revision(const char *revision)
Parses the revision number out of the CVS Revision string.
Reference::To< Match > processing_match_policy
The pulsar ephemeris, as used by TEMPO.
Definition: Archive.h:684
unsigned size() const
void bscrunch_to_nbin(unsigned new_nbin)
Call bscrunch with the appropriate value.
Definition: Archive_bscrunch.C:16
bool has_ephemeris() const
Return true if the Archive has an ephemeris.
Definition: Archive.h:321
Profile * get_Profile(unsigned subint, unsigned pol, unsigned chan)
Return pointer to the specified profile.
Definition: Archive.C:270
Reference::To< Match > calibrator_match_policy
The pulsar ephemeris, as used by TEMPO.
Definition: Archive.h:683
bool type_is_cal() const
Return true if the observation is a calibrator.
Definition: Archive.C:330
virtual std::string get_telescope() const =0
Get the name of the telescope used.
void reverse_chan()
Reverse the order of frequency channels.
Definition: Integration.C:619
Expert * expert()
Provide access to the expert interface.
Definition: Archive.C:40
MJD end_time() const
Return the MJD at the end of the last sub-integration.
Definition: Archive.C:308
PhaseWeight * baseline() const
Return a new PhaseWeight instance with the baseline phase bins masked.
Definition: Archive_baseline.C:11
virtual bool get_dedispersed() const =0
Inter-channel dispersion delay has been removed.
Archive * total(bool tscrunch=true) const
Return pointer to a new fscrunched, tscrunched and pscrunched clone.
Definition: Archive_total.C:19
void set_ephemeris(const Parameters *ephemeris, bool update=true)
Install the given ephemeris and call update_model.
Definition: Archive_set_ephemeris.C:17
virtual void set_source(const std::string &source)=0
Set the source name.
bool zero_phase_aligned() const
Return true if all Integration::zero_phase_aligned flags are set.
Definition: Archive.C:344
const Match * get_standard_match() const
Policy determines if a standard/template matches an observation.
Definition: Archive_match.C:53
ExtensionType * getadd()
Template method returns an Extension of the specified type.
MJD start_time() const
Return the MJD at the start of the first sub-integration.
Definition: Archive.C:299
void rotate_phase(double phase)
Rotate each profile by phase.
Definition: Archive_rotate.C:18
virtual double get_bandwidth() const =0
Get the overall bandwidth of the observation.
void set_model(const Predictor *model, bool apply=true)
Install the given predictor and shift profiles to align.
Definition: Archive_set_model.C:14
void resize_Integration(Integration *integration)
Provide Integration::resize access to Archive-derived classes.
Definition: Archive_resize.C:88
std::string get_extension_name() const
Return the name of the Extension.
Definition: Archive.C:145
virtual unsigned get_nextension() const
Return the number of extensions available.
Definition: Archive.C:131
float find_min_phase(float dc=0.15) const
Returns the centre phase of the region with minimum total intensity.
Definition: Archive_find.C:56
StrategySet * get_strategy() const
Returns the strategy manager.
Definition: StrategySet.C:182
std::string unload_filename
Name of file to which the archive will be written on call to unload()
Definition: Archive.h:617
void set_processing_match(Match *)
The default baseline removal strategy.
Definition: Archive_match.C:83
void update()
Update the current archive, saving current Integration data.
Definition: Archive.C:253
void reverse_chan()
Reverse the order of frequency channels.
Definition: Archive.C:225
std::string get_filename() const
Get the name of the file to which the archive will be unloaded.
Definition: Archive.h:108
void dedisperse()
Rotate the Profiles to remove dispersion delays b/w chans.
Definition: Archive_dedisperse.C:18
bool in_frequency_order(const Archive *A, const Archive *B)
Return true if A precedes B in frequency order of channels.
Definition: Archive.C:364
virtual void set_nbin(unsigned numbins)=0
Set the number of pulsar phase bins.
Manages a vector of Integration instances.
Definition: IntegrationManager.h:33
const Predictor * get_model() const
Return a pointer to the current phase predictor.
Definition: Archive.C:290
Definition: ArchiveExtension.h:28
Signal::Basis get_basis() const
Convenience interface to Receiver::get_basis.
Definition: Archive.C:234
void append(const Archive *archive)
Append the Integrations from the specifed archive.
Definition: Archive_append.C:20
virtual Archive * clone() const =0
Return a new copy constructed instance equal to this.
void invint()
Transform Stokes I,Q,U,V into the polarimetric invariant interval.
Definition: Archive_invint.C:11
void fscrunch(unsigned nscrunch=0)
Integrate profiles in frequency.
Definition: Archive_fscrunch.C:17
void set_calibrator_match(Match *)
The default baseline removal strategy.
Definition: Archive_match.C:71
Defines the PSRCHIVE library.
Definition: CalSource.h:17
const Profile * get_Profile(const Archive *data, Index subint, Index pol, Index chan)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:24
void rotate(double time)
Phase rotate each profile by time seconds.
Definition: Archive_rotate.C:12
virtual void set_faraday_corrected(bool done=true)=0
Set the value to be returned by get_ism_rm_corrected.
void fold(unsigned nfold)
Integrate neighbouring sections of the pulse profiles.
Definition: Archive_fold.C:15
void pscrunch()
Integrate profiles in polarization.
Definition: Archive_pscrunch.C:16
void unload(const char *filename=0) const
Write the archive to filename.
Definition: Archive_unload.C:36
virtual sky_coord get_coordinates() const =0
Get the coordinates of the source.
virtual double get_dispersion_measure() const =0
Get the dispersion measure (in )
void apply_model(Integration *subint, const Predictor *old=0)
Apply the current model to the Integration.
Definition: Archive_apply_model.C:26
void create_updated_model(bool clear_model)
Creates polynomials to span the Integration set.
Definition: Archive_update_model.C:109
virtual void set_telescope(const std::string &code)=0
Set the name of the telescope used.
virtual void set_rotation_measure(double rm)=0
Set the rotation measure (in )
virtual void load_header(const char *filename)=0
Load the header information from filename.
const Match * get_calibrator_match() const
Policy determines if a calibrator matches an observation.
Definition: Archive_match.C:65
virtual ~Archive()
Destructor.
Definition: Archive.C:86
virtual unsigned get_nbin() const =0
Get the number of pulsar phase bins used.
void find_peak_edges(int &rise, int &fall) const
Find the bins in which the total intensity exceeds a threshold.
Definition: Archive_find.C:40
bool standard_match(const Archive *arch, std::string &reason) const
Test if arch matches (enough for a pulsar - standard match)
Definition: Archive_match.C:34
virtual void set_scale(Signal::Scale scale)=0
Set the scale in which flux density is measured.
Alternative ways of ordering Integration instances.
Definition: IntegrationOrder.h:29
virtual void erase(unsigned isubint)
Remove the specified sub-integration.
Definition: Archive_resize.C:94
virtual void set_state(Signal::State state)=0
Set the state of the profile data.
void transform(const Jones< float > &)
Perform the transformation on each polarimetric profile.
Definition: Archive_transform.C:15
double weighted_frequency(unsigned ichan, unsigned start, unsigned end) const
Computes the weighted channel frequency over an Integration interval.
Definition: Archive_weighted_frequency.C:23
Archive & operator=(const Archive &a)
Assignment operator.
Definition: Archive.C:97
static Option< bool > no_clobber
Default policy for overwriting archive files.
Definition: Archive.h:602
void set_standard_match(Match *)
The default baseline removal strategy.
Definition: Archive_match.C:59
void tscrunch(unsigned nscrunch=0)
Integrate profiles in time.
Definition: Archive_tscrunch.C:17
Archive * tscrunched() const
Return pointer to a new tscrunched clone.
Definition: Archive_tscrunched.C:18

Generated using doxygen 1.8.17