geirs2Panic  Richard J. Mathar
Fits header keyword batch editor
 All Classes Files Functions Variables Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
GeirsPanic Class Reference

#include <GeirsPanic.h>

Collaboration diagram for GeirsPanic:
Collaboration graph

Public Member Functions

 GeirsPanic (char *fitsInname, const char *fitsOutname, int gap, int chpsz)
 
void exec (bool doTrim, bool doMimax, double north, bool doflip, bool doaltaz, bool doGeo, bool verbose, bool remov)
 Modify the FITS header and optionally rotate/flip the image. More...
 

Static Public Member Functions

static void wgs84 (const double lolatlat[3], double xyz[3])
 Convert geographic longitude, latitude and sea leavel to geocentric Cartesian coords. More...
 
static void altAzPar (double ha, double dec, double phi, double aap[3])
 Derive altitude (complementary zenith), azimuth and paralactic angle. More...
 
static double hex2deg (const string &hexstr, bool isdeg)
 Convert a sedecimal-String to degrees. More...
 

Public Attributes

string iname
 Name of the input file. More...
 
string oname
 Name of the output file. More...
 
WindowSet ws
 The set of subwindows. More...
 

Protected Attributes

FITS * ofits
 The FITS file that will be created. More...
 

Detailed Description

Since
2012-10-23
Author
Richard J. Mathar

Constructor & Destructor Documentation

GeirsPanic::GeirsPanic ( char *  fitsIname,
const char *  fitsOname,
int  gap,
int  chpsz 
)
Parameters
[in]fitsnameThe name of the FITS file to be read.
[in]fitstplThe name of the FITS file to be created. This may be the empty string ("") indicating that the file name is to be determined with a standard rule.
[in]gapThe gap between the chips of the mosaic in units of pixels.
[in]chpszThe edge length of the single chip in pixel units. This would be 2048 for Hawaii2 and Hawaii2-RG, or 1024 for Hawaii1.
Since
2012-10-23
Author
Richard J. Mathar

Member Function Documentation

void GeirsPanic::exec ( bool  doTrim,
bool  doMimax,
double  north,
bool  doflip,
bool  doaltaz,
bool  doGeo,
bool  verbose,
bool  remov 
)

Modify the FITS header and optionally rotate/flip the image.

Parameters
[in]doTrimIf true, remove (blanken) the 4 pixels at the edges of each detector.
[in]doMimaxIf true, write DATAMIN, DATAMAX, DATAMED etc to the header.
[in]gapThe size of the crossing gap (pixels) in the mosaic.
[in]chpszThe size of a single chip (pixels) of the mosaic.
[in]northThe direction angle of North in the current image (+90=up, +180 = left)
[in]doflipIf true, flip the image. The main idea is to trigger a swap of the Eastern side relative to North, if previously found to be wrong. There is of course an effect of this option on the direction of North in the final image, unless this was exactly +90 or -90.
[in]doaltazIf true, derive ALT, AZ and PARANG from latitude, HA and DEC. Warning: this will only produce correct values if the keywords HA, DEC and GEOPOS_L are degrees in the original header, or HA and DEC are given in hex-decimal colon-separated notation.
[in]doGeoIf true, add OBSGEO-[XYZ] to the keywords.
[in]verboseIf true, write more verbose output.
[in]removIf true, the initial file (or the initial file set if windowed) is removed on exit. This is always done if requested, and may lead to loss of data if anything is wrong with the new file that is created.
Since
2012-10-18
Todo:
Divert windows into header units instead inserting the gaps into the single image.
Author
Richard J. Mathar

If any keywords were changed or added, write a HISTORY line keeping track of the template file, and remove the CHECKSUM keyword if present.

void GeirsPanic::wgs84 ( const double  lolatalt[3],
double  xyz[3] 
)
static

Convert geographic longitude, latitude and sea leavel to geocentric Cartesian coords.

Parameters
[in]lolataltThe longitude (lambda, degrees), latitude (phi, degrees) and altitude (meters) of the site. The latitude is the topocentric one, not the geocentric one.
[out]xyzThe x, y and z coordinates in the Greenwhich centered coordinates (meters).
Since
2012-10-25
void GeirsPanic::altAzPar ( double  ha,
double  dec,
double  phi,
double  aap[3] 
)
static

Derive altitude (complementary zenith), azimuth and paralactic angle.

Note that this will fail (drastically) if any of the units in the original header for the hour angle (HA), declination (DEC) or latitude (OBSGEO-L) were not degrees.

Parameters
[in]haHour angle at the epoch (deg)
[in]decDeclination at the epoch (deg).
[in]phiObserver's latitude (deg).
[out]aapThe altitude (deg), azimuth (deg, South to West) and parallactic angle (deg)
Since
2012-10-25
double GeirsPanic::hex2deg ( const string &  hexstr,
bool  isdeg 
)
static

Convert a sedecimal-String to degrees.

Parameters
[in]hexstrA string with optional sign, integer number, colon, integer number, colon and integer or floating point number.
[in]isdegIf true, assume that the string is in DD:MM:SS.ss format. If false the string is in HH:MM:SS.ss format. This implies an additional factor 15 to move on to degrees. If the string contains a sign (plus or minus), this parameter is ignored and the function assumes degrees.
Returns
The value in degrees.
Since
2012-11-13

Member Data Documentation

string GeirsPanic::iname

Name of the input file.

This may also be the stem of the window set, without the _win*.fits.

string GeirsPanic::oname

Name of the output file.

WindowSet GeirsPanic::ws

The set of subwindows.

This may be a simple single full frame.

FITS* GeirsPanic::ofits
protected

The FITS file that will be created.