IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37376


Ignore:
Timestamp:
Sep 8, 2014, 2:41:16 PM (12 years ago)
Author:
eugene
Message:

to support image maps and for better thread-safety, I am making Image and Coords internal-only structures and removing them from regular autocoding. I have put them in libautocode/include/common.h for now, but maybe they should go to libdvo/include/dvo.h

Location:
branches/eam_branches/ipp-20140904/Ohana/src/libautocode
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/Makefile.Targets

    r37034 r37376  
    11AOBJS = \
    2 $(ASRC)/coords.$(ARCH).o \
     2$(ASRC)/coords-disk.$(ARCH).o \
    33$(ASRC)/average.$(ARCH).o \
    44$(ASRC)/average-loneos.$(ARCH).o \
     
    5656$(ASRC)/photcode-ps1-v5.$(ARCH).o \
    5757$(ASRC)/photcode-ps1-ref.$(ARCH).o \
    58 $(ASRC)/image.$(ARCH).o \
    5958$(ASRC)/image-loneos.$(ARCH).o \
    6059$(ASRC)/image-elixir.$(ARCH).o \
     
    9897
    9998AINCS = \
    100 $(AINC)/coords.h \
     99$(AINC)/coords-disk.h \
    101100$(AINC)/average.h \
    102101$(AINC)/average-loneos.h \
     
    154153$(AINC)/photcode-ps1-v5.h \
    155154$(AINC)/photcode-ps1-ref.h \
    156 $(AINC)/image.h \
    157155$(AINC)/image-loneos.h \
    158156$(AINC)/image-elixir.h \
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/common.h

    r37034 r37376  
    3434# define DVO_IMAGE_NAME_LEN 117
    3535
     36typedef struct {
     37  int Nx;
     38  int Ny;
     39  float *value;
     40  float dX;
     41  float dY;
     42  float Xo;
     43  float Yo;
     44} ImageMap;
     45
     46/* Internal version of Coords (see CoordsDisk in libautocode/def/coords-disk.d) */
     47typedef struct Coords {
     48  double           crval1;               // coordinate at reference pixel
     49  double           crval2;               // coordinate at reference pixel
     50  float            crpix1;               // coordinate of reference pixel
     51  float            crpix2;               // coordinate of reference pixel
     52  float            cdelt1;               // degrees per pixel
     53  float            cdelt2;               // degrees per pixel
     54  float            pc1_1;                // rotation matrix
     55  float            pc1_2;                // rotation matrix
     56  float            pc2_1;                // rotation matrix
     57  float            pc2_2;                // rotation matrix
     58  float            polyterms[7][2];      // higher order warping terms
     59  char             ctype[15];            // coordinate type
     60  char             Npolyterms;           // order of polynomial
     61  struct Coords   *mosaic;               // pointer to parent mosaic
     62  ImageMap        *imageMap;             // pointer to image map transformation
     63} Coords;
     64
     65typedef struct Image {
     66  Coords           coords;               // astrometric data
     67  e_time           tzero;                // readout time (row 0)
     68  unsigned int     nstar;                // number of stars on image
     69  float            secz;                 // airmass (mag)
     70  unsigned short   NX;                   // image width
     71  unsigned short   NY;                   // image height
     72  float            apmifit;              // aperture correction (mag)
     73  float            dapmifit;             // apmifit error (mag)
     74  float            Mcal;                 // calibration mag (mag)
     75  float            dMcal;                // error on Mcal (mag)
     76  short            Xm;                   // image chisq (10*log(value))
     77  short            photcode;             // identifier for CCD,
     78  float            exptime;              // exposure time (seconds)
     79  float            sidtime;              // sidereal time of exposure
     80  float            latitude;             // observatory latitude (degrees)
     81  float            RAo;                  // image center (degrees)
     82  float            DECo;                 // image center (degrees)
     83  float            Radius;               // image radius (degrees)
     84  float            refColorBlue;         // median astrometry ref color
     85  float            refColorRed;          // median astrometry ref color
     86  char             name[117];            // name of original image
     87  unsigned char    detection_limit;      // detection limit (10*mag)
     88  unsigned char    saturation_limit;     // saturation limit (10*mag)
     89  unsigned char    cerror;               // astrometric error (50*arcsec)
     90  unsigned char    fwhm_x;               // PSF x width (25*arcsec)
     91  unsigned char    fwhm_y;               // PSF y width (25*arcsec)
     92  unsigned char    trate;                // scan rate (100 usec/pixel)
     93  unsigned char    ccdnum;               // CCD ID number
     94  unsigned int     flags;                // image quality flags
     95  unsigned int     imageID;              // internal image ID
     96  unsigned int     parentID;             // associated ref image
     97  unsigned int     externID;             // external image ID
     98  unsigned short   sourceID;             // analysis source ID
     99  short            nLinkAstrom;          // mean number of matched measurements for astrometry
     100  short            nLinkPhotom;          // mean number of matched measurements for astrometry
     101  short            ubercalDist;          // distance to nearest ubercal image
     102  float            dXpixSys;             // systematic astrometry error in X
     103  float            dYpixSys;             // systematic astrometry error in Y
     104  float            dMagSys;              // systematic photometry error
     105  unsigned short   nFitAstrom;           // number of stars used for astrometry cal
     106  unsigned short   nFitPhotom;           // number of stars used for photometry cal
     107  unsigned int     photom_map_id;        // reference to 2D zero point map
     108  unsigned int     astrom_map_id;        // reference to 2D astrometry map
     109  struct Image    *parent;               // pointer to parent mosaic (not save to disk)
     110} Image;
     111
    36112/*** rawshort is used to handle the broken pre-autocode photreg tables
    37113     fix the tables and remove this
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/coords.d

    r6454 r37376  
    1717FIELD  pc2_2,            PC2_2,                float,            rotation matrix
    1818FIELD  polyterms,        POLYTERMS,            float[7][2],      higher order warping terms
    19 FIELD  ctype,            CTYPE,                char[15],      coordinate type
     19FIELD  ctype,            CTYPE,                char[15],         coordinate type
    2020FIELD  Npolyterms,       NPOLYTERMS,           char,             order of polynomial
     21FIELD  astrom_map_id,    ASTROM_MAP_ID,        unsigned int,   reference to 2D astrometry map
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/image-elixir.d

    r30604 r37376  
    66# elements of the image structure
    77
    8 SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
     8SUBSTRUCT coords,           COORDS,               CoordsDisk,    astrometric data
    99SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
    1010SUBFIELD  crval2,           CRVAL2,               double,        coordinate at reference pixel
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/image-loneos.d

    r30604 r37376  
    66# elements of the image structure
    77
    8 SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
     8SUBSTRUCT coords,           COORDS,               CoordsDisk,    astrometric data
    99SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
    1010SUBFIELD  crval2,           CRVAL2,               double,        coordinate at reference pixel
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/image-panstarrs-dev-0.d

    r30604 r37376  
    77# elements of the image structure
    88
    9 SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
     9SUBSTRUCT coords,           COORDS,               CoordsDisk,    astrometric data
    1010SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
    1111SUBFIELD  crval2,           CRVAL2,               double,        coordinate at reference pixel
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/image-panstarrs-dev-1.d

    r30604 r37376  
    77# elements of the image structure
    88
    9 SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
     9SUBSTRUCT coords,           COORDS,               CoordsDisk,    astrometric data
    1010SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
    1111SUBFIELD  crval2,           CRVAL2,               double,        coordinate at reference pixel
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/image-ps1-dev-1.d

    r30604 r37376  
    77# elements of the image structure
    88
    9 SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
     9SUBSTRUCT coords,           COORDS,               CoordsDisk,    astrometric data
    1010SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
    1111SUBFIELD  crval2,           CRVAL2,               double,        coordinate at reference pixel
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/image-ps1-dev-2.d

    r30604 r37376  
    77# elements of the image structure
    88
    9 SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
     9SUBSTRUCT coords,           COORDS,               CoordsDisk,    astrometric data
    1010SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
    1111SUBFIELD  crval2,           CRVAL2,               double,        coordinate at reference pixel
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/image-ps1-dev-3.d

    r30604 r37376  
    77# elements of the image structure
    88
    9 SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
     9SUBSTRUCT coords,           COORDS,               CoordsDisk,    astrometric data
    1010SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
    1111SUBFIELD  crval2,           CRVAL2,               double,        coordinate at reference pixel
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/image-ps1-ref.d

    r30604 r37376  
    77# elements of the image structure
    88
    9 SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
     9SUBSTRUCT coords,           COORDS,               CoordsDisk,    astrometric data
    1010SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
    1111SUBFIELD  crval2,           CRVAL2,               double,        coordinate at reference pixel
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/image-ps1-v1.d

    r30604 r37376  
    77# elements of the image structure
    88
    9 SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
     9SUBSTRUCT coords,           COORDS,               CoordsDisk,    astrometric data
    1010SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
    1111SUBFIELD  crval2,           CRVAL2,               double,        coordinate at reference pixel
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/image-ps1-v2.d

    r36833 r37376  
    77# elements of the image structure
    88
    9 SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
     9SUBSTRUCT coords,           COORDS,               CoordsDisk,    astrometric data
    1010SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
    1111SUBFIELD  crval2,           CRVAL2,               double,        coordinate at reference pixel
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/image-ps1-v3.d

    r36833 r37376  
    77# elements of the image structure
    88
    9 SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
     9SUBSTRUCT coords,           COORDS,               CoordsDisk,    astrometric data
    1010SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
    1111SUBFIELD  crval2,           CRVAL2,               double,        coordinate at reference pixel
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/image-ps1-v4.d

    r36833 r37376  
    77# elements of the image structure
    88
    9 SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
     9SUBSTRUCT coords,           COORDS,               CoordsDisk,    astrometric data
    1010SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
    1111SUBFIELD  crval2,           CRVAL2,               double,        coordinate at reference pixel
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/image-ps1-v5.d

    r37034 r37376  
    88# careful of 8-byte boundaries
    99
    10 SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
     10SUBSTRUCT coords,           COORDS,               CoordsDisk,    astrometric data
    1111SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
    1212SUBFIELD  crval2,           CRVAL2,               double,        coordinate at reference pixel
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/image.d

    r37034 r37376  
    22EXTNAME      DVO_IMAGE
    33TYPE         BINTABLE
    4 SIZE         360
     4SIZE         384
    55DESCRIPTION  DVO Image Table
    66
     
    88# careful of 8-byte boundaries
    99
     10# Coords is an internal structure defined in def/common.h
    1011SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
    1112SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
     
    2223SUBFIELD  ctype,            CTYPE,                char[15],      coordinate type
    2324SUBFIELD  Npolyterms,       NPOLYTERMS,           char,          order of polynomial
    24 # 120 bytes
     25SUBFIELD  mosaic,           MOSAIC,               e_void,        pointer to parent mosaic
     26SUBFIELD  imageMap,         IMAGE_MAP,            e_void,        pointer to image map
     27# 136 bytes
    2528
    2629# change this to a double?
     
    7679FIELD     photom_map_id,    PHOTOM_MAP_ID,        unsigned int,   reference to 2D zero point map
    7780FIELD     astrom_map_id,    ASTROM_MAP_ID,        unsigned int,   reference to 2D astrometry map
     81
     82FIELD    *parent,           PARENT,               e_void,         pointer to parent mosaic (not save to disk)
    7883# nFitPhotom lands on the old location of Mxxxx, which was used to mean nFitPhotom in some cases
    7984
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/doc/autocode.txt

    r21508 r37376  
    3535
    3636- the element name
     37- the element FITS field (in FITS table)
    3738- the element data type
    3839- the element description
    3940- the element physical unit
     41
     42SUBFIELD / SUBSTRUCT keywords allows the user to define elements of a
     43structure which are themselves structures.  These fields are used as
     44follow:
     45
     46Binary / ASCII FITS tables write out the SUBFIELD entries as if they
     47were regular table rows (substructure distinction not visible in FITS
     48table).  SUBSTRUCT rows are NOT added to the FITS table.
     49
     50In a C-structure, the SUBFIELD rows are skipped and only the SUBSTRUCT
     51row is saved.  The definition of the substructure is assumed to be
     52defined elsewhere in the C code.
    4053
    4154Template File
     
    4356The template file is a source code in whatever language is desired.
    4457Within the template, the defined keywords may be used as desired,
    45 wherever needed.  In addition, there are special directives which
    46 invoke additional special behavior.  All special directives have the
    47 form of comments within their target language.  They are replaced with
    48 a block of code in that target language, normally one which iterates
    49 over the FIELD elements of the schema file.  As such, the directive
    50 appropriate for one language should not be used within code for a
    51 different language.  Here is a list of existing special directives:
     58wherever needed. 
     59
     60In addition, there are special directives which invoke additional
     61special behavior.  All special directives have the form of comments
     62within their target language.  They are replaced with a block of code
     63in that target language, normally one which iterates over the FIELD
     64elements of the schema file.  As such, the directive appropriate for
     65one language should not be used within code for a different language.
     66Here is a list of existing special directives:
    5267
    5368/** STRUCT DEFINITION **/
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/generate

    r26384 r37376  
    144144        if ($type eq "e_time")        { $pt1 = "J"; }
    145145        if ($type eq "e_void")        { $pt1 = "B"; $Np = 8*$Np; }
     146        # if ($type eq "Image")               { $pt1 = "B"; $Np = 8*$Np; }
    146147        # e_void is a 64 bit pointer, cast to size_t.  its value is not loaded
    147148        # from the table.
     
    248249        if ($type eq "e_time")        { $pt1 = sprintf "I%s", $length; }
    249250        if ($type eq "e_void")        { $pt1 = sprintf "I%s", $length; }
     251        # if ($type eq "Image")               { $pt1 = sprintf "I%s", $length; }
    250252
    251253        if (!$pt1) { die "unknown type $type"; }
     
    331333        if ($type eq "e_time")        { $T = "WORD"; $n = 4; }
    332334        if ($type eq "e_void")        { $T = "DBLE"; $n = 8; }
     335        # if ($type eq "Image")               { $T = "DBLE"; $n = 8; }
    333336
    334337        if (!$n) { die "unknown type $type"; }
     
    375378        if ($type eq "e_time")         { $Nbytes += 4*$Np; $valid = 1; }
    376379        if ($type eq "e_void")         { $Nbytes += 8*$Np; $valid = 1; }
     380        # if ($type eq "Image")                { $Nbytes += 8*$Np; $valid = 1; }
    377381        if (!$valid) { die "unknown type $type"; }
    378382    }
Note: See TracChangeset for help on using the changeset viewer.