geirs2Panic  Richard J. Mathar
Fits header keyword batch editor
 All Classes Files Functions Variables Macros Pages
Functions
geirs2Panic.cxx File Reference

The program geirs2Panic is a postprocessor for FITS mosaic files that have been generated by GEIRS. More...

#include "config.h"
#include <unistd.h>
#include "GeirsPanic.h"
Include dependency graph for geirs2Panic.cxx:

Functions

void usage (char *argv0, int gap, int chpsz, double north)
 Print a usage syntax message detailing the command line. More...
 
int main (int argc, char *argv[])
 The program is a postprocessor for FITS files of CAHA/PANIC that have been generated by GEIRS. More...
 

Detailed Description

The program geirs2Panic is a postprocessor for FITS mosaic files that have been generated by GEIRS.

Function Documentation

void usage ( char *  argv0,
int  gap,
int  chpsz,
double  north 
)

Print a usage syntax message detailing the command line.

Parameters
[in]argv0The name of the main program.
Since
2012-10-18
int main ( int  argc,
char *  argv[] 
)

The program is a postprocessor for FITS files of CAHA/PANIC that have been generated by GEIRS.

The main and mandatory arguments are an existing FITS file of the 2x2 mosaic in the glued representation as generated by GEIRS, and the name of a non-existing FITS file that will be generated by the program.

The program supports

  • insertion of a cross of undefined values in the mosaic, the definition of the North direction in the image and associated flip/rotation by multiples of 90 degrees to align that direction as good as possible with the up-direction in the image, plus insertion of the linear WCS scale transformation.
  • insertion of ALT, AZ and PARANG angles in the output header.
  • insertion of OBSGEO-X, OBSGEO-Y and OBSGEO-Z in the output header.

Note that in a field of view stretching across 1 deg, the atmospheric dispersion R = tan(z)*(n-1) (in radians) differs across the field by delta(R) = delta(z)/cos^2(z) *(n-1), where n-1=2e-4 is roughly the index of refraction at the mountain altitude of 2700 m. Since delta(z) is roughly 4000 pixels, the product of both factors amounts to roughly 1 pixel across the field, but that expected linear distortion is not yet included in the WCS keywords of the header in the output.

All of these tasks are actually covered by the instrument pipeline (Ibanez-Mengual et al, "The PANIC software system", SPIE 77402E, July 19 2012, doi:10.1117/12.856029) and do not need to be run on the mountain.

Parameters
[in]argcThe number of command line switches and arguments.
[in]argvThe vector of all command line arguments. The standard syntax is geirs2Panic [-c chipsz] [-g gapPx] [-A] [-t] [-f] [-N degr] [-v] fitsIn [fitsOut.fits] The options and their arguments are:
  • -c cipsz Sets the edge length of the single chip in the mosaic in units of pixels. This defines the regular distance at which gaps appear in the mosaic. The current default size is 2048. CAHA/LAICA users should set this to 4096.
  • -g gapPx This is the gap between any two chips in the mosaic, in units of pixels. There is a default which is some value of the literature, currently 167. CAHA/LAICA users should set this to 3207 (assuming a pixel scale of 0.225 arcsec/px and 2 times 100 arcsec overlap of the gap with the two adjacent chips).
  • -A Requests that the ALT, AZ and PARANG values are inserted into the header (or replaced if they exist). This uses standard spherical trigonometry and assumes that the latitude, hour angle and declination are all given in degrees in the FITS header. The latitude may either be TELLAT (preferred is the standard OBSGEO-B) and the other two are taken from HA and DEC in the FITS header.
  • -t Replaces the 4 pixels around each chip of the mosaic by the BLANK value. This is useful to avoid confusion of standard pipeline code that does not know how to interpret these engineering pixels.
  • -N degr Indicates that North is that many degrees in counter-clock-wise position from the horizontal axis in the input image. So a value near +90 would be about ideal. This has two implications: The WCS sky transformation will have the correct entries, and values more than 45 degrees away from 90 will trigger a rotation by multiples of 90 degrees on output.
  • -f Indicates that East is on the wrong side of North in the input data. This triggers that an additional flip (alongside any rotations) of the images is done for the output. Note that this is associated with a flip of North and additional changes of the WCS matrix.
  • -G Triggers that the OBSGEO-X OBSGEO-Y OBSGEO-Z triple is added to the header on output. This works only if the three TELLONG TELLAT and TELALT or their standard OBSGEO-B, OBSGEO-L and OBSGEO-H values with are provided in the standard units in the input header.
  • -v generates more comments on standard output about what the program is doing.
  • fitsIn is either (i) a single file with suffix .fits which contains either a full frame or a subwindow of the mosaic, or (ii) a basis name for a set of GEIRS window files without their _wini<code>.fits parts. Note that any of these windows may already stretch across more than one of the chips of the mosaic, because GEIRS uses windowing in that manner.
  • fitsOut.fits is an optional file name with suffix .fits to be chosen for the output file. If this final argument is absent, the program choses a file name which is the concatenation of the instrument name (keyword INSTRUME) and date, keyword DATE-OBS (preferred) or DATE.
Since
2012-10-23