appendHistory |
Add a history element to the global sditerator history. |
appendrec |
Put an sdrecord at the end of the sditerator. |
correcteddata |
Is the CORRECTED_DATA column being used?. |
deepcopy |
Make a true copy of this data set. |
deleterec |
Delete the sdrecord at the current location pointer. |
done |
Close this sditerator and disconnect it from the data set. |
flush |
Flush the contents to disk. |
get |
Get an sdrecord. |
getdata |
Get the data part of the sdrecord. |
getdesc |
Get the desc part of the field of the sdrecord. |
getdescvector |
Get a vector of values from the desc record. |
getempty |
Get an empty sdrecord. |
getheader |
Get the header part of the sdrecord. |
getheadervector |
Get a vector of values from the header record. |
getother |
Get the other part of the sdrecord. |
getvectors |
Get a vector of values for the fields in the template. |
history |
Get the global history associated with all sdrecords |
id |
Return the ID record of this sditerator. |
iswritable |
Can sdrecords be stored (written) to this sditerator? |
length |
Get the total number of sdrecords in this sditerator. |
location |
Get the value of the location pointer. |
lock |
Set the appropriate lock on all associated tables. |
more |
Are there more sdrecords after this location? |
name |
What is the name of the underlying data on disk. |
next |
Set the location pointer to the next record. |
origin |
Set the location pointer to the first record. |
previous |
Set the location pointer to the previous record. |
put |
Put an sdrecord at the current location pointer. |
reselect |
Re-apply the previous selection to the parent data set. |
resync |
Resynchronize with the data on disk. |
sel2string |
Convert a selection record to a string. |
select |
Make a new sditerator by applying a selection criteria record |
setlocation |
Set the location pointer to the indicated record. |
stringfields |
Returns a record indicating which fields in the sditerator are strings. |
type |
Return the type of the underlying data. |
unlock |
Release the lock on all associated tables. |
usecorrecteddata |
Use the CORRECTED_DATA column?. |
Description
This
tool is intended to be used with the
dish tool .
It provides access to single dish data sets. One can step
(iterate) through a data set with this
tool . Two types of single
dish data sets are supported:
MeasurementSet
and a flat
table modeled on the
SDFITS convention. Data is copied to and from an SDRecord, which is a
Glish record structure with a set of fixed fields plus a few optional fields which
vary depending on the data source. Data can only be saved back to an sditerator
using a flat table as the underlying data source. Selection is supported either
through a constructor or through the
select function.
The SDRecord structure
The SDRecord is the fundamental data atom of this tool as well as of
dish.
An SDRecord is a Glish record having the following fields:
- data
- A Glish record containing the data and things which describe
that data (axes, units, flags, weights, etc.). The following fields are found in data:
- arr
- The data array. Its dimensions are (nstokes, nchan) where nchan
is the number of frequency channels and nstokes is the
number of stokes pixels (polarizations). The type may be real or complex.
- flag
- A boolean array with the same shape as arr. A value of
T (true) for any pixel here means the corresponding pixel in arr
has been flagged as bad.
- sigma
- An array of floats having the same shape as arr.
- weight
- An array of floats having the same shape as arr.
- desc
- A Glish record describing arr (axes and units). The
following fields are found in desc:
- chan_freq
- A vector of quantities giving each frequency value along
the first axis of arr. See the quanta tool
for a description
of how to extract the values from a quantity as well as how to work
with quantities.
- refframe
- A string indicate the frequency measures reference frame
for the chan_freq values.
- reffrequency
- A reference frequency for the frequency axis. This has
the same units as the bf chan_freq values do.
- chan_width
- The channel width at reffrequency for use in
selection. This has
the same units as the bf chan_freq values do.
- restfrequency
- A rest frequency associated with this data. This has
the same units as the bf chan_freq values do.
- corr_type
- A vector of strings giving the polarization type for
each pixel of the stokes axis in arr.
- units
- The units of arr.
- header
- A Glish record containing associated header information
common to all sditerators. The following fields are found in header:
- time
- An epoch measure giving the midpoint of this integration.
See the measures tool
for a description
of how to extract the values from a measure as well as how to work
with measures.
- scan_number
- An integer.
- source_name
- direction
- A direction measure showing where the telescope was pointed
during this integration.
- refdirection
- A direction measure for any reference (off) direction if
position switched data has been calibrated.
- veldef
- The velocity definition appropriate to this data.
- transition
- A string describing the transition, if available.
- exposure
- The effective integration time, in seconds.
- duration
- The total time, including any blanking time, spent taking
this data, in seconds.
- observer
- project
- resolution
- The channel resolution at the reffrequency in Hz.
- bandwidth
- The total bandwith in Hz.
- tcal
- A vector of CAL temperatures - one for each pixel on the stokes
axis, in K.
- trx
- A vector of receiver temperatures - one for each pixel on the stokes
axis, in K.
- tsys
- A vector of system temperatures - one for each pixel on the stokes
axis, in K.
- telescope
- telescope_position
- A position measure holding the location of the
telescope.
- pressure
- The atmospheric pressure in hPa.
- dewpoint
- The dewpoint in K.
- tambient
- The ambient temperature in K.
- wind_dir
- The wind direction in radians.
- wind_speed
- The wind speed in m/s.
- azel
- A direction measure holding the azimuth and elevation for this
integration (at time).
- hist
- A vector of strings holding the history of operations on this data.
- other
- A Glish record containing other information from the data
set not found elsewhere in this structure. The contents of this field depend
on the data source. If the source is a MeasurementSet, this record contains
sub-records holding the appropriate values for the various sub-tables in
that MeasurementSet. There will be one sub-record for each sub-table and the
fields in each sub-record are the same as the column names in that sub-table.
If the source is a flat table following the SDFITS convention, then any field
not used in the header or data records is copied to an sdfits
sub-record of the other record.
Example
sdit := sditerator('dishdemo2')
nrecords := sdit.length()
scans := array(0,nrecords)
sources := array("",nrecords)
count := 1
rec := sdit.get()
scans[count] := rec.header.scan_number
sources[count] := rec.header.source_name
while (sdit.more()) {
sdit.next();
rec := sdit.get()
count +:= 1
scans[count] := rec.header.scan_number
sources[count] := rec.header.source_name
}
# or alternatively ...
vec := sdit.getheadervector("scan_number source_name")
scans := vec.scan_number
sources := vec.source_name
The first line makes an sditerator tool from a file.
The next several lines show how the scan numbers and
source names for each sdrecord in that iterator can be retrieved by
iterating through the entire sditerator. The final three lines show how
all of that could be done using the getheadervector function.