Changeset 4020
- Timestamp:
- May 24, 2005, 7:20:52 AM (21 years ago)
- Location:
- trunk/Ohana/src/libautocode
- Files:
-
- 2 edited
-
def/image.d (modified) (1 diff)
-
generate (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libautocode/def/image.d
r4019 r4020 6 6 # elements of the image structure 7 7 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 8 SUBSTRUCT coords, COORDS, Coords, astrometric data 9 SUBFIELD crval1, CRVAL1, double, coordinate at reference pixel 10 SUBFIELD crval2, CRVAL2, double, coordinate at reference pixel 11 SUBFIELD crpix1, CRPIX1, float, coordinate of reference pixel 12 SUBFIELD crpix2, CRPIX2, float, coordinate of reference pixel 13 SUBFIELD cdelt1, CDELT1, float, degrees per pixel 14 SUBFIELD cdelt2, CDELT2, float, degrees per pixel 15 SUBFIELD pc1_1, PC1_1, float, rotation matrix 16 SUBFIELD pc1_2, PC1_2, float, rotation matrix 17 SUBFIELD pc2_1, PC2_1, float, rotation matrix 18 SUBFIELD pc2_2, PC2_2, float, rotation matrix 19 SUBFIELD polyterms[7][2], POLYTERMS[7][2], float, higher order warping terms 20 SUBFIELD ctype[15], CTYPE[15], char, coordinate type 21 SUBFIELD Npolyterms, NPOLYTERMS, char, order of polynomial 46 22 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 23 FIELD tzero, TZERO, e_time, readout time (row 0) 24 FIELD nstar, NSTAR, unsigned int, number of stars on image 25 FIELD secz, SECZ, short int, airmass, milliairmass 26 FIELD NX, NX, short int, image width 27 FIELD NY, NY, short int, image height 28 FIELD apmifit, APMIFIT, short int, aperture correction, millimag 29 FIELD dapmifit, DAPMIFIT, short int, apmifit error, millimag 30 FIELD source, SOURCE, short int, identifier for CCD, 31 FIELD Mcal, MCAL, short int, calibration mag, millimag 32 FIELD dMcal, DMCAL, short int, error on Mcal, millimag 33 FIELD Xm, XM, short int, image chisq, 10*log(value) 34 FIELD name, NAME, char[32], name of original image 35 FIELD detection_limit, DETECTION_LIMIT, unsigned char, detection limit, 10*mag 36 FIELD saturation_limit, SATURATION_LIMIT, unsigned char, saturation limit, 10*mag 37 FIELD cerror, CERROR, unsigned char, astrometric error, 50*arcsec 38 FIELD fwhm_x, FWHM_X, unsigned char, PSF x width, 25*arcsec 39 FIELD fwhm_y, FWHM_Y, unsigned char, PSF y width, 25*arcsec 40 FIELD trate, TRATE, unsigned char, scan rate, 100 usec/pixel 41 FIELD exptime, EXPTIME, float, exposure time, seconds 42 FIELD code, CODE, char, image quality flag 43 FIELD ccdnum, CCDNUM, unsigned char, CCD ID number 44 FIELD dummy, DUMMY, char[20], unused 45 FIELD order, ORDER, short int, Mrel 2D polynomical order 46 FIELD Mx, MX, short int, Mrel polyterm 47 FIELD My, MY, short int, Mrel polyterm 48 FIELD Mxx, MXX, short int, Mrel polyterm 49 FIELD Mxy, MXY, short int, Mrel polyterm 50 FIELD Myy, MYY, short int, Mrel polyterm 51 FIELD Mxxx, MXXX, short int, Mrel polyterm 52 FIELD Mxxy, MXXY, short int, Mrel polyterm 53 FIELD Mxyy, MXYY, short int, Mrel polyterm 54 FIELD Myyy, MYYY, short int, Mrel polyterm 55 FIELD Mxxxx, MXXXX, short int, Mrel polyterm 56 FIELD Mxxxy, MXXXY, short int, Mrel polyterm 57 FIELD Mxxyy, MXXYY, short int, Mrel polyterm 58 FIELD Mxyyy, MXYYY, short int, Mrel polyterm 59 FIELD Myyyy, MYYYY, short int, Mrel polyterm 60 61 62 63 -
trunk/Ohana/src/libautocode/generate
r4019 r4020 1 1 #!/usr/bin/env perl 2 2 3 $VERBOSE = 0; 4 if ($ARGV[0] eq "-v") { $VERBOSE = 1; shift @ARGV; } 3 5 if (@ARGV != 3) { die "generate (schema) (template) (output)\n"; } 4 6 … … 40 42 41 43 # not a simple key/value entry 42 if ($key eq "FIELD") {44 if (($key eq "FIELD") || ($key eq "SUBSTRUCT") || ($key eq "SUBFIELD")) { 43 45 ($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; } 45 47 push @element, $element; 46 48 push @field, $field; … … 48 50 push @comment, $comment; 49 51 push @unit, $unit; 52 push @mode, $key; 50 53 } 51 54 } … … 89 92 90 93 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] 91 98 # add [\d\.] to match ascii-type formats 92 99 ($type, $length) = $format[$i] =~ m|^(\w+)\[(\d+)\]|; … … 122 129 123 130 for ($i = 0; $i < @field; $i++) { 131 # skip SUBSTRUCT type of entries: 132 if ($mode[$i] eq "SUBSTRUCT") { next; } 133 124 134 ($type, $length) = $format[$i] =~ m|^(\w+)\[([\d\.]+)\]|; 125 135 if (!$type && !$length) { die "format must be specified for ASCII table"; } … … 147 157 print FILE "typedef struct {\n"; 148 158 for ($i = 0; $i < @element; $i++) { 159 # skip SUBFIELD entries 160 if ($mode[$i] eq "SUBFIELD") { next; } 161 149 162 ($type, $length) = $format[$i] =~ m|^(\w+)\[([\d\.]+)\]|; 150 163 if (!$type && !$length) { $type = $format[$i]; } … … 169 182 $N = 0; 170 183 for ($i = 0; $i < @field; $i++) { 184 # skip SUBSTRUCT type of entries: 185 if ($mode[$i] eq "SUBSTRUCT") { next; } 186 171 187 ($type, $length) = $format[$i] =~ m|^(\w+)\[([\d\.]+)\]|; 172 188 if (!$type && !$length) { $type = $format[$i]; } … … 219 235 $Nbytes = 0; 220 236 for ($i = 0; $i < @field; $i++) { 237 # skip SUBSTRUCT type of entries: 238 if ($mode[$i] eq "SUBSTRUCT") { next; } 221 239 222 240 # add [\d\.] to match ascii-type formats … … 250 268 $Nbytes = 0; 251 269 for ($i = 0; $i < @field; $i++) { 270 # skip SUBSTRUCT type of entries: 271 if ($mode[$i] eq "SUBSTRUCT") { next; } 272 252 273 ($length) = $format[$i] =~ m|^\w+\[([\d\.]+)\]|; 253 274 if ($length == 0) { die "ASCII table format requires field size"; }
Note:
See TracChangeset
for help on using the changeset viewer.
