Reading in and writing out observations
Loading SDFITS files
Classes and functions for importing SDFITS files
SDFITSLoad
Load generic SDFITS files - Not typically used directly. Sub-class for specific telescope SDFITS flavors.
- class dysh.fits.sdfitsload.SDFITSLoad(filename, source=None, hdu=None, **kwargs)[source]
Bases:
object
Generic Container for a bintable(s) from selected HDU(s) for a single SDFITS file. For multiple SDFITS files, see
GBTFITSLoad
.- Parameters:
- filenamestr
input file name
- sourcestr
target source to select from input file. Default: all sources
- hduint or list
Header Data Unit to select from input file. Default: all HDUs
- Attributes:
Methods
The list of bintable headers
create_index
([hdu])Create the index of the SDFITS file.
fix_meta
(meta)Do any repair to the meta/header for peculariaties in definitions from a particular observatory The passed-in dictionary will be repaired in place.
getrow
(i[, bintable])Get a FITS_record from the input bintable
getspec
(i[, bintable, observer_location])Get a row (record) as a Spectrum
index
([hdu, bintable])Return The index table.
info
()Return the
HDUList
info()load
([hdu])Load the bintable for given hdu.
naxis
(naxis, bintable)The NAXISn value of the input bintable.
nchan
(bintable)The number of channels per row of the input bintable.
nintegrations
(bintable[, source])The number of integrations on a given source divided by the number of polarizations
npol
(bintable)The number of polarizations present in the input bintable.
nrows
(bintable)The number of rows of the input bintable
rawspectra
(bintable)Get the raw (unprocessed) spectra from the input bintable.
rawspectrum
(i[, bintable])Get a single raw (unprocessed) spectrum from the input bintable.
scans
(bintable)The number of scans resent in the input bintable.
sources
(bintable)The number of sources present in the input bintable.
summary
()Print a summary of each record of the data
udata
(key[, bintable])The unique list of values of a given header keyword
ushow
(key[, bintable])Print the unique list of values of a given header keyword
velocity_convention
(veldef, velframe)Compute the velocity convention string use for velocity conversions, given the VELDEF and VELFRAME values.
write
(fileobj[, rows, bintable, ...])Write the
SDFITSLoad
to a new file, potentially sub-selecting rows or bintables.add_primary_hdu
- property bintable
The list of bintables
- create_index(hdu=None)[source]
Create the index of the SDFITS file.
- Parameters:
- hduint or list
Header Data Unit to select from input file. Default: all HDUs
- property filename
The input SDFITS filename
- fix_meta(meta)[source]
Do any repair to the meta/header for peculariaties in definitions from a particular observatory The passed-in dictionary will be repaired in place. At minimum this method must populate meta[‘VELDEF’] and meta[‘VELFRAME’]
- Parameters:
- metadict
The header of the
Spectrum
to be fixed, corresponding to themeta
attribute of the Spectrum.
- getrow(i, bintable=0)[source]
Get a FITS_record from the input bintable
- Parameters:
- iint
The record (row) index to retrieve
- bintableint
The index of the
bintable
attribute
- Returns:
- row
FITS_record
The i-th record of the input bintable
- row
- getspec(i, bintable=0, observer_location=None)[source]
Get a row (record) as a Spectrum
- Parameters:
- iint
The record (row) index to retrieve
- bintableint, optional
The index of the
bintable
attribute. default is 0.- observer_location
EarthLocation
Location of the observatory. See
Observatory
. This will be transformed toITRS
using the time of observation DATE-OBS or MJD-OBS in the SDFITS header. The default is None.
- Returns:
- s
Spectrum
The Spectrum object representing the data row.
- s
- index(hdu=None, bintable=None)[source]
Return The index table.
- Parameters:
- hduint or list
Header Data Unit to select from the index. Default: all HDUs
- bintableint
The index of the
bintable
attribute, None means all bintables
- Returns:
- index~pandas.DataFrame
The index of this SDFITS file
- load(hdu=None, **kwargs)[source]
Load the bintable for given hdu. Note mmHg and UTC are unrecognized units. mmHg is in astropy.units.cds but UTC is just wrong.
- Parameters:
- hduint or list
Header Data Unit to select from input file. Default: all HDUs
- naxis(naxis, bintable)[source]
The NAXISn value of the input bintable.
- Parameters:
- naxisint
The NAXIS whose length is requested
- bintableint
The index of the
bintable
attribute
- Returns:
- naxisthe length of the NAXIS
- nchan(bintable)[source]
The number of channels per row of the input bintable. Assumes all rows have same length.
- Parameters:
- bintableint
The index of the
bintable
attribute
- Returns:
- nchanint
Number channels in the first spectrum of the input bintbale
- nintegrations(bintable, source=None)[source]
The number of integrations on a given source divided by the number of polarizations
- Parameters:
- bintableint
The index of the
bintable
attribute- source: str
The source name (OBJECT keyword) or None for all sources. Default: None
- Returns:
- nintegrationsthe number of integrations
- npol(bintable)[source]
The number of polarizations present in the input bintable.
- Parameters:
- bintableint
The index of the
bintable
attribute
- Returns:
- npol: int
Number of polarizations as given by
CRVAL4
FITS header keyword.
- nrows(bintable)[source]
The number of rows of the input bintable
- Parameters:
- bintableint
The index of the
bintable
attribute
- Returns:
- nrowsint
Number of rows, i.e., the length of the input bintable
- rawspectra(bintable)[source]
Get the raw (unprocessed) spectra from the input bintable.
- Parameters:
- bintableint
The index of the
bintable
attribute
- Returns:
- rawspectra~numpy.ndarray
The DATA column of the input bintable
- rawspectrum(i, bintable=0)[source]
Get a single raw (unprocessed) spectrum from the input bintable.
- Parameters:
- iint
The row index to retrieve.
- bintableint or None
The index of the
bintable
attribute. If None, the underlying bintable is computed from i
- Returns:
- rawspectrum~numpy.ndarray
The i-th row of DATA column of the input bintable
- scans(bintable)[source]
The number of scans resent in the input bintable. TODO: move this to GBTFISLoad?
- Parameters:
- bintableint
The index of the
bintable
attribute
- Returns:
- scans: int
Number of scans as given by
SCAN
FITS header keyword.
- sources(bintable)[source]
The number of sources present in the input bintable.
- Parameters:
- bintableint
The index of the
bintable
attribute
- Returns:
- sources: int
Number of sources as given by
OBJECT
FITS header keyword.
- udata(key, bintable=None)[source]
The unique list of values of a given header keyword
- Parameters:
- keystr
The keyword to retrieve
- bintableint
The index of the
bintable
attribute, None means all bintables
- Returns:
- udatalist
The unique set of values for the input keyword.
- ushow(key, bintable=None)[source]
Print the unique list of values of a given header keyword
- Parameters:
- keystr
The keyword to retrieve
- bintableint
The index of the
bintable
attribute, None means all bintables
- velocity_convention(veldef, velframe)[source]
Compute the velocity convention string use for velocity conversions, given the VELDEF and VELFRAME values. Return value must be a recognized string of
Spectrum1D
, one of {“doppler_relativistic”, “doppler_optical”, “doppler_radio”} Sub-classes should implement, because different observatories use VELDEF and VELFRAME inconsistently. This base class method hard-coded to return “doppler_radio.”- Parameters:
- veldefstr
The velocity definition string (
VELDEF
FITS keyword)- velframestr
The velocity frame string (
VELFRAME
FITS keyword)
- write(fileobj, rows=None, bintable=None, output_verify='exception', overwrite=False, checksum=False)[source]
Write the
SDFITSLoad
to a new file, potentially sub-selecting rows or bintables.- Parameters:
- fileobjstr, file-like or
pathlib.Path
File to write to. If a file object, must be opened in a writeable mode.
- rows: int or list-like
Range of rows in the bintable(s) to write out. e.g. 0, [14,25,32]. Default: None, meaning all rows Note: Currently
rows
, if given, must be contained in a single bintable and bintable must be given- bintableint
The index of the
bintable
attribute or None for all bintables. Default: None- output_verifystr
Output verification option. Must be one of
"fix"
,"silentfix"
,"ignore"
,"warn"
, or"exception"
. May also be any combination of"fix"
or"silentfix"
with"+ignore"
,+warn
, or+exception" (e.g. ``"fix+warn"
). See https://docs.astropy.org/en/latest/io/fits/api/verification.html for more info- overwritebool, optional
If
True
, overwrite the output file if it exists. Raises anOSError
ifFalse
and the output file exists. Default isFalse
.- checksumbool
When
True
adds bothDATASUM
andCHECKSUM
cards to the headers of all HDU’s written to the file.
- fileobjstr, file-like or
GBTFITSLoad
Load SDFITS files produced by the Green Bank Telescope
- class dysh.fits.gbtfitsload.GBTFITSLoad(fileobj, source=None, hdu=None, **kwargs)[source]
Bases:
SDFITSLoad
GBT-specific container to reprensent one or more SDFITS files
- Parameters:
- fileobjstr or
pathlib.Path
File to read or directory path. If a directory, all FITS files within will be read in.
- sourcestr
target source to select from input file(s). Default: all sources
- hduint or list
Header Data Unit to select from input file. Default: all HDUs
- fileobjstr or
- Attributes:
bintable
The list of bintables
filename
The input SDFITS filename
files
The list of SDFITS file(s) that make up this GBTFITSLoad object
final_selection
The merged selection rules in the Selection object.
selection
The data selection object
Methods
binheader
()The list of bintable headers
calonoff_rows
([scans, bintable, fitsindex])Get individual scan row numbers sorted by whether the calibration (diode) was on or off, and selected by ifnum,plnum, fdnum,subref,bintable.
create_index
([hdu])Create the index of the SDFITS file.
fix_meta
(meta)Do any repair to the meta/header for peculariaties in definitions from a particular observatory The passed-in dictionary will be repaired in place.
getfs
([calibrate, fold, use_sig, ...])Retrieve and calibrate frequency-switched data.
getps
([calibrate, timeaverage, polaverage, ...])Retrieve and calibrate position-switched data.
getrow
(i[, bintable])Get a FITS_record from the input bintable
getspec
(i[, bintable, observer_location, ...])Get a row (record) as a Spectrum
gettp
([sig, cal, calibrate, timeaverage, ...])Get a total power scan, optionally calibrating it.
index
([hdu, bintable, fitsindex])Return The index table
info
()Return information on the HDUs contained in this object. See :meth:`~astropy.HDUList/info().
load
([hdu])Load the bintable for given hdu.
naxis
(naxis, bintable)The NAXISn value of the input bintable.
nchan
(bintable)The number of channels per row of the input bintable.
nintegrations
(bintable[, source])The number of integrations on a given source divided by the number of polarizations
npol
(bintable)The number of polarizations present in the input bintable.
nrows
(bintable)The number of rows of the input bintable
onoff_rows
([scans, ifnum, plnum, bintable, ...])Get individual ON/OFF (position switch) scan row numbers selected by ifnum,plnum, bintable.
onoff_scan_list
([scans, ifnum, plnum, ...])Get the scans for position-switch data sorted
rawspectra
(bintable, fitsindex)Get the raw (unprocessed) spectra from the input bintable.
rawspectrum
(i[, bintable, fitsindex])Get a single raw (unprocessed) spectrum from the input bintable.
scan_rows
(scans[, ifnum, plnum, bintable, ...])Get scan rows selected by ifnum,plnum, bintable.
scans
(bintable)The number of scans resent in the input bintable.
select
([tag])Add one or more exact selection rules, e.g.,
key1 = value1, key2 = value2, ...
Ifvalue
is array-like then a match to any of the array members will be selected.select_channel
(chan[, tag])Select channels and/or channel ranges.
select_range
([tag])Select a range of inclusive values for a given key(s).
select_within
([tag])Select a value within a plus or minus for a given key(s).
sources
(bintable)The number of sources present in the input bintable.
subbeamnod
([method, sig, cal, calibrate, ...])Get a subbeam nod power scan, optionally calibrating it.
summary
([scans, verbose, show_index])Create a summary list of the input dataset.
udata
(key[, bintable])The unique list of values of a given header keyword
ushow
(key[, bintable])Print the unique list of values of a given header keyword
velocity_convention
(veldef)Given the GBT VELDEF FITS string return the specutils velocity convention, e.g., "doppler_radio"
velocity_frame
(veldef)Given the GBT VELDEF FITS string return the velocity frame, e.g., "heliocentric".
write
(fileobj[, rows, bintable, ...])Write the
SDFITSLoad
to a new file, potentially sub-selecting rows or bintables.write_scans
(fileobj, scans[, output_verify, ...])Write specific scans of the
GBTFITSLoad
to a new file.add_primary_hdu
select_track
- calonoff_rows(scans=None, bintable=None, fitsindex=0, **kwargs)[source]
Get individual scan row numbers sorted by whether the calibration (diode) was on or off, and selected by ifnum,plnum, fdnum,subref,bintable.
- Parameters:
- scansint or list-like
The scan numbers to find the rows of
- ifnumint
the IF index
- plnumint
the polarization index
- fdnumint
the feed index
- subrefint
the subreflector state (-1,0,1)
- bintableint
the index for BINTABLE containing the scans
- fitsindex: int
the index of the FITS file contained in this GBTFITSLoad. Default:0
- Returns:
- rowsdict
A dictionary with keys ‘ON’ and ‘OFF’ giving the row indices of CALON and CALOFF data for the input scan(s)
- property files
The list of SDFITS file(s) that make up this GBTFITSLoad object
- Returns:
- fileslist
list of
PosixPath
objects
- property final_selection
The merged selection rules in the Selection object. See
final()
- Returns:
- ~pandas.DataFrame
The final merged selection
- getfs(calibrate=True, fold=True, use_sig=True, timeaverage=True, polaverage=False, weights='tsys', bintable=None, observer_location=<EarthLocation (882593.9465029, -4924896.36541728, 3943748.74743984) m>, **kwargs)[source]
Retrieve and calibrate frequency-switched data.
- Parameters:
- calibrateboolean, optional
Calibrate the scans. The default is True.
- foldboolean, optional
Fold the sig and ref scans. The default is True.
- use_sigboolean, optional
Return the sig or ref based spectrum. This applies to both the folded and unfolded option. The default is True. NOT IMPLEMENTED YET
- timeaverageboolean, optional
Average the scans in time. The default is True.
- polaverageboolean, optional
Average the scans in polarization. The default is False.
- weightsstr or None, optional
How to weight the spectral data when averaging.
tsys
means use system temperature weighting (see e.g.,timeaverage()
); None means uniform weighting. The default is “tsys”.- fold: boolean, optional
The default is True
- bintableint, optional
Limit to the input binary table index. The default is None which means use all binary tables.
- observer_location
EarthLocation
Location of the observatory. See
Observatory
. This will be transformed toITRS
using the time of observation DATE-OBS or MJD-OBS in the SDFITS header. The default is the location of the GBT.- **kwargsdict
Optional additional selection (only?) keyword arguments, typically given as key=value, though a dictionary works too. e.g.,
ifnum=1, plnum=[2,3]
etc.
- Returns:
- scanblock
ScanBlock
ScanBlock containing the individual `~spectra.scan.FSScan`s
- scanblock
- Raises:
- Exception
If no scans matching the selection criteria are found.
- getps(calibrate=True, timeaverage=True, polaverage=False, weights='tsys', bintable=None, **kwargs)[source]
Retrieve and calibrate position-switched data.
- Parameters:
- calibrateboolean, optional
Calibrate the scans. The default is True.
- timeaverageboolean, optional
Average the scans in time. The default is True.
- polaverageboolean, optional
Average the scans in polarization. The default is False.
- weightsstr or None, optional
How to weight the spectral data when averaging.
tsys
means use system temperature weighting (see e.g.,timeaverage()
); None means uniform weighting. The default is “tsys”.- bintableint, optional
Limit to the input binary table index. The default is None which means use all binary tables. (This keyword should eventually go away)
- **kwargsdict
Optional additional selection (only?) keyword arguments, typically given as key=value, though a dictionary works too. e.g.,
ifnum=1, plnum=[2,3]
etc.
- Returns:
- scanblock
ScanBlock
ScanBlock containing the individual `~spectra.scan.PSScan`s
- scanblock
- Raises:
- Exception
If scans matching the selection criteria are not found.
- getspec(i, bintable=0, observer_location=<EarthLocation (882593.9465029, -4924896.36541728, 3943748.74743984) m>, fitsindex=0)[source]
Get a row (record) as a Spectrum
- Parameters:
- iint
The record (row) index to retrieve
- bintableint, optional
The index of the
bintable
attribute. default is 0.- observer_location
EarthLocation
Location of the observatory. See
Observatory
. This will be transformed toITRS
using the time of observation DATE-OBS or MJD-OBS in the SDFITS header. The default is the location of the GBT.- fitsindex: int
the index of the FITS file contained in this GBTFITSLoad. Default:0
- Returns
- ——-
- s
Spectrum
The Spectrum object representing the data row.
- gettp(sig=None, cal=None, calibrate=True, timeaverage=True, polaverage=False, weights='tsys', bintable=None, **kwargs)[source]
Get a total power scan, optionally calibrating it.
- Parameters:
- sigbool or None
True to use only integrations where signal state is True, False to use reference state (signal state is False). None to use all integrations.
- cal: bool or None
True to use only integrations where calibration (diode) is on, False if off. None to use all integrations regardless calibration state. The system temperature will be calculated from both states regardless of the value of this variable.
- calibrate: bool
whether or not to calibrate the data. If
True
, the data will be (calon - caloff)*0.5, otherwise it will be SDFITS row data. Default:True- timeaverageboolean, optional
Average the scans in time. The default is True.
- polaverageboolean, optional
Average the scans in polarization. The default is False.
- weights: str or None
None or ‘tsys’ to indicate equal weighting or tsys weighting to use in time averaging. Default: ‘tsys’
- bintableint, optional
Limit to the input binary table index. The default is None which means use all binary tables.
- **kwargsdict
Optional additional selection (only?) keyword arguments, typically given as key=value, though a dictionary works too. e.g.,
ifnum=1, plnum=[2,3]
etc.
- Returns:
- data
ScanBlock
A ScanBlock containing one or more
TPScan
- data
- index(hdu=None, bintable=None, fitsindex=None)[source]
Return The index table
- Parameters:
- hduint or list
Header Data Unit to select from the index. Default: all HDUs
- bintableint
The index of the
bintable
attribute, None means all bintables- fitsindex: int
The index of the FITS file contained in this GBTFITSLoad. Default:None meaning return one index over all files.
- Returns:
- index~pandas.DataFrame
The index of this GBTFITSLoad
- info()[source]
Return information on the HDUs contained in this object. See :meth:`~astropy.HDUList/info()
- onoff_rows(scans=None, ifnum=0, plnum=0, bintable=None, fitsindex=0)[source]
Get individual ON/OFF (position switch) scan row numbers selected by ifnum,plnum, bintable.
- Parameters:
- scansint or list-like
The scan numbers to find the rows of
- ifnumint
the IF index
- plnumint
the polarization index
- bintableint
the index for BINTABLE in
sdfits
containing the scans- fitsindex: int
the index of the FITS file contained in this GBTFITSLoad. Default:0
- Returns:
- rowsdict
A dictionary with keys ‘ON’ and ‘OFF’ giving the row indices of the ON and OFF data for the input scan(s)
- onoff_scan_list(scans=None, ifnum=0, plnum=0, bintable=None, fitsindex=0)[source]
- Get the scans for position-switch data sorted
by ON and OFF state
- Parameters:
- scansint or list-like
The scan numbers to find the rows of
- ifnumint
the IF index
- plnumint
the polarization index
- Returns:
- rowsdict
A dictionary with keys ‘ON’ and ‘OFF’ giving the scan numbers of ON and OFF data for the input scan(s)
- rawspectra(bintable, fitsindex)[source]
Get the raw (unprocessed) spectra from the input bintable.
- Parameters:
- bintableint
The index of the
bintable
attribute- fitsindex: int
the index of the FITS file contained in this GBTFITSLoad. Default:0
- Returns:
- rawspectra~numpy.ndarray
The DATA column of the input bintable
- rawspectrum(i, bintable=0, fitsindex=0)[source]
Get a single raw (unprocessed) spectrum from the input bintable.
- Parameters:
- iint
The row index to retrieve.
- bintableint or None
The index of the
bintable
attribute. If None, the underlying bintable is computed from i- fitsindex: int
the index of the FITS file contained in this GBTFITSLoad. Default:0
- Returns:
- rawspectrum~numpy.ndarray
The i-th row of DATA column of the input bintable
- scan_rows(scans, ifnum=0, plnum=0, bintable=None, fitsindex=0)[source]
Get scan rows selected by ifnum,plnum, bintable.
- Parameters:
- scansint or list-like
The scan numbers to find the rows of
- ifnumint
the IF index
- plnumint
the polarization index
- bintableint
the index for BINTABLE in
sdfits
containing the scans. Default:None- fitsindex: int
the index of the FITS file contained in this GBTFITSLoad. Default:0
- Returns:
- rowslist
Lists of the rows in each bintable that contain the scans. Index of
rows
is the bintable index number
- select(tag=None, **kwargs)[source]
Add one or more exact selection rules, e.g.,
key1 = value1, key2 = value2, ...
Ifvalue
is array-like then a match to any of the array members will be selected. For instanceselect(object=['3C273', 'NGC1234'])
will select data for either of those objects andselect(ifnum=[0,2])
will select IF number 0 or IF number 2. SeeSelection
.- Parameters:
- tagstr
An identifying tag by which the rule may be referred to later. If None, a randomly generated tag will be created.
- keystr
The key (SDFITS column name or other supported key)
- valueany
The value to select
- select_channel(chan, tag=None)[source]
Select channels and/or channel ranges. These are NOT used in
final()
but rather will be used to create a mask for calibration or flagging. Single arrays/tuples will be treated as channel lists; nested arrays will be treated as ranges, for instance`` # selects channels 1 and 10 select_channel([1,10]) # selects channels 1 thru 10 inclusive select_channel([[1,10]]) # select channel ranges 1 thru 10 and 47 thru 56 inclusive, and channel 75 select_channel([[1,10], [47,56], 75)]) # tuples also work, though can be harder for a human to read select_channel(((1,10), [47,56], 75)) ``
See
Selection
.- Parameters:
- channumber, or array-like
The channels to select
- Returns:
- None.
- select_range(tag=None, **kwargs)[source]
Select a range of inclusive values for a given key(s). e.g.,
key1 = (v1,v2), key2 = (v3,v4), ...
will select datav1 <= data1 <= v2, v3 <= data2 <= v4, ... ` Upper and lower limits may be given by setting one of the tuple values to None. e.g., `key1 = (None,v1)
for an upper limitdata1 <= v1
andkey1 = (v1,None)
for a lower limitdata >=v1
. Lower limits may also be specified by a one-element tuplekey1 = (v1,)
. SeeSelection
.- Parameters:
- tagstr, optional
An identifying tag by which the rule may be referred to later. If None, a randomly generated tag will be created.
- keystr
The key (SDFITS column name or other supported key)
- valuearray-like
Tuple or list giving the lower and upper limits of the range.
- Returns:
- None.
- select_within(tag=None, **kwargs)[source]
Select a value within a plus or minus for a given key(s). e.g.
key1 = [value1,epsilon1], key2 = [value2,epsilon2], ...
Will select datavalue1-epsilon1 <= data1 <= value1+epsilon1,
value2-epsilon2 <= data2 <= value2+epsilon2,...
See
Selection
.- Parameters:
- tagstr, optional
An identifying tag by which the rule may be referred to later. If None, a randomly generated tag will be created.
- keystr
The key (SDFITS column name or other supported key)
- valuearray-like
Tuple or list giving the value and epsilon
- Returns:
- None.
- property selection
The data selection object
- Returns:
- ~dysh.util.Selection
The Selection object
- subbeamnod(method='cycle', sig=None, cal=None, calibrate=True, timeaverage=True, polaverage=False, weights='tsys', bintable=None, **kwargs)[source]
Get a subbeam nod power scan, optionally calibrating it.
- Parameters:
- method: str
Method to use when processing. One of ‘cycle’ or ‘scan’. ‘cycle’ is more accurate and averages data in each SUBREF_STATE cycle. ‘scan’ reproduces GBTIDL’s snodka function which has been shown to be less accurate. Default:’cycle’
- sigbool
True to indicate if this is the signal scan, False if reference
- cal: bool
True if calibration (diode) is on, False if off.
- calibrate: bool
whether or not to calibrate the data. If
True
, the data will be (calon - caloff)*0.5, otherwise it will be SDFITS row data. Default:True- timeaverageboolean, optional
Average the scans in time. The default is True.
- polaverageboolean, optional
Average the scans in polarization. The default is False.
- weights: str or None
None to indicate equal weighting or ‘tsys’ to indicate tsys weighting to use in time averaging. Default: ‘tsys’
- bintableint, optional
Limit to the input binary table index. The default is None which means use all binary tables.
- **kwargsdict
Optional additional selection (only?) keyword arguments, typically given as key=value, though a dictionary works too. e.g.,
ifnum=1, plnum=[2,3]
etc.
- Returns:
- data
ScanBlock
A ScanBlock containing one or more
SubBeamNodScan
- data
- summary(scans=None, verbose=False, show_index=True)[source]
Create a summary list of the input dataset. If
verbose=False
(default), some numeric data (e.g., RESTFREQ, AZIMUTH, ELEVATIO) are averaged over the records with the same scan number.- Parameters:
- scansint or 2-tuple
The scan(s) to use. A 2-tuple represents (beginning, ending) scans. Default: show all scans
- verbose: bool
If True, list every record, otherwise return a compact summary
- show_index: bool
If True, show the DataFrame index column. Default: False
- Returns:
- summary -
DataFrame
Summary of the data as a DataFrame.
- summary -
- velocity_convention(veldef)[source]
Given the GBT VELDEF FITS string return the specutils velocity convention, e.g., “doppler_radio”
- Parameters:
- veldefstr
The FITS header VELDEF string
- Returns:
- conventionstr
The velocity convention
- velocity_frame(veldef)[source]
Given the GBT VELDEF FITS string return the velocity frame, e.g., “heliocentric”.
- Parameters:
- veldefstr
The FITS header VELDEF string
- Returns:
- frame: str
The velocity frame
- write_scans(fileobj, scans, output_verify='exception', overwrite=False, checksum=False)[source]
Write specific scans of the
GBTFITSLoad
to a new file. TBD: How does this work for multiple files??- Parameters:
- fileobjstr, file-like or
pathlib.Path
File to write to. If a file object, must be opened in a writeable mode.
- scans: int or list-like
Range of scans to write out. e.g. 0, [14,25,32].
- output_verifystr
Output verification option. Must be one of
"fix"
,"silentfix"
,"ignore"
,"warn"
, or"exception"
. May also be any combination of"fix"
or"silentfix"
with"+ignore"
,+warn
, or+exception" (e.g. ``"fix+warn"
). See https://docs.astropy.org/en/latest/io/fits/api/verification.html for more info- overwritebool, optional
If
True
, overwrite the output file if it exists. Raises anOSError
ifFalse
and the output file exists. Default isFalse
.- checksumbool
When
True
adds bothDATASUM
andCHECKSUM
cards to the headers of all HDU’s written to the file.
- fileobjstr, file-like or