Date: Fri, 14 Jun 2013 10:42:46 -0400 (EDT)
From: Ken Young 
To: cqi@cfa.harvard.edu, jzhao@cfa.harvard.edu, mgurwell@cfa.harvard.edu,
     aargon@cfa.harvard.edu, tcooper@cfa.harvard.edu
Cc: kyoung@cfa.harvard.edu
Subject: Flagging the observation "intent" in SMA data format

Dear SMA Data Stakeholder,

   During Jun-Hui's Miriad Meeting on Wednesday, we briefly discussed the
issue of flagging the "intent" of a scan when storing SMA data.   We are
currently flagging data that is intended for bandpass calibration, but
not, for example, complex gain calibration scans.   The flags which exist
in both the current data file format and the current version of the
proposed new format are what we inherited from OVRO, and I don't think
they match our needs particularly well.   There are two flags, sp.igq and
sp.ipq, which are used as boolean variables indicating whether or nor a
scan is a bandpass calibration scan (sp.ipq) or a gain calibration scan
(sp.igq).   So we do not have any location specified in our datasets to
indicate a scan is a flux scan, rather than a gain scan.   Furthermore, it
seems odd to me that these flags are in the sp structure at all.   We have
sp records for each spectral chunk, but we certainly never take a scan
for which only certain chunks are meant to be used for calibration.

I suggest that we modify the proposed new format, and define a single
flag integer in the integration header (in_read) structure, which will be
used to specify the intended purpose of a scan.   I propose the new
variable be called in.intent, and its value will be the OR of whichever
of the following flags are appropriate:

#define INTENT_BANDPASS     0x00000001
#define INTENT_FLUX         0x00000002
#define INTENT_COMPLEX_GAIN 0x00000004
#define INTENT_POINTING     0x00000008

so science target observations would have this variable set to 0, and all
other scans would have some of the above bits set.   Defining this
variable as a 32 bit integer gives us lots of spacce for future additions.

How do you feel about this change?   Should we stick with what we've got
instead?

Thanks,

Taco