sigpyproc.io.pfits#
PSRFITS header and data reading.
This module contains classes for reading PSRFITS headers and data.
Classes
Backend information. |
|
Handle a PSRFITS file. |
|
Primary header information. |
|
Receiver information. |
|
Sub-integration header information. |
- class sigpyproc.io.pfits.Backend(*, name, phase, dcc, delay, tcycle, configfile)[source]#
Bases:
objectBackend information.
- Attributes:
- name
str Name of the backend instrument.
- phase: float
Phase convention of backend.
- dcc: float
Downconversion conjugation corrected.
- delay: float
Backend propn delay from digi. input.
- tcycle: float
Native cycle time of correlation system.
- configfile: str
Name of a configuration file used to set up the backend system.
- name
- name#
- phase#
- dcc#
- delay#
- tcycle#
- configfile#
- class sigpyproc.io.pfits.PFITSFile(filename)[source]#
Bases:
objectHandle a PSRFITS file.
- Parameters:
- filename
str Filename of the PSRFITS file.
- filename
- Attributes:
Methods
read_freqs(isub)Read the Channel centre frequency from the PSRFITS SUBINT table.
read_offsets(isub)Read channel data offset (DAT_OFFS) column from the SUBINT table.
read_scales(isub)Read channel data scale factor (DAT_SCL) column from the SUBINT table.
read_subint(isub, *[, scloffs, weights])Read the digitised data from the PSRFITS SUBINT table.
read_subint_pol(isub, *[, poln_select, ...])Read the given polarization format from the PSRFITS SUBINT table.
read_subints(startsub, nsubs, *[, ...])Read the given polarization format from a range of PSRFITS SUBINT table.
read_weights(isub)Read channel weight (DAT_WTS) column from the SUBINT table.
- property pri_hdr#
Primary header object.
- Returns:
PrimaryHdrPrimary header.
- read_subints(startsub, nsubs, *, poln_select=1, scloffs=True, weights=True)[source]#
Read the given polarization format from a range of PSRFITS SUBINT table.
- Parameters:
- startsub
int Index of start row (subint) to read from the SUBINT table.
- nsubs
int Number of subints to read from the SUBINT table.
- poln_select
int, optional 1=PP+QQ, 2=PP,QQ, 3=(PP+QQ)^2 4=PP,QQ,PQ,QP, by default 1.
- scloffs
bool, optional Apply scales and offsets when unpacking data, by default False.
- weights
bool, optional Apply weights when unpacking data, by default False.
- startsub
- Returns:
ndarraySubint (row) data in
float32ifscloffsorweightsapplied, otherwise inuint8with shape(nsamps, nchan).
- read_subint_pol(isub, *, poln_select=1, scloffs=True, weights=True)[source]#
Read the given polarization format from the PSRFITS SUBINT table.
- Parameters:
- isub
int Index of row (subint) to read from the SUBINT table.
- poln_select
int, optional Polarization index to select, by default 1.
Available options:
1=PP+QQ
2=PP,QQ
3=(PP+QQ)^2
4=PP,QQ,PQ,QP
- scloffs
bool, optional Apply scales and offsets when unpacking data, by default True
- weights
bool, optional Apply weights when unpacking data, by default True
- isub
- Returns:
ndarraySubint (row) data in
float32ifscloffsor weights applied, otherwise inuint8with shape(nsamps, nchan).
- read_subint(isub, *, scloffs=True, weights=True)[source]#
Read the digitised data from the PSRFITS SUBINT table.
- Parameters:
- Returns:
ndarraySubint (row) data in
float32ifscale_and_offsetor weights applied, otherwise inuint8with shape(nsamps, npol, nchan).
- read_freqs(isub)[source]#
Read the Channel centre frequency from the PSRFITS SUBINT table.
- Parameters:
- isub
int Index of row (subint) to read from the SUBINT table.
- isub
- Returns:
FrequencyChannelsCentre frequency for each channel in MHz (
NCHAN).
- class sigpyproc.io.pfits.PrimaryHdr(filename)[source]#
Bases:
objectPrimary header information.
- Parameters:
- filename
str Filename of the PSRFITS file.
- filename
- Attributes:
headerastropy.io.fits.Header: Primary header.
observerstr: Observer name(s).
project_idstr: Project name.
telescopestr: Telescope name.
locationastropy.coordinates.EarthLocation: Antenna location.
receiverReceiver: Receiver information.backendBackend: Backend information.ibeamint: Beam number.
obs_modestr: Observation mode.
date_obsastropy.time.Time: Observation start date.
freqsFrequencyChannels: Frequency channels.chan_dmfloat: On-line (normally coherent) dedispersion measure.
sourcestr: Source name or label for an observation.
coordastropy.coordinates.SkyCoord: Source coordinates.
tstartastropy.time.Time: Observation start time.
- property header#
astropy.io.fits.Header: Primary header.
- property observer#
str: Observer name(s).
- property project_id#
str: Project name.
- property telescope#
str: Telescope name.
- property location#
astropy.coordinates.EarthLocation: Antenna location.
- property ibeam#
int: Beam number.
- property obs_mode#
str: Observation mode.
- property date_obs#
astropy.time.Time: Observation start date.
- property freqs#
FrequencyChannels: Frequency channels.
- property chan_dm#
float: On-line (normally coherent) dedispersion measure.
- property source#
str: Source name or label for an observation.
- property coord#
astropy.coordinates.SkyCoord: Source coordinates.
- property tstart#
astropy.time.Time: Observation start time.
- class sigpyproc.io.pfits.Receiver(*, name, nrcvr, basis, hand, sa, rph, tracking_mode, tracking_angle)[source]#
Bases:
objectReceiver information.
- Attributes:
- name
str Name of the receiver.
- nrcvr
int Number of receptors.
- basis
str Basis of receptors.
- hand: int
Hand of receptor basis.
- sa: float
Symmetry angle of receptor basis.
- rph: float
Reference source phase.
- tracking_mode: str
Tracking mode of the receiver platform.
- tracking_angle: float
Position angle tracked by the receiver.
- name
- name#
- nrcvr#
- basis#
- hand#
- sa#
- rph#
- tracking_mode#
- tracking_angle#
- class sigpyproc.io.pfits.SubintHdr(filename)[source]#
Bases:
objectSub-integration header information.
- Parameters:
- filename
str Filename of the PSRFITS file.
- filename
- Attributes:
headerastropy.io.fits.Header: SUBINT header.
subint_widthint: Width of subint table in bytes.
nsubintint: Number of rows (subints) in subint table.
poln_typestr: Polarisation identifier (e.g., AABBCRCI, AA+BB).
poln_statestr: Polarisation state (e.g., Coherence).
npolint: Number of polarisation products in the DATA table.
tsampfloat: Time per bin or sample (seconds).
nbitsint: Number of bits per sample.
zero_offfloat: Zero offset for data (the nominal data zero in digitiser units).
signintint: Flag to indicate that the data values are signed integers.
subint_offsetint: Subint offset for contiguous SEARCH-mode files.
nchansint: Number of frequency channels for each polarisation in the DATA table.
chan_bwfloat: Channel bandwidth in MHz.
channel_offsetint: Channel offset for contiguous SEARCH-mode files.
subint_samplesint: Number of samples per subint or table row.
nsamplesint: Total number of valid samples in a search-mode file.
- subint_shape
- sub_hdr
tsubintfloat: Time per subint or table row (seconds).
offs_subfloat: Time since the observation start at the centre of first subint (s).
azimuthastropy.coordinates.Angle: Azimuth (degrees).
zenithastropy.coordinates.Angle: Zenith (degrees).
freqssigpyproc.utils.FrequencyChannels: Frequency channels for first subint.
- property header#
astropy.io.fits.Header: SUBINT header.
- property subint_width#
int: Width of subint table in bytes.
- property nsubint#
int: Number of rows (subints) in subint table.
- property poln_type#
str: Polarisation identifier (e.g., AABBCRCI, AA+BB).
- property poln_state#
str: Polarisation state (e.g., Coherence).
- property npol#
int: Number of polarisation products in the DATA table.
- property tsamp#
float: Time per bin or sample (seconds).
- property nbits#
int: Number of bits per sample.
- property zero_off#
float: Zero offset for data (the nominal data zero in digitiser units).
- property signint#
int: Flag to indicate that the data values are signed integers.
- property subint_offset#
int: Subint offset for contiguous SEARCH-mode files.
- property nchans#
int: Number of frequency channels for each polarisation in the DATA table.
- property chan_bw#
float: Channel bandwidth in MHz.
- property channel_offset#
int: Channel offset for contiguous SEARCH-mode files.
- property subint_samples#
int: Number of samples per subint or table row.
- property nsamples#
int: Total number of valid samples in a search-mode file.
- property subint_shape#
- property sub_hdr#
- property tsubint#
float: Time per subint or table row (seconds).
- property offs_sub#
float: Time since the observation start at the centre of first subint (s).
- property azimuth#
astropy.coordinates.Angle: Azimuth (degrees).
- property zenith#
astropy.coordinates.Angle: Zenith (degrees).
- property freqs#
sigpyproc.utils.FrequencyChannels: Frequency channels for first subint.