The scripts described here are intended primarily to be run in an automated way whenever new images are uploaded to the physics server. Each can also be run manually, either from the command line or from python.
Both these ways of invoking the script (from the command line or from python) is are wrappers around the python functions that do the real work. References to those functions, which provide more control over what you can do at the expense of taking more effort to understand, are provided below where appropriate.
The purpose of the header processing is to:
The three primary scripts are, in the order in which they are intended (though not required, necessarily) to run:
- generate a table summarizing properties of images in a directory. Each image is one row in the table and the columns are keywords from the FITS headers.
- create files with lists of images missing key information.
The workflow above works great when the images that come off the telescope contain pointing information (i.e. RA/Dec), filter information and the image type in the header matches the actual image type.
Manual intervention will be required in any of these circumstances:
The discussion below is deliberately broad. For some concrete examples see Manual header processing
Adding pointing information: There are a few options here:
- Use quick_add_keys_to_file to add the OBJECT keyword to the header, then add_ra_dec_from_object_name() to add pointing information, then run_astrometry to add astrometry to the images.
- Use quick_add_keys_to_file to add the OBJECT, RA, DEC, OBJCTRA and OBJCTDEC to the headers, then run_astrometry to add astrometry to the images. This route is not recommended because it is easy to use a format for RA/Dec that isn’t understood (or is misinterpreted) by the code that adds astrometry.
- Do blind astrometry to add pointing information, then use add_object_info() to add object names. There are no inherent with with this approach, though it may be simpler to add the astrometry then re-run the standard processing workflow to add any missing keywords than it is to manually use add_object_info()
Adding filter information: The hard part here is not adding the filter keyword, it is figuring out what filter was used when the image was taken. You are on your own in figuring out that piece. Once you know what the filter should be, use quick_add_keys_to_file to add the keyword FILTER to the relevant files.
Adding filter information: As with adding filter information, the hard part is figuring out what the image type should be. In practice most cases of this are light images misidentified as flat and vice versa and it ought to be easy to determine which of those an image is at a glance (arguably, if you can’t tell at a glance then the image is probably useful as neither a light nor a flat image). Once you know what the image type should be, use quick_add_keys_to_file to set the keyword IMAGETYP to the appropriate value in the relevant files. Allowed values for IMAGETYP are “BIAS”, “DARK”, “FLAT” or “LIGHT”.
Adding object information: Assuming pointing information is already in the header for the images that need object information this is fairly straightforward. One way to do it is to add the object to the master object list and run add_object_info() (or even just re-run run_patch, which will end up re-doing some of the keyword-patching work). Another way to approach is to use quick_add_keys_to_file to set the OBJECT keyword directly. Either way you are encouraged to upadte the master object list.
Some keywords are purged from the original headers because I don’t trust the values that MaxImDL v5 puts in:
OBJECT
JD
JD-HELIO
OBJCTALT
OBJCTAZ
OBJCTHA
AIRMASS
The keywords that are currently added/modified by patch_headers for all files are:
IMAGETYP: Type of image
LATITUDE: [degrees] Observatory latitude
LONGITUD: [degrees east] Observatory longitude
ALTITUDE: [meters] Observatory altitude
LST: Local Sidereal Time at start of observation
JD-OBS: Julian Date at start of observation
MJD-OBS: Modified Julian date at start of observation
OSCAN: True if image has overscan region
OSCANAX: Overscan axis, 1 is NAXIS1, 2 is NAXIS 2
OSCANST: Starting pixel of overscan region
The keywords that are currently added/modified by patch_header for light files only are:
RA: Approximate RA at EQUINOX
DEC: Approximate DEC at EQUINOX
OBJECT: Target of the observations
HA: Hour angle
AIRMASS: Airmass (Sec(Z)) at start of observation
ALT-OBJ: [degrees] Altitude of object, no refraction
AZ-OBJ: [degrees] Azimuth of object, no refraction