Date: Fri, 8 Mar 2013 16:46:25 -0500 (EST)
From: Ken Young 
To: Mark A. Gurwell 
Cc: aargon@cfa.harvard.edu, cqi@cfa.harvard.edu, dwilner@cfa.harvard.edu, jzhao@cfa.harvard.edu, spaine@cfa.harvard.edu, kyoung@cfa.harvard.edu
Subject: Re: Modification to the tsys_read file

On Fri, 8 Mar 2013, Mark A. Gurwell wrote:

> that's ok with me...however we should assure that all three data
> pathways can do what is needed: MIR, miriad, and CASA^[[C
>

OK, what do you think of the following idea.   Change the format of the
Tsys records to

typedef struct __attribute__((packed)) tsysRecordDef {
  int nMeasurements; /* Number of Tsys measurements for this antenna     */
  float *data;       /* The Tsys measurements.   This will be a variable */
                     /* length array, consisting of nMeasurement sets of */
                     /* four single precision floating point values.     */
                     /* Each set of four values will contain the         */
                     /* following values, in this order:                 */
                     /* Lower IF frequency for the Tsys value (GHz)      */
                     /* Upper IF frequency for the Tsys value (GHz)      */
                     /* LSB Tsys (K)                                     */
                     /* USB Tsys (K)                                     */
} tsysRecordDef;

We'll have one such record for each antenna in each scan.   The bl_read
file records will have two new fields added: ant1TsysOff and ant2TsysOff.
Those will be byte offsets to the location within the tsys_read file
at which the Tsys record for that antenna-scan combination begins.
These offsets will be much like the dataoff field in the sp_read file,
which specifies where a chunk's visibilities can be found within the
sch_read file.   This format can accomodate changes in the number of Tsys
values measured for each antenna, without requiring any changes to the
data reading software.   This file would be far smaller than the
tsys_read file we are currently writing, even when the new multi-channel
continuum detectors become available, because we would not be storing the
same Tsys value many times, for each chunk.   The whole tsys_read file
will be about 6 MBytes, for a 16 hour track with 10 second scans, if
we have a Tsys measurement every 1 GHz thoughout the IF.
How does this format sound to you?

Taco