IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 29, 2012, 2:26:09 PM (14 years ago)
Author:
watersc1
Message:

ppSkycell binning mostly working, but not for masks yet.

Location:
branches/czw_branch/20120906/ppStack/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20120906/ppStack/src/ppStackCamera.c

    r34516 r34623  
    223223              pmFPAfile *inputBKG = defineFile(config,NULL,"PPSTACK.INPUT.BKGMODEL",bkgmodel,
    224224                                               PM_FPA_FILE_IMAGE);
    225               fprintf(stderr,"ppSC: %s\n",bkgmodel);
    226225              if (!inputBKG) {
    227226                psError(psErrorCodeLast(), false,
  • branches/czw_branch/20120906/ppStack/src/ppStackCleanup.c

    r34516 r34623  
    2828    options->expRO = NULL;
    2929
    30     options->bkgRO->data_exists = false;
    31     options->bkgRO->parent->data_exists = false;
    32     options->bkgRO->parent->parent->data_exists = false;
    33     psFree(options->bkgRO);
    34     options->bkgRO = NULL;
     30    if (options->bkgRO) {
     31      options->bkgRO->data_exists = false;
     32      options->bkgRO->parent->data_exists = false;
     33      options->bkgRO->parent->parent->data_exists = false;
     34      psFree(options->bkgRO);
     35      options->bkgRO = NULL;
     36    }
    3537   
    3638    for (int i = 0; i < options->num; i++) {
  • branches/czw_branch/20120906/ppStack/src/ppStackCombineFinal.c

    r34531 r34623  
    2727    return(false);
    2828  }
     29#if 0
    2930  if (!ppStackWriteImage("/tmp/test_forced.bkgmdl.fits",
    3031                         bkgRO->parent->parent->parent->hdu->header,
     
    3334    fprintf(stderr,"Failed to write image because fail.\n");
    3435  }
    35  
     36#endif
    3637  for (int i = 0; i < options->num; i++) {
    3738    pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT.BKGMODEL", i);
     
    5354  bkgRO->parent->data_exists = true;
    5455  bkgRO->parent->parent->data_exists = true;
     56 
    5557  return(true);
    5658}
  • branches/czw_branch/20120906/ppStack/src/ppStackCombinePrepare.c

    r34531 r34623  
    6060      options->bkgRO->parent->parent->parent->concepts = psMetadataCopy(options->bkgRO->parent->parent->parent->concepts,
    6161                                                                        ro->parent->parent->parent->concepts);
     62
    6263    }
    6364
     
    8485        return false;
    8586      }
     87     
     88
     89     
    8690    }
    8791
  • branches/czw_branch/20120906/ppStack/src/ppStackFiles.c

    r34531 r34623  
    2727static char *filesUnconv[] = { "PPSTACK.UNCONV", "PPSTACK.UNCONV.MASK", "PPSTACK.UNCONV.VARIANCE",
    2828                               "PPSTACK.UNCONV.EXP", "PPSTACK.UNCONV.EXPNUM", "PPSTACK.UNCONV.EXPWT",
    29                                "PPSTACK.OUTPUT.BKGMODEL",
    3029                               NULL };
    3130
  • branches/czw_branch/20120906/ppStack/src/ppStackLoop.c

    r34516 r34623  
    193193
    194194        // Prepare for combination
    195         if (!ppStackCombinePrepare("PPSTACK.UNCONV", "PPSTACK.UNCONV.EXP", "PPSTACK.OUTPUT.BKGMODEL", PPSTACK_FILES_UNCONV,
     195        if (!ppStackCombinePrepare("PPSTACK.UNCONV", "PPSTACK.UNCONV.EXP", NULL, PPSTACK_FILES_UNCONV,
    196196                                   stack, options, config)) {
    197197            psError(psErrorCodeLast(), false, "Unable to prepare for combination.");
  • branches/czw_branch/20120906/ppStack/src/ppStackThread.c

    r34516 r34623  
    3535            psFitsClose(stack->varianceFits->data[i]);
    3636        }
    37 /*         if (stack->bkgFits->data[i]) { */
    38 /*             psFitsClose(stack->bkgFits->data[i]); */
    39 /*         } */
    4037        stack->imageFits->data[i] = stack->maskFits->data[i] = stack->varianceFits->data[i] = NULL;
    4138    }
     
    5754    const psArray *varianceNames = conv ? options->convVariances : options->origVariances; // Variance names
    5855    const psArray *covariances = conv ? options->convCovars : options->origCovars; // Covariance matrices
    59     const psArray *bkgNames = options->bkgImages;
     56
    6057    PS_ASSERT_ARRAY_NON_NULL(cells, NULL);
    6158    if (imageNames) {
     
    10097            psFree(resolved); \
    10198        }
    102         fprintf(stderr,"%d %s\n",i,(char*) bkgNames->data[i]);
    10399        IMAGE_OPEN(imageNames, stack->imageFits, i);
    104100        IMAGE_OPEN(maskNames, stack->maskFits, i);
    105101        IMAGE_OPEN(varianceNames, stack->varianceFits, i);
    106         //      IMAGE_OPEN(bkgNames, stack->bkgFits, i);
    107102    }
    108103
  • branches/czw_branch/20120906/ppStack/src/ppStackUpdateHeader.c

    r31158 r34623  
    66
    77    pmReadout *outRO = options->outRO;                                      // Output readout
     8    pmReadout *expRO = options->expRO;
    89
    910    // Propagate WCS
     
    123124        snprintf (field, 64, "AIR_%04d", i);
    124125        psMetadataAddF32(hdu->header, PS_LIST_TAIL, field, PS_META_REPLACE, "input image airmass", value);
    125     }   
     126    }
     127
     128    // Copy information into expRO, because it should be there too.
     129    pmHDU *expROhdu = pmHDUFromCell(expRO->parent);
     130    if (!expROhdu->header) {
     131      expROhdu->header = psMetadataAlloc();
     132    }
     133    expRO->parent->parent->parent->hdu->header = psMetadataCopy(expRO->parent->parent->parent->hdu->header,
     134                                                                outRO->parent->parent->parent->hdu->header);
     135   
     136    expRO->parent->concepts = psMetadataCopy(expRO->parent->concepts,
     137                                             outRO->parent->concepts);
     138    expRO->parent->parent->concepts = psMetadataCopy(expRO->parent->parent->concepts,
     139                                                     outRO->parent->concepts);
     140    expRO->parent->parent->parent->concepts = psMetadataCopy(expRO->parent->parent->parent->concepts,
     141                                                             outRO->parent->parent->parent->concepts);
     142   
     143   
    126144    return true;
    127145}
Note: See TracChangeset for help on using the changeset viewer.