TimerIntegration.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2003 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Base/Formats/Timer/Pulsar/TimerIntegration.h
10 
11 /*
12 
13  Pulsar::Integration - base class for pulsar observations
14 
15 */
16 
17 #ifndef __Timer_Integration_h
18 #define __Timer_Integration_h
19 
20 #include <stdio.h>
21 #include <vector>
22 
23 #include "Pulsar/Integration.h"
24 #include "mini.h"
25 
26 namespace Pulsar {
27 
28  class TimerIntegration : public Integration {
29 
30  public:
31 
32  friend class TimerArchive;
33 
35  TimerIntegration ();
36 
38  TimerIntegration (const TimerIntegration& t_subint);
39 
41  TimerIntegration (const Integration& subint);
42 
44  virtual ~TimerIntegration ();
45 
47  virtual void copy (const Integration* subint, bool management = true);
48 
50  virtual Integration* clone () const;
51 
53 
54  virtual unsigned get_nchan () const { return nchan; }
55 
57 
58  virtual unsigned get_npol () const { return npol; }
59 
61 
62  virtual unsigned get_nbin () const { return nbin; }
63 
65  virtual MJD get_epoch () const;
67  virtual void set_epoch (const MJD& mjd);
68 
70  virtual double get_duration () const;
72  virtual void set_duration (double seconds);
73 
75  virtual double get_folding_period () const;
77  virtual void set_folding_period (double seconds);
78 
80  void load (FILE * fptr, int wts_and_bpass, bool big_endian=true);
81 
83  void unload (FILE * fptr) const;
84 
86  virtual void resize (unsigned npol, unsigned nchan, unsigned nbin);
87 
89  virtual void insert (Integration*);
90 
91  protected:
92 
93  struct mini mini;
94 
96  unsigned npol;
97 
99  unsigned nchan;
100 
102  unsigned nbin;
103 
105  std::vector<float> wts;
106 
108  std::vector< std::vector<float> > med;
109 
111  std::vector< std::vector<float> > bpass;
112 
114 
115  virtual void set_nbin (unsigned numbins) { nbin = numbins; }
116 
118 
119  virtual void set_nchan (unsigned numchan) { nchan = numchan; }
120 
122 
123  virtual void set_npol (unsigned numpol) { npol = numpol; }
124 
126  void init ();
127 
129  void load_extra (FILE* fptr, bool big_endian);
130 
132  void load_old (FILE* fptr, bool big_endian);
133 
135  void unpack_Pointing ();
136 
138  void pack_Pointing () const;
139 
140  };
141 
143  void TimerProfile_load (FILE* fptr, Profile* profile, bool big_endian=true);
144 
146  void TimerProfile_unload (FILE* fptr, const Profile* profile, int poln);
147 
148 }
149 
150 #endif
bool get_basis_corrected() const
Return true when receptor basis has been corrected.
Definition: Receiver.h:165
double cal_frequency
Calibrator frequency.
Definition: CalInfoExtension.h:58
void TimerProfile_load(FILE *fptr, Profile *profile, bool big_endian=true)
load a Profile from a timer archive
Definition: TimerProfile_load.C:22
Warning warning
Warning messages filter.
Definition: Pulsar.C:12
double get_parallactic_angle() const
bool get_corrected() const
True if backend corrections were applied during calibration.
Definition: Backend.C:131
void set_Y_offset(const Angle &offset)
Set the offset of the feed Y axis from its nominal value.
Definition: Receiver.C:149
void set_corrected(bool corrected=true)
True if backend corrections were applied during calibration.
Definition: Backend.C:137
void set_observatory_latitude(double latitude)
std::string get_name() const
Get the name of the receiver.
Definition: Receiver.h:90
void set_right_ascension(const Angle &)
Set the RA (J2000) at subint centre.
Definition: Pointing.C:87
void set_basis(Signal::Basis basis)
Set the basis of the feed receptors.
Definition: Receiver.C:97
void hdr_load(FILE *fptr)
load the timer header from an open file
Definition: TimerArchive_load.C:482
virtual MJD get_epoch() const =0
Get the epoch of the rising edge of bin zero.
Stores information about the instrument backend.
Definition: Backend.h:26
float get_weight() const
get the weight of the profile
Definition: Profile.h:207
bool get_downconversion_corrected() const
True if backend has compensated for lower sideband downconversion.
Definition: Backend.C:119
void set_source_coordinates(const sky_coord &coords)
void set_name(const std::string &_name)
Set the name of the receiver.
Definition: Receiver.h:92
void subint_load(FILE *fptr)
load the sub-integrations from an open file
Definition: TimerArchive_load.C:93
const Integration * get_Integration(const Archive *data, Index subint)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:118
bool get_projection_corrected() const
Return true when receptor projection onto sky has been corrected.
Definition: Receiver.h:170
double cal_phase
Calibrator phase.
Definition: CalInfoExtension.h:64
Stores information about the tape on which the data were recorded.
Definition: TapeInfo.h:24
void unpack(Receiver *receiver)
Unpack the Receiver extension.
Definition: TimerArchive_Receiver.C:29
Angle get_longitude() const
Get the longitude of the antenna.
Definition: Telescope.h:106
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
Angle get_Y_offset() const
Get the offset of the feed Y axis from its nominal value.
Definition: Receiver.C:154
void set_galactic_latitude(const Angle &)
Set the Gal latitude at subint centre.
Definition: Pointing.C:120
void set_galactic_longitude(const Angle &)
Set the Gal longitude at subint centre.
Definition: Pointing.C:109
Contains information about the receiver and receiver platform.
Definition: Receiver.h:28
std::string get_tracking_mode_string() const
Return a string that describes the tracking mode.
Definition: Receiver.C:84
std::string get_tape_label() const
Get tape label for raw data (FB only)
Definition: TapeInfo.h:55
void subint_unload(FILE *fptr) const
unload the sub-integrations to an open file
Definition: TimerArchive_unload.C:72
Angle get_tracking_angle() const
Get the position angle tracked by the receiver.
Definition: Receiver.h:85
Signal::Basis get_basis() const
Get the basis of the feed receptors.
Definition: Receiver.h:100
void unpack_extensions()
Unpack the Receiver and Telescope Extension classes (after loading)
Definition: TimerArchive_extensions.C:22
virtual void load_header(const char *filename)
Load the header information from filename.
Definition: TimerArchive_load.C:30
void set_file_number(int number)
Set file number for raw data (FB only)
Definition: TapeInfo.h:52
void psr_load(FILE *fptr)
load the polyco and ephemeris from an open file
Definition: TimerArchive_load.C:517
void unload(FILE *fptr) const
unload the archive to an open file
Definition: TimerArchive_unload.C:57
void set_name(const std::string &name)
Set the name of the backend.
Definition: Backend.C:89
std::string cal_mode
Cal mode (As defined by the ATNF TCS: OFF, SYNC, EXT1, EXT2)
Definition: CalInfoExtension.h:55
virtual double get_duration() const =0
Get the total time integrated (in seconds)
void set_observatory_longitude(double longitude)
void set_projection_corrected(bool val)
Set true when receptor projection onto sky has been corrected.
Definition: Receiver.h:172
std::string get_name() const
Return the name of the Backend.
Definition: Backend.C:83
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
void load(FILE *fptr)
load the archive from an open file
Definition: TimerArchive_load.C:57
double get_azimuth() const
void set_epoch(const MJD &epoch)
Contains information about the telescope used for the observation.
Definition: Telescope.h:26
void set_calibrator_offset(const Angle &offset)
Set the offset of the feed calibrator axis from its nominal value.
Definition: Receiver.C:164
Angle get_calibrator_offset() const
Get the offset of the feed calibrator axis from its nominal value.
Definition: Receiver.C:169
void set_tape_label(std::string label)
Set tape label for raw data (FB only)
Definition: TapeInfo.h:58
double cal_dutycycle
Calibrator duty-cycle.
Definition: CalInfoExtension.h:61
void hdr_unload(FILE *fptr) const
unload the timer header to an open file
Definition: TimerArchive_unload.C:108
void set_basis_corrected(bool)
Set true when receptor basis has been corrected.
Definition: Receiver.C:174
Angle get_X_offset() const
Get the offset of the feed X axis with respect to the platform zero.
Definition: Receiver.C:140
Angle get_latitude() const
Get the latitude of the antenna.
Definition: Telescope.h:101
std::string get_extension_name() const
Return the name of the Extension.
Definition: Archive.C:145
virtual void unload_file(const char *filename) const
Unload the Archive (header and Integration data) to filename.
Definition: TimerArchive_unload.C:27
void pack_extensions()
Pack the Receiver and Telescope Extension classes (before unloading)
Definition: TimerArchive_extensions.C:74
void set_downconversion_corrected(bool corrected=true)
True if backend has compensated for lower sideband downconversion.
Definition: Backend.C:125
Tracking get_tracking_mode() const
Get the tracking mode of the receiver platform.
Definition: Receiver.h:80
void pack(const Receiver *receiver)
Pack the Receiver extension.
Definition: TimerArchive_Receiver.C:173
int get_file_number() const
Get file number for raw data (FB only)
Definition: TapeInfo.h:49
virtual void set_be_data_size()
set the backend data size
Definition: TimerArchive_unload.C:163
Integration()
Default constructor.
Definition: Integration.C:152
void set_X_offset(const Angle &offset)
Set the offset of the feed X axis with respect to the platform zero.
Definition: Receiver.C:135
double get_local_sidereal_time() const
const std::string get_message() const
void set_tracking_angle(const Angle &angle)
Get the position angle tracked by the receiver.
Definition: Receiver.h:87
void set_tracking_mode(Tracking mode)
Set the tracking mode of the receiver platform.
Definition: Receiver.h:82
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 set_coordinates(const std::string &code)
Set the coordinates of the telescope based on known tempo codes.
Definition: Telescope.C:59
void TimerProfile_unload(FILE *fptr, const Profile *profile, int poln)
unload a Profile to a timer archive
Definition: TimerProfile_unload.C:26
virtual double get_folding_period() const =0
Get the folding or topocentric pulsar period (in seconds)
virtual void set_weight(float)
set the weight of the profile
Definition: Profile.C:185
Stores information about the reference source (ATNF)
Definition: CalInfoExtension.h:28
virtual void backend_unload(FILE *fptr) const
unload the backend-specific information to an open file
Definition: TimerArchive_unload.C:157
double get_zenith() const
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
void set_declination(const Angle &)
Set the DEC (J2000) at subint centre.
Definition: Pointing.C:98
Telescope pointing parameters recorded during the observation.
Definition: Pointing.h:27
Reads and writes the timer archive file format.
Definition: TimerArchive.h:29
virtual void backend_load(FILE *fptr)
load the backend-specific information from an open file
Definition: TimerArchive_load.C:497
void psr_unload(FILE *fptr) const
unload the polyco and ephemeris from an open file
Definition: TimerArchive_unload.C:168

Generated using doxygen 1.8.17