IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2009, 12:08:50 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/psastro

  • branches/cnb_branches/cnb_branch_20090301/psastro/src/psastroDataSave.c

    r21409 r23352  
    1818  return false; \
    1919}
    20  
     20
    2121/**
    2222 * this loop saves the photometry/astrometry data files
     
    3131    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, PSASTRO_RECIPE);
    3232    if (!recipe) {
    33         psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n");
    34         return false;
     33        psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n");
     34        return false;
    3535    }
    3636
     
    3838    pmFPAfile *output = psMetadataLookupPtr (NULL, config->files, "PSASTRO.OUTPUT");
    3939    if (!output) {
    40         psError(PSASTRO_ERR_CONFIG, true, "Can't find or interpret output file rule PSASTRO.OUTPUT!\n");
    41         return false;
     40        psError(PSASTRO_ERR_CONFIG, true, "Can't find or interpret output file rule PSASTRO.OUTPUT!\n");
     41        return false;
    4242    }
    4343
     
    4848
    4949    pmFPAview *view = pmFPAviewAlloc (0);
     50    pmHDU *lastHDU = NULL;              // Last HDU updated
    5051
    5152    // open/load files as needed
     
    5556        psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    5657        if (!chip->process || !chip->file_exists) { continue; }
    57         if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;
     58        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;
    5859
    59         while ((cell = pmFPAviewNextCell (view, output->fpa, 1)) != NULL) {
     60        while ((cell = pmFPAviewNextCell (view, output->fpa, 1)) != NULL) {
    6061            psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    6162            if (!cell->process || !cell->file_exists) { continue; }
    62             if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;
     63            if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;
    6364
    64             // process each of the readouts
    65             while ((readout = pmFPAviewNextReadout (view, output->fpa, 1)) != NULL) {
    66                 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;
    67                 if (!readout->data_exists) { continue; }
     65            // process each of the readouts
     66            while ((readout = pmFPAviewNextReadout (view, output->fpa, 1)) != NULL) {
     67                if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;
     68                if (!readout->data_exists) { continue; }
    6869
    69                 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE;
    70             }
    71             if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE;
    72         }
    73         if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE;
     70                // Put version information into the header
     71                pmHDU *hdu = pmHDUGetHighest(output->fpa, chip, cell);
     72                if (hdu && hdu != lastHDU) {
     73                    psastroVersionHeaderFull(hdu->header);
     74                    lastHDU = hdu;
     75                }
     76
     77                if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE;
     78            }
     79            if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE;
     80        }
     81        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE;
    7482    }
    7583    if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE;
Note: See TracChangeset for help on using the changeset viewer.