IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 20, 2006, 8:57:16 PM (20 years ago)
Author:
eugene
Message:

modifications to support psphot on pmReadout with full IPP config files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psModulesUtils.c

    r5993 r6117  
    5959}
    6060
     61pmModel *pmModelSelect (pmSource *source) {
     62    switch (source->type) {
     63      case PM_SOURCE_STAR:
     64        return source->modelPSF;
     65       
     66      case PM_SOURCE_EXTENDED:
     67        return source->modelEXT;
     68       
     69      default:
     70        return NULL;
     71    }
     72    return NULL;
     73}
     74
    6175bool pmSourcePhotometry (float *fitMag, float *obsMag, pmModel *model, psImage *image, psImage *mask) {
    6276
     
    162176    return (flux);
    163177}
     178
     179static void ppConfigFree (ppConfig *config) {
     180
     181  if (config == NULL) return;
     182  return;
     183}
     184
     185// allocate a ppConfig structrue
     186ppConfig *ppConfigAlloc (void) {
     187
     188  ppConfig *config = psAlloc (sizeof(ppConfig));
     189  psMemSetDeallocator(config, (psFreeFunc) ppConfigFree);
     190
     191  config->site = NULL;
     192  config->camera = NULL;
     193  config->recipe = NULL;
     194  config->arguments = NULL;
     195  config->database = NULL;
     196
     197  return (config);
     198}
     199
     200static void ppFileFree (ppFile *file) {
     201
     202  if (file == NULL) return;
     203  return;
     204}
     205
     206// allocate a ppFile structrue
     207ppFile *ppFileAlloc (void) {
     208
     209  ppFile *file = psAlloc (sizeof(ppFile));
     210  psMemSetDeallocator(file, (psFreeFunc) ppFileFree);
     211
     212  file->filename = NULL;
     213  file->fits = NULL;
     214  file->phu = NULL;
     215  file->fpa = NULL;
     216
     217  return (file);
     218}
     219
     220psMetadata *pmReadoutGetHeader (pmReadout *readout) {
     221
     222    p_pmHDU *hdu = NULL;
     223
     224    pmCell *cell = readout->parent;     // cell containing this readout;
     225    hdu = cell->hdu;                    // The data unit, containing the weight and mask originals
     226    if (hdu) return hdu->header;
     227   
     228    pmChip *chip = cell->parent;        // The parent chip
     229    hdu = chip->hdu;                    // The data unit, containing the weight and mask originals
     230    if (hdu) return hdu->header;
     231
     232    pmFPA *fpa = chip->parent;          // The parent FPA
     233    hdu = fpa->hdu;
     234    if (hdu) return hdu->header;
     235
     236    if (fpa->phu) return fpa->phu;
     237   
     238    psError(PS_ERR_UNKNOWN, true, "Unable to find the HDU in the hierarchy!\n");
     239    return NULL;
     240}
Note: See TracChangeset for help on using the changeset viewer.