IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41633


Ignore:
Timestamp:
Jun 3, 2021, 1:27:21 PM (5 years ago)
Author:
tdeboer
Message:

changes to Ghost masking and crosstalk

Location:
tags/ipp-ps1-20210510/psastro/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-ps1-20210510/psastro/src/psastroLoadCrosstalk.c

    r41618 r41633  
    559559                    // TdB20210304: This should not be relevant for faint crosstalk rules. Do this rather ad hoc right now by placing a limit at 8 mags of difference
    560560                    if( crossMagOffset[k] > 8.) { continue; }
    561                     if (cal->Mag < SPIKE_MAX_MAG) {           
     561                    if ((cal->Mag + MagOffset) < SPIKE_MAX_MAG) {             
    562562                      int Xt = X;
    563563                      int Yt = Y;
     
    597597                        pmAstromObj *crosstalk = pmAstromObjAlloc();
    598598               
    599                         crosstalk->Mag = cal->Mag;
     599                        crosstalk->Mag = cal->Mag + MagOffset;
    600600                        crosstalk->chip->x = x_t_chip;
    601601                        crosstalk->chip->y = y_t_chip;
     
    777777                        pmAstromObj *crosstalk = pmAstromObjAlloc();
    778778               
    779                         crosstalk->Mag = ref->Mag - MagOffset;
     779                        crosstalk->Mag = ref->Mag ;
    780780                        crosstalk->chip->x = x_t_chip;
    781781                        crosstalk->chip->y = y_t_chip;
  • tags/ipp-ps1-20210510/psastro/src/psastroLoadGhosts.c

    r41434 r41633  
    144144    pmFPA *fpa = astrom->fpa;
    145145
     146    // select the reference mask fpa :: we use this to determine cell boundaries
     147    pmFPAfile *refMask = psMetadataLookupPtr (NULL, config->files, "PSASTRO.REFMASK");
     148    if (!refMask) {
     149      psError(PSASTRO_ERR_CONFIG, true, "Can't find mask reference");
     150      return false;
     151    }
     152    // Activate the reference mask to generate an FPA structure we can use to map stars down to cells
     153    pmFPAfileActivate (config->files, false, NULL);
     154    pmFPAfileActivate (config->files, true, "PSASTRO.REFMASK");
     155
    146156    // raise an error if the config is broken
    147157    if (!psastroZeroPointFromRecipe (&zeropt, &exptime, &INSTR_MAX_MAG, NULL, fpa, recipe)) {
     
    161171        if (!chip->fromFPA) { continue; }
    162172
     173        // Get the current chip's name, and parse out the grid location.
     174        pmChip *refChip  = pmFPAviewThisChip (view, refMask->fpa);
     175        const char *chipName = psMetadataLookupStr(NULL,refChip->concepts, "CHIP.NAME");
     176        int X = chipName[2] - '0';
     177        int Y = chipName[3] - '0';
     178
     179        //Check if we are in the central 8 chips, where old ghost-style locations work better
     180        int cenChip = 0;
     181        if ( (Y >= 3)&&(Y <=4)&&(X >= 2)&&(X <= 5) ) {cenChip = 1;}
     182       
     183
    163184        while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {
    164185            psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
     
    200221                        ghost->FP->y = ghost_y_fpa_mirror + psPolynomial2DEval(centerY, ghost_x_fpa_mirror, ghost_y_fpa_mirror);
    201222                    } 
    202                     if(!mirCheck) {
     223                    if(!mirCheck | cenChip) {
    203224                        //Use the old-style ghost position determination
    204225                        ghost->FP->x = -cal->FP->x + psPolynomial2DEval(centerX, -cal->FP->x, -cal->FP->y);
  • tags/ipp-ps1-20210510/psastro/src/psastroMaskUpdates.c

    r41618 r41633  
    479479                            ref->chip->x,ref->chip->y,ref->Mag,radius);
    480480                    // XXX for now, assume cell binning is 1x1 relative to chip
    481                     psastroMaskCircle (readoutMask->mask, crosstalkMaskValue, ref->chip->x, ref->chip->y, radius, radius);
     481                    //For the moment, make the crostalk masks into ovals by doing a simple 1:2 scaling with radius. Not ideal, but better until we can get more examples.
     482                    psastroMaskCircle (readoutMask->mask, crosstalkMaskValue, ref->chip->x, ref->chip->y, radius/2., radius);
    482483                  }
    483484                }
Note: See TracChangeset for help on using the changeset viewer.