sigpyproc.header
sigpyproc.header¶
- class sigpyproc.header.Header(*, filename, data_type, nchans, foff, fch1, nbits, tsamp, tstart, nsamples, nifs=1, coord=<SkyCoord (ICRS): (ra, dec) in deg (0., 0.)>, azimuth=<Angle 0. deg>, zenith=<Angle 0. deg>, telescope='Fake', backend='Fake', source='Fake', frame='topocentric', ibeam=0, nbeams=0, dm=0, period=0, accel=0, signed=False, rawdatafile=None, hdrlens=NOTHING, datalens=NOTHING, filenames=NOTHING, nsamples_files=NOTHING, tstart_files=NOTHING)¶
Bases:
objectContainer object to handle observation metadata.
- Parameters
filename (
str) – filenamedata_type (
str) – data typenchans (
int) – Number of channelsfoff (
float) – Channel width in MHzfch1 (
float) – Central frequency of the first channel in MHznbits (
int) – Number of bits of sampletsamp (
float) – Sampling timetstart (
float) – Start MJDnsamples (
int) – Number of samplesnifs (
int) – Number of polarizationscoord (
SkyCoord) – Sky coordinateazimuth (
Angle) – Telescope Azimuthzenith (
Angle) – Telescope Zenith angletelescope (
str) – Telescope namebackend (
str) – Backend namesource (
str) – Source nameframe (
str) – Frame (Topocentric)ibeam (
int) – Beam nonbeams (
int) – Total beamsdm (
float) – Reference DMperiod (
float) – Periodaccel (
float) – Accelerationsigned (
bool) – if the data is signedtstart_files (
listoffloat) – List of start MJD in each file
- filename¶
- data_type¶
- nchans¶
- foff¶
- fch1¶
- nbits¶
- tsamp¶
- tstart¶
- nsamples¶
- nifs¶
- coord¶
- azimuth¶
- zenith¶
- telescope¶
- backend¶
- source¶
- frame¶
- ibeam¶
- nbeams¶
- dm¶
- period¶
- accel¶
- signed¶
- rawdatafile¶
- hdrlens¶
- datalens¶
- filenames¶
- nsamples_files¶
- tstart_files¶
- property basename¶
Basename of header filename (str, read-only).
- property extension¶
Extension of header filename (str, read-only).
- property telescope_id¶
Telescope id (int, read-only).
- property machine_id¶
Machine id (str, read-only).
- property bandwidth¶
Bandwidth in MHz (float, read-only).
- property ftop¶
Frequency (boundary) of the top channel (float, read-only).
- property fbottom¶
Frequency (boundary) of the bottom channel (float, read-only).
- property fcenter¶
Central frequency of the whole band (float, read-only).
- property dtype¶
Type of the data (np.dtype, read-only).
- property tobs¶
Total time of the observation (float, read-only).
- property ra¶
Right Ascension (str, read-only).
- property dec¶
Declination (str, read-only).
- property obs_date¶
Observation date and time (str, read-only).
- mjd_after_nsamps(nsamps)¶
Find the Modified Julian Date after nsamps have elapsed.
- get_dmdelays(dm, in_samples=True)¶
For a given dispersion measure get the dispersive ISM delay for middle of each frequency channel.
- dedispersed_header(dm)¶
Get a dedispersed version of the current header.
- to_dict(with_properties=True)¶
Get a dict of all attributes including property attributes.
- Returns
attributes
- Return type
- to_sigproc(as_dict=False)¶
Get sigproc format header binary header.
- Returns
header in binary format
- Return type
- prep_outfile(filename, update_dict=None, nbits=None, quantize=False, interval_seconds=10, constant_offset_scale=False, **kwargs)¶
Prepare a file to have sigproc format data written to it.
- Parameters
- Returns
a prepared file
- Return type
- make_inf(outfile=None)¶
Make a presto format
.inffile.
- classmethod from_inffile(filename)¶
Parse the metadata from a presto
.inffile.