IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 27, 2006, 7:12:19 PM (20 years ago)
Author:
Paul Price
Message:

Changes to pmHDU and pmFPAWrite to (hopefully) fix for the last time
this horrible problem of when we write that annoying blank PHU. When
we want to write something out, there are four usage cases for the
pm{FPA,Chip,Cell}Write functions:

(1) Write the blank PHU only: blank=true, recurse=false;
(2) Write an image HDU only: blank=false, recurse=false;
(3) Write an entire file: blank=true, recurse=true; and
(4) Write only image HDUs within the file: blank=false, recurse=true.

So here, the "blank" boolean indicates whether we should write a
"blank" HDU (which consists of a header only, i.e., no pixels) when we
come across it. "recurse" is self-explanatory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmHDU.c

    r7604 r7717  
    1515{
    1616    // Deal with the PHU case
    17     if (strcasecmp(hdu->extname, "PHU") == 0 || hdu->phu) {
    18         if (! psFitsMoveExtNum(fits, 0, false)) {
     17    if (hdu->blankPHU) {
     18        if (!psFitsMoveExtNum(fits, 0, false)) {
    1919            psError(PS_ERR_IO, false, "Unable to move to primary header!\n");
    2020            return false;
    2121        }
    22         hdu->phu = true;
    23         return true;
    24     }
    25 
    26     if (! psFitsMoveExtName(fits, hdu->extname)) {
     22        return true;
     23    }
     24
     25    if (!psFitsMoveExtName(fits, hdu->extname)) {
    2726        psError(PS_ERR_IO, false, "Unable to move to extension %s\n", hdu->extname);
    2827        return false;
    29     }
    30     // Now, just in case for some reason the PHU has an extension name that we've moved to....
    31     if (psFitsGetExtNum(fits) == 0) {
    32         hdu->phu = true;
    33     } else {
    34         hdu->phu = false;
    3528    }
    3629
     
    6154
    6255    if (!extname || strlen(extname) == 0) {
    63         hdu->phu = true;
    64         hdu->extname = psStringCopy("PHU");
     56        hdu->blankPHU = true;
     57        hdu->extname = NULL;
    6558    } else {
    66         if (strcasecmp(extname, "PHU") == 0) {
    67             hdu->phu = true;
    68         } else {
    69             hdu->phu = false;
    70         }
     59        hdu->blankPHU = false;
    7160        hdu->extname = psStringCopy(extname);
    7261    }
Note: See TracChangeset for help on using the changeset viewer.