ASPArchive.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2007 by Paul Demorest
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Base/Formats/ASP/Pulsar/ASPArchive.h
10 
11 #ifndef __ASPArchive_h
12 #define __ASPArchive_h
13 
14 #include "Pulsar/BasicArchive.h"
15 #include "Pulsar/Agent.h"
16 #include <fitsio.h>
17 
18 // File version codes
19 #define ASP_FITS_V10 1
20 #define ASP_FITS_V11 2
21 #define ASP_FITS_V101 3
22 
23 namespace Pulsar {
24 
26  class ASPArchive : public BasicArchive {
27 
28  public:
29 
31  ASPArchive ();
32 
34  ASPArchive (const ASPArchive& archive);
35 
37  ~ASPArchive ();
38 
40  const ASPArchive& operator = (const ASPArchive& archive);
41 
43  ASPArchive (const Archive& archive);
44 
46  void copy (const Archive& archive);
47 
49  ASPArchive* clone () const;
50 
51  protected:
52 
54  virtual void load_header (const char* filename);
55 
57  virtual Integration*
58  load_Integration (const char* filename, unsigned subint);
59 
61  void load_extensions(fitsfile *f, int *status);
62 
64  bool can_unload () const { return false; }
65 
67  virtual void unload_file (const char* filename) const;
68 
69  // Advocates the use of the ASPArchive plugin
70  class Agent;
71 
73  friend class Archive::Advocate<ASPArchive>;
74 
75  private:
76 
78  void init ();
79 
81  int asp_file_version;
82 
84  bool have_asp_stokes;
85 
86  };
87 
88 
89  // Advocates the use of the ASPArchive plugin
90  class ASPArchive::Agent : public Archive::Advocate<ASPArchive> {
91 
92  public:
93 
94  Agent () { }
95 
97  bool advocate (const char* filename);
98 
100  std::string get_name () { return "ASP"; }
101 
103  std::string get_description ();
104 
105  };
106 
107 }
108 
109 #endif
double cal_frequency
Calibrator frequency.
Definition: CalInfoExtension.h:58
std::string get_name() const
Get the name of the observatory and/or primary reflector.
Definition: Telescope.h:96
void load_extensions(fitsfile *f, int *status)
Fill in info for select Archive extensions.
Definition: ASPArchive.C:509
void set_hand(Signal::Hand)
Set the hand of the basis.
Definition: Receiver.C:112
ASPArchive * clone() const
Return a new copy-constructed ASPArchive instance.
Definition: ASPArchive.C:95
std::string get_name() const
Get the name of the receiver.
Definition: Receiver.h:90
void set_basis(Signal::Basis basis)
Set the basis of the feed receptors.
Definition: Receiver.C:97
bool can_unload() const
The unload_file method is not implemented.
Definition: ASPArchive.h:64
Stores information about the instrument backend.
Definition: Backend.h:26
virtual Integration * load_Integration(const char *filename, unsigned subint)
Load the specified Integration from filename, returning new instance.
Definition: ASPArchive.C:302
void set_name(const std::string &_name)
Set the name of the receiver.
Definition: Receiver.h:92
double cal_phase
Calibrator phase.
Definition: CalInfoExtension.h:64
void set_amps(const T *data)
set the amplitudes array equal to the contents of the data array
Definition: ProfileAmps.h:89
void set_argument(Signal::Argument)
Set the argument of the backend.
Definition: Backend.C:113
void set_centre_frequency(unsigned ichan, double frequency)
Set the Profile centre frequency attributes of the given channel.
Definition: Integration.C:372
void copy(const Archive &archive)
Copy all of the class attributes and the selected Integration data.
Definition: ASPArchive.C:71
~ASPArchive()
Destructor.
Definition: ASPArchive.C:48
The primary interface to pulsar observational data.
Definition: Archive.h:45
Contains information about the receiver and receiver platform.
Definition: Receiver.h:28
virtual void unload_file(const char *filename) const
Unload the ASPArchive (header and Integration data) to filename.
Definition: ASPArchive.C:599
virtual void add_extension(Extension *extension)
Add an Extension to the Integration instance.
Definition: Integration.C:90
ASPArchive()
Default constructor.
Definition: ASPArchive.C:43
void shift(unsigned npts, float *arr, double shift)
void set_delay(const double set_delay)
Set the delay.
Definition: Backend.h:96
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
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
std::string project_ID
Project ID.
Definition: ObsExtension.h:84
const ASPArchive & operator=(const ASPArchive &archive)
Assignment operator.
virtual void set_epoch(const MJD &mjd)
Set the epoch of the rising edge of bin zero.
Definition: BasicIntegration.h:63
BasicIntegration class.
Definition: BasicIntegration.h:24
Contains information about the telescope used for the observation.
Definition: Telescope.h:26
Observation Information Extension.
Definition: ObsExtension.h:29
double cal_dutycycle
Calibrator duty-cycle.
Definition: CalInfoExtension.h:61
std::string observer
Observer name.
Definition: ObsExtension.h:78
virtual void set_folding_period(double seconds)
Set the folding period (in seconds)
Definition: BasicIntegration.h:73
Loads and unloads ASP Pulsar archives.
Definition: ASPArchive.h:26
void set_downconversion_corrected(bool corrected=true)
True if backend has compensated for lower sideband downconversion.
Definition: Backend.C:125
Defines the pure virtual methods declared in Pulsar::Archive.
Definition: BasicArchive.h:37
Defines the PSRCHIVE library.
Definition: CalSource.h:17
virtual void set_duration(double seconds)
Set the total time integrated (in seconds)
Definition: BasicIntegration.h:68
virtual void load_header(const char *filename)
Load the ASP header information from filename.
Definition: ASPArchive.C:102
Stores information about the reference source (ATNF)
Definition: CalInfoExtension.h:28
Profile * get_Profile(unsigned ipol, unsigned ichan)
Returns a pointer to the Profile given by the specified indeces.
Definition: Integration.C:306
void uniform_weight(float new_weight=1.0)
Set the weight of each profile to the given number.
Definition: Integration.C:706
Telescope pointing parameters recorded during the observation.
Definition: Pointing.h:27
int cal_nstate
Number of different states during cal period.
Definition: CalInfoExtension.h:67

Generated using doxygen 1.8.17