Appendix B: Internal PIA Buffer Structure Definitions

This section lists the definitions of the PIA internal structures, phterd, phtsrd, phtscp, phtspd, phtaad, phtcs and phtcla. The related common block can be made available to the IDL environment by the IDL include symbol, e.g. executing @phterd from the IDL prompt. This will make the ERD Data structure as defined below avaliable for use under the IDL interactve line interface environment. For more information on how to access the internal buffers please refer to chapter 6, Advanced PIA use - working interactively...

Please note that the common block is an array of structures containing several 'real' variables (in string, integer, real format) and several pointers ('handles' in IDL language) to one- and two-dimensional arrays. In this way a flat architecture is achieved, even for variables representing one- or two-dimensional arrays of different sizes, according to the sub-instrument (e.g. the variable phterd.conp is a one-dimensional array with a length n given by the number of read-outs for a PHT-P1 measurement, while it is an (11,n) array for a PHT-C100 measurement. The first dimension given by the 9 detector pixels plus open plus resistor pixel).

PHTERD - Edited Raw Data

Name:   Typ:            Contents:

UNIT    String          Acquisition date
DET     String          Detector
ADMN    String          Internal measurement name
ORDR    Integer         Position within the TDT
DIMS    Long integer    Total number of read-outs
TINT    Real            Integration time
NNDR    Integer         Number of non destructive read-outs / ramp
RCHP    Integer         Number of ramps / chopper plateau
HDR     Pointer         Header (String array)
RAWP    Pointer         Unconverted read-out data (DIE output) (Int {p,n}-array)
CONP    Pointer         Converted read-out data [V] (Real {p,n}-array)
FITV    Pointer         Fitted voltages [V] (filled after processing to SRD)
                         (Real {p,n}-array)
TIME    Pointer         Time within measurement [s] (Real {p,n}-array)
PIXF    Pointer         Bit Flags (Int n-array)
                         On-target flag
                         Read-out status
                         Chopper sign
                         Chopper on-position flag
CHOP    Pointer         Chopper position [arcsec] (Int n-array)
STEP    Pointer         Chopper step (Int n-array)
FCSN    Pointer         Fine Calibration Source FCS selected (Int n-array)
TEMP    Pointer         Temperature  [K] (Real n-array)
FCS1    Pointer         FCS1 electrical power  [mW] (Real n-array)
FCS2    Pointer         FCS2 electrical power  [mW] (Real n-array)
TKEY    Pointer         Instrument time key  (Real n-array)
RPID    Pointer         Raster point ID (Byte (2,n)-array)
FLAG    Pointer         PIA bitflags (Int {p,n}-array) [See Flag definitions]

p: number of pixels (P1,P2,P3 = 1, C100=11, C200=6, SS/SL=132)
n: number of read-outs (=DIMS)


PHTSRD - Signal per Ramp Data

Name:   Typ:            Contents:

UNIT    String          Acquisition date
DET     String          Detector
ADMN    String          Internal measurement name
ORDR    Integer         Position within the TDT
DIMS    Long integer    Total number of read-outs
SLDI    Long integer    Total number of ramps
RCHP    Integer         Number of ramps / chopper plateau               
HDR     Pointer         Header (String array)
SLOP    Pointer         Ramp slopes (Real {p,n}-array) 
SLUN    Pointer         Ramp slopes uncert. (Real {p,n}-array)
FLAG    Pointer         PIA bitflags (Int {p,n}-array) [See Flag definitions]
STIM    Pointer         Time within measurement [s] (Real n-array)
CHOP    Pointer         Chopper position [arcsec] (Int n-array)
STEP    Pointer         Chopper step (Int n-array)
FCSN    Pointer         FCS selected (Int n-array)
TEMP    Pointer         Temperature  [K] (Real n-array)
FCS1    Pointer         FCS1 electrical power  [mW] (Real n-array)
FCS2    Pointer         FCS2 electrical power  [mW] (Real n-array)
TKEY    Pointer         Instrument time key  (Real n-array)
RPID    Pointer         Raster point ID (Byte (2,n)-array)
RESI    Pointer         Effective reset time (Real n-array)
NROS    Pointer         Number of read-outs used in ramp (Real n-array)

p: number of pixels (P1,P2,P3 = 1, C100=11, C200=6, SS/SL=132)
n: number of ramps (=SLDI)

PHTSCP - Signal per chopper plateau

         

Name:   Typ:            Contents:

UNIT    String          Acquisition date
DET     String          Detector
ADMN    String          Internal measurement name
ORDR    Integer         Position within the TDT
DIMS    Long-integer    Total number of chopper plateaux
HDR     Pointer         Header (String array)
TIME    Pointer         Time within measurement [s] (n-array)
AVER    Pointer         Average Signals per Chopper Plateau and Raster point
                         [V/s] ({p,n}-array)
AVUN    Pointer         Avrg.Signal uncertainties per Ch.Pl. and Raster point 
                         [V/s] ({p,n}-array)
MEDI    Pointer         Median Signals/Ch.Pl. and raster [V/s] ({p,n}-array)
Q1ME    Pointer         First Quartiles/Ch.Pl. and raster  [V/s] ({p,n}-array)
Q3ME    Pointer         Third Quartiles/Ch.Pl. [V/s] ({p,n}-array)
FLAG    Pointer         PIA bitflags (Int {p,n}-array) [See Flag definitions]
CHOP    Pointer         Chopper position [arcsec] (Int n-array) 
STEP    Pointer         Chopper step (Int n-array)
FCSN    Pointer         FCS selected (Int n-array)
TEMP    Pointer         Temperature  [K] (Real n-array)
FCS1    Pointer         FCS1 electrical power  [mW] (Real n-array)
FCS2    Pointer         FCS2 electrical power  [mW] (Real n-array)
TKEY    Pointer         Instrument time key  (Real n-array)
RPID    Pointer         Raster point ID (Byte (2,n)-array)
ARSI    Pointer         Mean effective reset time (Real n-array)
ANDR    Pointer         Mean nr. of read-outs used (Real n-array)
AVSD    Pointer         Sigma signals' distr [V/s] (Real {p,n}-array)

p: number of pixels (P1,P2,P3 = 1, C100=11, C200=6, SS/SL=132)
n: number of chopper plateaux (=DIMS)
        
Note: the phtscp structure is also used for accomodating background-subtracted
measurements, in which case DIMS is reduced from the original number of chopper
plateaux to 1, and the values are given by the results of the subtraction.

PHTSPD

         

Name:   Typ:            Contents:

UNIT    String          Acquisition date
DET     String          Detector
ADMN    String          Internal measurement name
ORDR    Integer         Position within the TDT
DIMS    Long-integer    Total number of chopper plateaux
HDR     Pointer         Header (String array)
TKEY    Pointer         Instrument time key  (Real n-array)
RPID    Pointer         Raster point ID (Byte (2,n)-array)
KYID    Pointer         Keyword Identifier (Int n-array)
FILT    Pointer         Filter wheel position (Int n-array)
APER    Pointer         Aperture wheel position (Int n-array)
POLZ    Pointer         Polarizer wheel position (Int n-array)
NDRS    Pointer         Number of destructive read-outs (Int n-array)
CSTP    Pointer         Chopper step (Int n-array)
DWEL    Pointer         Chopper dwell time [s]  (Int n-array)
MEAS    Pointer         Measurement time [s] (Int n-array)
CPOS    Pointer         Chopper position (Int n-array)
TIME    Pointer         Time within measurement [s] (n-array)
MNPW    Pointer         Mean in-band power / ch.plateau & raster pos. [W]
                         (Real {p,n}-array) 
MNPU    Pointer         MNPW Uncertainty [W] (Real {p,n}-array)
MDPW    Pointer         Median of in-band power / ch.plateau & raster pos. [W]
                         (Real {p,n}-array)
Q1PW    Pointer         First quartile of in-band power / ch.plateau & raster 
                         pos. [W] (Real {p,n}-array)
Q3PW    Pointer         Third quartile of in-band power / ch.plateau & raster 
                         pos. [W] (Real {p,n}-array)
DEC     Pointer         Declination [degrees] (Real n-array)
RA      Pointer         Right ascension [degrees] (Real n-array)
ROLL    Pointer         Roll angle [degrees] (Real n-array)
PLEN    Pointer         Plateau length (Real {p,n}-array)
FLAG    Pointer         PIA bitflags (Int {p,n}-array) [See Flag definitions]


p: number of pixels (P1,P2,P3 = 1, C100=11, C200=6, SS/SL=132)
n: number of chopper plateaux (=DIMS)

Note: the definition of the phtspd structure is strongly influenced by the 
pipeline products, to make use of the same arrays, independent of their 
processing origins. 

Note: the phtspd structure is also used for accomodating background subtracted
measurements, in which case DIMS is reduced from the original number of chopper
plateaux to 1, and the values are given by the results/derivations of the 
subtraction. 

PHTAAP

Name:   Typ:            Contents:

DET     String          Detector
ADMN    String          Internal measurement name
DIMS    Long-integer    Total number of chopper plateaux
FILT    Integer         Filter wheel position 
APER    Integer         Aperture wheel position 
POLZ    Integer         Polarizer wheel position 
HDR     Pointer         Header (String array)
TKEY    Pointer         Instrument time key  (Real n-array)
RPID    Pointer         Raster point ID (Byte (2,n)-array)
KYID    Pointer         Keyword Identifier (Int n-array)
CSTP    Pointer         Chopper step (Int n-array)
DWEL    Pointer         Chopper dwell time [s]  (Int n-array)
CPOS    Pointer         Chopper position (Int n-array)
TIME    Pointer         Time within measurement [s] (n-array)
MNFL    Pointer         Mean flux / ch.plateau & raster pos. [Jy]
                         (Real {p,n}-array) 
MNFU    Pointer         MNFL Uncertainty [Jy] (Real {p,n}-array)
MDFL    Pointer         Median of flux / ch.plateau & raster pos. [Jy]
                         (Real {p,n}-array)
Q1FL    Pointer         First quartile of flux / ch.plateau & raster 
                         pos. [Jy] (Real {p,n}-array)
Q3FL    Pointer         Third quartile of flux / ch.plateau & raster 
                         pos. [Jy] (Real {p,n}-array)
MNBR    Pointer         Mean brightness / ch.plateau & raster pos. [MJy/sr]
                         (Real {p,n}-array) 
MNBU    Pointer         MNPW Uncertainty [MJy/sr] (Real {p,n}-array)
MDBR    Pointer         Median of brightness / ch.plateau & raster pos. [MJy/sr]
                         (Real {p,n}-array)
Q1BR    Pointer         First quartile of brightness / ch.plateau & raster 
                         pos. [MJy/sr] (Real {p,n}-array)
Q3BR    Pointer         Third quartile of brightness / ch.plateau & raster 
                         pos. [MJy/sr] (Real {p,n}-array)
DEC     Pointer         Declination [degrees] (Real n-array)
RA      Pointer         Right ascension [degrees] (Real n-array)
ROLL    Pointer         Roll angle [degrees] (Real n-array)
FLAG    Pointer         PIA bitflags (Int {p,n}-array) [See Flag definitions]


p: number of pixels (P1,P2,P3 = 1, C100=11, C200=6, SS/SL=132)
n: number of chopper plateaux (=DIMS)

Note: the phtaap structure is also used for accomodating background subtracted
measurements, in which case DIMS is reduced from the original number of chopper
plateaux to 1, and the values are given by the results/derivations of the 
subtraction.




PHTCS

         

Name:   Typ:            Contents:

UNIT    String          Compact Status File name
DIMS    Integer         Number of measurements comprised in the file
HANDLE  Pointer         Structure with tags as shown below              


Note: The pointer handle indicates a structure containing all the variables
quoted in the Compact Status Files as produced by the Pipeline (unconverted raw
telemetry values). For the user, however, it is more useful to have access to 
the numbers converted into physical meaningful quantities. 
The following table shows a static structure as output from the PIA routine 
CONV_CS (after e.g. a call CONV_CS, PHTCS(1), CST)  


Structure CST
 
Name:   Typ:            Contents:

UNIT    String          Compact Status File name
DIMS    Integer         Number of measurements comprised in the file
UKST    Integer array   Universal Time Key, measurement start time 
UKEN    Integer array   Universal Time Key, measurement end time 
IKST    Integer array   Instrument Time Key, measurement start time 
IKEN    Integer array   Instrument Time Key, measurement end time 
UTST    Integer array   Universal Time Key, period start time 
UTEN    Integer array   Universal Time Key, period end time
AOTN    Integer array   Observation sequence number
SUBS    String array    Subsystem ('P1', 'C100', ...)   
OPFO    Integer array   Chopper on position, override flag
F1TS    String array    Selected TRS for FCS1
F2TS    String array    Selected TRS for FCS2 
F1PS    Real array      Selected electrical power on FCS1 [mW]
F2PS    Real array      Selected electrical power on FCS2 [mW]
C1PS    String array    Commanded position on wheel I
C2PS    String array    Commanded position on wheel II
C3PS    String array    Commanded position on wheel III
CMOD    String array    Chopper mode
CAMP    String array    Chopper amplitude [arcsec] 
CSTE    String array    Chopper Steps
CINC    String array    Chopper increment [arcsec] 
CRES    Integer array   Powered cold read-out electronics
DETA    String array    Detector assembly
DRS     String array    Data reduction factor
MUX1    String array    Multiplexer 1 line
MUX2    String array    Multiplexer 2 line
XSTA    String array    Multiplexer cross switch status
D1OF    String array    Digital interface electronics 1, offset [V]
D1GA    String array    Digital interface electronics 1, gain factor
D2OF    String array    Digital interface electronics 1, offset [V]
D2GA    String array    Digital interface electronics 1, gain factor
FREQ    String array    Frequency [Hz]
NNDR    String array    Number of non-destructive read-outs
NDR     String array    Number of destructive read-outs
INTT    String array    Integration time [s]
MEAT    String array    Measurement time [s]
MPC1    String array    Measured position change wheel I
MPC2    String array    Measured position change wheel II
MPC3    String array    Measured position change wheel III
MET     String array    Measured EEUU temperature [0C]

PHTCLA

         
@phtcla
         
PHTCLA_REC = {PHTCLA_TYPE, $
         UNIT: ` `, $
         DET: ` `, $
         ADMN: ` `, $
         ORDR: 0,  $
         DIMS: 0L, $ 
         DWEL: 0L, $ 
         RPID: HANDLE_CREATE(), $ 
         QFLG: HANDLE_CREATE(), $ 
         QSTA: HANDLE_CREATE(), $ 
         STAT: HANDLE_CREATE(), $ 
         CPOS: HANDLE_CREATE(), $ 
         FCS1: HANDLE_CREATE(), $ 
         FCS2: HANDLE_CREATE(), $ 
         TEMP: HANDLE_CREATE(), $
         TIME: HANDLE_CREATE(), $
         BIAS: HANDLE_CREATE(), $
         PIXL: HANDLE_CREATE(), $
         PUNC: HANDLE_CREATE()}
         
PHTCLA = {PHTCLA_TYPE}
Name:   Typ:            Contents:

UNIT    String          Acquisition date
DET     String          Detector
ADMN    String          Internal measurement name
ORDR    Integer         Position within the TDT
DIMS    Long-integer    Total number of chopper plateaux
HDR     Pointer         Header (String array)
TIME    Pointer         Time within measurement [s] (n-array)
TKEY    Pointer         Instrument time key  (Real n-array)
QFLG    Pointer         Quality flag (n-array)
KYID    Pointer         Keyword Identifier (Int n-array)
FILT    Pointer         Filter wheel position (Int n-array)
APER    Pointer         Aperture wheel position (Int n-array)
POLZ    Pointer         Polarizer wheel position (Int n-array)
STAT    Pointer         FPC state (Int n-array)
DWEL    Pointer         Chopper Dwell Time (Int n-array)
CPOS    Pointer         Chopper step (Int n-array)
FCS1    Pointer         Measured FCS1 power (Real n-array)
FCS2    Pointer         Measured FCS2 power (Real n-array)
TEMP    Pointer         Detector Temperature (Real n-array)
BIAS    Pointer         Measured Bias voltage (Real n-array)
MNSG    Pointer         Mean signal / ch.plateau [V/s] (Real {p,n}-array) 
MNSU    Pointer         MNSG Uncertainty [V/s] (Real {p,n}-array)
MDSG    Pointer         Median signal / ch.plateau [V/s] (Real {p,n}-array)
Q1SG    Pointer         First quartile of signal / ch.plateau [V/s] (Real {p,n}-array)
Q3SG    Pointer         Third quartile of signal / ch.plateau [V/s] (Real {p,n}-array)
PLEN    Pointer         Plateau length (Real {p,n}-array)
FLAG    Pointer         Flag, indicating status of data point for processing
                        (Integer {p,n}-array)   0: valid 
                                                1: uncertainties not valid
                                                2: not valid 




Flag Definitions for the internal dynamic buffers:

PIA has a bitflag system for giving the status of each data point. The definition of the flags as well as their severity is given in the file pia_flaginfo.pro which is reproduced below:
 
;ERD flags
Nflag = 9
LEX = MAKE_ARRAY(nflag,value='DUMMY')
LEX(0) = 'NOTF'
LEX(1) = 'DR'
LEX(2) = 'OUTVOLT'
LEX(4) = 'GENDISC'
LEX(5) = 'MANDISC'
LEX(6) = 'GLITCH'


EXPLA = MAKE_ARRAY(nflag,value='')
EXPLA(0) = 'Not On target'
EXPLA(1) = 'Destructive Read'
EXPLA(2) = 'Out of voltage'
EXPLA(4) = 'General discard'
EXPLA(5) = 'Manual discard'
EXPLA(6) = 'Detected glitch'


severe = INTARR(Nflag)
severe(2) = 1
severe(4:6) = 1


flagerd_str = {nflag:nflag, LEX:lex, EXPLA:expla, valflag:2^INDGEN(nflag), $
    severe:severe}




;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; SRD flags
Nflag = 10
LEX = MAKE_ARRAY(nflag,value='DUMMY')
LEX(0) = 'RAMPNDR_2'
LEX(1) = 'RAMPNDR_1'
LEX(2) = 'NOTF'
LEX(3) = 'GENDISC'
LEX(4) = 'MANDISC'
LEX(5) = 'GLITCH'
LEX(6) = 'NOCHOP'
LEX(7) = 'MANNMASK'


EXPLA = MAKE_ARRAY(nflag,value='')
EXPLA(0) = '2 readouts/ramp'
EXPLA(1) = '1 readout/ramp'
EXPLA(2) = 'Not On target'
EXPLA(3) = 'General discard'
EXPLA(4) = 'Manual discard'
EXPLA(5) = 'Detected glitch'
EXPLA(6) = 'No valid ch.pos.'
EXPLA(7) = 'Not stabilized '


severe = INTARR(Nflag)
severe(1:6) = 1
 
flagsrd_str = {nflag:nflag, LEX:lex, EXPLA:expla, valflag:2^INDGEN(nflag), $
    severe:severe}


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; SCP flags
Nflag = 10
LEX = MAKE_ARRAY(nflag,value='DUMMY')
LEX(0) = 'NSIG_1'
LEX(1) = 'NSIG_0'
LEX(2) = 'NOCHOP'
LEX(3) = 'GENDISC'
LEX(4) = 'MANDISC'
LEX(5) = 'STABIL1'
LEX(6) = 'STABIL2'
LEX(7) = 'DRIFTMOD'


EXPLA = MAKE_ARRAY(nflag,value='')
EXPLA(0) = 'Only 1 signal'
EXPLA(1) = 'No valid signal'
EXPLA(2) = 'No valid ch.pos.'
EXPLA(3) = 'General discard'
EXPLA(4) = 'Manual discard'
EXPLA(5) = 'Stability flag 1'
EXPLA(6) = 'Stability flag 2'
EXPLA(7) = 'Drift model flag'


severe = INTARR(Nflag)
severe(1:4) = 1
flagscp_str = {nflag:nflag, LEX:lex, EXPLA:expla, valflag:2^INDGEN(nflag), $
    severe:severe}


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; SPD flags
Nflag = 10
LEX = MAKE_ARRAY(nflag,value='DUMMY')
LEX(0) = 'NSIG_1'
LEX(1) = 'NSIG_0'
LEX(2) = 'NOCHOP'
LEX(3) = 'GENDISC'
LEX(4) = 'MANDISC'
LEX(5) = 'QUALIT1'
LEX(6) = 'QUALIT2'
LEX(7) = 'BACKSEL'


EXPLA = MAKE_ARRAY(nflag,value='')
EXPLA(0) = 'Only 1 signal'
EXPLA(1) = 'No valid signal'
EXPLA(2) = 'No valid ch.pos.'
EXPLA(3) = 'General discard'
EXPLA(4) = 'Manual discard'
EXPLA(5) = 'Quality flag 1'
EXPLA(6) = 'Quality flag 2'
EXPLA(7) = 'Bckgr. position'




severe = INTARR(Nflag)
severe(1:4) = 1
 
flagspd_str = {nflag:nflag, LEX:lex, EXPLA:expla, valflag:2^INDGEN(nflag), $
    severe:severe}




;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; AAP flags
Nflag = 10
LEX = MAKE_ARRAY(nflag,value='DUMMY')
LEX(0) = 'NSIG_1'
LEX(1) = 'NSIG_0'
LEX(2) = 'NOCHOP'
LEX(3) = 'GENDISC'
LEX(4) = 'MANDISC'
LEX(5) = 'QUALIT1'
LEX(6) = 'QUALIT2'
LEX(7) = 'BACKSEL'


EXPLA = MAKE_ARRAY(nflag,value='')
EXPLA(0) = 'Only 1 signal'
EXPLA(1) = 'No valid signal'
EXPLA(2) = 'No valid ch.pos.'
EXPLA(3) = 'General discard'
EXPLA(4) = 'Manual discard'
EXPLA(5) = 'Quality flag 1'
EXPLA(6) = 'Quality flag 2'
EXPLA(7) = 'Bckgr. position'


severe = INTARR(Nflag)
severe(1:4) = 1
 
flagaap_str = {nflag:nflag, LEX:lex, EXPLA:expla, valflag:2^INDGEN(nflag), $
    severe:severe}


piaflag_str = {erd:flagerd_str, srd:flagsrd_str, scp:flagscp_str, $
               spd:flagspd_str, aap:flagaap_str}
 


 
History of this Section:
Date  Authors  Description 
04/07/1995  Ingolf Heinrichsen(MPIK)  First Version 
22/07/1996  Carlos Gabriel(ESA/VILSPA-SAI)  General Update 
25/08/1999 Carlos Gabriel(ESA/VILSPA-SAI)  Update (V8.0)