struct FITS_HEADER { //COMMENT It may be possible to change many of the doubles to reals or integers - the use of // doubles was a fix for early aips++ fits readers. struct ARRAY_DES datapointer; /* x x Pointer to the data in the heap */ //COMMENT TSCAL1 and TZERO1 keywords will be added to the binary table header in order to // support integer data (needed for high data rates). struct ARRAY_DES headpointer; /* x x Pointer to header info written to each heap record */ //COMMENT This is technical information that needs to be associated with each data dump rather // than each header line when the time dimension is expanded (e.g. time or sequence // number, calon, dataqual, anything else?) char tdim1[32]; /* x A32 Dimensions of data pointed to in the heap */ char object[16]; /* x A16 Name of source observed */ double crval1; /* Hz D13.5 Center frequency */ double cdelt1; /* Hz D13.5 Frequency interval */ double crpix1; /* x D13.5 Pixel of center frequency */ double crval2; /* deg D13.5 Actual RA J2000 pointing this beam on sky */ double crval3; /* deg D13.5 Actual DEC J2000 pointing this beam on sky */ double crval4; /* x D13.5 Polarization (neg -> Pol, pos -> Stokes) */ double crval5; /* s D13.5 Seconds since midnight from obsdate (UTC) */ double cdelt5; /* s D13.5 time interval */ // ?? be careful with wall versus integration time for cdelt5 double crpix5; /* x D13.5 Pixel to which CRVAL5 refers */ //COMMENT Axis 5 (the time axis) will now be non-degenerate for fast data-rates. // Keywords will be added to enable RA and DEC to keep up with a non-degenerate // time axis. I think this can be done by adding PCi_j keywords (pc2_2, pc3_3, // pc2_5, pc3_5). char datexxobs[16]; /* x A16 Start of this observation (UTC) - YYYY-MM-DD */ double tsys; /* K D13.5 Last computed Tsys - set to 1.0 if unavailable */ double bandwid; /* Hz D13.5 Overall bandwidth of spectrum */ double restfrq; /* Hz D13.5 Rest frequency used for doppler correction */ char specsys[8]; /* x A8 Velocity frame for CRVAL1 (always TOPOCENT for AO data) */ char req_sys[8] /* x A8 User-requested velocity frame double req_vel; /* x D13.5 Requested velocity or z in frame REQ_SYS */ char req_vel_unit[8]; /* x A8 Specifies units of REQ_VEL: either m/s or Z */ char req_vel_type[8]; /* x A8 Velocity type for REQ_VEL */ double mjdxxobs; /* d D13.5 Modified Julian day number at exposure start */ // ?? for arrays this is time at first exposure start double lst; /* s D13.5 Local mean sidereal time */ double exposure; /* s D13.5 Exposure time of current subscan (dump) */ // ?? if we have an array, is it the duration of the first spectra // if we have blanking then this has to be an array?? double duration /* s D13.5 Duration of the subscan (including blanking time) */ double req_coord1; /* deg D13.5 Requested long (usually RA) in REQ_COORDSYS */ double req_coord2; /* deg D13.5 Requested lat (usually DEC) in REQ_COORDSYS */ // ?? does req_coordx include any offsets and rates? char req_coordsys[8]; /* x A8 Coordinate system used for REQ_COORD1 and REQ_COORD2 */ double req_equinox; /* x D13.5 Epoch of requested position REQ_COORD1 and REQ_COORD2 */ double req_raj; /* deg D13.5 Requested RA J2000 antenna pointing */ double req_decj; /* deg D13.5 Requested Dec J2000 antenna pointing */ // ?? this includes all offsets,rates for this beam double enc_time; /* s D13.5 Time when encoders were read out (UTC) */ double enc_azimuth; /* deg D13.5 Azimuth encoder read-out at ENC_TIME */ double enc_elevatio; /* deg D13.5 Elevation encoder read-out at ENC_TIME */ double enc_altel; /* deg D13.5 Elevation encoder of other carriage house */ double offc1; /* deg D13.5 User-commanded telescope offset */ double offc2; /* deg D13.5 User-commanded telescope offset */ // ?? what does the offc1/2 include.. // just a mapping offset pnt tr $ra $dec -o off1,off2 // model offset? // user_offaz,offza ? double off_time; /* s D13.5 Seconds from midnight (UTC) */ double rate_c1; /* deg/s D13.5 User-commanded telescope rate */ double rate_c2; /* deg/s D13.5 User-commanded telescope rate */ int off_cs; /* x I9 Coordinate system of offs */ int rate_cs; /* x I9 Coordinate system of rates */ // ?? Note: coord systems for offsets, rates different than req_coordsys[8] //COMMENT description of coordinate system codes to be added double rate_dur; /* s D13.5 How long has rate been applied */ double cur_err; /* deg D13.5 Actual great circle tracking error */ double allowed_err; /* deg D13.5 Maximum allowed tracking error */ double az_err; /* deg D13.5 Azimuth tracking error (actual-requested) */ double el_err; /* deg D13.5 Elevation tracking error (actual-requested) */ double model_offaz; /* deg D13.5 Pointing model offset AZ */ double model_offza; /* deg D13.5 Pointing model offset ZA */ // ?? model offset used to be for requested position // do we want to swith it to the actual position?? double beam_offaz; /* deg D13.5 ALFA unrotated offset AZ */ double beam_offza; /* deg D13.5 ALFA unrotated offset ZA */ double user_offaz; /* deg D13.5 User selected pointing offset AZ (great circle) */ double user_offza; /* deg D13.5 User selected pointing offset ZA */ // ?? what is this.. the great circle offsets pnt cor setoff az,za ?? // is it included in the requested positions ?? double rfeed_offaz; /* deg D13.5 Rotated offset this beam AZ */ // ?? from center of alfa or center of prfeed.. comment should specify double rfeed_offza; /* deg D13.5 Rotated offset this beam ZA */ double prfeed_offaz; /* deg D13.5 Offset to center prfeed beam AZ */ double prfeed_offza; /* deg D13.5 Offset to center prfeed beam ZA */ double beam_offraj; /* deg D13.5 Total RA offset to this beam */ double beam_offdecj; /* deg D13.5 Total DEC offset to this beam */ // ?? from where.. crval1,2 or requested position double azimuth; /* deg D13.5 Actual AZ pointing this beam on sky */ double elevatio; /* deg D13.5 Actual EL pointing this beam on sky */ // ?? this has no model in it?? double glon ; /* deg D13.5 Actual galactic l pointing this beam on sky */ double glat; /* deg D13.5 Actual galactic b pointing this beam on sky */ double off_ra; /* deg D13.5 Actual RA J2000 offset to commanded map center */ double off_dec; /* deg D13.5 Actual DEC J2000 offset to commanded map center */ // ?? where is the map center stored? req_coord1,2?? double off_az; /* deg D13.5 Actual AZ offset to commanded map center */ // ?? is off_az great circle or little circle double off_za; /* deg D13.5 Actual ZA offset to commanded map center */ double alfa_ang; /* deg D13.5 ALFA rotation angle */ double para_ang; /* deg D13.5 Parallactic angle */ double vel_bary; /* m/s D13.5 Projected barycentric velocity (incl. VEL_GEO) */ double vel_geo; /* m/s D13.5 Projected geocentric velocity */ double vel_obs; /* m/s D13.5 Observers projected velocity in OBSSYS // ?? in commnet what is OBSSYS char frontend[8]; /* x A8 Receiver name */ char backend[8]; /* x A8 Backend name */ char backendmode[24]; /* x A24 Backend mode description */ // ?? does pdev want to describe backendmode or just provide the setup params //COMMENT keywords to be added to make this information easier to parse // char caltype[8]; /* x A8 Calibration type */ // ?? Does caltype describe the cal diode or some calibration mode of datataking char obsmode[8]; /* x A8 Name of observation pattern (e.g. ONOFF) */ char scantype[8]; /* x A8 Type of scan (as part of pattern - e.g. ON OFF) */ int pattern_id; /* x I9 Unique number for observation pattern YDDDnnnnn */ int scan_id; /* x I9 Unique number for scan YDDDnnnnn */ int subscan; /* x I8 Sequential number of current subscan (dump) */ // ?? is there a reason why we don't use record number?? int total_subscans; /* x I8 Total number of subscans (dumps) in scan */ // ?? ditto above int lags_in; /* x I8 Number of lags - same as bytes of data/4 (for 32-bit fits) */ // ?? ffts don't have lags. should this be channels // pdev has an fftlen and it has the number of channels // returned.. these can be different numbers unsigned int bad_data; /* x I8 0->good data <>0->problem (see COMMENT) */ // ?? if we have an array of spectra does this need to be an array double plat_power; /* x D13.5 Power from platform meter */ // ?? for stokes to we put sqrt(pwrA*pwrB)?? double cntrl_power; /* x D13.5 Power from control room meter */ // ?? ditto above double syn1; /* Hz D13.5 Platform synthesizer */ double synfrq; /* Hz D13.5 Control room synthesizer for this board */ // ?? make more sense to call this syn2 .. since first lo is syn1 double tot_power; /* x D13.5 Scaled power in zero-lag */ // ?? the average of the spectra? // what to do for stokes u,v int ntcal; /* x I8 Number of entries in TCAL_FRQ and TCAL_VAL */ double tcal_frq[32]; /* Hz D13.5 Frequencies for Tcal-values in TCAL_VAL */ double tcal_val[32]; /* K D13.5 Tcal-values for frequencies in TCAL_FRQ */ // ?? would it be easier/quicker to fit a 3rd order // polynomial to the frequency range of bandpass. // would then only need the 4 coef. // Would it take too long to fit on the fly (versus interpolation)?? unsigned char backendmask[8]; /* x I8 Which backend boards enabled */ // ?? how is this coded // pdev has have 7 beams and with two fpgas/beam. you can use // the highband, lowband or both for each beam. //COMMENT This contains information on what is coming from each backend board, replacing wappmask unsigned char num_beams; /* x B1 Number of beams in this observation (1, 7 or 8) */ unsigned char num_ifs; /* x B1 Number of IFs for this beam (1 - 8 or 1 - 2) */ // ?? is an IF a subband (section of frequency space?) // - We don't know how many IFs there are for this // fits file. Will we always have 1 IF per fits file // with pdev (even in single pixel?) unsigned char num_pols; /* x B1 Number of pols for this IF and this beam (1, 2 or 4) */ // ?? 1,2,4 how does this differ from crval4 unsigned char beam /* x B1 Number of this beam (1, 0 - 6 or 0 - 7) */ unsigned char if /* x B1 Number of this IF (1 - 8 or 1 - 2) */ // ?? if is a reserved identifier and may not be used unsigned char pol /* x B1 Number of this pol (1, 2 or 4) */ // ?? should be 1,2,3,4 unsigned char prfeed; /* x B1 ALFA beam used as pointing center */ unsigned char input_id; /* x B1 spectrometer board number (engineering parameter) */ // ?? how will this be numbered for pdev // will high,low bands be different numbers unsigned char uppersb; /* x B1 True if spectrum flipped */ // ?? does the sign of cdelt1 tell us the same info? unsigned char attn_cor; /* x B1 Correlator attenuator: 0-15 dB */ // ?? pdev also has an attenuator setting // should the be changed to attn_bkend or something unsigned char master; /* x B1 0=Gregorian dome 1=Carriage house */ unsigned char onsource; /* x B1 True if on-source at ENC_TIME */ unsigned char blanking; /* x B1 Blanking turned on */ unsigned char lbwhyb; /* x B1 LBandWide Hybrid is in (for circular pol) */ unsigned char shcl; /* x B1 True if receiver shutter closed */ unsigned char sbshcl; /* x B1 True if S-band receiver shutter closed */ unsigned char rfnum; /* x B1 Platform position of the receiver selector */ unsigned char calrcvmux; /* x B1 Platform cal selector */ // ?? do we have the caltype highcal correlatored cal etc somewhere unsigned char zmnormal; /* x B1 Platform transfer switch to reverse channels, true normal */ unsigned char rfattn[2]; /* x B1 Platform attenuator positions */ unsigned char ifnum; /* x B1 Platform IF selector, 1/300 2/750, 3/1500, 4/10GHz1500, 5-thru */ unsigned char ifattn[2]; /* x B1 Platform IF attenuator positions */ unsigned char fiber; /* x B1 True if platform fiber chosen (usually true) */ // ?? remove.. bill removed ability to switch to coax. unsigned char ac2sw; /* x B1 Platform AC power to various instruments etc. */ unsigned char phbsig; /* x B1 Platform converter combiner signal ph adjust */ unsigned char hybrid; /* x B1 Platform converter combiner hybrid */ unsigned char phblo; /* x B1 Platform converter combiner LO phase adjust */ unsigned char xfnormal; /* x B1 Control room transfer switch true = default */ unsigned char noise; /* x B1 Control room noise on */ unsigned char ampgain[2]; /* x B1 Gain of control room amplifiers */ unsigned char inpfrq; /* x B1 Control room input distributor position */ unsigned char mixer; /* x B1 Control room mixer source switches */ unsigned char vlbainp; /* x B1 Control room VLBA input switch position */ unsigned char ampinp; /* x B1 Control room amplifier input source switch for this board */ // ?? ampinp no longer needed. determined by inpfrq unsigned char syndest; /* x B1 Control room synthesizer destination for this board*/ unsigned char calsrc; /* x B1 Control room cal source bit */ unsigned char cal; /* x B1 Is cal bit turned on */ unsigned char vis30mhz; /* x B1 Control room greg 1 ch 0 */ unsigned char pwrmet; /* x B1 Control room power meter input switch */ unsigned char blank430; /* x B1 Control room 430 blanking on */ unsigned char fill[4]; /* x B1 Round up header to even 8 bytes */ //COMMENT more engineering keywords to be added //COMMENT weather information keywords to be added // // ?? -pdev will has about 40 parameters to configure it. // -some of these will duplicate kewords already in the header. // -Some of them could become generic keywords used by other spectrometers // -What should we do with A24 backendmodes variable // -can we switch to multi pols per record for arrays?? // -Will we allow multiple scans per fits file? // if no then we can put the pdev hdr params before the binary table // -Where is the array dimension for a row. We can always get it from // tdim1 but it's a hassle. // ?? need to add the status bits/ counter, overflow for each arra elmn // ?? if we put multiple pols per row we need to make an array of: // - crval4 // - tsys (although it currentl isn't set??) // - exposure.. will we always blank the 4 pols the same?? probably // - bad_data maybe.. // - total_power .. pola,b different .. // - tcal_val[32].. .. a real hassle but only 2 d since stokes u,v don't have measured cal. // - pol - instead of 1,2,3,4 need an encoding for all combined };