IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 16, 2009, 11:33:52 AM (17 years ago)
Author:
eugene
Message:

merge changes from eam_branch_20090208: add PS1_V1 formats; rename average.code to flags, image.code to flags; some opihi function name clarification; drop Stars as autocode struct; rework addstar to isolate input -> Measure conversions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libautocode/generate

    r7080 r21508  
    114114       
    115115        # rawshort is a short without byteswapping
     116        # rawshort is a patch for old photreg tables
    116117
    117118        $pt1 = 0;
     
    124125        if ($type eq "int")           { $pt1 = "J"; }
    125126        if ($type eq "unsigned int")  { $pt1 = "J"; }
    126         if ($type eq "e_time")        { $pt1 = "J"; }
     127
     128        if ($type eq "int8_t")        { $pt1 = "B"; }
     129        if ($type eq "uint8_t")       { $pt1 = "B"; }
     130        if ($type eq "int16_t")       { $pt1 = "I"; }
     131        if ($type eq "uint16_t")      { $pt1 = "I"; }
     132        if ($type eq "int32_t")       { $pt1 = "J"; }
     133        if ($type eq "uint32_t")      { $pt1 = "J"; }
     134
     135        # FITS tables do not allow for 64bit integers.  we need to
     136        # write these by splitting the value into high and low 32 bit values
     137        if ($type eq "int64_t")       { $pt1 = "J"; $Np = 2*$Np; }
     138        if ($type eq "uint64_t")      { $pt1 = "J"; $Np = 2*$Np; }
     139
    127140        if ($type eq "float")         { $pt1 = "E"; }
    128141        if ($type eq "double")        { $pt1 = "D"; }
    129142
     143        # special 'elixir' types:
     144        if ($type eq "e_time")        { $pt1 = "J"; }
    130145        if ($type eq "e_void")        { $pt1 = "B"; $Np = 8*$Np; }
    131146        # e_void is a 64 bit pointer, cast to size_t.  its value is not loaded
     
    146161        printf FILE "%-20s 1.0, 0.0);\n", "\"$unit[$i]\", ";
    147162    }
    148 
    149163}
    150164
     
    217231        if ($type eq "int")           { $pt1 = sprintf "I%s", $length; }
    218232        if ($type eq "unsigned int")  { $pt1 = sprintf "I%s", $length; }
    219         if ($type eq "e_time")        { $pt1 = sprintf "I%s", $length; }
     233
     234        if ($type eq "int8_t")        { $pt1 = sprintf "I%s", $length; }
     235        if ($type eq "uint8_t")       { $pt1 = sprintf "I%s", $length; }
     236        if ($type eq "int16_t")       { $pt1 = sprintf "I%s", $length; }
     237        if ($type eq "uint16_t")      { $pt1 = sprintf "I%s", $length; }
     238        if ($type eq "int32_t")       { $pt1 = sprintf "I%s", $length; }
     239        if ($type eq "uint32_t")      { $pt1 = sprintf "I%s", $length; }
     240
     241        # FITS tables do not allow for 64bit integers.  we need to
     242        # write these by splitting the value into high and low 32 bit values
     243        if ($type eq "int64_t")       { $pt1 = sprintf "I%s", $length; }
     244        if ($type eq "uint64_t")      { $pt1 = sprintf "I%s", $length; }
     245
    220246        if ($type eq "float")         { $pt1 = sprintf "F%s", $length; }
    221247        if ($type eq "double")        { $pt1 = sprintf "F%s", $length; }
    222248
     249        # special 'elixir' types:
     250        if ($type eq "e_time")        { $pt1 = sprintf "I%s", $length; }
    223251        if ($type eq "e_void")        { $pt1 = sprintf "I%s", $length; }
    224252
     
    283311        if ($type eq "unsigned char") { $N +=   $Np; next; }
    284312        if ($type eq "rawshort")      { $N += 2*$Np; next; }
     313
    285314        if ($type eq "short")         { $T = "BYTE"; $n = 2; }
    286315        if ($type eq "unsigned short"){ $T = "BYTE"; $n = 2; }
    287316        if ($type eq "int")           { $T = "WORD"; $n = 4; }
    288317        if ($type eq "unsigned int")  { $T = "WORD"; $n = 4; }
     318
     319        if ($type eq "int8_t")        { $N +=   $Np; next; }
     320        if ($type eq "uint8_t")       { $N +=   $Np; next; }
     321        if ($type eq "int16_t")       { $T = "BYTE"; $n = 2; }
     322        if ($type eq "uint16_t")      { $T = "BYTE"; $n = 2; }
     323        if ($type eq "int32_t")       { $T = "WORD"; $n = 4; }
     324        if ($type eq "uint32_t")      { $T = "WORD"; $n = 4; }
     325
     326        # FITS tables do not allow for 64bit integers.  we need to
     327        # write these by splitting the value into high and low 32 bit values
     328        if ($type eq "int64_t")       { $T = "WORD"; $n = 4; $Np = 2*$Np; }
     329        if ($type eq "uint64_t")      { $T = "WORD"; $n = 4; $Np = 2*$Np; }
     330
     331        if ($type eq "float")         { $T = "WORD"; $n = 4; }
     332        if ($type eq "double")        { $T = "DBLE"; $n = 8; }
     333
     334        # special 'elixir' types:
    289335        if ($type eq "e_time")        { $T = "WORD"; $n = 4; }
    290336        if ($type eq "e_void")        { $T = "DBLE"; $n = 8; }
    291         if ($type eq "float")         { $T = "WORD"; $n = 4; }
    292         if ($type eq "double")        { $T = "DBLE"; $n = 8; }
     337
    293338        if (!$n) { die "unknown type $type"; }
    294339        for ($j = 0; $j < $Np; $j++) {
     
    318363        if ($type eq "int")            { $Nbytes += 4*$Np; $valid = 1; }
    319364        if ($type eq "unsigned int")   { $Nbytes += 4*$Np; $valid = 1; }
     365
     366        if ($type eq "int8_t")         { $Nbytes += 1*$Np; $valid = 1; }
     367        if ($type eq "uint8_t")        { $Nbytes += 1*$Np; $valid = 1; }
     368        if ($type eq "int16_t")        { $Nbytes += 2*$Np; $valid = 1; }
     369        if ($type eq "uint16_t")       { $Nbytes += 2*$Np; $valid = 1; }
     370        if ($type eq "int32_t")        { $Nbytes += 4*$Np; $valid = 1; }
     371        if ($type eq "uint32_t")       { $Nbytes += 4*$Np; $valid = 1; }
     372
     373        # FITS tables do not allow for 64bit integers.  we need to
     374        # write these by splitting the value into high and low 32 bit values
     375        if ($type eq "int64_t")        { $Nbytes += 8*$Np; $valid = 1; }
     376        if ($type eq "uint64_t")       { $Nbytes += 8*$Np; $valid = 1; }
     377
     378        if ($type eq "float")          { $Nbytes += 4*$Np; $valid = 1; }
     379        if ($type eq "double")         { $Nbytes += 8*$Np; $valid = 1; }
     380
     381        # special 'elixir' types:
    320382        if ($type eq "e_time")         { $Nbytes += 4*$Np; $valid = 1; }
    321383        if ($type eq "e_void")         { $Nbytes += 8*$Np; $valid = 1; }
    322         if ($type eq "float")          { $Nbytes += 4*$Np; $valid = 1; }
    323         if ($type eq "double")         { $Nbytes += 8*$Np; $valid = 1; }
    324384        if (!$valid) { die "unknown type $type"; }
    325385    }
Note: See TracChangeset for help on using the changeset viewer.