IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4020


Ignore:
Timestamp:
May 24, 2005, 7:20:52 AM (21 years ago)
Author:
eugene
Message:

working on images, non-flat structures, float[5][4]

Location:
trunk/Ohana/src/libautocode
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libautocode/def/image.d

    r4019 r4020  
    66# elements of the image structure
    77
    8 TYPE  coords,               COORDS,               Coords         astrometric data
    9 FIELD tzero,                TZERO,                e_time         readout time (row 0)
    10 FIELD nstar,                NSTAR,                unsigned int   number of stars on image
    11 FIELD secz,                 SECZ,                 short int      airmass,                   milliairmass
    12 FIELD NX,                   NX,                   short int      image width
    13 FIELD NY,                   NY,                   short int      image height
    14 FIELD apmifit,              APMIFIT,              short int      aperture correction,       millimag
    15 FIELD dapmifit,             DAPMIFIT,             short int      apmifit error,             millimag
    16 FIELD source,               SOURCE,               short int      identifier for CCD
    17 FIELD Mcal,                 MCAL,                 short int      millimag
    18 FIELD dMcal,                DMCAL,                short int      millimag
    19 FIELD Xm,                   XM,                   short int      10*log(image chi-square)
    20 FIELD name,                 NAME,                 char[32]       name of original image
    21 FIELD detection_limit,      DETECTION_LIMIT,      unsigned char  detection limit,           10*mag
    22 FIELD saturation_limit,     SATURATION_LIMIT,     unsigned char  saturation limit,          10*mag
    23 FIELD cerror,               CERROR,               unsigned char  astrometric error,         50*arcsec
    24 FIELD fwhm_x                FWHM_X                unsigned char  PSF x width,               25*arcsec
    25 FIELD fwhm_y,               FWHM_Y,               unsigned char  PSF y width,               25*arcsec
    26 FIELD trate,                TRATE,                unsigned char  scan rate,                 100 usec/pixel
    27 FIELD exptime,              EXPTIME,              float          exposure time,             seconds
    28 FIELD code,                 CODE,                 char           image quality flag
    29 FIELD ccdnum,               CCDNUM,               unsigned char  CCD ID number
    30 FIELD dummy,                DUMMY,                char[20]       unused
    31 FIELD order,                ORDER,                short int      Mrel 2D polynomical order
    32 FIELD Mx,                   MX,                   short int      Mrel polyterm
    33 FIELD My,                   MY,                   short int      Mrel polyterm
    34 FIELD Mxx                   MXX                   short int      Mrel polyterm
    35 FIELD Mxy                   MXY                   short int      Mrel polyterm
    36 FIELD Myy,                  MYY,                  short int      Mrel polyterm
    37 FIELD Mxxx                  MXXX                  short int      Mrel polyterm
    38 FIELD Mxxy                  MXXY                  short int      Mrel polyterm
    39 FIELD Mxyy                  MXYY                  short int      Mrel polyterm
    40 FIELD Myyy,                 MYYY,                 short int      Mrel polyterm
    41 FIELD Mxxxx                 MXXXX                 short int      Mrel polyterm
    42 FIELD Mxxxy                 MXXXY                 short int      Mrel polyterm
    43 FIELD Mxxyy                 MXXYY                 short int      Mrel polyterm
    44 FIELD Mxyyy                 MXYYY                 short int      Mrel polyterm
    45 FIELD Myyyy,                MYYYY,                short int      Mrel polyterm
     8SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
     9SUBFIELD  crval1,           CRVAL1,               double,        coordinate at reference pixel
     10SUBFIELD  crval2,           CRVAL2,               double,        coordinate at reference pixel
     11SUBFIELD  crpix1,           CRPIX1,               float,         coordinate of reference pixel
     12SUBFIELD  crpix2,           CRPIX2,               float,         coordinate of reference pixel
     13SUBFIELD  cdelt1,           CDELT1,               float,         degrees per pixel
     14SUBFIELD  cdelt2,           CDELT2,               float,         degrees per pixel
     15SUBFIELD  pc1_1,            PC1_1,                float,         rotation matrix
     16SUBFIELD  pc1_2,            PC1_2,                float,         rotation matrix
     17SUBFIELD  pc2_1,            PC2_1,                float,         rotation matrix
     18SUBFIELD  pc2_2,            PC2_2,                float,         rotation matrix
     19SUBFIELD  polyterms[7][2],  POLYTERMS[7][2],      float,         higher order warping terms
     20SUBFIELD  ctype[15],        CTYPE[15],            char,          coordinate type
     21SUBFIELD  Npolyterms,       NPOLYTERMS,           char,          order of polynomial
    4622
    47 TYPE  Coords
    48 FIELD crval1                CRVAL1                double   
    49 FIELD crval2                CRVAL2                double   
    50 FIELD crpix1                CRPIX1                float   
    51 FIELD crpix2                CRPIX2                float   
    52 FIELD cdelt1                CDELT1                float   
    53 FIELD cdelt2                CDELT2                float   
    54 FIELD pc1_1                 PC1_1                 float   
    55 FIELD pc1_2                 PC1_2                 float   
    56 FIELD pc2_1                 PC2_1                 float   
    57 FIELD pc2_2                 PC2_2                 float   
    58 FIELD polyterms[7][2]       POLYTERMS[7][2]       float   
    59 FIELD ctype[15]             CTYPE[15]             char     
    60 FIELD Npolyterms            NPOLYTERMS            char     
    61 END
     23FIELD     tzero,            TZERO,                e_time,         readout time (row 0)
     24FIELD     nstar,            NSTAR,                unsigned int,   number of stars on image
     25FIELD     secz,             SECZ,                 short int,      airmass,                   milliairmass
     26FIELD     NX,               NX,                   short int,      image width
     27FIELD     NY,               NY,                   short int,      image height
     28FIELD     apmifit,          APMIFIT,              short int,      aperture correction,       millimag
     29FIELD     dapmifit,         DAPMIFIT,             short int,      apmifit error,             millimag
     30FIELD     source,           SOURCE,               short int,      identifier for CCD,
     31FIELD     Mcal,             MCAL,                 short int,      calibration mag,           millimag
     32FIELD     dMcal,            DMCAL,                short int,      error on Mcal,             millimag
     33FIELD     Xm,               XM,                   short int,      image chisq,               10*log(value)
     34FIELD     name,             NAME,                 char[32],       name of original image
     35FIELD     detection_limit,  DETECTION_LIMIT,      unsigned char,  detection limit,           10*mag
     36FIELD     saturation_limit, SATURATION_LIMIT,     unsigned char,  saturation limit,          10*mag
     37FIELD     cerror,           CERROR,               unsigned char,  astrometric error,         50*arcsec
     38FIELD     fwhm_x,           FWHM_X,               unsigned char,  PSF x width,               25*arcsec
     39FIELD     fwhm_y,           FWHM_Y,               unsigned char,  PSF y width,               25*arcsec
     40FIELD     trate,            TRATE,                unsigned char,  scan rate,                 100 usec/pixel
     41FIELD     exptime,          EXPTIME,              float,          exposure time,             seconds
     42FIELD     code,             CODE,                 char,           image quality flag
     43FIELD     ccdnum,           CCDNUM,               unsigned char,  CCD ID number
     44FIELD     dummy,            DUMMY,                char[20],       unused
     45FIELD     order,            ORDER,                short int,      Mrel 2D polynomical order
     46FIELD     Mx,               MX,                   short int,      Mrel polyterm
     47FIELD     My,               MY,                   short int,      Mrel polyterm
     48FIELD     Mxx,              MXX,                  short int,      Mrel polyterm
     49FIELD     Mxy,              MXY,                  short int,      Mrel polyterm
     50FIELD     Myy,              MYY,                  short int,      Mrel polyterm
     51FIELD     Mxxx,             MXXX,                 short int,      Mrel polyterm
     52FIELD     Mxxy,             MXXY,                 short int,      Mrel polyterm
     53FIELD     Mxyy,             MXYY,                 short int,      Mrel polyterm
     54FIELD     Myyy,             MYYY,                 short int,      Mrel polyterm
     55FIELD     Mxxxx,            MXXXX,                short int,      Mrel polyterm
     56FIELD     Mxxxy,            MXXXY,                short int,      Mrel polyterm
     57FIELD     Mxxyy,            MXXYY,                short int,      Mrel polyterm
     58FIELD     Mxyyy,            MXYYY,                short int,      Mrel polyterm
     59FIELD     Myyyy,            MYYYY,                short int,      Mrel polyterm
     60
     61
     62
     63
  • trunk/Ohana/src/libautocode/generate

    r4019 r4020  
    11#!/usr/bin/env perl
    22
     3$VERBOSE = 0;
     4if ($ARGV[0] eq "-v") { $VERBOSE = 1; shift @ARGV; }
    35if (@ARGV != 3) { die "generate (schema) (template) (output)\n"; }
    46
     
    4042
    4143        # not a simple key/value entry
    42         if ($key eq "FIELD") {
     44        if (($key eq "FIELD") || ($key eq "SUBSTRUCT") || ($key eq "SUBFIELD")) {
    4345            ($element, $field, $format, $comment, $unit) = split (/,\s+/, $value, 5);
    44 #           print "$element : $field : $format : $comment : $unit\n";
     46            if ($VERBOSE) { printf "%-20s %-20s %-15s %-35s %-10s\n", $element, $field, $format, $comment, $unit; }
    4547            push @element, $element;
    4648            push @field,   $field;
     
    4850            push @comment, $comment;
    4951            push @unit,    $unit;
     52            push @mode,    $key;
    5053        }
    5154    }
     
    8992
    9093    for ($i = 0; $i < @field; $i++) {
     94        # skip SUBSTRUCT type of entries:
     95        if ($mode[$i] eq "SUBSTRUCT") { next; }
     96
     97        # need to handle all structures like: float poly[5][4]
    9198        # add [\d\.] to match ascii-type formats
    9299        ($type, $length) = $format[$i] =~ m|^(\w+)\[(\d+)\]|;
     
    122129
    123130    for ($i = 0; $i < @field; $i++) {
     131        # skip SUBSTRUCT type of entries:
     132        if ($mode[$i] eq "SUBSTRUCT") { next; }
     133
    124134        ($type, $length) = $format[$i] =~ m|^(\w+)\[([\d\.]+)\]|;
    125135        if (!$type && !$length) { die "format must be specified for ASCII table"; }
     
    147157    print FILE "typedef struct {\n";
    148158    for ($i = 0; $i < @element; $i++) {
     159        # skip SUBFIELD entries
     160        if ($mode[$i] eq "SUBFIELD") { next; }
     161
    149162        ($type, $length) = $format[$i] =~ m|^(\w+)\[([\d\.]+)\]|;
    150163        if (!$type && !$length) { $type = $format[$i]; }
     
    169182    $N = 0;
    170183    for ($i = 0; $i < @field; $i++) {
     184        # skip SUBSTRUCT type of entries:
     185        if ($mode[$i] eq "SUBSTRUCT") { next; }
     186
    171187        ($type, $length) = $format[$i] =~ m|^(\w+)\[([\d\.]+)\]|;
    172188        if (!$type && !$length) { $type = $format[$i]; }
     
    219235    $Nbytes = 0;
    220236    for ($i = 0; $i < @field; $i++) {
     237        # skip SUBSTRUCT type of entries:
     238        if ($mode[$i] eq "SUBSTRUCT") { next; }
    221239
    222240        # add [\d\.] to match ascii-type formats
     
    250268    $Nbytes = 0;
    251269    for ($i = 0; $i < @field; $i++) {
     270        # skip SUBSTRUCT type of entries:
     271        if ($mode[$i] eq "SUBSTRUCT") { next; }
     272
    252273        ($length) = $format[$i] =~ m|^\w+\[([\d\.]+)\]|;
    253274        if ($length == 0) { die "ASCII table format requires field size"; }
Note: See TracChangeset for help on using the changeset viewer.