IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 11, 2015, 2:14:39 PM (12 years ago)
Author:
eugene
Message:

merge changes from eam branch ipp-20140904

Location:
trunk/Ohana
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/libdvo/include/libdvo_astro.h

    r31635 r37807  
    1 #ifdef notdef
    2 # include "external.h"
    3 # include "shell.h"
    4 # include "dvomath.h"
    5 # include "convert.h"
    6 # include "display.h"
    7 # include "data.h"
    8 #endif
     1# ifndef LIBDVO_ASTRO_H
     2# define LIBDVO_ASTRO_H
    93
    10 # ifndef ASTRO_H
    11 # define ASTRO_H
     4typedef enum {
     5  COORD_NONE,
     6  COORD_CELESTIAL,
     7  COORD_GALACTIC, // based on Liu et al 2011
     8  COORD_ECLIPTIC,
     9  COORD_GALACTIC_REID_2004, // an older definition of the galactic plane
     10} CoordTransformSystem;
    1211
    13 void InitAstro (void);
    14 void FreeAstro (void);
     12typedef enum {
     13  PROJ_NONE, // undefined
     14  PROJ_ZEA, // zenithal
     15  PROJ_ZPL, // zenithal
     16  PROJ_ARC, // zenithal
     17  PROJ_STG, // zenithal
     18  PROJ_SIN, // zenithal
     19  PROJ_TAN, // zenithal
     20  PROJ_TNX, // zenithal
     21  PROJ_DIS, // zenithal (TAN + polyterms)
     22  PROJ_LIN, // cartesian
     23  PROJ_PLY, // cartesian (allow polyterms)
     24  PROJ_WRP, // cartesian (allow polyterms, require mosaic)
     25  PROJ_AIT, // pseudocyl
     26  PROJ_GLS, // pseudocyl
     27  PROJ_PAR, // pseudocyl
     28} OhanaProjection;
     29
     30typedef enum {
     31  PROJ_MODE_NONE,
     32  PROJ_MODE_CARTESIAN,
     33  PROJ_MODE_ZENITHAL,
     34  PROJ_MODE_PSEUDOCYL,
     35} OhanaProjectionMode;
    1536
    1637typedef struct {
     
    2950} CoordTransform;
    3051
    31 typedef enum {COORD_NONE, COORD_CELESTIAL, COORD_GALACTIC, COORD_ECLIPTIC} CoordTransformSystem;
     52typedef struct {
     53  int Nx;
     54  int Ny;
     55  float dX;
     56  float dY;
     57  float **dXv;
     58  float **dYv;
     59  unsigned int tableID;
     60  unsigned int imageID;
     61  int keep;
     62} AstromOffsetMap;
     63
     64typedef struct {
     65  int Nmap;
     66  AstromOffsetMap **map;
     67   int *imageIDtoTableSeq;
     68  int MaxImageID;
     69  int MaxTableID;
     70} AstromOffsetTable;
     71
     72/* Internal version of Coords (see CoordsDisk in libautocode/def/coords-disk.d) */
     73typedef struct Coords {
     74  double           crval1;               // coordinate at reference pixel
     75  double           crval2;               // coordinate at reference pixel
     76  float            crpix1;               // coordinate of reference pixel
     77  float            crpix2;               // coordinate of reference pixel
     78  float            cdelt1;               // degrees per pixel
     79  float            cdelt2;               // degrees per pixel
     80  float            pc1_1;                // rotation matrix
     81  float            pc1_2;                // rotation matrix
     82  float            pc2_1;                // rotation matrix
     83  float            pc2_2;                // rotation matrix
     84  float            polyterms[7][2];      // higher order warping terms
     85  char             ctype[15];            // coordinate type
     86  char             Npolyterms;           // order of polynomial
     87  struct Coords   *mosaic;               // pointer to parent mosaic
     88  AstromOffsetMap *offsetMap;            // pointer to offset map transformation
     89} Coords;
     90
     91typedef struct Image {
     92  Coords           coords;               // astrometric data
     93  e_time           tzero;                // readout time (row 0)
     94  unsigned int     nstar;                // number of stars on image
     95  float            secz;                 // airmass (mag)
     96  unsigned short   NX;                   // image width
     97  unsigned short   NY;                   // image height
     98  float            apmifit;              // aperture correction (mag)
     99  float            dapmifit;             // apmifit error (mag)
     100  float            Mcal;                 // calibration mag (mag)
     101  float            dMcal;                // error on Mcal (mag)
     102  short            Xm;                   // image chisq (10*log(value))
     103  short            photcode;             // identifier for CCD,
     104  float            exptime;              // exposure time (seconds)
     105  float            sidtime;              // sidereal time of exposure
     106  float            latitude;             // observatory latitude (degrees)
     107  float            RAo;                  // image center (degrees)
     108  float            DECo;                 // image center (degrees)
     109  float            Radius;               // image radius (degrees)
     110  float            refColorBlue;         // median astrometry ref color
     111  float            refColorRed;          // median astrometry ref color
     112  char             name[117];            // name of original image
     113  unsigned char    detection_limit;      // detection limit (10*mag)
     114  unsigned char    saturation_limit;     // saturation limit (10*mag)
     115  unsigned char    cerror;               // astrometric error (50*arcsec)
     116  unsigned char    fwhm_x;               // PSF x width (25*arcsec)
     117  unsigned char    fwhm_y;               // PSF y width (25*arcsec)
     118  unsigned char    trate;                // scan rate (100 usec/pixel)
     119  unsigned char    ccdnum;               // CCD ID number
     120  unsigned int     flags;                // image quality flags
     121  unsigned int     imageID;              // internal image ID
     122  unsigned int     parentID;             // associated ref image
     123  unsigned int     externID;             // external image ID
     124  unsigned short   sourceID;             // analysis source ID
     125  short            nLinkAstrom;          // mean number of matched measurements for astrometry
     126  short            nLinkPhotom;          // mean number of matched measurements for astrometry
     127  short            ubercalDist;          // distance to nearest ubercal image
     128  float            dXpixSys;             // systematic astrometry error in X
     129  float            dYpixSys;             // systematic astrometry error in Y
     130  float            dMagSys;              // systematic photometry error
     131  unsigned short   nFitAstrom;           // number of stars used for astrometry cal
     132  unsigned short   nFitPhotom;           // number of stars used for photometry cal
     133  unsigned int     photom_map_id;        // reference to 2D zero point map
     134  unsigned int     astrom_map_id;        // reference to 2D astrometry map
     135  struct Image    *parent;               // pointer to parent mosaic (not save to disk)
     136} Image;
    32137
    33138CoordTransform *InitTransform (CoordTransformSystem input, CoordTransformSystem output);
    34139int ApplyTransform (double *x, double *y, double X, double Y, CoordTransform *transform);
    35140
     141/* in coords.c */
     142void InitCoords (Coords *coords, char *projection);
     143void CopyCoords (Coords *tgt, Coords *src);
     144
     145int  XY_to_LM (double *L, double *M, double x,  double y,   Coords *coords);
     146int  LM_to_XY (double *x,  double *y,   double L, double M, Coords *coords);
     147int  RD_to_LM (double *L, double *M, double ra,  double dec,   Coords *coords);
     148int  LM_to_RD (double *ra, double *dec,   double L, double M, Coords *coords);
     149int  XY_to_RD (double *ra, double *dec, double x,  double y,   Coords *coords);
     150int  RD_to_XY (double *x,  double *y,   double ra, double dec, Coords *coords);
     151int  fXY_to_RD (float *ra, float *dec, double x,  double y,   Coords *coords);
     152int  fRD_to_XY (float *x,  float *y,   double ra, double dec, Coords *coords);
     153int  GetCoords (Coords *coords, Header *header);
     154int  PutCoords (Coords *coords, Header *header);
     155void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch);
     156OhanaProjection GetProjection (char *ctype);
     157int SetProjection (char *ctype, OhanaProjection proj);
     158OhanaProjectionMode GetProjectionMode (OhanaProjection proj);
     159
     160/* in AstromOffsetMapIO.c */
     161AstromOffsetTable *AstromOffsetMapLoad (char *filename, int VERBOSE);
     162int AstromOffsetMapSave (AstromOffsetTable *table, char *filename);
     163AstromOffsetTable *AstromOffsetMapToTable(AstromOffsetMap_Disk_6x6 *map_disk, off_t Nmap);
     164AstromOffsetMap_Disk_6x6 *AstromOffsetTableToMap(AstromOffsetTable *table, off_t *Nmap);
     165
     166/* in AstromOffsetMapOps.c */
     167float AstromOffsetMapValue (AstromOffsetMap *map, float x, float y, int xdir);
     168int AstromOffsetMapFit (AstromOffsetMap *map, float *x, float *y, float *f, int Npts, int xdir);
     169
     170/* in AstromOffsetMapUtils.c */
     171AstromOffsetMap *AstromOffsetMapInit (int Nx, int Ny);
     172void AstromOffsetMapFree (AstromOffsetMap *map);
     173
     174int AstromOffsetTableNewMap (AstromOffsetTable *table, int Nx, int Ny, Image *image);
     175int AstromOffsetTableMatchChips (Image *images, off_t Nimages, AstromOffsetTable *table);
     176AstromOffsetTable *AstromOffsetTableInit();
     177void AstromOffsetTableFree(AstromOffsetTable *table);
     178int AstromOffsetTableAddMapFromImage (AstromOffsetTable *table, Image *image);
     179void AstromOffsetMapPrint (AstromOffsetMap *map, char *filename);
     180int AstromOffsetMapRepair (AstromOffsetMap *map, int xdir);
     181AstromOffsetMap *AstromOffsetMapCopy (AstromOffsetMap *map);
     182void AstromOffsetMapCopyData (AstromOffsetMap *tgt, AstromOffsetMap *src);
     183void AstromOffsetMapSetOrder (AstromOffsetMap *map, int Nx, int Ny, Image *image);
     184
    36185# endif
Note: See TracChangeset for help on using the changeset viewer.