IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 20, 2009, 4:15:17 PM (17 years ago)
Author:
eugene
Message:

updates from head

Location:
branches/eam_branches/20091113
Files:
14 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091113

  • branches/eam_branches/20091113/ippconfig/gpc1/psastro.config

    r26233 r26237  
    233233END
    234234
     235REFSTAR_MASK_CROSSTALK_MAG_SLOPE F32   3.44
     236REFSTAR_MASK_CROSSTALK_MAG_MAX   F32 -14.47
     237CROSSTALK_MAX_MAG                F32  20.0
     238CROSSTALK_MASK                   BOOL TRUE
  • branches/eam_branches/20091113/ippconfig/recipes/psastro.config

    r26232 r26237  
    154154END
    155155
     156REFSTAR_MASK_CROSSTALK_MAG_SLOPE F32 3.44
     157REFSTAR_MASK_CROSSTALK_MAG_MAX   F32 -14.47
     158CROSSTALK_MAX_MAG    F32  20.0
     159CROSSTALK_MASK       BOOL FALSE
     160
    156161EXTRACT_MAX_MAG                 F32 -15.0
    157162
     
    217222PR_RECIPE METADATA
    218223END
     224
  • branches/eam_branches/20091113/ppStack/src/ppStackCleanup.c

    r26117 r26237  
    99#include "ppStack.h"
    1010#include "ppStackLoop.h"
    11 
    12 #define WCS_TOLERANCE 0.001             // Tolerance for WCS
    1311
    1412
     
    3432
    3533    // Close up
    36     bool wcsDone = false;           // Have we done the WCS?
    37     for (int i = 0; i < options->num; i++) {
    38         if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    39             continue;
    40         }
    41 
    42         ppStackThread *thread = stack->threads->data[0]; // Representative stack
    43         pmReadout *inRO = thread->readouts->data[i]; // Template readout
    44         if (inRO && !wcsDone) {
    45             // Copy astrometry over
    46             wcsDone = true;
    47             pmHDU *inHDU = pmHDUFromCell(inRO->parent); // Template HDU
    48             pmHDU *outHDU = pmHDUFromCell(options->outRO->parent); // Output HDU
    49             pmChip *outChip = options->outRO->parent->parent; // Output chip
    50             pmFPA *outFPA = outChip->parent; // Output FPA
    51             if (!outHDU || !inHDU) {
    52                 psWarning("Unable to find HDU at FPA level to copy astrometry.");
    53             } else {
    54                 if (!pmAstromReadWCS(outFPA, outChip, inHDU->header, 1.0)) {
    55                     psErrorClear();
    56                     psWarning("Unable to read WCS astrometry from input FPA.");
    57                     wcsDone = false;
    58                 } else {
    59                     if (!outHDU->header) {
    60                         outHDU->header = psMetadataAlloc();
    61                     }
    62                     if (!pmAstromWriteWCS(outHDU->header, outFPA, outChip, WCS_TOLERANCE)) {
    63                         psErrorClear();
    64                         psWarning("Unable to write WCS astrometry to output FPA.");
    65                         wcsDone = false;
    66                     }
    67                 }
    68             }
    69         }
    70     }
    7134
    7235    ppStackMemDump("cleanup");
     
    9659    }
    9760
    98     // Put version information into the header
    99     pmHDU *hdu = pmHDUFromCell(options->outRO->parent);
    100     if (!hdu) {
    101         psError(PS_ERR_UNKNOWN, false, "Unable to find HDU for output.");
    102         return false;
    103     }
    104     if (!hdu->header) {
    105         hdu->header = psMetadataAlloc();
    106     }
    107     ppStackVersionHeader(hdu->header);
    108 
    10961    return true;
    11062}
  • branches/eam_branches/20091113/ppStack/src/ppStackCombineFinal.c

    r26076 r26237  
    99#include "ppStack.h"
    1010#include "ppStackLoop.h"
     11
     12#define WCS_TOLERANCE 0.001             // Tolerance for WCS
    1113
    1214//#define TESTING                         // Enable test output
     
    8486    }
    8587
     88    // Propagate WCS
     89    bool wcsDone = false;           // Have we done the WCS?
     90    for (int i = 0; i < options->num && !wcsDone; i++) {
     91        if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
     92            continue;
     93        }
     94
     95        ppStackThread *thread = stack->threads->data[0]; // Representative stack
     96        pmReadout *inRO = thread->readouts->data[i]; // Template readout
     97        if (inRO && !wcsDone) {
     98            // Copy astrometry over
     99            wcsDone = true;
     100            pmHDU *inHDU = pmHDUFromCell(inRO->parent); // Template HDU
     101            pmHDU *outHDU = pmHDUFromCell(target->parent); // Output HDU
     102            pmChip *outChip = target->parent->parent; // Output chip
     103            pmFPA *outFPA = outChip->parent; // Output FPA
     104            if (!outHDU || !inHDU) {
     105                psWarning("Unable to find HDU at FPA level to copy astrometry.");
     106            } else {
     107                if (!pmAstromReadWCS(outFPA, outChip, inHDU->header, 1.0)) {
     108                    psErrorClear();
     109                    psWarning("Unable to read WCS astrometry from input FPA.");
     110                    wcsDone = false;
     111                } else {
     112                    if (!outHDU->header) {
     113                        outHDU->header = psMetadataAlloc();
     114                    }
     115                    if (!pmAstromWriteWCS(outHDU->header, outFPA, outChip, WCS_TOLERANCE)) {
     116                        psErrorClear();
     117                        psWarning("Unable to write WCS astrometry to output FPA.");
     118                        wcsDone = false;
     119                    }
     120                }
     121            }
     122        }
     123    }
     124
     125    // Put version information into the header
     126    pmHDU *hdu = pmHDUFromCell(target->parent);
     127    if (!hdu) {
     128        psError(PS_ERR_UNKNOWN, false, "Unable to find HDU for output.");
     129        return false;
     130    }
     131    if (!hdu->header) {
     132        hdu->header = psMetadataAlloc();
     133    }
     134    ppStackVersionHeader(hdu->header);
     135
     136
    86137#ifdef TESTING
    87138    static int pass = 0;                // Pass through
  • branches/eam_branches/20091113/ppStack/src/ppStackConvolve.c

    r26104 r26237  
    213213        pmFPAview view;                 // View for output
    214214        view.chip = view.cell = view.readout = 0;
     215
    215216        pmCell *outCell = pmFPAfileThisCell(config->files, &view, "PPSTACK.OUTPUT"); // Output cell
    216217        pmFPA *outFPA = outCell->parent->parent; // Output FPA
     218
     219        pmCell *unconvCell = pmFPAfileThisCell(config->files, &view, "PPSTACK.UNCONV"); // Unconvolved cell
     220        pmFPA *unconvFPA = unconvCell->parent->parent;                                  // Unconvolved FPA
     221
    217222        pmConceptsAverageFPAs(outFPA, fpaList);
    218223        pmConceptsAverageCells(outCell, cellList, NULL, NULL, true);
     224
     225        pmConceptsAverageFPAs(unconvFPA, fpaList);
     226        pmConceptsAverageCells(unconvCell, cellList, NULL, NULL, true);
     227
    219228        psFree(fpaList);
    220229        psFree(cellList);
     
    223232        UPDATE_CONCEPT(outCell, "CELL.EXPOSURE", options->sumExposure);
    224233        UPDATE_CONCEPT(outCell, "CELL.DARKTIME", NAN);
     234
     235        UPDATE_CONCEPT(unconvFPA,  "FPA.EXPOSURE",  options->sumExposure);
     236        UPDATE_CONCEPT(unconvCell, "CELL.EXPOSURE", options->sumExposure);
     237        UPDATE_CONCEPT(unconvCell, "CELL.DARKTIME", NAN);
    225238    }
    226239
  • branches/eam_branches/20091113/psModules/src/imcombine/pmSubtractionKernels.c

    r25999 r26237  
    250250    int num = PS_SQR(2 * size + 1) - 1; // Number of basis functions
    251251
    252     pmSubtractionKernels *kernels = pmSubtractionKernelsAlloc(num, PM_SUBTRACTION_KERNEL_POIS, size,
     252    pmSubtractionKernels *kernels = pmSubtractionKernelsAlloc(0, PM_SUBTRACTION_KERNEL_POIS, size,
    253253                                                              spatialOrder, penalty, mode); // The kernels
    254254    psStringAppend(&kernels->description, "POIS(%d,%d,%.2e)", size, spatialOrder, penalty);
  • branches/eam_branches/20091113/psModules/src/imcombine/pmSubtractionKernels.h

    r25101 r26237  
    5252    PS_ASSERT_PTR_NON_NULL(KERNELS, RETURNVALUE); \
    5353    PS_ASSERT_STRING_NON_EMPTY((KERNELS)->description, RETURNVALUE); \
    54     PS_ASSERT_INT_POSITIVE((KERNELS)->num, RETURNVALUE); \
     54    PS_ASSERT_INT_NONNEGATIVE((KERNELS)->num, RETURNVALUE); \
    5555    PS_ASSERT_VECTOR_NON_NULL((KERNELS)->u, RETURNVALUE); \
    5656    PS_ASSERT_VECTOR_NON_NULL((KERNELS)->v, RETURNVALUE); \
  • branches/eam_branches/20091113/psModules/src/objects/Makefile.am

    r25754 r26237  
    6060        pmSourceMatch.c \
    6161        pmDetEff.c \
     62        pmSourceGroups.c \
    6263        models/pmModel_GAUSS.c \
    6364        models/pmModel_PGAUSS.c \
     
    9697        pmSourceMatch.h \
    9798        pmDetEff.h \
     99        pmSourceGroups.h \
    98100        models/pmModel_GAUSS.h \
    99101        models/pmModel_PGAUSS.h \
  • branches/eam_branches/20091113/psastro/src/Makefile.am

    r24645 r26237  
    9090        psastroMaskUtils.c          \
    9191        psastroChooseGlintStars.c   \
     92        psastroLoadCrosstalk.c \
    9293        psastroLoadGlints.c   \
    9394        psastroLoadGhosts.c         \
  • branches/eam_branches/20091113/psastro/src/psastro.h

    r26223 r26237  
    7575bool              psastroLoadGlints (pmConfig *config);
    7676bool              psastroChooseGlintStars (pmConfig *config, psArray *refs, const char *source);
     77
     78bool              psastroLoadCrosstalk (pmConfig *config);
    7779
    7880psArray          *psastroLoadRefstars (pmConfig *config, const char *source);
  • branches/eam_branches/20091113/psastro/src/psastroMaskUpdates.c

    r26167 r26237  
    3434    psImageMaskType spikeMaskValue = pmConfigMaskGet("SPIKE", config); // Mask value for ghost pixels
    3535    psImageMaskType starMaskValue  = pmConfigMaskGet("STARCORE", config); // Mask value for ghost pixels
    36 
     36    psImageMaskType crosstalkMaskValue = pmConfigMaskGet("GHOST", config); // Mask value for crosstalk ghosts
     37   
    3738    // psImageMaskType maskBlank  = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels
    3839
     
    4849    if (!REFSTAR_MASK) return true;
    4950
     51    // convert star positions to crosstalk artifact positions and add to the readout->analysis data
     52    bool CROSSTALK_MASK                    = psMetadataLookupBool (&status, recipe, "CROSSTALK_MASK");
     53    if (CROSSTALK_MASK && !psastroLoadCrosstalk (config)) {
     54      psError(PSASTRO_ERR_CONFIG, false, "Error loading crosstalk data");
     55      return(false);
     56    }
     57   
    5058    // convert star positions to ghost positions and add to the readout->analysis data
    5159    if (!psastroLoadGhosts (config)) {
     
    7684    double REFSTAR_MASK_BLEED_MAG_SLOPE    = psMetadataLookupF32 (&status, recipe, "REFSTAR_MASK_BLEED_MAG_SLOPE");
    7785
     86    double REFSTAR_MASK_CROSSTALK_MAG_MAX  = psMetadataLookupF32 (&status, recipe, "REFSTAR_MASK_CROSSTALK_MAG_MAX");
     87    double REFSTAR_MASK_CROSSTALK_MAG_SLOPE= psMetadataLookupF32 (&status, recipe, "REFSTAR_MASK_CROSSTALK_MAG_SLOPE");
     88   
    7889    // select the input data sources
    7990    pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT");
     
    204215
    205216                    if (ref->Mag > REFSTAR_MASK_MAX_MAG) continue;
     217
    206218
    207219                    // the reference magnitudes have been converted from the instrumental
     
    285297                }
    286298
     299                // Select the crosstalk artifact regions for this readout, and mask a circular region
     300                // corresponding to the source star
     301
     302                psArray *crosstalks = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.CROSSTALKS");
     303                if (crosstalks) {
     304                  for (int i = 0; i < crosstalks->n; i++) {
     305                    pmAstromObj *ref = crosstalks->data[i];
     306                    float radius = REFSTAR_MASK_CROSSTALK_MAG_SLOPE * (REFSTAR_MASK_CROSSTALK_MAG_MAX - ref->Mag);
     307                    psTrace("psastro.crosstalk",2,"Masking star on Chip %s @ (%f,%f) Magnitude: %f Radius %f\n",
     308                            psMetadataLookupStr(&status,readout->parent->parent->concepts,"CHIP.NAME"),
     309                            ref->chip->x,ref->chip->y,ref->Mag,radius);
     310                    // XXX for now, assume cell binning is 1x1 relative to chip
     311                    psastroMaskCircle (readoutMask->mask, crosstalkMaskValue, ref->chip->x, ref->chip->y, radius, radius);
     312                  }
     313                }
     314               
    287315                // this probably should move into a function of its own:
    288316                {
  • branches/eam_branches/20091113/psphot/doc/efficiency.txt

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/20091113/psphot/src/psphotFake.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.