IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 18, 2007, 12:28:16 PM (19 years ago)
Author:
eugene
Message:

a variety of fixes to get psastro working in chip and mosaic mode

  • various memory leaks
  • when loading mosaic data, the modification of the WCS for the common focal-plane scale was getting the offset wrong (fixed in psModules)
  • added some debugging dump; more plots still needed
  • error handling in psastroMosaicAstrom
  • loading chip and fpa dimensions from concepts
  • now reading chip concepts when reading objects (in psModules)
  • now supplying region and subdivisions for gradient measurements
  • grid search is now optional

-

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroMosaicGradients.c

    r10880 r12492  
    1616        if (!chip->process || !chip->file_exists) { continue; }
    1717       
     18        psRegion *region = pmChipExtent (chip);
     19
    1820        while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {
    1921            psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
     
    3739
    3840                // measure the local gradients for this set of stars
    39                 gradients = pmAstromMeasureGradients (gradients, rawstars, refstars, match, recipe);
     41                // XXX 2,2 are the number of test boxes on the chip.  put this in the recipe
     42                gradients = pmAstromMeasureGradients (gradients, rawstars, refstars, match, region, 2, 2);
    4043            }
    4144        }
     45        psFree (region);
    4246    }
    4347
     
    5963    }
    6064
     65    // physical pixel scale in microns per pixel (FP is in physical units, chip is in pixels)
     66    double pixelScale = psMetadataLookupF32 (&status, recipe, "PSASTRO.PIXEL.SCALE");
     67    if (!status) {
     68        psError(PS_ERR_IO, false, "Failed to lookup pixel scale");
     69        return false;
     70    }
     71
    6172    // fit the measured gradients with the telescope distortion model (polynomial order based on toTPA)
    62     pmAstromFitDistortion (fpa, gradients, recipe);
    63     psastroMosaicSetAstrom (fpa);
     73    if (!pmAstromFitDistortion (fpa, gradients, pixelScale)) {
     74        psError(PSASTRO_ERR_UNKNOWN, false, "failed to fit the distortion terms\n");
     75        psFree (gradients);
     76        psFree (view);
     77        return false;
     78    }
     79       
     80    if (!psastroMosaicSetAstrom (fpa)) {
     81        psError(PSASTRO_ERR_UNKNOWN, false, "failed to apply mosaic distortion terms\n");
     82        psFree (gradients);
     83        psFree (view);
     84        return false;
     85    }
    6486
    6587    psFree (gradients);
Note: See TracChangeset for help on using the changeset viewer.