IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12526


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

working on skipping unused chips, ignoring skycell pixels

Location:
trunk/pswarp/src
Files:
6 edited

Legend:

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

    r12505 r12526  
    1111    pmConceptsDone ();
    1212    pmConfigDone ();
    13     fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "pswarp");
    14     // fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "pswarp");
     13    // fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "pswarp");
     14    fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "pswarp");
    1515
    1616    return;
  • trunk/pswarp/src/pswarpDataLoad.c

    r12523 r12526  
    2424    pmFPAfile *astrom = psMetadataLookupPtr (NULL, config->files, "PSWARP.ASTROM");
    2525    if (!astrom) {
    26         fprintf (stderr, "*** using header astrometry\n");
    2726        astrom = input;
    2827    }
  • 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);
  • trunk/pswarp/src/pswarpMatchRange.c

    r12523 r12526  
    88    psPlaneTransformApply (srcFP, fpaSrc->fromTPA, srcTP); \
    99    psPlaneTransformApply (srcPix, chipSrc->fromFPA, srcFP); \
    10     fprintf (stderr, "%6.1f,%6.1f -> ", srcPix->x, srcPix->y); \
    1110    *minX = PS_MIN (*minX, srcPix->x); \
    1211    *minY = PS_MIN (*minY, srcPix->y); \
    1312    *maxX = PS_MAX (*maxX, srcPix->x); \
    14     *maxY = PS_MAX (*maxY, srcPix->y); \
    15     fprintf (stderr, "%4d,%4d - %4d,%4d\n", *minX, *minY, *maxX, *maxY);
     13    *maxY = PS_MAX (*maxY, srcPix->y);
    1614
    1715// we are warping from src to dest.  find the max overlapping pixels in the INPUT (src)
     
    3735    *maxX = src->image->col0;
    3836    *maxY = src->image->row0;
    39     fprintf (stderr, "%4d,%4d - %4d,%4d\n", *minX, *minY, *maxX, *maxY);
    4037
    4138    // XXX save these as static for speed?
     
    8885
    8986    // demo forward and backward transformation
     87# if (0)
    9088    srcPix->x = *minX;
    9189    srcPix->y = *minY;
     
    9694    psPlaneTransformApply (destFP, fpaDest->fromTPA, destTP);
    9795    psPlaneTransformApply (destPix, chipDest->fromFPA, destFP);
    98 
    9996    fprintf (stderr, "%f,%f -> %f,%f ", srcPix->x, srcPix->y, destPix->x, destPix->y);
    10097
     
    105102    psPlaneTransformApply (srcFP, fpaSrc->fromTPA, srcTP);
    106103    psPlaneTransformApply (srcPix, chipSrc->fromFPA, srcFP);
    107 
    108104    fprintf (stderr, "-> %f,%f ", srcPix->x, srcPix->y);
     105# endif
    109106
    110107    psFree (srcPix);
  • trunk/pswarp/src/pswarpParseCamera.c

    r12505 r12526  
    1919    pmFPAfileDefineFromArgs (&status, config, "PSWARP.ASTROM", "ASTROM");
    2020    if (status) {
    21         fprintf (stderr, "using supplied astrometry\n");
     21        psLogMsg ("pswarp", 3, "using supplied astrometry\n");
    2222    } else {
    23         fprintf (stderr, "using header astrometry\n");
     23        psLogMsg ("pswarp", 3, "using header astrometry\n");
    2424    }
    2525
    2626    // the mask is not required - but must conform to input camera
    2727    if (!pmFPAfileBindFromArgs (NULL, input, config, "PSWARP.MASK", "MASK")) {
    28         fprintf (stderr, "no mask supplied\n");
     28        psLogMsg ("pswarp", 3, "no mask supplied\n");
    2929    }
    3030
    3131    if (!pmFPAfileBindFromArgs (NULL, input, config, "PSWARP.WEIGHT", "WEIGHT")) {
    32         fprintf (stderr, "no weight supplied\n");
     32        psLogMsg ("pswarp", 3, "no weight supplied\n");
    3333    }
    3434
     
    4242
    4343    // these calls bind the I/O handle to the specified fpa
     44    // NOTE: output file could be binned relative to sky cell...
     45    // if (!pmFPAfileDefineFromFPA (skyConfig, skycell->fpa, 1, 1, "PSWARP.OUTPUT")) {
    4446    if (!pmFPAfileDefineOutput (skyConfig, skycell->fpa, "PSWARP.OUTPUT")) {
    4547        psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT");
  • trunk/pswarp/src/pswarpTransformReadout_Opt.c

    r12523 r12526  
    3737    // XXX need to modify the grid based on this result and force the maxError < XXX
    3838    double maxError = pswarpMapGridMaxError (grid);
    39     fprintf (stderr, "maximum error using this grid sampling: %f\n", maxError);
     39    psLogMsg ("pswarp", 3, "maximum error using this grid sampling: %f\n", maxError);
    4040
    4141    pswarpMapGridSetGrid (grid, minX, minY, &gridX, &gridY);
Note: See TracChangeset for help on using the changeset viewer.