Changeset 40211 for branches/eam_branches/ohana.20170822
- Timestamp:
- Nov 21, 2017, 2:28:05 PM (9 years ago)
- Location:
- branches/eam_branches/ohana.20170822/src/libdvo
- Files:
-
- 1 added
- 14 edited
-
Makefile (modified) (2 diffs)
-
doc/notes.txt (modified) (1 diff)
-
include/dvo.h (modified) (2 diffs)
-
include/libdvo_astro.h (modified) (1 diff)
-
include/ps1_v6_defs.h (added)
-
src/ImageMetadata.c (modified) (4 diffs)
-
src/LoadPhotcodesFITS.c (modified) (1 diff)
-
src/SavePhotcodesFITS.c (modified) (1 diff)
-
src/dbExtractImages.c (modified) (2 diffs)
-
src/dbFields.c (modified) (2 diffs)
-
src/dvo_catalog.c (modified) (1 diff)
-
src/dvo_catalog_raw.c (modified) (8 diffs)
-
src/dvo_convert.c (modified) (19 diffs)
-
src/dvo_image.c (modified) (1 diff)
-
src/dvo_image_raw.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20170822/src/libdvo/Makefile
r40063 r40211 50 50 $(DESTINC)/ps1_v4_defs.h \ 51 51 $(DESTINC)/ps1_v5_defs.h \ 52 $(DESTINC)/ps1_v6_defs.h \ 52 53 $(DESTINC)/ps1_v5_ld_defs.h \ 53 54 $(DESTINC)/ps1_ref_defs.h \ … … 100 101 $(SRC)/dvo_convert_PS1_V4.$(ARCH).o \ 101 102 $(SRC)/dvo_convert_PS1_V5.$(ARCH).o \ 103 $(SRC)/dvo_convert_PS1_V6.$(ARCH).o \ 102 104 $(SRC)/dvo_convert_PS1_V5_LOAD.$(ARCH).o \ 103 105 $(SRC)/dvo_convert_PS1_REF.$(ARCH).o \ -
branches/eam_branches/ohana.20170822/src/libdvo/doc/notes.txt
r34749 r40211 16 16 uppercase, eg: AveragePanstarrs_DEV_0, AveragePanstarrs_PS1_2). 17 17 18 4) create a DVO TableFormat entry for the new format18 4) create a DVOCatFormat entry for the new format 19 19 (libdvo/include/dvo.h). the naming convention is DVO_FORMAT_FOO. 20 20 -
branches/eam_branches/ohana.20170822/src/libdvo/include/dvo.h
r40063 r40211 33 33 DVO_FORMAT_PS1_V4, 34 34 DVO_FORMAT_PS1_V5, 35 DVO_FORMAT_PS1_V6, 35 36 DVO_FORMAT_PS1_V5_LOAD, 36 37 } DVOCatFormat; … … 1073 1074 # include "ps1_v4_defs.h" 1074 1075 # include "ps1_v5_defs.h" 1076 # include "ps1_v6_defs.h" 1075 1077 # include "ps1_v5_ld_defs.h" 1076 1078 # include "ps1_ref_defs.h" -
branches/eam_branches/ohana.20170822/src/libdvo/include/libdvo_astro.h
r39457 r40211 100 100 float apmifit; // aperture correction (mag) 101 101 float dapmifit; // apmifit error (mag) 102 float Mcal; // calibration mag (mag) 102 float McalPSF; // calibration mag (mag) 103 float McalAPER; // calibration mag (mag) 103 104 float dMcal; // error on Mcal (mag) 104 short Xm;// image chisq (10*log(value))105 short McalChiSq; // image chisq (10*log(value)) 105 106 short photcode; // identifier for CCD, 106 107 float exptime; // exposure time (seconds) -
branches/eam_branches/ohana.20170822/src/libdvo/src/ImageMetadata.c
r37807 r40211 64 64 GET_COLUMN (crval2, "CRVAL2", double); 65 65 GET_COLUMN (theta, "THETA", float); 66 GET_COLUMN (Mcal ,"MCAL", float);66 GET_COLUMN (McalPSF, "MCAL", float); 67 67 GET_COLUMN (secz, "SECZ", float); 68 68 GET_COLUMN (Xcenter, "X_CENTER", float); … … 77 77 image[i].crval2 = crval2[i] ; 78 78 image[i].theta = theta[i] ; 79 image[i].Mcal = Mcal [i] ;79 image[i].Mcal = McalPSF[i] ; 80 80 image[i].secz = secz[i] ; 81 81 image[i].Xcenter = Xcenter[i] ; … … 90 90 free (crval2); 91 91 free (theta); 92 free (Mcal );92 free (McalPSF); 93 93 free (secz); 94 94 free (Xcenter); … … 166 166 theta[i] = DEG_RAD*atan2(mosaic->pc1_2, mosaic->pc1_1); 167 167 168 Mcal[i] = image[i].Mcal ;168 Mcal[i] = image[i].McalPSF; 169 169 secz[i] = image[i].secz; 170 170 Xcenter[i] = 0.5*image[i].NX; -
branches/eam_branches/ohana.20170822/src/libdvo/src/LoadPhotcodesFITS.c
r40063 r40211 64 64 CONVERT_FORMAT("DVO_PHOTCODE_PS1_V4", PS1_V4); 65 65 CONVERT_FORMAT("DVO_PHOTCODE_PS1_V5", PS1_V5); 66 CONVERT_FORMAT("DVO_PHOTCODE_PS1_V6", PS1_V6); 66 67 CONVERT_FORMAT("DVO_PHOTCODE_PS1_V5_LOAD", PS1_V5_LOAD); 67 68 -
branches/eam_branches/ohana.20170822/src/libdvo/src/SavePhotcodesFITS.c
r38553 r40211 30 30 // for the moment, we simply support the latest photcode format for output 31 31 // XXX update this as needed as new formats are defined 32 PhotCode_PS1_V 5 *photcode_output = PhotCode_Internal_To_PS1_V5(table[0].code, table[0].Ncode);32 PhotCode_PS1_V6 *photcode_output = PhotCode_Internal_To_PS1_V6 (table[0].code, table[0].Ncode); 33 33 34 34 /* convert FITS format data to internal format (byteswaps & EXTNAME) */ 35 35 if (!gfits_db_create (&db)) return (FALSE); 36 if (!gfits_table_set_PhotCode_PS1_V 5(&db.ftable, photcode_output, table[0].Ncode, TRUE)) return (FALSE);36 if (!gfits_table_set_PhotCode_PS1_V6 (&db.ftable, photcode_output, table[0].Ncode, TRUE)) return (FALSE); 37 37 if (!gfits_db_save (&db)) return (FALSE); 38 38 if (!gfits_db_close (&db)) return (FALSE); -
branches/eam_branches/ohana.20170822/src/libdvo/src/dbExtractImages.c
r39457 r40211 220 220 221 221 case IMAGE_MCAL: 222 value.Flt = image[N].Mcal; 222 // XXX : note add McalAPER methods 223 value.Flt = image[N].McalPSF; 223 224 break; 224 225 case IMAGE_dMCAL: … … 226 227 break; 227 228 case IMAGE_XM: 228 value.Flt = pow(10.0, 0.01*image[N].Xm);229 value.Flt = image[N].McalChiSq; 229 230 break; 230 231 case IMAGE_PHOTCODE: -
branches/eam_branches/ohana.20170822/src/libdvo/src/dbFields.c
r39633 r40211 333 333 334 334 // make a local working copy of fieldName and replace ':' with spaces 335 // XXX memory leak here: 335 336 char *fieldCopy = strcreate(fieldName); 336 337 for (j = 0; fieldCopy[j]; j++) { … … 338 339 } 339 340 341 // XXX potential memory leak here 340 342 char *firstWord = getword(fieldCopy); 343 if (!firstWord) return FALSE; 341 344 342 345 // firstWord may be either flux, mag or photcode -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_catalog.c
r40063 r40211 57 57 if (!strcasecmp (catformat, "PS1_V4")) return (DVO_FORMAT_PS1_V4); 58 58 if (!strcasecmp (catformat, "PS1_V5")) return (DVO_FORMAT_PS1_V5); 59 if (!strcasecmp (catformat, "PS1_V6")) return (DVO_FORMAT_PS1_V6); 59 60 if (!strcasecmp (catformat, "PS1_V5_LOAD")) return (DVO_FORMAT_PS1_V5_LOAD); 60 61 if (!strcasecmp (catformat, "PS1_REF")) return (DVO_FORMAT_PS1_REF); -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_catalog_raw.c
r40063 r40211 91 91 FORMAT_CASE (PS1_V4, PS1_V4); 92 92 FORMAT_CASE (PS1_V5, PS1_V5); 93 FORMAT_CASE (PS1_V6, PS1_V6); 93 94 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 94 95 FORMAT_CASE (PS1_REF, PS1_REF); … … 288 289 if (catalog[0].catformat == DVO_FORMAT_PS1_V4) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_V4"); 289 290 if (catalog[0].catformat == DVO_FORMAT_PS1_V5) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_V5"); 291 if (catalog[0].catformat == DVO_FORMAT_PS1_V6) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_V6"); 290 292 if (catalog[0].catformat == DVO_FORMAT_PS1_V5_LOAD) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_V5_LOAD"); 291 293 if (catalog[0].catformat == DVO_FORMAT_PS1_REF) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_REF"); … … 394 396 FORMAT_CASE (PS1_V4, PS1_V4); 395 397 FORMAT_CASE (PS1_V5, PS1_V5); 398 FORMAT_CASE (PS1_V6, PS1_V6); 396 399 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 397 400 FORMAT_CASE (PS1_REF, PS1_REF); … … 448 451 FORMAT_CASE (PS1_V4, PS1_V4); 449 452 FORMAT_CASE (PS1_V5, PS1_V5); 453 FORMAT_CASE (PS1_V6, PS1_V6); 450 454 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 451 455 FORMAT_CASE (PS1_REF, PS1_REF); … … 505 509 FORMAT_CASE (PS1_V3, PS1_V3); 506 510 FORMAT_CASE (PS1_V5, PS1_V5); 511 FORMAT_CASE (PS1_V6, PS1_V6); 507 512 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 508 513 FORMAT_CASE (PS1_REF, PS1_REF); … … 559 564 FORMAT_CASE (PS1_V4, PS1_V4); 560 565 FORMAT_CASE (PS1_V5, PS1_V5); 566 FORMAT_CASE (PS1_V6, PS1_V6); 561 567 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 562 568 FORMAT_CASE (PS1_REF, PS1_REF); … … 617 623 FORMAT_CASE (PS1_V4, PS1_V4); 618 624 FORMAT_CASE (PS1_V5, PS1_V5); 625 FORMAT_CASE (PS1_V6, PS1_V6); 619 626 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 620 627 FORMAT_CASE (PS1_REF, PS1_REF); … … 671 678 FORMAT_CASE (PS1_V4, PS1_V4); 672 679 FORMAT_CASE (PS1_V5, PS1_V5); 680 FORMAT_CASE (PS1_V6, PS1_V6); 673 681 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 674 682 FORMAT_CASE (PS1_REF, PS1_REF); -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert.c
r40063 r40211 42 42 CONVERT_FORMAT ("DVO_AVERAGE_PS1_V4", PS1_V4); 43 43 CONVERT_FORMAT ("DVO_AVERAGE_PS1_V5", PS1_V5); 44 CONVERT_FORMAT ("DVO_AVERAGE_PS1_V6", PS1_V6); 44 45 CONVERT_FORMAT ("DVO_AVERAGE_PS1_V5_LOAD", PS1_V5_LOAD); 45 46 CONVERT_FORMAT ("DVO_AVERAGE_PS1_REF", PS1_REF); … … 133 134 CONVERT_FORMAT ("DVO_AVERAGE_PS1_V4", PS1_V4, PS1_V4); 134 135 CONVERT_FORMAT ("DVO_AVERAGE_PS1_V5", PS1_V5, PS1_V5); 136 CONVERT_FORMAT ("DVO_AVERAGE_PS1_V6", PS1_V6, PS1_V6); 135 137 CONVERT_FORMAT ("DVO_AVERAGE_PS1_V5_LOAD", PS1_V5_LOAD, PS1_V5_LOAD); 136 138 CONVERT_FORMAT ("DVO_AVERAGE_PS1_REF", PS1_REF, PS1_REF); … … 171 173 FORMAT_CASE (PS1_V4, PS1_V4); 172 174 FORMAT_CASE (PS1_V5, PS1_V5); 175 FORMAT_CASE (PS1_V6, PS1_V6); 173 176 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 174 177 FORMAT_CASE (PS1_REF, PS1_REF); … … 270 273 CONVERT_FORMAT ("DVO_MEASURE_PS1_V4", PS1_V4, PS1_V4, FALSE); 271 274 CONVERT_FORMAT ("DVO_MEASURE_PS1_V5", PS1_V5, PS1_V5, TRUE); 275 CONVERT_FORMAT ("DVO_MEASURE_PS1_V6", PS1_V6, PS1_V6, TRUE); 272 276 CONVERT_FORMAT ("DVO_MEASURE_PS1_V5_LOAD", PS1_V5_LOAD, PS1_V5_LOAD, TRUE); 273 277 CONVERT_FORMAT ("DVO_MEASURE_PS1_REF", PS1_REF, PS1_REF, FALSE); … … 310 314 FORMAT_CASE (PS1_V4, PS1_V4, FALSE); 311 315 FORMAT_CASE (PS1_V5, PS1_V5, TRUE); 316 FORMAT_CASE (PS1_V6, PS1_V6, TRUE); 312 317 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD, TRUE); 313 318 FORMAT_CASE (PS1_REF, PS1_REF, FALSE); … … 391 396 SKIPPING_FORMAT ("DVO_MISSING_PS1_V4", PS1_V4, PS1_V4); 392 397 SKIPPING_FORMAT ("DVO_MISSING_PS1_V5", PS1_V5, PS1_V5); 398 SKIPPING_FORMAT ("DVO_MISSING_PS1_V6", PS1_V6, PS1_V6); 393 399 SKIPPING_FORMAT ("DVO_MISSING_PS1_V5_LOAD", PS1_V5_LOAD, PS1_V5_LOAD); 394 400 # undef CONVERT_FORMAT … … 466 472 CONVERT_FORMAT ("DVO_SECFILT_PS1_V4", PS1_V4, PS1_V4); 467 473 CONVERT_FORMAT ("DVO_SECFILT_PS1_V5", PS1_V5, PS1_V5); 474 CONVERT_FORMAT ("DVO_SECFILT_PS1_V6", PS1_V6, PS1_V6); 468 475 CONVERT_FORMAT ("DVO_SECFILT_PS1_V5_LOAD", PS1_V5_LOAD, PS1_V5_LOAD); 469 476 CONVERT_FORMAT ("DVO_SECFILT_PS1_REF", PS1_REF, PS1_REF); … … 504 511 FORMAT_CASE (PS1_V4, PS1_V4); 505 512 FORMAT_CASE (PS1_V5, PS1_V5); 513 FORMAT_CASE (PS1_V6, PS1_V6); 506 514 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 507 515 FORMAT_CASE (PS1_REF, PS1_REF); … … 612 620 SKIPPING_FORMAT ("DVO_LENSING_PS1_V4", PS1_V4, PS1_V4); 613 621 CONVERT_FORMAT ("DVO_LENSING_PS1_V5", PS1_V5, PS1_V5_R3); 622 CONVERT_FORMAT ("DVO_LENSING_PS1_V6", PS1_V6, PS1_V6); 614 623 CONVERT_FORMAT ("DVO_LENSING_PS1_V5_LOAD", PS1_V5_LOAD, PS1_V5_LOAD); 615 624 SKIPPING_FORMAT ("DVO_LENSING_PS1_SIM", PS1_SIM, PS1_SIM); … … 652 661 // FORMAT_CASE (PS1_V4, PS1_V4); 653 662 FORMAT_CASE (PS1_V5, PS1_V5_R3); 663 FORMAT_CASE (PS1_V6, PS1_V6); 654 664 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 655 665 # undef FORMAT_CASE … … 732 742 SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_V4", PS1_V4, PS1_V4); 733 743 CONVERT_FORMAT ("DVO_LENSOBJ_PS1_V5", PS1_V5, PS1_V5_R1); 744 CONVERT_FORMAT ("DVO_LENSOBJ_PS1_V6", PS1_V6, PS1_V6); 734 745 CONVERT_FORMAT ("DVO_LENSOBJ_PS1_V5_LOAD", PS1_V5_LOAD, PS1_V5_LOAD); 735 746 SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_SIM", PS1_SIM, PS1_SIM); … … 772 783 // FORMAT_CASE (PS1_V4, PS1_V4); 773 784 FORMAT_CASE (PS1_V5, PS1_V5_R1); 785 FORMAT_CASE (PS1_V6, PS1_V6); 774 786 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 775 787 # undef FORMAT_CASE … … 840 852 SKIPPING_FORMAT ("DVO_STARPAR_PS1_V4", PS1_V4, PS1_V4); 841 853 CONVERT_FORMAT ("DVO_STARPAR_PS1_V5", PS1_V5, PS1_V5); 854 CONVERT_FORMAT ("DVO_STARPAR_PS1_V6", PS1_V6, PS1_V6); 842 855 CONVERT_FORMAT ("DVO_STARPAR_PS1_V5_LOAD", PS1_V5_LOAD, PS1_V5_LOAD); 843 856 # undef CONVERT_FORMAT … … 880 893 // FORMAT_CASE (PS1_V4, PS1_V4); 881 894 FORMAT_CASE (PS1_V5, PS1_V5); 895 FORMAT_CASE (PS1_V6, PS1_V6); 882 896 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 883 897 # undef FORMAT_CASE … … 961 975 SKIPPING_FORMAT ("DVO_GALPHOT_PS1_V4", PS1_V4, PS1_V4); 962 976 CONVERT_FORMAT ("DVO_GALPHOT_PS1_V5", PS1_V5, PS1_V5_R1); 977 CONVERT_FORMAT ("DVO_GALPHOT_PS1_V6", PS1_V6, PS1_V6); 963 978 CONVERT_FORMAT ("DVO_GALPHOT_PS1_V5_LOAD", PS1_V5_LOAD, PS1_V5_LOAD); 964 979 SKIPPING_FORMAT ("DVO_GALPHOT_PS1_SIM", PS1_SIM, PS1_SIM); … … 1000 1015 // FORMAT_CASE (PS1_V3, PS1_V3); 1001 1016 // FORMAT_CASE (PS1_V4, PS1_V4); 1002 FORMAT_CASE (PS1_V 5, PS1_V5_R1);1017 FORMAT_CASE (PS1_V6, PS1_V6); 1003 1018 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 1004 1019 # undef FORMAT_CASE … … 1075 1090 CONVERT_FORMAT ("DVO_IMAGE_PS1_V4", PS1_V4, PS1_V4); 1076 1091 CONVERT_FORMAT ("DVO_IMAGE_PS1_V5", PS1_V5, PS1_V5); 1092 CONVERT_FORMAT ("DVO_IMAGE_PS1_V6", PS1_V6, PS1_V6); 1077 1093 CONVERT_FORMAT ("DVO_IMAGE_PS1_V5_LOAD", PS1_V5_LOAD, PS1_V5_LOAD); 1078 1094 CONVERT_FORMAT ("DVO_IMAGE_PS1_REF", PS1_REF, PS1_REF); … … 1114 1130 FORMAT_CASE (PS1_V4, PS1_V4); 1115 1131 FORMAT_CASE (PS1_V5, PS1_V5); 1132 FORMAT_CASE (PS1_V6, PS1_V6); 1116 1133 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 1117 1134 FORMAT_CASE (PS1_REF, PS1_REF); … … 1166 1183 FORMAT_CASE (PS1_V4, PS1_V4); 1167 1184 FORMAT_CASE (PS1_V5, PS1_V5); 1185 FORMAT_CASE (PS1_V6, PS1_V6); 1168 1186 FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD); 1169 1187 FORMAT_CASE (PS1_REF, PS1_REF); -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_image.c
r40063 r40211 223 223 if (db[0].format == DVO_FORMAT_PS1_V4) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_V4"); 224 224 if (db[0].format == DVO_FORMAT_PS1_V5) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_V5"); 225 if (db[0].format == DVO_FORMAT_PS1_V6) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_V6"); 225 226 if (db[0].format == DVO_FORMAT_PS1_V5_LOAD) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_V5_LOAD"); 226 227 if (db[0].format == DVO_FORMAT_PS1_REF) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_REF"); -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_image_raw.c
r40063 r40211 60 60 if (db[0].format == DVO_FORMAT_PS1_V4) ImageSize = sizeof(Image_PS1_V4); 61 61 if (db[0].format == DVO_FORMAT_PS1_V5) ImageSize = sizeof(Image_PS1_V5); 62 if (db[0].format == DVO_FORMAT_PS1_V6) ImageSize = sizeof(Image_PS1_V6); 62 63 if (db[0].format == DVO_FORMAT_PS1_V5_LOAD) ImageSize = sizeof(Image_PS1_V5_LOAD); 63 64 if (db[0].format == DVO_FORMAT_PS1_REF) ImageSize = sizeof(Image_PS1_REF); … … 93 94 if (db[0].format == DVO_FORMAT_PS1_V4) gfits_table_mkheader_Image_PS1_V4 (&db[0].theader); 94 95 if (db[0].format == DVO_FORMAT_PS1_V5) gfits_table_mkheader_Image_PS1_V5 (&db[0].theader); 96 if (db[0].format == DVO_FORMAT_PS1_V6) gfits_table_mkheader_Image_PS1_V6 (&db[0].theader); 95 97 if (db[0].format == DVO_FORMAT_PS1_V5_LOAD) gfits_table_mkheader_Image_PS1_V5_LOAD (&db[0].theader); 96 98 if (db[0].format == DVO_FORMAT_PS1_REF) gfits_table_mkheader_Image_PS1_REF (&db[0].theader);
Note:
See TracChangeset
for help on using the changeset viewer.
