Changeset 38667
- Timestamp:
- Aug 9, 2015, 6:44:43 AM (11 years ago)
- Location:
- branches/eam_branches/ipp-20150625/Ohana/src/libdvo
- Files:
-
- 5 edited
-
include/dvo.h (modified) (1 diff)
-
src/dbExtractMeasures.c (modified) (1 diff)
-
src/dbFields.c (modified) (4 diffs)
-
src/dvo_catalog_split.c (modified) (10 diffs)
-
src/dvo_photcode_ops.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150625/Ohana/src/libdvo/include/dvo.h
r38643 r38667 902 902 float PhotZeroPoint (Measure *measure, Average *average, SecFilt *secfilt); 903 903 904 int PhotSecfiltFlags (PhotCode *code, Average *average, SecFilt *secfilt); 905 int PhotNcode (PhotCode *code, Average *average, SecFilt *secfilt); 904 906 int PhotNphot (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source); 905 907 float PhotMstdev (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source); -
branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dbExtractMeasures.c
r38153 r38667 241 241 break; 242 242 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 251 254 case MAG_OPTION_X11_SM_OBJ: 252 255 case MAG_OPTION_X12_SM_OBJ: -
branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dbFields.c
r38581 r38667 316 316 dvoMagSourceType source = GetMagSource (word); 317 317 if (source != MAG_SRC_NONE) { 318 // if mySource is already set, then we have two 'source' elements (an error) 318 319 if (mySource != MAG_SRC_NONE) { fprintf (stderr, "invalid selection %s in %s\n", word, fieldName); free (word); return FALSE; } 319 320 mySource = source; … … 324 325 dvoMagLevelType level = GetMagLevel (word); 325 326 if (level != MAG_LEVEL_NONE) { 327 // if myLevel is already set, then we have two 'level' elements (an error) 326 328 if (myLevel != MAG_LEVEL_NONE) { fprintf (stderr, "invalid selection %s in %s\n", word, fieldName); free (word); return FALSE; } 327 329 myLevel = level; … … 332 334 dvoMagClassType class = GetMagClass (word); 333 335 if (class != MAG_CLASS_NONE) { 336 // if myClass is already set, then we have two 'class' elements (an error) 334 337 if (myClass != MAG_CLASS_NONE) { fprintf (stderr, "invalid selection %s in %s\n", word, fieldName); free (word); return FALSE; } 335 338 myClass = class; … … 340 343 dvoMagOptionType option = GetMagOption (word); 341 344 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 } 344 362 myOption = option; 345 ptr = skipword (ptr);346 continue;347 }348 // some combinations are OK: err + mag -> err349 if ((myOption == MAG_OPTION_ERR) && (option == MAG_OPTION_MAG)) {350 ptr = skipword (ptr);351 continue;352 }353 // some combinations are OK: flux + err -> FLUX_ERR354 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_ERR360 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_ERR366 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_ERR372 if ((myOption == MAG_OPTION_FLUX_ERR) && (option == MAG_OPTION_FLUX)) {373 myOption = MAG_OPTION_FLUX_ERR;374 363 ptr = skipword (ptr); 375 364 continue; -
branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dvo_catalog_split.c
r38658 r38667 100 100 return FALSE; 101 101 } 102 103 if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE); 102 104 103 105 // write PHU header … … 120 122 gfits_free_matrix (&matrix); 121 123 # endif 124 125 if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE); 122 126 123 127 FTable *outtable = ftable; … … 844 848 } 845 849 850 if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE); 851 846 852 Nmeasure_disk_new = MAX (catalog[0].Nmeasure_disk, catalog[0].Nmeasure + catalog[0].Nmeasure_off); 847 853 Nmissing_disk_new = MAX (catalog[0].Nmissing_disk, catalog[0].Nmissing + catalog[0].Nmissing_off); … … 867 873 /* in split mode, we can save only part of the data */ 868 874 875 if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE); 876 869 877 /*** Average Table ***/ 870 878 if ((catalog[0].catflags & DVO_LOAD_AVERAGE) && (catalog[0].average != NULL)) { … … 892 900 } 893 901 902 if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE); 903 894 904 if (!dvo_catalog_save_subcat (catalog, &ftable, start, Nrows, catalog[0].Naverage_disk, Naverage_disk_new)) { 895 905 fprintf (stderr, "failure writing Average table\n"); 896 906 goto failure; 897 907 } 908 909 if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE); 898 910 899 911 gfits_free_header (&header); … … 924 936 assert (catalog[0].Nmeasure_disk >= catalog[0].Nmeasure_off); 925 937 938 if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE); 939 926 940 // if we are going to compress, we need to receive unswapped data -- 927 941 int swapFromNative = !output_is_compressed (start, Nrows, Nmeasure_disk_new, catalog->catcompress); … … 932 946 goto failure; 933 947 } 948 949 if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE); 934 950 935 951 // write out Measure table … … 939 955 goto failure; 940 956 } 957 if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE); 958 941 959 942 960 gfits_free_header (&header); … … 988 1006 int swapFromNative = !output_is_compressed (start, Nrows, Nsecfilt_disk_new, catalog->catcompress); 989 1007 1008 if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE); 1009 990 1010 // convert to external table format 991 1011 if (!SecFiltToFtable (&ftable, &secfilt[first], Nrows, catalog[0].catformat, swapFromNative)) { … … 993 1013 goto failure; 994 1014 } 1015 1016 if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE); 995 1017 996 1018 // write out SecFilt table -
branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dvo_photcode_ops.c
r38553 r38667 747 747 } 748 748 749 // return the number of detections in this filter (gpc1) 750 int 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) 761 int 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 749 771 int PhotNphot (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source) { 750 772
Note:
See TracChangeset
for help on using the changeset viewer.
