IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38667


Ignore:
Timestamp:
Aug 9, 2015, 6:44:43 AM (11 years ago)
Author:
eugene
Message:

looking for mem corruption; add in mean nphot and other fields to mextract

Location:
branches/eam_branches/ipp-20150625/Ohana/src/libdvo
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150625/Ohana/src/libdvo/include/dvo.h

    r38643 r38667  
    902902float PhotZeroPoint (Measure *measure, Average *average, SecFilt *secfilt);
    903903
     904int PhotSecfiltFlags (PhotCode *code, Average *average, SecFilt *secfilt);
     905int PhotNcode (PhotCode *code, Average *average, SecFilt *secfilt);
    904906int   PhotNphot (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source);
    905907float PhotMstdev (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source);
  • branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dbExtractMeasures.c

    r38153 r38667  
    241241          break;
    242242
    243         case MAG_OPTION_STDEV:
    244         case MAG_OPTION_CHISQ:
    245         case MAG_OPTION_MIN:
    246         case MAG_OPTION_MAX:
    247         case MAG_OPTION_NCODE:
    248         case MAG_OPTION_NPHOT:
    249         case MAG_OPTION_UC_DIST:
    250         case MAG_OPTION_FLAGS:
     243          // the following are all values which are come from the secfit table
     244        case MAG_OPTION_STDEV:   { value.Flt = PhotMstdev (equiv, average, secfilt, field->magClass, field->magSource); break; }
     245        case MAG_OPTION_CHISQ:   { value.Flt = PhotXm (equiv, average, secfilt); break; }
     246        case MAG_OPTION_MIN:     { value.Flt = PhotMmin (equiv, average, secfilt); break;}
     247        case MAG_OPTION_MAX:     { value.Flt = PhotMmax (equiv, average, secfilt); break;}
     248        case MAG_OPTION_NCODE:   { value.Int = PhotNcode (equiv, average, secfilt); break; }
     249        case MAG_OPTION_NPHOT:   { value.Int = PhotNphot (equiv, average, secfilt, field->magClass, field->magSource); break; }
     250        case MAG_OPTION_UC_DIST: { value.Flt = PhotUCdist (equiv, average, secfilt); break; }
     251        case MAG_OPTION_FLAGS:   { value.Int = PhotSecfiltFlags (equiv, average, secfilt); break; }
     252         
     253          // the following values come from the mean lensobj table
    251254        case MAG_OPTION_X11_SM_OBJ:
    252255        case MAG_OPTION_X12_SM_OBJ:
  • branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dbFields.c

    r38581 r38667  
    316316    dvoMagSourceType source = GetMagSource (word);
    317317    if (source != MAG_SRC_NONE) {
     318      // if mySource is already set, then we have two 'source' elements (an error)
    318319      if (mySource != MAG_SRC_NONE) { fprintf (stderr, "invalid selection %s in %s\n", word, fieldName); free (word); return FALSE; }
    319320      mySource = source;
     
    324325    dvoMagLevelType level = GetMagLevel (word);
    325326    if (level != MAG_LEVEL_NONE) {
     327      // if myLevel is already set, then we have two 'level' elements (an error)
    326328      if (myLevel != MAG_LEVEL_NONE) { fprintf (stderr, "invalid selection %s in %s\n", word, fieldName); free (word); return FALSE; }
    327329      myLevel = level;
     
    332334    dvoMagClassType class = GetMagClass (word);
    333335    if (class != MAG_CLASS_NONE) {
     336      // if myClass is already set, then we have two 'class' elements (an error)
    334337      if (myClass != MAG_CLASS_NONE) { fprintf (stderr, "invalid selection %s in %s\n", word, fieldName); free (word); return FALSE; }
    335338      myClass = class;
     
    340343    dvoMagOptionType option = GetMagOption (word);
    341344    if (option != MAG_OPTION_NONE) {
    342       // some combinations are OK: mag + err -> err
    343       if ((myOption == MAG_OPTION_MAG) && (option == MAG_OPTION_ERR)) {
     345      // if myClass is already set, then we have two 'class' elements
     346      // this is an error unless the request was of the form mag:value
     347      // if so, then code->type will be PHOT_MAG
     348
     349      if (code->type == PHOT_MAG) {
     350        // mag:err -> magerr
     351        if ((myOption == MAG_OPTION_MAG) && (option == MAG_OPTION_ERR)) {
     352          myOption = MAG_OPTION_ERR;
     353          ptr = skipword (ptr);
     354          continue;
     355        }
     356        // flux:err -> fluxerr
     357        if ((myOption == MAG_OPTION_FLUX) && (option == MAG_OPTION_ERR)) {
     358          myOption = MAG_OPTION_FLUX_ERR;
     359          ptr = skipword (ptr);
     360          continue;
     361        }
    344362        myOption = option;
    345         ptr = skipword (ptr);
    346         continue;
    347       }
    348       // some combinations are OK: err + mag -> err
    349       if ((myOption == MAG_OPTION_ERR) && (option == MAG_OPTION_MAG)) {
    350         ptr = skipword (ptr);
    351         continue;
    352       }
    353       // some combinations are OK: flux + err -> FLUX_ERR
    354       if ((myOption == MAG_OPTION_FLUX) && (option == MAG_OPTION_ERR)) {
    355         myOption = MAG_OPTION_FLUX_ERR;
    356         ptr = skipword (ptr);
    357         continue;
    358       }
    359       // some combinations are OK: err + flux -> FLUX_ERR
    360       if ((myOption == MAG_OPTION_ERR) && (option == MAG_OPTION_FLUX)) {
    361         myOption = MAG_OPTION_FLUX_ERR;
    362         ptr = skipword (ptr);
    363         continue;
    364       }
    365       // some combinations are OK: flux + fluxerr -> FLUX_ERR
    366       if ((myOption == MAG_OPTION_FLUX) && (option == MAG_OPTION_FLUX_ERR)) {
    367         myOption = MAG_OPTION_FLUX_ERR;
    368         ptr = skipword (ptr);
    369         continue;
    370       }
    371       // some combinations are OK: fluxerr + flux -> FLUX_ERR
    372       if ((myOption == MAG_OPTION_FLUX_ERR) && (option == MAG_OPTION_FLUX)) {
    373         myOption = MAG_OPTION_FLUX_ERR;
    374363        ptr = skipword (ptr);
    375364        continue;
  • branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dvo_catalog_split.c

    r38658 r38667  
    100100    return FALSE;
    101101  }
     102
     103  if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE);
    102104
    103105  // write PHU header
     
    120122  gfits_free_matrix (&matrix);
    121123# endif
     124
     125  if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE);
    122126
    123127  FTable *outtable = ftable;
     
    844848  }
    845849
     850  if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE);
     851
    846852  Nmeasure_disk_new = MAX (catalog[0].Nmeasure_disk, catalog[0].Nmeasure + catalog[0].Nmeasure_off);
    847853  Nmissing_disk_new = MAX (catalog[0].Nmissing_disk, catalog[0].Nmissing + catalog[0].Nmissing_off);
     
    867873  /* in split mode, we can save only part of the data */
    868874
     875  if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE);
     876
    869877  /*** Average Table ***/
    870878  if ((catalog[0].catflags & DVO_LOAD_AVERAGE) && (catalog[0].average != NULL)) {
     
    892900    }
    893901
     902    if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE);
     903
    894904    if (!dvo_catalog_save_subcat (catalog, &ftable, start, Nrows, catalog[0].Naverage_disk, Naverage_disk_new)) {
    895905      fprintf (stderr, "failure writing Average table\n");
    896906      goto failure;
    897907    }
     908
     909    if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE);
    898910
    899911    gfits_free_header (&header);
     
    924936    assert (catalog[0].Nmeasure_disk >= catalog[0].Nmeasure_off);
    925937
     938    if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE);
     939
    926940    // if we are going to compress, we need to receive unswapped data --
    927941    int swapFromNative = !output_is_compressed (start, Nrows, Nmeasure_disk_new, catalog->catcompress);
     
    932946      goto failure;
    933947    }
     948
     949    if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE);
    934950
    935951    // write out Measure table
     
    939955      goto failure;
    940956    }
     957    if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE);
     958
    941959
    942960    gfits_free_header (&header);
     
    9881006    int swapFromNative = !output_is_compressed (start, Nrows, Nsecfilt_disk_new, catalog->catcompress);
    9891007
     1008    if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE);
     1009
    9901010    // convert to external table format
    9911011    if (!SecFiltToFtable (&ftable, &secfilt[first], Nrows, catalog[0].catformat, swapFromNative)) {
     
    9931013      goto failure;
    9941014    }
     1015
     1016    if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE);
    9951017
    9961018    // write out SecFilt table
  • branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dvo_photcode_ops.c

    r38553 r38667  
    747747}
    748748
     749// return the number of detections in this filter (gpc1)
     750int PhotNcode (PhotCode *code, Average *average, SecFilt *secfilt) {
     751
     752  if (code == NULL) return 0;
     753
     754  int Ns = photcodes[0].hashNsec[code[0].code];
     755  if (Ns == -1) return 0;
     756
     757  return secfilt[Ns].Ncode;
     758}
     759
     760// return the number of detections in this filter (gpc1)
     761int PhotSecfiltFlags (PhotCode *code, Average *average, SecFilt *secfilt) {
     762
     763  if (code == NULL) return 0;
     764
     765  int Ns = photcodes[0].hashNsec[code[0].code];
     766  if (Ns == -1) return 0;
     767
     768  return secfilt[Ns].flags;
     769}
     770
    749771int PhotNphot (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source) {
    750772
Note: See TracChangeset for help on using the changeset viewer.