IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 21, 2007, 1:29:55 PM (19 years ago)
Author:
eugene
Message:

working on skipping unused chips, ignoring skycell pixels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpDefine.c

    r12523 r12526  
    1818    }
    1919
    20     // open the full skycell file; no need to defer different depths
     20    // open the full skycell file; no need to defer different depths. only load the header data
     21    // XXX force fileLevel and view to be chip. is this right?
     22    // skycell->type = PM_FPA_FILE_HEADER;
     23    // skycell->fileLevel = PM_FPA_LEVEL_CHIP;
    2124    pmFPAview *view = pmFPAviewAlloc (0);
    2225    pmFPAfileOpen (skycell, view, config);
     
    4952        return false;
    5053    }
     54    // output->fileLevel = PM_FPA_LEVEL_CHIP;
    5155
    5256    pmFPAfileCreate(output, view, config);
     57
     58# if 0
     59    // XXX This function should only load the skycell headers and create the output based
     60    // on that file.  I'm going to ask paul to look into this
     61    pmFPACopyStructure (output->fpa, skycell->fpa, 1, 1);
     62
     63    // XXX can I just create the needed readout?
     64    // create the needed readouts
     65    for (int i = 0; i < output->fpa->chips->n; i++) {
     66        pmChip *chip = output->fpa->chips->data[i];
     67        for (int j = 0; j < chip->cells->n; j++) {
     68            pmCell *cell = chip->cells->data[j];
     69            pmReadout *readout;
     70            if (cell->readouts->n == 0) {
     71                readout = pmReadoutAlloc (cell);
     72            }
     73            bool mdok1 = false;
     74            bool mdok2 = false;
     75            pmHDU *hdu = pmHDUGetLowest (output->fpa, chip, cell);
     76            int Nx = psMetadataLookupS32(&mdok1, hdu->header, "NAXIS1"); // Trim section
     77            int Ny = psMetadataLookupS32(&mdok2, hdu->header, "NAXIS2"); // Trim section
     78            if (!mdok1 || !mdok2) {
     79                psError(PS_ERR_IO, true, "NAXIS1 or NAXIS2 not set --- unable to create output image.\n");
     80                return false;
     81            }
     82            readout->image = psImageAlloc (Nx, Ny, PS_TYPE_F32);
     83            psFree (readout);
     84        }
     85    }
     86# endif
    5387
    5488    psFree (view);
Note: See TracChangeset for help on using the changeset viewer.