;+ ; NAME: ; spe_head2fits ; ; PURPOSE: (one line) ; convert a Princeton Instruments SPE header structure to a FITS header ; ; CATEGORY: ; File IO ; ; CALLING SEQUENCE: ; fitsh = spe_head2fits(speh, infitsh=infitsh) ; ; INPUTS: ; speh : structure for the header of Princeton Instruments ; WinView or WinSpec programs, as output by ; convert_princeton_header2 ; ; INPUT KEYWORDS: ; infitsh = initial FITS header ; ; OUTPUTS: ; fitsh = output FITS header ; ; MODIFICATION HISTORY: ; Written 05 Aug 2007 Leslie Young SwRI ;- function spe_head2fits, speh, infitsh=infitsh ; if fitsh is not passed, begin with a minimal header if not keyword_set(infitsh) then begin data_type = speh.datatype ; data type from Byte 108 of Princeton Instruments header ; 0 = FLOATING POINT ; 1 = LONG INTEGER ; 2 = INTEGER ; 3 = UNSIGNED INTEGER case data_type of 0: idl_type = 4 1: idl_type = 3 2: idl_type = 2 3: idl_type = 12 else: message, 'Unknown data type' endcase nx = speh.xdim ny = speh.ydim nframes = speh.NumFrames mkhdr, fitsh, idl_type, [nx, ny, nframes] endif else begin fitsh = infitsh endelse ; SXADDPAR, Header, Name, Value, [ Comment, Location, /SaveComment, ; BEFORE =, AFTER = , FORMAT= , /PDU] sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='END' sxaddpar, fitsh, 'COMMENT', 'Start values from SPE header', $ before='END' sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='END' ; placeholder for sxaddpar, fitsh, 'LASTSPE', '', $ 'Placeholder for adding comments in order' sxaddpar, fitsh, 'CONTVERS', speh.controllerversion, $ 'ControllerVersion:Hardware Version', before='LASTSPE' sxaddpar, fitsh, 'LOGICOUT', speh.logicoutput, $ 'LogicOutput:Definition of Output BNC', before='LASTSPE' sxaddpar, fitsh, 'AMPHICAP', speh.AmpHiCapLowNoise, $ 'AmpHiCapLowNoise:Amp Switching Mode', before='LASTSPE' sxaddpar, fitsh, 'XDIMDET', speh.xDimDet, $ 'xDimDet:Detector x dimension of chip.', before='LASTSPE' sxaddpar, fitsh, 'MODE', speh.mode, $ 'mode:timing mode', before='LASTSPE' sxaddpar, fitsh, 'EXP_SEC', speh.exp_sec, $ 'exp_sec:alternitive exposure, in sec.', before='LASTSPE' sxaddpar, fitsh, 'VCHIPXDI', speh.VChipXdim, $ 'VChipXdim:Virtual Chip X dim', before='LASTSPE' sxaddpar, fitsh, 'VCHIPYDI', speh.VChipYdim, $ 'VChipYdim:Virtual Chip Y dim', before='LASTSPE' sxaddpar, fitsh, 'YDIMDET', speh.yDimDet, $ 'yDimDet: y dimension of CCD or detector.', before='LASTSPE' sxaddpar, fitsh, 'DATE', speh.date, $ 'date[DATEMAX]:date', before='LASTSPE' sxaddpar, fitsh, 'VIRTFLAG', speh.VirtualChipFlag, $ 'VirtualChipFlag:On/Off', before='LASTSPE' ; ; Spare_1 is type byte, but string(0b) = '', so force to uint ; sxaddpar, fitsh, 'SPAR1_1', uint( speh.Spare_1[0] ), $ ; 'Spare_1[2] :', before='LASTSPE' ; ; sxaddpar, fitsh, 'SPAR1_2', uint( speh.Spare_1[1] ), $ ; 'Spare_1[2] :', before='LASTSPE' sxaddpar, fitsh, 'NOSCAN', speh.noscan, $ 'noscan:Old # of scans - should always be -1', before='LASTSPE' sxaddpar, fitsh, 'DETEMP', speh.DetTemperature, $ 'DetTemperature:Detector Temperature Set', before='LASTSPE' sxaddpar, fitsh, 'DETTYPE', speh.dettype, $ 'DetType:CCD/DiodeArray type', before='LASTSPE' sxaddpar, fitsh, 'XDIM', speh.xdim, $ 'xdim:actual # of pixels on x axis', before='LASTSPE' sxaddpar, fitsh, 'STDIODE', speh.stdiode, $ 'stdiode:trigger diode', before='LASTSPE' sxaddpar, fitsh, 'DELAYTIM', speh.DelayTime, $ 'DelayTime:Used with Async Mode', before='LASTSPE' sxaddpar, fitsh, 'SHUTCNTL', speh.ShutterControl, $ 'ShutterControl:Normal,DisabledOpen,DisabledClosed', before='LASTSPE' sxaddpar, fitsh, 'ABSLIVE', speh.AbsorbLive, $ 'AbsorbLive:On/Off', before='LASTSPE' sxaddpar, fitsh, 'ABSMODE', speh.AbsorbMode, $ 'AbsorbMode:Reference Strip or File', before='LASTSPE' sxaddpar, fitsh, 'CAN_VIRT', speh.CanDoVirtualChipFlag, $ 'CanDoVirtualChipFlag:T/F Chip able to do Virtual Chip', before='LASTSPE' sxaddpar, fitsh, 'THRSHMNL', speh.ThresholdMinLive, $ 'ThresholdMinLive:On/Off', before='LASTSPE' sxaddpar, fitsh, 'THRSHMNV', speh.ThresholdMinVal, $ 'ThresholdMinVal:Threshold Minimum Value', before='LASTSPE' sxaddpar, fitsh, 'THRSHMXL', speh.ThresholdMaxLive, $ 'ThresholdMaxLive:On/Off', before='LASTSPE' sxaddpar, fitsh, 'THRSHMXV', speh.ThresholdMaxVal, $ 'ThresholdMaxVal:Threshold Maximum Value', before='LASTSPE' sxaddpar, fitsh, 'SPMODE', speh.SpecAutoSpectroMode,$ 'SpecAutoSpectroMode:T/F Spectrograph Used', before='LASTSPE' sxaddpar, fitsh, 'SPCTRNM', speh.SpecCenterWlNm, $ 'SpecCenterWlNm:Center Wavelength in Nm', before='LASTSPE' sxaddpar, fitsh, 'SPGFLAG', speh.SpecGlueFlag, $ 'SpecGlueFlag:T/F File is Glued', before='LASTSPE' sxaddpar, fitsh, 'SPGSTART', speh.SpecGlueStartWlNm, $ 'SpecGlueStartWlNm:Starting Wavelength in Nm', before='LASTSPE' sxaddpar, fitsh, 'SPGEND', speh.SpecGlueEndWlNm, $ 'SpecGlueEndWlNm:Starting Wavelength in Nm', before='LASTSPE' sxaddpar, fitsh, 'SPGOVRLP', speh.SpecGlueMinOvrlpNm, $ 'SpecGlueMinOvrlpNm:Minimum Overlap in Nm', before='LASTSPE' sxaddpar, fitsh, 'SPGRESNM', speh.SpecGlueFinalResNm, $ 'SpecGlueFinalResNm:Final Resolution in Nm', before='LASTSPE' sxaddpar, fitsh, 'PULSETYP', speh.PulserType, $ 'PulserType:0=None, PG200=1, PTG=2, DG535=3', before='LASTSPE' sxaddpar, fitsh, 'CSTOMCHP', speh.CustomChipFlag, $ 'CustomChipFlag:T/F Custom Chip Used', before='LASTSPE' sxaddpar, fitsh, 'XPREPIX', speh.XPrePixels, $ 'XPrePixels:Pre Pixels in X direction', before='LASTSPE' sxaddpar, fitsh, 'XPOSTPIX', speh.XPostPixels, $ 'XPostPixels:Post Pixels in X direction', before='LASTSPE' sxaddpar, fitsh, 'YPREPIX', speh.YPrePixels, $ 'YPrePixels:Pre Pixels in Y direction', before='LASTSPE' sxaddpar, fitsh, 'YPOSTPIX', speh.YPostPixels, $ 'YPostPixels:Post Pixels in Y direction', before='LASTSPE' sxaddpar, fitsh, 'ASYNEN', speh.asynen, $ 'asynen:asynchron enable flag 0 = off', before='LASTSPE' sxaddpar, fitsh, 'DATATYPE', speh.datatype, $ 'datatype:experiment datatype', before='LASTSPE' sxaddpar, fitsh, '', '0 = FLOATING POINT', before='LASTSPE' sxaddpar, fitsh, '', '1 = LONG INTEGER', before='LASTSPE' sxaddpar, fitsh, '', '2 = INTEGER', before='LASTSPE' sxaddpar, fitsh, '', '3 = UNSIGNED INTEGER', before='LASTSPE' sxaddpar, fitsh, 'PMODE', speh.PulserMode, $ 'PulserMode:Repetitive/Sequential', before='LASTSPE' sxaddpar, fitsh, 'PACCUM', speh.PulserOnChipAccums, $ 'PulserOnChipAccums:Num PTG On-Chip Accums', before='LASTSPE' sxaddpar, fitsh, 'PREPEXP', speh.PulserRepeatExp, $ 'PulserRepeatExp:Num Exp Repeats (Pulser SW Accum)', before='LASTSPE' sxaddpar, fitsh, 'PREPWID', speh.PulseRepWidth, $ 'PulseRepWidth:Width Value for Repetitive pulse (usec)', before='LASTSPE' sxaddpar, fitsh, 'PREPDLY', speh.PulseRepDelay, $ 'PulseRepDelay:Width Value for Repetitive pulse (usec)', before='LASTSPE' sxaddpar, fitsh, 'PSEQSWID', speh.PulseSeqStartWidth, $ 'PulseSeqStartWidth:Start Width for Sequential pulse (usec)', before='LASTSPE' sxaddpar, fitsh, 'PSEQEWID', speh.PulseSeqEndWidth, $ 'PulseSeqEndWidth:End Width for Sequential pulse (usec)', before='LASTSPE' sxaddpar, fitsh, 'PSEQSDLY', speh.PulseSeqStartDelay, $ 'PulseSeqStartDelay:Start Delay for Sequential pulse (usec)', before='LASTSPE' sxaddpar, fitsh, 'PSEQEDLY', speh.PulseSeqEndDelay, $ 'PulseSeqEndDelay:End Delay for Sequential pulse (usec)', before='LASTSPE' sxaddpar, fitsh, 'PSEQMODE', speh.PulseSeqIncMode, $ 'PulseSeqIncMode:Increments: 1=Fixed, 2=Exponential', before='LASTSPE' sxaddpar, fitsh, 'PIUSED', speh.PImaxUsed, $ 'PImaxUsed:PI-Max type controller flag', before='LASTSPE' sxaddpar, fitsh, 'PIMODE', speh.PImaxMode, $ 'PImaxMode:PI-Max mode', before='LASTSPE' sxaddpar, fitsh, 'PIGAIN', speh.PImaxGain, $ 'PImaxGain:PI-Max Gain', before='LASTSPE' sxaddpar, fitsh, 'BKGDAPPL', speh.BackGrndApplied, $ 'BackGrndApplied:1 if background subtraction done', before='LASTSPE' sxaddpar, fitsh, 'PI2NSBRD', speh.PImax2nsBrdUsed, $ 'PImax2nsBrdUsed:T/F PI-Max 2ns Board Used', before='LASTSPE' sxaddpar, fitsh, 'MINBLK', speh.minblk, $ 'minblk:min. # of strips per skips', before='LASTSPE' sxaddpar, fitsh, 'NMINBLK', speh.numminblk, $ 'numminblk:# of min-blocks before geo skps', before='LASTSPE' sxaddpar, fitsh, 'SPMLOC_1', speh.SpecMirrorLocation[0], $ 'SpecMirrorLocation:Spectro Mirror Location, 0=Not Present', before='LASTSPE' sxaddpar, fitsh, 'SPMLOC_2', speh.SpecMirrorLocation[1], $ 'SpecMirrorLocation:Spectro Mirror Location, 0=Not Present', before='LASTSPE' sxaddpar, fitsh, 'SPSLOC_1', speh.SpecSlitLocation[0], $ 'SpecSlitLocation:Spectro Slit Location, 0=Not Present', before='LASTSPE' sxaddpar, fitsh, 'SPSLOC_2', speh.SpecSlitLocation[1], $ 'SpecSlitLocation:Spectro Slit Location, 0=Not Present', before='LASTSPE' sxaddpar, fitsh, 'SPSLOC_3', speh.SpecSlitLocation[2], $ 'SpecSlitLocation:Spectro Slit Location, 0=Not Present', before='LASTSPE' sxaddpar, fitsh, 'SPSLOC_4', speh.SpecSlitLocation[3], $ 'SpecSlitLocation:Spectro Slit Location, 0=Not Present', before='LASTSPE' sxaddpar, fitsh, 'CSTOMTIM', speh.CustomTimingFlag, $ 'CustomTimingFlag:T/F Custom Timing Used', before='LASTSPE' sxaddpar, fitsh, 'EXTIMLOC', speh.ExperimentTimeLocal, $ 'ExperimentTimeLocal:Experiment Local Time as hhmmss\0', before='LASTSPE' sxaddpar, fitsh, 'EXTIMUTC', speh.ExperimentTimeUTC, $ 'ExperimentTimeUTC:Experiment UTC Time as hhmmss\0', before='LASTSPE' sxaddpar, fitsh, 'EXPUNITS', speh.ExposUnits, $ 'ExposUnits:User Units for Exposure', before='LASTSPE' sxaddpar, fitsh, 'ADCOFFSE', speh.ADCoffset, $ 'ADCoffset:ADC offset', before='LASTSPE' sxaddpar, fitsh, 'ADCRATE', speh.ADCrate, $ 'ADCrate:ADC rate', before='LASTSPE' sxaddpar, fitsh, 'ADCTYPE', speh.ADCtype, $ 'ADCtype:ADC type', before='LASTSPE' sxaddpar, fitsh, 'ADCRES', speh.ADCresolution, $ 'ADCresolution:ADC resolution', before='LASTSPE' sxaddpar, fitsh, 'ADCBITAD', speh.ADCbitAdjust, $ 'ADCbitAdjust:ADC bit adjust', before='LASTSPE' sxaddpar, fitsh, 'GAIN', speh.gain, $ 'gain:gain', before='LASTSPE' sxaddpar, fitsh, 'COMMNTS1', speh.Comments[0], $ 'Comments:File Comments', before='LASTSPE' sxaddpar, fitsh, 'COMMNTS2', speh.Comments[1], $ 'Comments:File Comments', before='LASTSPE' sxaddpar, fitsh, 'COMMNTS3', speh.Comments[2], $ 'Comments:File Comments', before='LASTSPE' sxaddpar, fitsh, 'COMMNTS4', speh.Comments[3], $ 'Comments:File Comments', before='LASTSPE' sxaddpar, fitsh, 'COMMNTS5', speh.Comments[4], $ 'Comments:File Comments', before='LASTSPE' sxaddpar, fitsh, 'GEOMETRI', speh.geometric, $ 'geometric:geometric ops',before='LASTSPE' sxaddpar, fitsh, '', 'rotate 0x01, reverse 0x02, flip 0x04',before='LASTSPE' sxaddpar, fitsh, 'XLABEL', speh.xlabel, $ 'xlabel:intensity display string', before='LASTSPE' sxaddpar, fitsh, 'CLEANS', speh.cleans, $ 'cleans:cleans', before='LASTSPE' sxaddpar, fitsh, 'NUMSKIP', speh.NumSkpPerCln, $ 'NumSkpPerCln:number of skips per clean.', before='LASTSPE' sxaddpar, fitsh, 'SPMPOS_1', speh.SpecMirrorPos[0], $ 'SpecMirrorPos:Spectrograph Mirror Positions', before='LASTSPE' sxaddpar, fitsh, 'SPMPOS_2', speh.SpecMirrorPos[1], $ 'SpecMirrorPos:Spectrograph Mirror Positions', before='LASTSPE' sxaddpar, fitsh, 'SPSPOS1', speh.SpecSlitPos[0], $ 'SpecSlitPos:Spectrograph Slit Positions', before='LASTSPE' sxaddpar, fitsh, 'SPSPOS2', speh.SpecSlitPos[1], $ 'SpecSlitPos:Spectrograph Slit Positions', before='LASTSPE' sxaddpar, fitsh, 'SPSPOS3', speh.SpecSlitPos[2], $ 'SpecSlitPos:Spectrograph Slit Positions', before='LASTSPE' sxaddpar, fitsh, 'SPSPOS4', speh.SpecSlitPos[3], $ 'SpecSlitPos:Spectrograph Slit Positions', before='LASTSPE' sxaddpar, fitsh, 'AUTOCLEA', speh.AutoCleansActive, $ 'AutoCleansActive:T/F', before='LASTSPE' sxaddpar, fitsh, 'USECONTC', speh.UseContCleansInst, $ 'UseContCleansInst:T/F', before='LASTSPE' sxaddpar, fitsh, 'ABSSTRIP', speh.AbsorbStripNum, $ 'AbsorbStripNum:Absorbance Strip Number', before='LASTSPE' sxaddpar, fitsh, 'SPSPOSUN', speh.SpecSlitPosUnits, $ 'SpecSlitPosUnits:Spectrograph Slit Position Units', before='LASTSPE' sxaddpar, fitsh, 'SGROOVES', speh.SpecGrooves, $ 'SpecGrooves:Spectrograph Grating Grooves', before='LASTSPE' sxaddpar, fitsh, 'SRCOMP', speh.srccmp, $ 'srccmp:number of source comp. diodes', before='LASTSPE' sxaddpar, fitsh, 'YDIM', speh.ydim, $ 'ydim:y dimension of raw data.', before='LASTSPE' sxaddpar, fitsh, 'SCRAMBLE', speh.scramble, $ 'scramble:0=scrambled,1=unscrambled', before='LASTSPE' sxaddpar, fitsh, 'CONTCLEFF', speh.ContinuousCleansFlag, $ 'ContinuousCleansFlag:T/F Continuous Cleans Timing Option', before='LASTSPE' sxaddpar, fitsh, 'EXTTRIGF', speh.ExternalTriggerFlag, $ 'ExternalTriggerFlag:T/F External Trigger Timing Option', before='LASTSPE' sxaddpar, fitsh, 'LNOSCAN', speh.lnoscan, $ 'lnoscan:Number of scans (Early WinX)', before='LASTSPE' sxaddpar, fitsh, 'LAVGEXP', speh.lavgexp, $ 'lavgexp:Number of Accumulations', before='LASTSPE' sxaddpar, fitsh, 'READOUTT', speh.ReadoutTime, $ 'ReadoutTime:Experiment readout time', before='LASTSPE' sxaddpar, fitsh, 'TRIGMODE', speh.TriggeredModeFlag, $ 'TriggeredModeFlag:T/F Triggered Timing Option', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR2_1', uint( speh.Spare_2[0] ), $ ; 'Spare_2 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR2_2', uint( speh.Spare_2[1] ), $ ; 'Spare_2 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR2_3', uint( speh.Spare_2[2] ), $ ; 'Spare_2 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR2_4', uint( speh.Spare_2[3] ), $ ; 'Spare_2 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR2_5', uint( speh.Spare_2[4] ), $ ; 'Spare_2 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR2_6', uint( speh.Spare_2[5] ), $ ; 'Spare_2 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR2_7', uint( speh.Spare_2[6] ), $ ; 'Spare_2 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR2_8', uint( speh.Spare_2[7] ), $ ; 'Spare_2 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR2_9', uint( speh.Spare_2[8] ), $ ; 'Spare_2 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR2_10', uint( speh.Spare_2[9] ), $ ; 'Spare_2 :', before='LASTSPE' sxaddpar, fitsh, 'SW_VERSI', speh.sw_version, $ 'sw_version:Version of SW creating this file', before='LASTSPE' sxaddpar, fitsh, 'TYPE', speh.type, $ 'type: 1 = new120 (Type II)', before='LASTSPE' sxaddpar, fitsh, '', $ ' 2 = old120 (Type I )', before='LASTSPE' sxaddpar, fitsh, '', $ ' 3 = ST130', before='LASTSPE' sxaddpar, fitsh, '', $ ' 4 = ST121', before='LASTSPE' sxaddpar, fitsh, '', $ ' 5 = ST138', before='LASTSPE' sxaddpar, fitsh, '', $ ' 6 = DC131 (PentaMax)', before='LASTSPE' sxaddpar, fitsh, '', $ ' 7 = ST133 (MicroMax/SpectroMax)', before='LASTSPE' sxaddpar, fitsh, '', $ ' 8 = ST135 (GPIB)', before='LASTSPE' sxaddpar, fitsh, '', $ ' 9 = VICCD', before='LASTSPE' sxaddpar, fitsh, '', $ ' 10 = ST116 (GPIB)', before='LASTSPE' sxaddpar, fitsh, '', $ ' 11 = OMA3 (GPIB)', before='LASTSPE' sxaddpar, fitsh, '', $ ' 12 = OMA4', before='LASTSPE' sxaddpar, fitsh, 'FLATAPPL', speh.flatFieldApplied, $ 'flatFieldApplied:1 if flat field was applied.', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_1', uint( speh.Spare_3[0] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_2', uint( speh.Spare_3[1] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_3', uint( speh.Spare_3[2] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_4', uint( speh.Spare_3[3] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_5', uint( speh.Spare_3[4] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_6', uint( speh.Spare_3[5] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_7', uint( speh.Spare_3[6] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_8', uint( speh.Spare_3[7] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_9', uint( speh.Spare_3[8] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_10', uint( speh.Spare_3[9] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_11', uint( speh.Spare_3[10] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_12', uint( speh.Spare_3[11] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_13', uint( speh.Spare_3[12] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_14', uint( speh.Spare_3[13] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_15', uint( speh.Spare_3[14] ), $ ; 'Spare_3 :', before='LASTSPE' ; sxaddpar, fitsh, 'SPAR3_16', uint( speh.Spare_3[15] ), $ ; 'Spare_3 :', before='LASTSPE' sxaddpar, fitsh, 'KINTMODE', speh.kin_trig_mode, $ 'kin_trig_mode:Kinetics Trigger Mode', before='LASTSPE' sxaddpar, fitsh, 'DLABEL', speh.dlabel, $ 'dlabel:Data label.', before='LASTSPE' ; char Spare_4[436] 742 sxaddpar, fitsh, 'PFILENAM', speh.PulseFileName, $ 'PulseFileName:Name of Pulser File with', before='LASTSPE' sxaddpar, fitsh, '', $ ' Pulse Widths/Delays (for Z-Slice)', before='LASTSPE' sxaddpar, fitsh, 'AFILENAM', speh.AbsorbFileName, $ 'AbsorbFileName:Name of Absorbance File (if File Mode)', before='LASTSPE' sxaddpar, fitsh, 'NEXPREP', speh.NumExpRepeats, $ 'NumExpRepeats:Number of Times experiment repeated', before='LASTSPE' sxaddpar, fitsh, 'NEXPACC', speh.NumExpAccums, $ 'NumExpAccums:Number of Time experiment accumulated', before='LASTSPE' sxaddpar, fitsh, 'YTFLAG', speh.YT_Flag, $ 'YT_Flag:Set to 1 if this file contains YT data', before='LASTSPE' sxaddpar, fitsh, 'CLKSPDUS', speh.clkspd_us, $ 'clkspd_us:Vert Clock Speed in micro-sec', before='LASTSPE' sxaddpar, fitsh, 'HWACCUMF', speh.HWaccumFlag, $ 'HWaccumFlag:set to 1 if accum done by Hardware.', before='LASTSPE' sxaddpar, fitsh, 'STORSYNC', speh.StoreSync, $ 'StoreSync:set to 1 if store sync used', before='LASTSPE' sxaddpar, fitsh, 'BLEMAPPL', speh.BlemishApplied, $ 'BlemishApplied:set to 1 if blemish removal applied', before='LASTSPE' sxaddpar, fitsh, 'COSMAPPL', speh.CosmicApplied, $ 'CosmicApplied:set to 1 if cosmic ray removal applied', before='LASTSPE' sxaddpar, fitsh, 'COSMTYPE', speh.CosmicType, $ 'CosmicType:if cosmic ray applied, this is type', before='LASTSPE' sxaddpar, fitsh, 'COSMTHSH', speh.CosmicThreshold, $ 'CosmicThreshold:Threshold of cosmic ray removal.', before='LASTSPE' sxaddpar, fitsh, 'NFRAMES', speh.NumFrames, $ 'NumFrames:number of frames in file.', before='LASTSPE' sxaddpar, fitsh, 'MAXINTEN', speh.MaxIntensity, $ 'MaxIntensity:max intensity of data (future)', before='LASTSPE' sxaddpar, fitsh, 'MININTEN', speh.MinIntensity, $ 'MinIntensity:min intensity of data (future)', before='LASTSPE' sxaddpar, fitsh, 'YLABEL', speh.ylabel, $ 'ylabel:y axis label.', before='LASTSPE' sxaddpar, fitsh, 'SHUTTYPE', speh.ShutterType, $ 'ShutterType:shutter type.', before='LASTSPE' sxaddpar, fitsh, 'SHUTCOMP', speh.shutterComp, $ 'shutterComp:shutter compensation time.', before='LASTSPE' sxaddpar, fitsh, 'READMODE', speh.readoutMode, $ 'readoutMode:readout mode, full,kinetics, etc', before='LASTSPE' sxaddpar, fitsh, 'WINDSIZE', speh.WindowSize, $ 'WindowSize:window size for kinetics only.', before='LASTSPE' sxaddpar, fitsh, 'CLKSPD', speh.clkspd, $ 'clkspd:clock speed for kinetics & frame transfer', before='LASTSPE' sxaddpar, fitsh, 'INTETYPE', speh.interface_type, $ 'interface_type:computer interface', before='LASTSPE' sxaddpar, fitsh, '', $ ' (isa-taxi, pci, eisa, etc.)', before='LASTSPE' sxaddpar, fitsh, 'NROIEXP', speh.NumROIsInExperiment, $ 'NumROIsInExperiment:May be more than the 10 allowed', before='LASTSPE' sxaddpar, fitsh, '', $ ' in this header (if 0, assume 1)', before='LASTSPE' ; char Spare_5[16] 1490 sxaddpar, fitsh, 'CONTRNUM', speh.controllerNum, $ 'controllerNum:if multiple controller system will', before='LASTSPE' sxaddpar, fitsh, '', $ ' have controller number data came from.', before='LASTSPE' sxaddpar, fitsh, '', $ ' this is a future item. ', before='LASTSPE' sxaddpar, fitsh, 'SWMADE', speh.SWmade, $ 'SWmade:Which software package created this file', before='LASTSPE' sxaddpar, fitsh, 'NUMROI', speh.NumROI, $ 'NumROI:number of ROIs used. if 0 assume 1.', before='LASTSPE' sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='LASTSPE' sxaddpar, fitsh, 'COMMENT', $ ' START OF ROI STRUCTURES ', $ before='LASTSPE' sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='LASTSPE' for i = 0, 9 do begin s = strtrim(string(i+1),2) sxaddpar, fitsh, 'STARTX'+s, speh.ROIinfoblk[i].startx, $ 'startx:left x start value.', before='LASTSPE' sxaddpar, fitsh, 'ENDX'+s, speh.ROIinfoblk[i].endx, $ 'endx:right x value.', before='LASTSPE' sxaddpar, fitsh, 'GROUPX'+s, speh.ROIinfoblk[i].groupx, $ 'groupx:amount x is binned/grouped in hw..', before='LASTSPE' sxaddpar, fitsh, 'STARTY'+s, speh.ROIinfoblk[i].starty, $ 'starty:left y start value.', before='LASTSPE' sxaddpar, fitsh, 'ENDY'+s, speh.ROIinfoblk[i].endy, $ 'endy:right y value.', before='LASTSPE' sxaddpar, fitsh, 'GROUPY'+s, speh.ROIinfoblk[i].groupy, $ 'groupy:amount y is binned/grouped in hw..', before='LASTSPE' end sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='LASTSPE' sxaddpar, fitsh, 'COMMENT', $ ' END OF ROI STRUCTURES ', $ before='LASTSPE' sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='LASTSPE' sxaddpar, fitsh, 'FLATFIEL', speh.FlatField, $ 'FlatField:Flat field file name.', before='LASTSPE' sxaddpar, fitsh, 'BKGD', speh.background, $ 'background:background sub. file name.', before='LASTSPE' sxaddpar, fitsh, 'BLEMISH', speh.blemish, $ 'blemish:blemish file name.', before='LASTSPE' sxaddpar, fitsh, 'FILEHVER', speh.file_header_ver, $ 'file_header_ver:version of this file header', before='LASTSPE' ; char YT_Info[1000] 1996-2996 Reserved for YT information sxaddpar, fitsh, 'WINVI_ID', speh.WinView_id, $ 'WinView_id:== 0x01234567L if file created by WinX', before='LASTSPE' sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='LASTSPE' sxaddpar, fitsh, 'COMMENT', $ ' START OF X CALIBRATION STRUCTURE ', $ before='LASTSPE' sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='LASTSPE' sxaddpar, fitsh, 'XOFFSET', speh.XCALIBRATION.offset, $ 'offset:offset for absolute data scaling', before='LASTSPE' sxaddpar, fitsh, 'XFACTOR', speh.XCALIBRATION.factor, $ 'factor:factor for absolute data scaling', before='LASTSPE' sxaddpar, fitsh, 'XCURUNIT', uint(speh.XCALIBRATION.current_unit), $ 'current_unit:selected scaling unit', before='LASTSPE' sxaddpar, fitsh, 'XRESERV1', uint(speh.XCALIBRATION.calibreserved1), $ 'reserved1:reserved', before='LASTSPE' sxaddpar, fitsh, 'XSTRING', string(speh.XCALIBRATION.Display_String), $ 'string:special string for scaling', before='LASTSPE' sxaddpar, fitsh, 'XRESERV2', string(speh.XCALIBRATION.calibreserved2), $ 'reserved2:reserved', before='LASTSPE' sxaddpar, fitsh, 'XCALVALI', uint(speh.XCALIBRATION.calib_valid), $ 'calib_valid:flag if calibration is valid', before='LASTSPE' sxaddpar, fitsh, 'XINPUNIT', uint(speh.XCALIBRATION.input_unit), $ 'input_unit:current input units for calib_value', before='LASTSPE' sxaddpar, fitsh, 'XPOLUNIT', uint(speh.XCALIBRATION.polynounit), $ 'polynom_unit:linear UNIT and used ', before='LASTSPE' sxaddpar, fitsh, '', $ ' in the polynom_coeff', before='LASTSPE' sxaddpar, fitsh, 'XPOLORDE', uint(speh.XCALIBRATION.polynoorder), $ 'polynom_order:ORDER of calibration POLYNOM', before='LASTSPE' sxaddpar, fitsh, 'XCALCOUN', uint(speh.XCALIBRATION.calib_count), $ 'calib_count:valid calibration data pairs', before='LASTSPE' for i = 0, 9 do begin s = strtrim(string(i+1),2) sxaddpar, fitsh, 'XPOSI'+s, speh.XCALIBRATION.pixel_position[i], $ 'pixel_position:pixel pos. of calibration data', before='LASTSPE' sxaddpar, fitsh, 'XVALUE'+s, speh.XCALIBRATION.calib_value[i], $ 'calib_value:calibration VALUE at above pos', before='LASTSPE' end for i = 0, 5 do begin s = strtrim(string(i+1),2) sxaddpar, fitsh, 'XPOCOEF'+s, speh.XCALIBRATION.polynocoeff[i], $ 'polynom_coeff:polynom COEFFICIENTS', before='LASTSPE' endfor sxaddpar, fitsh, 'XLASERPO', speh.XCALIBRATION.laser_position, $ 'laser_position:laser wavenumber for relativ WN', before='LASTSPE' sxaddpar, fitsh, 'XRESERV3', uint(speh.XCALIBRATION.CalibReserved3), $ 'reserved3:reserved', before='LASTSPE' sxaddpar, fitsh, 'XNEWCAL', uint(speh.XCALIBRATION.leftover_flag), $ 'new_calib_flag:If set to 200, valid label below', before='LASTSPE' sxaddpar, fitsh, 'XCALLAB', string(speh.XCALIBRATION.user_label), $ 'calib_label:Calibration label (NULL terminated)', before='LASTSPE' ; char expansion[87] 3402 Calibration Expansion area sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='LASTSPE' sxaddpar, fitsh, 'COMMENT', $ ' END OF X CALIBRATION STRUCTURE ', $ before='LASTSPE' sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='LASTSPE' sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='LASTSPE' sxaddpar, fitsh, 'COMMENT', $ ' START OF Y CALIBRATION STRUCTURE ', $ before='LASTSPE' sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='LASTSPE' sxaddpar, fitsh, 'YOFFSET', speh.YCALIBRATION.offset, $ 'offset:offset for absolute data scaling', before='LASTSPE' sxaddpar, fitsh, 'YFACTOR', speh.YCALIBRATION.factor, $ 'factor:factor for absolute data scaling', before='LASTSPE' sxaddpar, fitsh, 'YCURUNIT', uint(speh.YCALIBRATION.current_unit), $ 'current_unit:selected scaling unit', before='LASTSPE' sxaddpar, fitsh, 'YRESERV1', uint(speh.YCALIBRATION.calibreserved1), $ 'reserved1:reserved', before='LASTSPE' sxaddpar, fitsh, 'YSTRING', string(speh.YCALIBRATION.Display_String), $ 'string:special string for scaling', before='LASTSPE' sxaddpar, fitsh, 'YRESERV2', string(speh.YCALIBRATION.calibreserved2), $ 'reserved2:reserved', before='LASTSPE' sxaddpar, fitsh, 'YCALVALI', uint(speh.YCALIBRATION.calib_valid), $ 'calib_valid:flag if calibration is valid', before='LASTSPE' sxaddpar, fitsh, 'YINPUNIT', uint(speh.YCALIBRATION.input_unit), $ 'input_unit:current input units for calib_value', before='LASTSPE' sxaddpar, fitsh, 'YPOLUNIT', uint(speh.YCALIBRATION.polynounit), $ 'polynom_unit:linear UNIT and used ', before='LASTSPE' sxaddpar, fitsh, '', $ ' in the polynom_coeff', before='LASTSPE' sxaddpar, fitsh, 'YPOLORDE', uint(speh.YCALIBRATION.polynoorder), $ 'polynom_order:ORDER of calibration POLYNOM', before='LASTSPE' sxaddpar, fitsh, 'YCALCOUN', uint(speh.YCALIBRATION.calib_count), $ 'calib_count:valid calibration data pairs', before='LASTSPE' for i = 0, 9 do begin s = strtrim(string(i+1),2) sxaddpar, fitsh, 'YPOSI'+s, speh.YCALIBRATION.pixel_position[i], $ 'pixel_position:pixel pos. of calibration data', before='LASTSPE' sxaddpar, fitsh, 'YVALUE'+s, speh.YCALIBRATION.calib_value[i], $ 'calib_value:calibration VALUE at above pos', before='LASTSPE' end for i = 0, 5 do begin s = strtrim(string(i+1),2) sxaddpar, fitsh, 'YPOCOEF'+s, speh.YCALIBRATION.polynocoeff[i], $ 'polynom_coeff:polynom COEFFICIENTS', before='LASTSPE' endfor sxaddpar, fitsh, 'YLASERPO', speh.YCALIBRATION.laser_position, $ 'laser_position:laser wavenumber for relativ WN', before='LASTSPE' sxaddpar, fitsh, 'YRESERV3', uint(speh.YCALIBRATION.CalibReserved3), $ 'reserved3:reserved', before='LASTSPE' sxaddpar, fitsh, 'YNEWCAL', uint(speh.YCALIBRATION.leftover_flag), $ 'new_calib_flag:If set to 200, valid label below', before='LASTSPE' sxaddpar, fitsh, 'YCALLAB', string(speh.YCALIBRATION.user_label), $ 'calib_label:Calibration label (NULL terminated)', before='LASTSPE' ; char expansion[87] 3402 Calibration Expansion area sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='LASTSPE' sxaddpar, fitsh, 'COMMENT', $ ' END OF X CALIBRATION STRUCTURE ', $ before='LASTSPE' sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='LASTSPE' sxaddpar, fitsh, speh.istring, $ 'Istring:special intensity scaling string', before='LASTSPE' ; char Spare_6[76] 4018 sxaddpar, fitsh, 'AVGAINUS', speh.AvGainUsed, $ 'AvGainUsed:avalanche gain was used', before='LASTSPE' sxaddpar, fitsh, 'AVGAIN', speh.AvGain, $ 'AvGain:avalanche gain value', before='LASTSPE' sxaddpar, fitsh, 'LASTVAL', speh.lastvalue, $ 'lastvalue:Always the LAST value in the header', before='LASTSPE' sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='END' sxaddpar, fitsh, 'COMMENT', 'END values from SPE header', $ before='END' sxaddpar, fitsh, 'COMMENT', '*******************************************', $ before='END' return, fitsh end