How to prepare and deliver IRFslast update of this page: 11.05.2005
Here I describe how to prepare a set of IRFs for delivery to the ISDC system.
- Assume you have a set of IRFs, with the IRF in the second extension of the fits files, keywords not set.
- I prepared four small scripts (you have to modify them; follow the instructions below) which you should copy into the directory, where you work on your IRFs: superchange.bat which is in principle only calling keywordchanger.bat for each file. Then mover.bat moves the files to the correct file names and keywordchangerGroup.bat fills the keywords of the IRF group.
- create a script similar to superchange.bat (e.g. by doing ls -1 *.irf.fits > superchange.bat and then putting a keywordchanger.bat in front of each line in superchange.bat)
- check the keyword values in keywordchanger.bat; especially the VSTART. If you use the same VERSION number as for the previous group, the VSTART has to be later in the new group (in order to make the automatic access work).
- make the scripts executable: chmod u+x *.bat
- run superchange.bat: superchange.bat
- now the files have to be renamed to the names they should have in
the ISDC system. Do a
to see what is the last file name. Create a script similar to mover.bat (e.g. by doing ls -1 *.irf.fits > mover.bat and then putting a cp in front and the destination file name in the end of each line).
- run mover.bat: mover.bat
- protect the fits files you have up to now:
chmod a-w spi_irf_rsp*.fits
- Now the IRF group has to be created. Assume that you want to
create the group with the name spi_irf_grp_0020.fits, then do the
dal_create obj_name="spi_irf_grp_0020.fits" template="SPI.-IRF.-GRP.tpl"
ls -1 spi_irf_rsp*.fits > dols.txt
edit dols.txt by adding a  at the end of each line (the DOL)
txt2idx index="irf.fits" template="SPI.-IRF.-RSP-IDX.tpl" element="dols.txt"
fappend infile="irf.fits" outfile="spi_irf_grp_0020.fits"
fparkey value=2 fitsfile=spi_irf_grp_0020.fits\ keyword=EXTVER
- Check the keyword values in keywordchangerGroup.bat. Especially the VSTART etc. keywords have to be consistent with the ones in the single IRF files.
- Apply keywordchangerGroup.bat: keywordchangerGroup.bat
This should finish with no erros and no warnings!
- dal_attach Parent="spi_irf_grp_0020.fits[GROUPING]" Child1="spi_irf_grp_0020.fits"
- Before you use the IRFs, make them write protected:
chmod a-w spi_irf*.fits
In case of questions and comments: contact me.