NICMOS ISR-00-005 The new NICMOS Exposure Time Calculator: Software and Installation A. Sivaramakrishnan, B. Simon, S. Holfeltz, H. Shukla and M. Sosey October 2, 2000 ABSTRACT This report describes the latest version of the NICMOS Imaging Exposure Time Calculator (ETC) from a software developer and instrument support point of view. This ETC uses STScI Calibration Data Base tables for instrument and telescope data, and STSDAS.SYNPHOT for its throughput engine. It uses a self-contained library to calculate thermal background due to telescope and instrument optics. We describe technical details of the software in case observers wish to extend the capabilities of the ETC. Introduction This is a companion ISR to NICMOS ISR 001-00 describing the use of the new NICMOS exposure time calculator maintained by STScI. We offer the source code to observers interested in modifying the ETC for their purposes. STScI cannot support such extension, but features developed outside can be incorporated into the STScI version of the NICMOS ETC, as is consistent with a bazaar style (http://www.ccil.org/~esr/writings/cathedral-paper.html) of software development where interested users can develop and improve the application. Exposure Time Calculators (ETCs) are used to estimate expected signal to noise ratios given a source brightness and size and an expected sky background. In the infrared, a knowledge of the thermal properties of the optics is also required. We describe the software architecture and required data files of the new NICMOS ETC which uses instrument throughput and data files maintained and updated by the Calibration Data Base System NICMOS ISR-00-005 (CDBS) at Space Telescope Science Institute (STScI). Earlier ETCs for HST’s NICMOS use independently maintained private data files. The STSDAS package SYNPHOT is the primary throughput calculator used in this ETC. All the code used is non-proprietary, and can be distributed and modified without concern about licensing issues. A self-contained library of modular thermal and optical transfer routines was written for this ETC. The NICMOS thermal model implemented in this library uses measured value of mirror emissivities and temperatures (Robberto et al. 2000). This library uses the CFITSIO library (Pence 1999) to read instrument calibration data files. A model of the zodiacal light at 45 degrees elevation is used to estimate sky background in the first release of this ETC. Other models (high or low elevations) can be added to the ETC. These models are stored on disk. A file describing the imaging modes is also stored on disk --- this is a holdover from earlier versions of STScI ETC software for other instruments, and is being removed as the NICMOS camera object in this ETC incorporates more of the camera parameters within it. The dark current is not obtained from the ‘mode’ file because it depends on detector temperature, for instance. It is obtained from a NIC_physical object (described later). This segregation is not yet complete. Point source signal is estimated in apertures of 1, 1 and 2 arc seconds diameter in cameras NIC 1, NIC 2 and NIC 3 cameras respectively. The point spread function (PSF) simulator Tiny Tim is used to simulate the PSF (Bushouse, 1997) in order to calculate the fraction of light falling in the standard aperture of the camera under consideration, as well as the fraction of light incident on the central pixel. COUNTRATE provides the pivot wavelength of the passband. This is parsed from the SYNPHOT call’s output for the source. PSF-related quantities are evaluated at this pivot wavelength. The necessary PSF data for this is hardwired in the NICMOS thermal and optical library. The ETC is compiled with gcc and run under the Solaris operating system. It requires IRAF and STSDAS to be accessible. It also required access to copies of CDBS data files pertaining to NICMOS and HST. Process Execution Thread and Software Architecture This ETC is derived from the STIS ETC (Hack et al., 1996, Simon, 1999). Much of the high level code preserves the basic structure of the antecedent code. The controlling executable is compiled from a C program that parses name-value pairs typical of an HTML post. That is, a web GUI interface can create the appropriate input file, and post the information to the ETC executable (a link in the web server’s cgi-bin directory which points to the actual executable file ETCHOME/bin/etc). Here and elsewhere we refer to the top level ETC directory as ETCHOME. The appendix A1 contains a sample posted input file. 2 NICMOS ISR-00-005 When run, this executable program then calls the STSDAS.SYNPHOT.COUNTRATE task with the appropriate parameters, and calculates the expected signal to noise ratio (SNR). Two calls to COUNTRATE are made by the ETC: one for the source and one for the sky background. Example parameter files are shown in Appendix A2. COUNTRATE is invoked from the executable by means of a popen()UNIX system call in the routine ETCHOME/src/runimaging.c. Parameters for the SYNPHOT task are written to a disk file in a world-writable directory (ETCHOME/stage, a link to a physical directory accessible to the web server), and COUNTRATE is pointed to this file for its parameters. In order for a working IRAF environment to be present for this call, the file zzsetenv.def must exist in the working directory of the SYNPHOT executable’s process (see Appendix A3). When called from a web browser, this working directory is usually the cgi-bin directory where the link to the ETC executable resides. The ETC can also be run from the command line using ASCII input which mimics the POST command from the web browser. The output of COUNTRATE is read through the pipe created by the call to popen(). Output to stdout from the ETC executable is normally HTML, and is driven by an externally defined output HTML file, ETCHOME/html/img_out.html. This enables the output to be displayed on the browser if the ETC is being run via the web. The manner in which an html file drives the output is not explained here, it is driven by the automatically created file html/img_out.html, which is generated from html/ img_out.inc. Development and Debugging Given this architecture, it is possible to capture the posted output of the web GUI and use that as an input file (argv[1])of the ETC executable itself, in order to run the ETC from the UNIX command line. This feature is used extensively during development, and can be useful for investigating large numbers of possible instrument configurations or targets. In order to capture the web post data, a freely distributable program ETCHOME/bin/postquery is called with the post data instead of the ETC executable. Switching between the real ETC and the web-post data capturing program is done with two scripts ETCHOME/ fake and ETCHOME/real --- these merely point the symbolic link in the cgi-bin directory of the web server to the ETC executable or the post-query executable. When ‘post-query’ is executed, the posted name-value pairs appear on the browser after the ‘submit calculation’ button is pressed, and this text can be captured into a file. The text must have trailing blanks removed in order to provide acceptable input to the ETC input parser. This input file is simple enough to be edited by hand to vary the submitted request. The camera, filter name, magnitude of source, and so on, can be changed this way. Error handling by the ETC (especially when run from the web browser) is minimal. Errors trapped within the ETC executable are typically reported via the output HTML form. Errors within the NICMOS thermal module are reported back to the executable 3 NICMOS ISR-00-005 using numerical error codes in the return values of the routines called. This is an area that could use improvement. Because incorrect HTML output by the ETC will cause the browser to fail to display the returned page, a compile switch -DDPRINTF is used when making prototype versions of the executable. This enables simple printf-style output to be produced (using a private dprintf() function) to facilitate development and command-line mode debugging. When this compile switch is not used, the printing to stdout from dprintf() is suppressed. The routine ETCHOME/src/dprintf.c implements this developer’s feature, and must therefore be touch‘ed to force its recompilation.The Makefile in the primary source code directory, ETCHOME/src/Makefile, contains sample compiler flag lines to enable or disable this feature. The HTML used to generate the web GUI and drive the ETC’s output resides in ETCHOME/html. The “.html” files there are automatically generated from the ‘*.inc’ and “.html.sav” files. This is an inherited feature from the STIS ETC code design. In order to change the GUI or the web output, one must edit these ‘.inc’ files, remove all existing html files, and re-run the Makefile (using make) in this html directory. The script mmk in ETCHOME/html does this for the developer. The thermal optics library At this time SYNPHOT does not handle thermal radiation by components of the optical relay. Each optic in the relay has an area, a temperature and an emissivity (which is usually the quantity with the greatest uncertainty). An optical invariant known as the etendue is used to calculate the background thermal count rate in each pixel. The reflectivities and emissivities of the optics in the relay must be known to the NICMOS thermal optics module. At the moment this duplicates some telescope- and instrument-specific information that also exists in the CDBS data base. For more information on these details see Sivaramakrishnan et al, 2000 NICMOS ISR 01-00 and Robberto et al. (2000). SYNPHOT’s CALCBAND task was used to create all possible ‘filter times DQE’ throughput tables. The IRAF CL script which performs this calculation is described in Appendix A4. These tables are read in from a file specified in the call to the public functions offered by this library, and the thermal background for the instrument is returned. These files usually reside in a ‘filter_dqe’ directory in the nicmos thermal library directory, to keep all the instrument-specific data within one directory. In the distribution described here a link is made to this directory in the general ETC data directory --- the directory name is passed as a parameter to the thermal library routine which calculates the background. The high level code obtains it from a #define in ETCHOME/src/config.h. The routine in the thermal library returns the thermal background (photons per second) in a pixel of a given camera, when using a given filter. 4 NICMOS ISR-00-005 NICMOS PSF-related quantities are hardwired into the source code of the thermal and optical library in a single file, ETCHOME/src/src_nicthermal/nic_physical.c. The telescope optical and thermal properties used to estimate telescope thermal background contributions are defined in the file ETCHOME/src/nic_thermal/hst_physical.c These are offered via two ‘public’ calls in the library ETCHOME/lib/libnic.a. Data files and models, and parameter and log files All data files need to be located in world readable directories in order to be accessed from an executable in the cgi-bin directory of a web server. The NICMOS ETC uses the following data files in the ETCHOME/data directory • img_modes.dat: ASCII file, columns are camera number (1, 2 or 3), dark current (e-/s per pixel), readnoise (standard deviation in e- for a double correlated read), pixel scale (arcseconds/pixel), radius in pixels of 80% encircled energy disc when the psf is centered on a pixel, and finally the gain in data numbers per electron. Note that NICMOS has a gain in electrons per photon of unity. The camera parameters should be input to the NIC_physical object loaded by the call to the load_nic_physical() in the nicmos thermal library. With that in mind, the img_modes file should cease to be used. This encapsulation of camera-specific input is in progress. • wavecat.dat: table of wavelengths used by SYNPHOT to calculate throughputs. • [high, avg, low]z.tab files are currently just pointers to a calculated Zodiacal light model found in the original NICMOS ETC fortran code (cf. the STIS ETC). When data are generated for these sources of background radiation the links can be replaced with files containing realistic estimates various zodiacal background levels. This means that earthshine is not considered in the estimation of signal to noise ratios. • Filter times DQE directory containing all possible filter and dqe throughputs. These are generated by the IRAF script “calcband.cl” in this directory. The directory is hardwired by the line #define QEFILTSUBDIR ”filt+dqe_11_aug_1988/” in the file ETCHOME/src/config.h. The directory name indicates the date of the most recent CDBS data file used to create the ‘filter + DQE’ throughput files. • cat_*.dat: file containing list of spectral templates in the same directory, and the spectral templates themselves in various *.dat or other SYNPHOT-compliant files • ETCHOME/stage is a world-writable directory where SYNPHOT’s ASCII parameter files are written by the executable before the calls to SYNPHOT are forked. A log of each run of the ETC is also written here. This directory needs periodic file purging. Source code directories In ETCHOME there are two source code directories: src and html. The html directory contains all the html files and makefiles needed to generate the GUI web interface. The src directory contains the ‘high level ETC code’ (in *.c and *.h files), as well as the NICMOS 5 NICMOS ISR-00-005 thermal library module (in the subdirectory src/src_nicthermal) and the CFITSIO library in src/src_cfitsio subdirectory. More detail on these is given in Appendix A5. All changes in the C code required to port the code to a new location are restricted to the first section of the ETCHOME/src/config.h file, and are clearly marked as local information. Changes in the web interface are restricted to the POST command in ETCHOME/ html/img_etc.inc file where a particular server might need to be specified Adding template spectra and classes of spectra A new spectral class of source or single spectrum can be added to the web interface by editing the file ETCHOME/html/img_etc.inc. To add a single source follow the examples in the html code there, being careful to distinguish between a character string presented in the web interface (e.g. “Gliese 229B”) and its corresponding value in the POST’ed output stream (e.g. “Gl229B”. To add a new class of sources, a new section must be added to the ETCHOME/html/ img_etc.inc file, but the C source code in the ETC must also be expanded. The file ETCHOME/src/dict.h will need a legal field added to the #define’d variable SPEC_TYPES, and the source code in ETCHOME/src/objectpars.c and ETCHOME/src/ setspecname.c will need revision. The ASCII file creating the mapping between the new class and the corresponding spectral data files will need to be created as well. For example, to add “Starburst Galaxies”, with a corresponding ‘sorigin’ value of “starburst” in the POST output stream of the web browser to the ETC executable, a field of ‘starburst’, the file dict.h will need to be modified as follows: #define SPEC_TYPES "user|model|cal|nonstellar|qso|synbb|synpl|syn- flat|starburst" and a key added to the list following this #define: #define SPEC_STARBURST 9 (its value is a sequential number in the sequence of allowed types) The appropriate code corresponding to the added type will need to be inserted in the case statement in objectpars.c and setspecname.c. In objectpars.c, the corresponding ‘safecopy’ call will specify “starburst” in its calling parameter list. A file ETCHOME/data/ cat_starburst will need to be created. In this file the particular offerings in the web page will be matched to SYNPHOT-compliant spectral data files present in ETCHOME/data. If the web page offered three choices of starburst spectral templates in the ETCHOME/html/ img_etc.inc file: <option value="20My starburst">20mystarburst <option value="50My starburst">50mystarburst <option value="500My starburst">500mystarburst then the file ETCHOME/data/cat_starburst could read 20mystarburstwfc3_starb_20myr.tab 50mystarburstwfc3_starb_50myr.tab 500mystarburstwfc3_cont_500myr.tab 6 NICMOS ISR-00-005 (where the right hand column entries are the names of the data files in the ETCHOME/ data directory). The HST and NICMOS objects The design of a generic HST (or other telescope) instrument software object can be improved upon: private data specific to the instrument can be hidden more thoroughly from higher level routines requesting information. The NICMOS thermal library also contains HST-specific code --- a separation of telescope and instrument is always somewhat arbitrary, since they are both part of the optical train. The current design offers the following routines to the higher level ETC code (these are only used in the routine ETCHOME/src/imgston()): int int int int int load_hst_physical(HST_physical *hst, char *fn); load_nic_physical(NIC_physical *nic, char *dirname); get_nic_physical(NIC_physical *nic, int key, void *val); set_nic_physical(NIC_physical *nic, int key, void *val); thermal_back_pixel_counts (HST_physical *hst, NIC_physical *nic, int inic, char *filter, double *back, double *lambdac, char *QExFilterdirname); int aperture_correction(int inic, double lambdac, double *apfrac); double central_pixfrac(int inic, char *filter); The initialization function load_hst_physical() currently uses hardwired telescope descriptions, though it is prototyped to accept a telescope descriptor file should it become useful in future. The filename argument is currently unused. The initialization function load_nic_physical takes a data directory name. The directory specified must contain the required NICMOS-specific data files that describe the behavior of the dark current with temperature. It also contains the subdirectory with throughput information for each filter-detector combination (which is used in the thermal background modeling of the instrument). The get_nic_physical() and set_nic_physical() take keys to indicate the various parameters they enable the higher level programs to access. The passed or returned data are in the ‘val’ variable. Examples of such data are the read noise, detector temperature, dark current, relative QE as a function of temperature and wavelength, presence or absence of the dark current bump, the saturation value of the electron count, and the NICMOS foreoptics temperature.The various keys are defined in ETCHOME/src/src_nicthermal/ include/nic_physical.h include file. This standard interface can obviously be extended to handle more camera parameters should they be needed for further instrument modeling. These functions are made use of extensively in the routine in ETCHOME/src/imgston.c. One obvious improvement in the applications programmer interface to the NICMOS thermal library would be to cast all the publicly used functions except the load function into the same get_nic_physical() and set_nic_physical mold(). The duplication of the CDBS instrument and telescope optical and thermal parameters in the thermal optics module should be removed in any new ETC/SYNPHOT development 7 NICMOS ISR-00-005 effort at the initial design stages. The current duplication of this information is a result of SYNPHOT not being able to calculate thermal contributions, combined with a need to make the NICMOS thermal library stand-alone and rapidly deployed. As a development aid as well as for use as API examples, many of the source code modules have embedded drivers exercising their functionality. These driver executables are made automatically by the Makefile in the NICMOS thermal library code, and can be run as independent, command-line stand-alone programs. Potential areas of improvement The addition of grism exposure time estimation as well as target acquisition capability would enhance the ETC software. No special arrangements are made for polarized light either: maximum and minimum throughputs of partially polarized light would enable the imaging ETC to deal with all non-coronagraphic imaging modes. At the moment this NICMOS ETC is purely for imaging (both point and extended sources). Coronagraphic observing is not addressed in this ETC. One area where the ETC can be improved is in the handling of errors that occur during associative list search failures. The context of any trapped error is missing from the error reporting at the moment. This makes debugging more difficult. Another area of potential improvement is the implementation of a graceful timing out of SYNPHOT.COUNTRATE calls forked by the ETC in case this forked process does not produce the desired output. These additions would improve both the development environment as well as the regular use of the ETC by observers. A final area of improvement would be an automated ‘distribution script’ that takes as its input the server’s html and cgi-bin directories where the ETC HTML and links in the cgibin directory exist, and the ETC root directory ETCHOME. Such an installation script would also need to know the location of the SYNPHOT executable, its associated CDBS files, and the location of a world-writable directory for COUNTRATE parameter files and ETC log files. The makefiles in the html and src were developed by three different developers, and could use unification into a make at the top level of the distribution. References H. Bushouse, stsdas$scidata NICMOS PSF files,1997 H. Bushouse, SYNPHOT User’s manual 1998 W. Hack, K. Sahu, E. Kinney, R. Bohlin, STIS ISR-020 1996 W. Pence, CFITSIO version 2.0.32, May 1999 B. Simon, private communication, 1999 C. J. Skinner, NICMOS ISR-014 1996 8 NICMOS ISR-00-005 A Sivaramakrishnan, S. Holfeltz, M. Sosey, B. Simon and M. Robberto, NICMOS ISR-00-001, 2000 Robberto, M., Sivaramakrishnan, A., Bacinski, J., Calzetti, D., Krist, J. E., MacKenty, J. M., Piquero, J., and Stiavelli, M. 2000, SPIE conference procedings, v4013 (Munich) Appendices A 1 Input stream or file This is a sample of the output stream from the browser which is the input stream to the ETC executable in the cgi-bin directory of the browser. Such an input file (without any trailing blanks before newline characters) can be used to run the ETC executable on the UNIX command line. dtemp = 61.5 detector = 2 nic1filt = f110w nic2filt = f110w nic3filt = blank simmode = exptime s_to_n = 10 time = 900 nreads = 1 usrfile = bpgsfile = O5 calfile = GD50 sorigin = nonstellar nonstellar = Gl229B zvalue = 1.00 bbtemp = 5500 plindex = -1 ftype = pmag punit = K pmag = 20.0 pflux = 1.5e-13 plambda = 20000 targsize = 1.128 eunit = h emag = 20 eflux = 1.5e-13 elambda = 20000 ebmvtype = gal1 ebv = 0.0 zodback = avgz earthback = avge dcbump = y A 2 zzsetenv.def environment setting IRAF file This file is the environment setter for command-line invocation of IRAF executables. See ETCHOME/zzsetenv.def for an example of the file. It is too long to include here. A copy of this must exist in the cgi-bin directory of the web server for the web GUI-invoked ETC 9 NICMOS ISR-00-005 to run COUNTRATE successfully. SYNPHOT uses information in this file to find its ‘graph’ and ‘component’ tables. See the SYNPHOT manual (Bushouse, 1998) for details. A local version of this file is located in the $iraf/unix/hlib directory. A 3 COUNTRATE PARS and COUNTRATE CALL The following example is from the development environment of the ETC. The source spectrum matches that of the cool brown dwarf Gliese 229b. The source magnitude is 18.5 in the J band. The exposure time required for an SNR of 10 using F110W in camera 1 is being calculated here. These files were generated in the development environment of the ETC. SYNPHOT requires the ‘aperture’ parameter, though it does not use it for NICMOS imaging. # Countrate source task parameters spectrum = /home/anands/rc/src/etc/nicmosc/data/gl229b.dat magnitude = "20.0 K" instrument = nicmos detector = 2 spec_elem = f110w aperture = " " cenwave = INDEF exptime = 1 reddening = 0.0 redlaw = gal1 output = none form = counts magform = vegamag wavecat = /home/anands/rc/src/etc/nicmosc/data/wavecat.dat refwave = INDEF verbose = yes area = 45238.93416 grtbl = mtab$*_tmg.fits cmptbl = mtab$*_tmc.fits Forked command for the source: usr/ra/stsdasx/bin/x_synphot.e countrate @/home/anands/rc/src/etc/nicmosc/stage/etc134070.dpr # Countrate background task parameters spectrum = /home/anands/rc/src/etc/nicmosc/data/gl229b.dat magnitude = "20.0 K" instrument = nicmos detector = 2 spec_elem = f110w aperture = " " cenwave = INDEF exptime = 1 reddening = 0.0 redlaw = gal1 output = none form = counts magform = vegamag wavecat = /home/anands/rc/src/etc/nicmosc/data/wavecat.dat refwave = INDEF verbose = yes area = 45238.93416 grtbl = mtab$*_tmg.fits cmptbl = mtab$*_tmc.fits 10 NICMOS ISR-00-005 Forked command for the background: /usr/ra/stsdasx/bin/x_synphot.e countrate @/home/anands/rc/src/etc/nicmosc/stage/etc539102.dpr A 4 CALCBAND.CL: CALCULATING FILTER * DQE TABLES The following calculations were performed on each detector-filter pair possible in NICMOS. STSDAS SYNPHOT’s CALCBAND is used for each filter * dqe calculation. A sample calculation is shown below: sy> calcband " crnicmoscomp$nic1_f110w_003.tab * \ crnimoscomp$nic1_dqe_004.tab" dqe1_f110w.fits A 5 INSTALLATION GUIDE 1. Unpack the tar.gzipped file available from http://www.stsci.edu/ftp/ software/nicmos/ETC.tar in an empty directory, which we call ETCHOME here (we will give all path names relative to this directory in this example). 2. Modify zzsetenv.def to reflect local CDBS directories and STSDAS and TABLES directories. Also specify where your CDBS reference directory is located. These locations are defined at the start of the file $iraf/unix/hlib/extern.pkg (where iraf is the environment variable that is set in order for IRAF to run on the local site). As an example, at STScI these values are: set stsdas set tables set crrefer = /usr/stsci/stsdasx/ = /usr/stsci/tables/ = "/data/cdbs1/" 3. Change the POST reference in the ETCHOME/html/img_etc.inc file. In the STScI installation it reads <FORM METHOD= "POST" ACTION="http://picard:8080/cgi-bin/stis_imgsim.cgi"> 4. In the ETCHOME/html directory create all the required html files by typing ./mmk 5. Make a world-read-writeable directory ETCHOME/stage so that the ETC executable can write temporary files. 6. Edit src/config.h to reflect local system configuration, making sure to retain the trailing slashes in the file names (the last two file names can be defined with or without trailing slashes). A local example is: #define #define #define #define #define #define #define STAGEDIR "/data/picard3/NICMOS/web/ETC/stage/" DATADIR "/data/picard3/NICMOS/web/ETC/data/" HTMLDIR "/data/picard3/NICMOS/web/ETC/html/" HTMLSUBDIR "data/" SDASBIN "/usr/ra/stsdasx/bin/" TABLESBIN "/usr/ra/tablesx/bin/" ETCBIN "/data/picard3/NICMOS/web/ETC/bin/" 11 NICMOS ISR-00-005 #define NIC_DATA_DIR "/data/picard3/NICMOS/web/ETC/data" #define NIC_QEF_SUBDIR "filt+dqe_11_aug_1988" 7. Make a world-read-writeable directory ETCHOME/stage so that the ETC executable can write temporary files. 8. Compile the CFITSIO library by running make in the ETCHOME/src/src_cfitsio directory. 9. Run make in the ETCHOME/src directory. This will compile the NICMOS thermal model library and the ETCHOME/bin/etc executable 10. Edit bin/ftp-auto-get to change the directory accessible to anonymous ftp: this is where user-supplied spectra will be placed before asking for exposure time estimates for such sources. Currently this reads: outside-access/in.coming 11. We assume that you will want links in your publicly served html and cgi directories to the physical NICMOS ETC html and cgi files. Set the environment variables describing your server’s html and cgi-bin directories, and your ETCHOME directory in the script setup_links.csh, and run it from the ETCHOME directory. You will need to have write permission in the server’s html and cgi-bin directories, where this script creates symbolic links to the executables and ETCHOME/html in your new installation. A 6 Common installation problems • Check the four links specified in setup_links.csh, and check the that the directory ETCHOME/stage is world-writable as well as world-readable. Make sure the ETCHOME/src/config.h file has trailing slashes in the local configuration file names (see section 6 of this appendix). IRAF requires this. • SYNPHOT: The most common problem is a missing zzsetenv.def file. The contents of this file depend to some extent on your IRAF/STSDAS/CDBS distribution. • Parameters for SYNPHOT: Problems finding the graph tables (grtbl) and component tables (cmptbl) “mtab$...” files: these are input parameters to the SYNPHOT calls. In ETCHOME/src/defaultpars.c the file templates specified for these files reflect a recent change to FITS files. If your version of CDBS contains ‘tab’ files (not FITS files) in the subdirectory comp/nicmos and comp/ota, you will need to modify the defaultpars.c routine. The older versions of the “grtbl” and “cmptbl” strings have been left in the code, they will need to replace the values used in the distributed version. A better solution would be to update yout CDBS data and use the distributed version of defaultpars.c source code. 12 NICMOS ISR-00-005 A 7 Brief tour of the development directory tree This section is intended for perusal by those interested in maintaining their own copies of the code, and (hopefully) improving the code or modifying it to suit their needs (e.g. adding grisms, polarization, target acquisition, coronagraphic modes). ETCHOME/ • real* script to interpose the real ETC exec at the other end of the cgi-bin symlink for real ETC calculations (cf fake*) • fake* script to interpose ’post-query’ executable instead of real ETC executable to capture POSTed output from browsers (cf real*) • stage -> symbolic link to World-writable directory for countrate parameters and ETC log files. • zzsetenv.def this file sets the required IRAF variables that is required by SYNPHOT execs that are forked by the ETC execution thread. When run from a browser this must reside in the cgi-bin directory. When run from the command line, this must reside in the working directory. ETCHOME/bin/ • etc* ETC executable • ftp-auto-get* used to get user-input spectrum from a well-known ftp site (advertised in user documentation of ETC) • post-query* capture POSTed output from browser and display on browser to assist development and debugging ETCHOME/data/ Directory with data files (names of spectral templates, lists of available templates for the html gui, subdirectories of throughput, and instrument data files. • avgz.tab -> zod_only_from_model symbolic link • cat_modelspec.dat list of Kurucz models. This file name is hardwired in html/img_etc.inc • cat_nonstellar.dat list of non-stellar spectral templates, pointing to files in the same directory. This ascii table name is hardwired in html/img_etc.inc 13 NICMOS ISR-00-005 • filt+dqe_11_aug_1988/ directory containing filter * dqe throughputs, for use by the nicmos thermal library, derived from files from CDBS. The latest CDBS file date is 11 Aug 1988. Highest version numbers are used. Directory name hardwired in ETCHOME/src/config.h file, passed as a parameter in nicmos thermal library call. • img_modes.dat almost vestigial file containing instrument parameters, being replaced incrementally by calls to get_nic_physical() and set_nic_physical() in the nicmos thermal library. • nic[123]_dark_temp.fits, nic[123]_dark_temp_nobump.fits dark current vs. temperature files • wavecat.dat table of wavelengths fed to synphot to use when calculating throughput. Can contain higher resolution around narrow-band filters. • zod_only_from_model data generated following C.J. Skinner’s zodiacal ’45 degree elevation average’. Source code in src/src_nicthermal as zodiac.c • calcband.cl IRAF CL script to generate files here: dqe1_f090m.fitsNIC 1 DQE * F090M filter transmission dqe1_f095n.fitsNIC 1 DQE * F095M filter transmission .... dqe3_g141.fitsNIC 3 DQE * Grism 141 transmission dqe3_g206.fitsNIC 3 DQE * Grism 206 transmission ETCHOME/dbg/ Directory containing a link to the executable and a sample input file ‘in’ corresponding to the example in appendix 1. Running the ETC from the command line is done as follows: stis_imgsim in Output is written to stdout. The file zzsetenv.def must be present in the working directory. ETCHOME/html/ • Makefile creates *.html from other files in the same directory • img_etc.inc principal input to web ETC GUI • img_out.inc driver for output to web GUI • mmk* cleans out old html and runs Makefile • template.html.sav template for regenerating html files 14 NICMOS ISR-00-005 ETCHOME/lib/ • etc.a high level C code library • libcfitsio.a CFITSIO library • libcnic.a NICMOS thermal optics library ETCHOME/src/ Location of ’high level’ C code for ETC; some key components are: • Makefile • C source files • config.h needs modification to reflect local system configuration • hst_physical.h -> ./src_nicthermal/include/hst_physical.h symlink to include file in NICMOS thermal library • imgston.c contains all calls to the nicmos thermal library • nic_physical.h -> ./src_nicthermal/include/nic_physical.h symlink to include file in nicmos thermal library • src_cfitsio/ W. Pence’s CFITSIO library source • src_nicthermal/ NICMOS thermal library source 15