next up previous contents
Next: Issues Up: Specifics Previous: Specifics

SDRecord

The SDRecord is the fundamental data atom of SDCalc.

Unless otherwise stated, the units of all values in an SDRecord are SI units. Angles are expressed in degrees. Until Measures and coordinates are fully supported in Glish, temporary fields in an SDRecord will be used to hold sufficient information to indicate the coordinate system and reference frame where appropriate. All of the fields described below are required unless stated otherwise.

The value of a field is undefined in the following circumstances:

For boolean fields, all values are considered valid. In addition, all values in the data array should be considered valid. The data array flag field should be used to indicate invalid values in the data array.

Certain operations on SDRecords lead to ambiguities in some fields in the resulting SDRecord. In averaging two SDRecords taken at different times, it is not clear what value should be given to the time field and the fields that contain values at the given time (e.g. azimuth). What value should be given to the direction when data from different directions are combined? Rather than simply mark these fields as undefined (which would loose all of this information), one of the input records will be chosen as a template for use during that operation. Typically this will be the first record used in that operation. All values in the resulting record except those directly affected by the operation (e.g. tsys and exposure in an average) will be unchanged from the values in the template record. The documentation for each operation should describe when this occurs. The hist field will show the history of operations.

An SDRecord is a Glish record having the following structure:

data
A Glish record which contains the data array and a description of the data array (axis type, values, increments, and units).
arr
The data array. The dimensionality of the data array is (nchan, nstokes) where nchan is the number of channels and nstokes is the number of different stokes types found in this data. nstokes is either 1, 2 or 4.
desc
A Glish record which describes the data array.
ctype, crval, crpix, and cdelt
Follow standard FITS usage. They describe the first axis of the data array. An SDRecord can therefore only contain data where the first axis is linear in some coordinate system.
units
A string describing the units of the data array.
stokes
A vector of strings describing the stokes type of each element of the second axis of the data array. The possible stokes types are:
I, Q, U, V, RR, RL, LR, LL, XX, XY, YX, YY, RX, RY, LX, LY, XR, XL YR, YL, PP, PQ, QP, QQ
For a typical single dish telescope, raw data will have stokes = ("XX", "YY") or ("RR", "LL").

flag
A boolean matrix with the shape as arr. When true, the corresponding value in arr has been flagged as bad and should not be used. When false, the corresponding value in arr is good.
weight
A floating point matrix having the same shape as arr.

header
A Glish record with the following fixed structure. The bulleted items are mearly separators to make this list easier to read, they are not members of header. The type of each field is indicated at the end of each description. Vector fields are indicated by giving the length of the vector in parenthesis after the field type.
hist
This vector of strings contains a history of the operations which resulted in this SDRecord. Each element is a valid Glish command. Taken as a while, the hist field should be sufficient to regenerate the SDRecord from the original data source.

In addition to the fixed structure described above. An SDRecord may contain an optional ns_header field. This is a Glish record which can contain any additional information not found in the fixed portion of an SDRecord. This field will typicall be used for telescope-dependent information.

The x-axis can be easily constructed from the data field by the following simple Glish function:

	make_xaxis := function(ref data)
	{
	   x := data.crval;
	   x +:= ([1:data::Shape[1]] - data.desc.crpix)*data.desc.cdelt;
	   return x;
	}

To summarize, in pseudo-Glish an SDRecord looks like this:

	sdrecord := [data=[=], header=[=], hist=[=], ns_header=[=]];
	sdrecord.data := [arr=[...], flag=[...], desc=[=], weight=[...]];
	sdrecord.data.desc := [units=,stokes=,ctype=,crpix=,crval=,cdelt=];
        sdrecord.header := [time=,scan_number=,object=,etc.];
	sdrecord.hist := ["# useful history","# as a vector","# etc. etc."];
        sdrecord.ns_header := [non-standard fields]

ns_header is optional




next up previous contents
Next: Issues Up: Specifics Previous: Specifics

Bob Garwood
Fri Jul 11 17:07:42 EDT 1997