ISAP Reference Guide, V0.9 (29-Jul-96)

At Work

Index


Introduction

This document outlines the routines and demonstration scripts that form the basis for an IDL toolbox for post-reduction and scientific analysis of ISO LWS and SWS observations. The package is known as the ISO Spectral Analysis Package (ISAP). ISAP is the result of an extensive
collaboration between the LWS and SWS Instrument Dedicated Teams and associates.

General User Requirements

The basic user requirements for ISAP, including primarily a description of why the package is needed, can be found in the Introduction to the ISAP User's Guide .

Jargon (Definitions, Acronyms and Abbreviations)

Installation & Set-up (UNIX)

Put this in your .cshrc file:
alias  isap 'idl  /[path...]/isap_start.dat'
At IPAC, it is:
alias  isap 'idl  /iso/slws-dev/isap/v_2.0/isap_start.dat'

General Science Requirements

There are other spectral reduction packages available as part of existing astronomical data reduction aand analysis packages (e.g., IRAF, MIDAS). However, for compatibility with other software efforts within the ISO mission, particularly the Interactive Analysis packages, we have decided to supply a package written in IDL. The starting point for ISAP is the Auto Analysis Results (AARs) for LWS and SWS. Various calibration and auxiliary files, as well as models of continuum and line sources, observations from other telescopes such as IRAS and KAO can also be read into ISAP as either FITS or multi-column ASCII files.

The base routines in ISAP are callable from either a graphical user interface (GUI), from the IDL command line, or from IDL command procedures (scripts).

The user will need to be able to plot/overlay these results displaying error bars where appropriate, manipulate the data as well as fit models to it and write FITS and ASCII output files (possibly MCFITS TBD). The plotting routines will also write hardcopies (postscript files) of any data set where appropriate. A history file will either be written to an ASCII file and/or appended to the FITS header TBD. This will log any changes to a data set as well as recording the results from any line/model fitting.

On-line help is provided in the following formats: standard IDL help screens, HTML, and a hardcopy Reference Guide. All of these are derived from the headers of the original procedure code.

Data Input/Output

ISAP software reads LWS and SWS Auto Analysis Result (binary FITS) products and writes them into an IDL AAR structure. Various LWS/SWS calibration files and model and ground based spectra for cross-calibration and scientific interpretation can also be imported.

Input files may be either ASCII or FITS. Output is either ASCII or FITS. Data can also be read/written from the active IDL session (i.e outside of the GUI). A record of how data has been modified and the results from any analysis (e.g., line fitting) are kept using a history mechanism which records history in an ASCII history file and adds some history as comments in the FITS header. In addition, every ISAP routine writes the command line wich has been given interactively to call the routine into the history tag of the output structure, so that the AAR itself keeps a record of all steps by which it has been modified. Note that this history handling currently holds only for the interactive mode (e.g., not with the GUI).

All the data imported/manipulated/created/exported by SAP will be accessed by the common AAR structure. The memory is allocated and deallocated dynamically, when data are read into the system and each time an additional data set is created or destroyed.

The handling of LWS raster observations is TBD.


AAR FITS Files

SWS AAR FITS File

Field NumberFormatUnitDescription
SWAAWAVE1R*4micronWavelength of data point
SWAAFLUX1R*4JyFlux density of data point
SWAASTDV1R*4JyStandard Deviation
SWAATINT1I*4secTotal integration time
SWAADETN1I*4 Detector number
SWAAITK1I*4 SWS instrument time key
SWAAUTK1I*4 ISO uniform time key
SWAARPID2I*1 Raster point ID
SWAASPAR2I*1 Spare
SWAALINE1I*4 Line number
SWAASDIR1I*4 Scan direction
SWAASCNT1I*4 Scan number
SWAASTAT1I*4 Status word
SWAAFLAG1I*4 Flag word
SWS Insrument Data Users Manual, Issue 1.0 (SAI/95-221/Dc), K. Leech, ISO Science Operations, Vilspa, 24 November 1995.


LWS AAR FITS File

Field (Click for Details)Offset#BytesVariable TypeDescription
LSANUTK01I*4UTK time
LSANRPID42I*1Raster Point ID
LSANFILL61I*2Filler
LSANLINE81I*4Line Number
LSANDET121I*4Detector ID
LSANSDIR161I*4Scan Direction
LSANSCNT201I*4Scan Count
LSANWAV241R*4Wavelength
LSANWAVU281R*4Uncertainty in Wavelength
LSANFLX321R*4Flux on detector
LSANFLXU361R*4Uncertainty in flux
LSANSTAT401I*4Status word
REC LENGTH: 44
p99 ISO DATA Products Document (ISO-SSD-9111A JAN 1995)

LWS Calibration Files

Link to Steve's pages.

AAR Data Structures in IDL

All ISAP data is passed in a varient of the "AAR format". This allows SWS to used their current routines from the command line, and the GUI to construct AAR structures to call the same routines.

The ARR structure is defined in IDL as follows:

aar_def = {     type    : 'AAR',$               ; string
                history : '',$                  ; string
                header  : '',$                  ; string
                data    : data}                 ; data structure

where `data' is an array of structures, each array element defined as follows:
data_def = {    wave    :  0.0,$                ; wavelength
                flux    :  0.0,$                ; flux
                stdev   :  0.0,$                ; standard deviation
                tint    :  0L,$                 ; time interval
                det     :  0L,$                 ; detector
                itk     :  0L,$                 ; instrument time key
                utk     :  0L,$                 ; universal time key
                rpid    : bytarr(2),$           ; raster point id
                spare   : bytarr(2),$           ; spare
                line    :  0L,$                 ; line number
                sdir    :  0L,$                 ; scan direction
                scnt    :  0L,$                 ; scan count
                status  :  0L,$                 ; status word
                flag    :  0L}
The array of data would ideally be arranged in order of increasing wavelength by the pipeline. In case this is not the case, the ISAP sorting routine
sap_sort is planned.

To extract all data for detector 3, the following would be used:

idl>temp = where(aar.data.det eq 3,count)
idl>if count gt 0 then detector3_data = aar.data(temp)
(Note: this is only an example!)

SWS AAR

LWS AAR

YAAAR

A more generic, flexible IDL structure is also allowed for some ISAP routines. It may have one or more tags from the standard SAAR or LAAR missing, and it is refered to as `YAAAR' ("Yet Another AAR"). As long as the tags that are required and expected for a given routine are present, the code should act as expected.

The YAARR structure is defined in IDL as follows:

aar_def = {     type    : 'YAAAR',$             ; string
                history : '',$                  ; string
                header  : '',$                  ; string
                data    : data}                 ; data structure

where `data' is an array of structures, each array element defined as follows:
data_def = {    wave    :  0.0,$                ; wavelength
                flux    :  0.0,$                ; flux
                stdev   :  0.0,$                ; standard deviation
                  .
                  .
               (other tags optional)
                  .
                flag    :  0L}

Auxilary Files for SWS & LWS

Auxilary FileDescripionPage
APPHAperture pointing history37
IIPHInstrument instantaneous pointing history37
IRPHInstrument reference pointing history37
ORBITOrbital parameters file37
Pages refer to ISO DATA Products Document (ISO-SSD-9111A JAN 1995)

Version 1 Routines

The routines which form ISAP Version 1 are described in detail in the header of each program. A tabular summary with links to the header documentation is given here.

High Level Routines (for Users)

Data Input/Output
Task(Click for Details)DescriptionProgrammerStatus
ascii2yaaarImport ASCII table to IDL YAAAR structureP. Morris (SRON)?
sap_rfitsImport FITS AAR file to IDL AAR structureR. Narron (IPAC)?
sap_wfitsExport IDL AAR structure to FITS fileR. Narron (IPAC)?

Plotting
Task(Click for Details)DescriptionProgrammerStatus
disp_aarPlot an AAR in various modesI. Khan (IPAC)?

History
Task(Click for Details)DescriptionProgrammerStatus
sapInitialize ISAP history handlingE. Sturm (MPE)?
squitQuit ISAP history handlingE. Sturm (MPE)?
write2histWrite a comment into the history tagE. Sturm (MPE)?

Header
Task(Click for Details)DescriptionProgrammerStatus
get_hdrkeyRead a keyword value (and comment)E. Sturm (MPE)?
write_hdrkey(Over)Write a keyword value (and comment)E. Sturm (MPE)?

Scan Arithmetic
Task(Click for Details)DescriptionProgrammerStatus
arithmdel_2.0E. Sturm (MPE)?

Rebinning (Regridding, Resampling) and Combining (Merging) Scans
Task(Click for Details)DescriptionProgrammerStatus
glueJoin overlapping (mini-)spectra into a single spectrumR. Narron (IPAC)?
maskMask (mark) bad data pointsR. Narron (IPAC)?
normalNormalize a portion of a spectrumR. Narron (IPAC)?
sap_rebinRebin/Regrid/Resample an AAR on wavelengthI. Khan (IPAC)?
sap_shiftNormalize a scan to match a selected detectorR. Narron (IPAC)?
tippexReplace masked points with interpolated valuesR. Narron (IPAC)?

Conversion
Task(Click for Details)DescriptionProgrammerStatus
wave_formConvert wavelength unitsE. Sturm (MPE)?
spect_formConvert flux (density) unitsE. Sturm (MPE)?
vel_profConvert from wavelength to velocity spaceE. Sturm (MPE)?
wav_dopCorrect wavelengths for Doppler velocity shiftsE. Sturm (MPE)?

Modeling & Fitting
Task(Click for Details)DescriptionProgrammerStatus
deredDeredden a spectrum or line listD.Lutz/C. Wright (MPE)?
syn_photPerform synthetic photometryI. Khan (IPAC)?
zodiacalModel Zodiacal emission spectrumI. Khan (IPAC)?

Instrumental Corrections
Task(Click for Details)DescriptionProgrammerStatus
point2extSWS calibration conversion between point and extended sourcesE. Sturm/L. Haser (MPE)?
how_about_for_lws?Any LWS instrumental corrections available for ISAP?? (RAL)?

Filtering
Task(Click for Details)DescriptionProgrammerStatus
sm_airyAiry smoothingL. Verstraete (IAS, Orsay)?
sm_boxBoxcar smoothingL. Verstraete (IAS, Orsay)?
sm_gaussGaussian smoothingL. Verstraete (IAS, Orsay)?
sm_medianMedian filteringL. Verstraete (IAS, Orsay)?

GUI Bits
Task(Click for Details)DescriptionProgrammerStatus
isap_guiIDL script to load GUIM.Buckley/S.Unger(RAL)?


Low-Level Auxillary Subroutines (for Programmers)

Task(Click for Details)DescriptionProgrammerStatus
avgsigCompute weighted means, sigmas and dispersionsI. Khan (IPAC)?
band_2_detMap bands to detectorsE.Sturm(MPE)?
bin_structModify an AAR after rebinning (sap_rebin)I. Khan (IAPC)?
binsrchBinary search to find indexI. Khan (IAPC)?
chk_detCheck that detectors are presentE. Sturm (MPE)?
chk_tagCheck that tags are presentE. Sturm (MPE)?
chk_multixCheck for very close x values (prebinning)I. Khan (IPAC)?
chk_unitsCheck unitsE. Sturm (MPE)?
define_yaaarDefine IDL YAAAR structureP. Morris (SRON)?
dered_corrDereddening for a single data pointD. Lutz (MPE)?
dered_getextInterpolate extinction or TauD. Lutz (MPE)?
flux_conservInterpolate a spectrum while conserving fluxI. Khan (IPAC)?
get_unitGet units for tag(s)E. Sturm (MPE)?
inter_polPerform interpolation (sap_rebin)I. Khan (IPAC)?
is_structVerify structure type AAR, SPD, or LLIE. Sturm (MPE)?
kwd_notsetCheck that a keyword is set and of correct typeR. Narron (IPAC)?
integrate_flux?I. Khan (IPAC)??
make52Make a 52 element (det) array E. Sturm (MPE)?
make_detmaskMake mask from det and band switchesE. Sturm (MPE)?
makeyaaarheadMake IDL YAAAR headerP. Morris (SRON)?
plot_legendPlot a legend (disp_aar)I. Khan (IPAC)?
polyintPolynomial interpolation (sap_rebin)I. Khan (IPAC)?
read_filterImport ASCII filter curve into IDL YAAARI. Khan (IPAC)?
redo_hdrRe-do secondary FITS headerR. Narron (IPAC)?
sap_absPerform y = abs(x) on arraysE.Sturm/A.Fiedler (MPE)?
sap_addAdd spectrum+spectrum or spectrum+CE.Sturm/A.Fiedler (MPE)?
sap_divDivide spectrum/spectrum or spectrum/CE.Sturm/A.Fiedler (MPE)?
sap_expPerform y = exp(x) on arraysE.Sturm/A.Fiedler (MPE)?
sap_exp10Perform y = 10^x on arraysE.Sturm/A.Fiedler (MPE)?
sap_logPerform y = log_e(x) on arraysE.Sturm/A.Fiedler (MPE)?
sap_log10Perform y = log_10(x) on arraysE.Sturm/A.Fiedler (MPE)?
sap_maxMax(spec,spec) or Max(spec,C)E.Sturm/A.Fiedler (MPE)?
sap_meanMean(spec,spec)E.Sturm/A.Fiedler (MPE)?
sap_minMin(spec,spec) or Min(spec,C)E.Sturm/A.Fiedler (MPE)?
sap_multMultiply spec*spec or spec*CE.Sturm/A.Fiedler (MPE)?
sap_sqrtPerform y = sqrt(x) on arraysE.Sturm/A.Fiedler (MPE)?
sap_subSubtract spec-spec or spec-CE.Sturm/A.Fiedler (MPE)?
sap_ckunitsCheck that parameter is set and of correct typeR. Narron (IPAC)?
sap_errorHandle error messages (GUI, command line, script)R. Narron (IPAC)?
sap_keyword_setCheck that a keyword is setE. Sturm (MPE)?
scale_defineDefine new wavelength scale for rebinning(sap_rebin)I. Khan (IPAC)?
set_usersymSet user-defined symbols (disp_aar)A. Fiedler (MPE)?
symgenSymbol generation (disp_aar)A. Fiedler (MPE)?
add_history_stringAdd a string (comment) to the historyE. Sturm (MPE)?
update_historyUpdate history tag in (Y)AAR E. Sturm (MPE)?
write2histWrite a comment into the history tagE. Sturm (MPE)?
zodi_iso_emitCompute Zodiacal emission spectrum at SWS/LWS wavelengths (zodiacal)I. Khan (IPAC)?
zodi_iso_fluxCompute zodiacal flux for given T,lambda (zodi_iso_emit)I. Khan (IPAC)?
zodi_model(ra/dec)->(elon/elat); UTC->Julian date (zodiacal)I. Khan (IPAC)?


Demo (Test) Scripts

Demos/Tests for Individual Routines or Related Routines

Task(Click for Details)ResponsibleStatus
test_disp_aar.proMazz/IffatV1.0 works
test_sap_rebin.proMazz/IffatV1.0 works
test_merge.proSteve/BobV1.0 works
test_arithm.proEckhardV1.0 works
test_synphot.proSteve/Iffat/Pat Needed
test_zodi.proMazz/Iffat Needed
test_smooth.pro LV (IAS)V1.0 works


End-to-End Demos (Reduction Scripts)

Task(Click for Details)ResponsibleStatus
test_sws01.proEckhardOK
test_sws02.proMazzNeeded
test_sws07.proEckhard/Dieter?Needed
test_lws01.proSteve/SarahNeeded
test_lws02.proSarah/SteveNeeded
test_lws03.proSteve/SarahNeeded
test_lws04.proSarah/SteveNeeded


Planned Routines (Version 2+)

The planned routines which will form ISAP Versions 2 and later are described in the header of a shell routine for each program. A tabular summary with links to these documentats is given here.

Note that multifit has been integrated "as is" into IA3 for fitting and measuring lines. These routines are planned to be re-written for Version 2+.

Task(Click for Details)DescriptionProgrammerStatus
sap_subsetSubset an AAR or YAARTBDWish-list
sap_sortSort an AAR on wavelengthTBDWish-list
specfitLine and continuum fittingTBDWish-list
merge_slwsMerge/splice SWS & LWS spectraSteve/Mazz/Sarah/EckhardWish-list
whatelse?TBDTBDWish-list


References


Last update: 30-Jul-96, V0.9
mazz@ipac.caltech.edu
ISAP