IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24701


Ignore:
Timestamp:
Jul 7, 2009, 10:49:34 AM (17 years ago)
Author:
eugene
Message:

raise ON_SPIKE, ON_GHOST, OFF_CHIP detection bit flags

File:
1 edited

Legend:

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

    r24652 r24701  
    282282                }
    283283
    284                 // select the raw objects for this readout, flag is they fall in a mask
    285                 psArray *rawstars = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.RAWSTARS");
    286                 if (rawstars == NULL) return false;
     284                // this probably should move into a function of its own:
     285                {
     286                    // select the raw objects for this readout, flag is they fall in a mask
     287                    psArray *inSources = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES");
     288                    if (inSources == NULL) continue;
    287289               
    288                 // XXX finish this: raise a bit for stars that land on certain types of masks;
    289                 // others (eg, bright star core) should be ignored.
    290                 for (int i = 0; false && (i < rawstars->n); i++) {
    291                     pmAstromObj *raw = rawstars->data[i];
    292                     psImageMaskType value = readoutMask->mask->data.PS_TYPE_IMAGE_MASK_DATA[(int)(raw->chip->x)][(int)(raw->chip->y)];
    293                     if (value) continue;
     290                    // create a replacement output array:
     291                    // psArray *outSources = psAllocArrayEmpty(100);
     292
     293                    // XXX finish this: raise a bit for stars that land on certain types of masks;
     294                    // others (eg, bright star core) should be ignored.
     295                    for (int i = 0; i < inSources->n; i++) {
     296                        pmSource *source = inSources->data[i];
     297
     298                        int xChip = source->peak->x;
     299                        int yChip = source->peak->y;
     300
     301                        bool onChip = true;
     302                        onChip &= (xChip >= 0);
     303                        onChip &= (xChip < readoutMask->mask->numCols);
     304                        onChip &= (yChip >= 0);
     305                        onChip &= (yChip < readoutMask->mask->numRows);
     306                        if (!onChip) {
     307                            // if the source is off the edge of the chip, raise a different bit?
     308                            source->mode |= PM_SOURCE_MODE_OFF_CHIP;
     309                            continue;
     310                        }
     311
     312                        psImageMaskType value = readoutMask->mask->data.PS_TYPE_IMAGE_MASK_DATA[yChip][xChip];
     313                        if (value & ghostMaskValue) {
     314                            source->mode |= PM_SOURCE_MODE_ON_GHOST;
     315                        }
     316                        // XXX note that for now, glint and ghost are identical
     317                        pmSourceMode PM_SOURCE_MODE_ON_GLINT = PM_SOURCE_MODE_ON_GHOST;
     318                        if (value & glintMaskValue) {
     319                            source->mode |= PM_SOURCE_MODE_ON_GLINT;
     320                        }
     321                        if (value & spikeMaskValue) {
     322                            source->mode |= PM_SOURCE_MODE_ON_SPIKE;
     323                        }
     324                    }
    294325                }
    295326            }
Note: See TracChangeset for help on using the changeset viewer.