Changeset 16810 for trunk/Ohana/src/libdvo
- Timestamp:
- Mar 4, 2008, 12:39:41 PM (18 years ago)
- Location:
- trunk/Ohana/src/libdvo
- Files:
-
- 2 added
- 2 deleted
- 17 edited
-
Makefile (modified) (3 diffs)
-
include/dvo.h (modified) (3 diffs)
-
include/ps1_dev_2_defs.h (added)
-
src/LoadPhotcodesFITS.c (modified) (1 diff)
-
src/LoadPhotcodesText.c (modified) (3 diffs)
-
src/SavePhotcodesFITS.c (modified) (1 diff)
-
src/dvo_catalog.c (modified) (1 diff)
-
src/dvo_catalog_chipcoords.c (modified) (1 diff)
-
src/dvo_catalog_raw.c (modified) (9 diffs)
-
src/dvo_convert.c (modified) (9 diffs)
-
src/dvo_convert_PS1_DEV_1.c (modified) (13 diffs)
-
src/dvo_convert_PS1_DEV_2.c (added)
-
src/dvo_convert_elixir.c (modified) (7 diffs)
-
src/dvo_convert_loneos.c (modified) (4 diffs)
-
src/dvo_convert_panstarrs_DEV_0.c (modified) (5 diffs)
-
src/dvo_convert_panstarrs_DEV_1.c (modified) (5 diffs)
-
src/dvo_image.c (modified) (1 diff)
-
src/dvo_image_raw.c (modified) (2 diffs)
-
src/dvo_photcode_convert_elixir.c (deleted)
-
src/dvo_photcode_convert_ps1_dev_1.c (deleted)
-
src/dvo_photcode_ops.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/Makefile
r16139 r16810 29 29 $(DESTINC)/panstarrs_dev_0_defs.h \ 30 30 $(DESTINC)/panstarrs_dev_1_defs.h \ 31 $(DESTINC)/ps1_dev_1_defs.h 31 $(DESTINC)/ps1_dev_1_defs.h \ 32 $(DESTINC)/ps1_dev_2_defs.h 32 33 33 34 INCS = $(DEFS) $(DESTINC)/dvo.h $(DESTINC)/autocode.h … … 37 38 $(SRC)/coordops.$(ARCH).o \ 38 39 $(SRC)/dvosorts.$(ARCH).o \ 39 $(SRC)/dvo_photcode_ops.$(ARCH).o \40 $(SRC)/dvo_photcode_convert_elixir.$(ARCH).o \41 $(SRC)/dvo_photcode_convert_ps1_dev_1.$(ARCH).o \42 40 $(SRC)/dvo_photcode_ops.$(ARCH).o \ 43 41 $(SRC)/LoadPhotcodes.$(ARCH).o \ … … 64 62 $(SRC)/dvo_convert_panstarrs_DEV_1.$(ARCH).o \ 65 63 $(SRC)/dvo_convert_PS1_DEV_1.$(ARCH).o \ 64 $(SRC)/dvo_convert_PS1_DEV_2.$(ARCH).o \ 66 65 $(SRC)/skyregion_io.$(ARCH).o \ 67 66 $(SRC)/skyregion_gsc.$(ARCH).o \ -
trunk/Ohana/src/libdvo/include/dvo.h
r16057 r16810 16 16 DVO_FORMAT_PANSTARRS_DEV_0, 17 17 DVO_FORMAT_PANSTARRS_DEV_1, 18 DVO_FORMAT_PS1_DEV_1 18 DVO_FORMAT_PS1_DEV_1, 19 DVO_FORMAT_PS1_DEV_2 19 20 } DVOTableFormat; 20 21 … … 215 216 struct Catalog *secfilt_catalog; /* secfilt catalog data (split) */ 216 217 218 unsigned int objID; 219 unsigned int catID; 220 217 221 /* extra catalog information */ 218 222 int lockmode; … … 383 387 # include "panstarrs_dev_1_defs.h" 384 388 # include "ps1_dev_1_defs.h" 389 # include "ps1_dev_2_defs.h" 385 390 386 391 /*** DVO image db I/O Functions ***/ -
trunk/Ohana/src/libdvo/src/LoadPhotcodesFITS.c
r15694 r16810 50 50 photcode = PhotCode_PS1_DEV_1_To_Internal (photcode_ps1_dev_1, Ncode); 51 51 free (photcode_ps1_dev_1); 52 } 53 54 if (!strcmp (extname, "DVO_PHOTCODE_PS1_DEV_2")) { 55 PhotCode_PS1_DEV_2 *photcode_ps1_dev_2 = gfits_table_get_PhotCode_PS1_DEV_2 (&db.ftable, &Ncode, &db.swapped); 56 photcode = PhotCode_PS1_DEV_2_To_Internal (photcode_ps1_dev_2, Ncode); 57 free (photcode_ps1_dev_2); 52 58 } 53 59 -
trunk/Ohana/src/libdvo/src/LoadPhotcodesText.c
r15694 r16810 27 27 char *c; 28 28 char line[256], **c1_names, **c2_names, **eq_names; 29 char name[32], type[32], Zero[32], Airmass[32], Offset[32], 30 C1[32], C2[32], Slope[32], Color[32], Primary[32]; 29 char name[32], type[32], Zero[32], Airmass[32], Offset[32]; 30 char C1[32], C2[32], Slope[32], Color[32], Primary[32]; 31 char astromErrSys[32], astromErrScale[32], astromErrMagScale[32], photomErrSys[32]; 31 32 32 33 table = GetPhotcodeTable (); … … 60 61 for (c = line; isspace (*c); c++); 61 62 if (*c == '#') continue; 62 Nfield = sscanf (c, "%d %s %s %s %s %s %s %s %s %s %s", 63 &code, name, type, Zero, Airmass, Offset, C1, C2, Slope, Color, Primary); 64 65 // XXX to add the AstromError (and PhotError) terms, we need to add them to the photcode structure, and 66 // define methods to read (at least) the old and the new photcode versions. 67 68 if (Nfield != 11) { continue; } 69 63 Nfield = sscanf (c, "%d %s %s %s %s %s %s %s %s %s %s %s %s %s %s", 64 &code, name, type, Zero, Airmass, Offset, C1, C2, Slope, Color, Primary, astromErrSys, astromErrScale, astromErrMagScale, photomErrSys); 65 66 switch (Nfield) { 67 case 11: 68 // minimum number of fields : original elixir layout 69 strcpy (astromErrSys, "0.0"); 70 strcpy (astromErrScale, "0.0"); 71 strcpy (astromErrMagScale, "0.0"); 72 strcpy (photomErrSys, "0.0"); 73 break; 74 case 14: 75 // allow only astrom elements 76 strcpy (photomErrSys, "0.0"); 77 break; 78 case 15: 79 // all fields defined 80 break; 81 default: 82 // skip unknown layouts 83 continue; 84 } 85 70 86 if (!code) { 71 87 fprintf (stderr, "photcode values may not be 0: fix %s\n", name); … … 95 111 photcode[Ncode].type = PHOT_ALT; 96 112 } 113 114 photcode[Ncode].astromErrSys = atof (astromErrSys); 115 photcode[Ncode].astromErrScale = atof (astromErrScale); 116 photcode[Ncode].astromErrMagScale = atof (astromErrMagScale); 117 photcode[Ncode].photomErrSys = atof (photomErrSys); 97 118 98 119 switch (photcode[Ncode].type) { -
trunk/Ohana/src/libdvo/src/SavePhotcodesFITS.c
r15694 r16810 29 29 // for the moment, we simply support the latest photcode format for output 30 30 // XXX update this as needed as new formats are defined 31 PhotCode_PS1_DEV_ 1 *photcode_output = PhotCode_Internal_To_PS1_DEV_1(table[0].code, table[0].Ncode);31 PhotCode_PS1_DEV_2 *photcode_output = PhotCode_Internal_To_PS1_DEV_2 (table[0].code, table[0].Ncode); 32 32 33 33 /* convert FITS format data to internal format (byteswaps & EXTNAME) */ 34 34 gfits_db_create (&db); 35 gfits_table_set_PhotCode_PS1_DEV_ 1(&db.ftable, photcode_output, table[0].Ncode);35 gfits_table_set_PhotCode_PS1_DEV_2 (&db.ftable, photcode_output, table[0].Ncode); 36 36 gfits_db_save (&db); 37 37 gfits_db_close (&db); -
trunk/Ohana/src/libdvo/src/dvo_catalog.c
r16057 r16810 51 51 if (!strcasecmp (catformat, "PANSTARRS_DEV_1")) return (DVO_FORMAT_PANSTARRS_DEV_1); 52 52 if (!strcasecmp (catformat, "PS1_DEV_1")) return (DVO_FORMAT_PS1_DEV_1); 53 if (!strcasecmp (catformat, "PS1_DEV_2")) return (DVO_FORMAT_PS1_DEV_2); 53 54 return (DVO_FORMAT_UNDEF); 54 55 } -
trunk/Ohana/src/libdvo/src/dvo_catalog_chipcoords.c
r12332 r16810 54 54 55 55 for (i = 0; i < catalog[0].Naverage; i++) { 56 m = average[i]. offset;57 for (j = 0; j < average[i].Nm ; j++, m++) {56 m = average[i].measureOffset; 57 for (j = 0; j < average[i].Nmeasure; j++, m++) { 58 58 ra = average[i].R - measure[m].dR / 3600.0; 59 59 dec = average[i].D - measure[m].dD / 3600.0; -
trunk/Ohana/src/libdvo/src/dvo_catalog_raw.c
r15743 r16810 73 73 FORMAT_CASE (PANSTARRS_DEV_1, Panstarrs_DEV_1); 74 74 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 75 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 75 76 76 77 default: … … 188 189 if (catalog[0].catflags & LOAD_AVES) { 189 190 for (i = Nmeas = Nmiss = 0; i < catalog[0].Naverage; i++) { 190 Nmeas += catalog[0].average[i].Nm ;191 Nmiss += catalog[0].average[i].N n;191 Nmeas += catalog[0].average[i].Nmeasure; 192 Nmiss += catalog[0].average[i].Nmissing; 192 193 } 193 194 if ((Nmeas != catalog[0].Nmeasure) || (Nmiss != catalog[0].Nmissing)) { … … 256 257 if (catalog[0].catformat == DVO_FORMAT_PANSTARRS_DEV_1) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PANSTARRS_DEV_1"); 257 258 if (catalog[0].catformat == DVO_FORMAT_PS1_DEV_1) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_DEV_1"); 259 if (catalog[0].catformat == DVO_FORMAT_PS1_DEV_2) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_DEV_2"); 258 260 259 261 /* rewind file pointers and truncate file */ … … 350 352 FORMAT_CASE (PANSTARRS_DEV_1, Panstarrs_DEV_1); 351 353 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 354 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 352 355 353 356 default: … … 395 398 FORMAT_CASE (PANSTARRS_DEV_1, Panstarrs_DEV_1); 396 399 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 400 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 397 401 398 402 default: … … 444 448 FORMAT_CASE (PANSTARRS_DEV_1, Panstarrs_DEV_1); 445 449 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 450 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 446 451 447 452 default: … … 489 494 FORMAT_CASE (PANSTARRS_DEV_1, Panstarrs_DEV_1); 490 495 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 496 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 491 497 492 498 default: … … 538 544 FORMAT_CASE (PANSTARRS_DEV_1, Panstarrs_DEV_1); 539 545 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 546 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 540 547 541 548 default: … … 583 590 FORMAT_CASE (PANSTARRS_DEV_1, Panstarrs_DEV_1); 584 591 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 592 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 585 593 586 594 default: -
trunk/Ohana/src/libdvo/src/dvo_convert.c
r15487 r16810 48 48 CONVERT_FORMAT ("DVO_AVERAGE_PANSTARRS_DEV_1", PANSTARRS_DEV_1, Panstarrs_DEV_1); 49 49 CONVERT_FORMAT ("DVO_AVERAGE_PS1_DEV_1", PS1_DEV_1, PS1_DEV_1); 50 CONVERT_FORMAT ("DVO_AVERAGE_PS1_DEV_2", PS1_DEV_2, PS1_DEV_2); 50 51 # undef CONVERT_FORMAT 51 52 … … 77 78 FORMAT_CASE (PANSTARRS_DEV_1, Panstarrs_DEV_1); 78 79 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 80 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 79 81 # undef FORMAT_CASE 80 82 … … 119 121 CONVERT_FORMAT ("DVO_MEASURE_PANSTARRS_DEV_1", PANSTARRS_DEV_1, Panstarrs_DEV_1); 120 122 CONVERT_FORMAT ("DVO_MEASURE_PS1_DEV_1", PS1_DEV_1, PS1_DEV_1); 123 CONVERT_FORMAT ("DVO_MEASURE_PS1_DEV_2", PS1_DEV_2, PS1_DEV_2); 121 124 # undef CONVERT_FORMAT 122 125 … … 148 151 FORMAT_CASE (PANSTARRS_DEV_1, Panstarrs_DEV_1); 149 152 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 153 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 150 154 # undef FORMAT_CASE 151 155 … … 190 194 CONVERT_FORMAT ("DVO_SECFILT_PANSTARRS_DEV_1", PANSTARRS_DEV_1, Panstarrs_DEV_1); 191 195 CONVERT_FORMAT ("DVO_SECFILT_PS1_DEV_1", PS1_DEV_1, PS1_DEV_1); 196 CONVERT_FORMAT ("DVO_SECFILT_PS1_DEV_2", PS1_DEV_2, PS1_DEV_2); 192 197 # undef CONVERT_FORMAT 193 198 … … 219 224 FORMAT_CASE (PANSTARRS_DEV_1, Panstarrs_DEV_1); 220 225 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 226 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 221 227 # undef FORMAT_CASE 222 228 … … 281 287 CONVERT_FORMAT ("DVO_IMAGE_PANSTARRS_DEV_1", PANSTARRS_DEV_1, Panstarrs_DEV_1); 282 288 CONVERT_FORMAT ("DVO_IMAGE_PS1_DEV_1", PS1_DEV_1, PS1_DEV_1); 289 CONVERT_FORMAT ("DVO_IMAGE_PS1_DEV_2", PS1_DEV_2, PS1_DEV_2); 283 290 # undef CONVERT_FORMAT 284 291 … … 313 320 FORMAT_CASE (PANSTARRS_DEV_1, Panstarrs_DEV_1); 314 321 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 322 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 315 323 # undef FORMAT_CASE 316 324 … … 361 369 FORMAT_CASE (PANSTARRS_DEV_1, Panstarrs_DEV_1); 362 370 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 371 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 363 372 # undef FORMAT_CASE 364 373 -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c
r15038 r16810 1 1 # include <dvo.h> 2 2 3 // XXX these functions ahve to be adjusted to agree with the new definition of PS1_DEV_1 4 5 /* convert panstarrs-format measures to internal measures */ 3 /* convert PS1_DEV_1 formats to internal formats */ 4 6 5 Measure *Measure_PS1_DEV_1_ToInternal (Measure_PS1_DEV_1 *in, int Nvalues) { 7 6 … … 16 15 out[i].M = in[i].M; 17 16 out[i].Mcal = in[i].Mcal; 18 out[i].M gal= in[i].Mgal;17 out[i].Map = in[i].Mgal; 19 18 out[i].dM = in[i].dM; 20 19 out[i].dt = in[i].dt; … … 30 29 out[i].imageID = in[i].imageID; 31 30 out[i].qPSF = in[i].qPSF; 32 out[i].psf Prob = in[i].psfProb;31 out[i].psfChisq = in[i].psfChisq; 33 32 out[i].crNsigma = in[i].crNsigma; 34 33 out[i].extNsigma = in[i].extNsigma; … … 47 46 } 48 47 49 /* convert internal measures to panstarrs-format measures */50 48 Measure_PS1_DEV_1 *MeasureInternalTo_PS1_DEV_1 (Measure *in, int Nvalues) { 51 49 … … 60 58 out[i].M = in[i].M; 61 59 out[i].Mcal = in[i].Mcal; 62 out[i].Mgal = in[i].M gal;60 out[i].Mgal = in[i].Map; 63 61 out[i].dM = in[i].dM; 64 62 out[i].dt = in[i].dt; … … 74 72 out[i].imageID = in[i].imageID; 75 73 out[i].qPSF = in[i].qPSF; 76 out[i].psf Prob = in[i].psfProb;74 out[i].psfChisq = in[i].psfChisq; 77 75 out[i].crNsigma = in[i].crNsigma; 78 76 out[i].extNsigma = in[i].extNsigma; … … 91 89 } 92 90 93 /* convert panstarrs-format averages to internal averages */ 94 // 'primary is needed to conform with the API for Loneos and Elixir, but is not used 91 // 'primary' is needed to conform with the API for Loneos and Elixir, but is not used 95 92 Average *Average_PS1_DEV_1_ToInternal (Average_PS1_DEV_1 *in, int Nvalues, SecFilt **primary) { 96 93 … … 99 96 100 97 ALLOCATE (out, Average, Nvalues); 98 99 for (i = 0; i < Nvalues; i++) { 100 out[i].R = in[i].R; 101 out[i].D = in[i].D; 102 out[i].Xp = in[i].Xp; 103 out[i].Nmeasure = in[i].Nm; 104 out[i].Nmissing = in[i].Nn; 105 out[i].code = in[i].code; 106 out[i].measureOffset = in[i].offset; 107 out[i].missingOffset = in[i].missing; 108 out[i].dR = in[i].dR; 109 out[i].dD = in[i].dD; 110 out[i].uR = in[i].uR; 111 out[i].uD = in[i].uD; 112 out[i].duR = in[i].duR; 113 out[i].duD = in[i].duD; 114 out[i].P = in[i].P; 115 out[i].dP = in[i].dP; 116 out[i].objID = in[i].objID; 117 out[i].catID = in[i].catID; 118 } 119 return (out); 120 } 121 122 // 'primary' is needed to conform with the API for Loneos and Elixir, but is not used 123 Average_PS1_DEV_1 *AverageInternalTo_PS1_DEV_1 (Average *in, int Nvalues, SecFilt *primary) { 124 125 int i; 126 Average_PS1_DEV_1 *out; 127 128 ALLOCATE (out, Average_PS1_DEV_1, Nvalues); 101 129 102 130 for (i = 0; i < Nvalues; i++) { … … 104 132 out[i].D = in[i].D; 105 133 out[i].Xp = in[i].Xp; 106 out[i].Nm = in[i].Nm ;107 out[i].Nn = in[i].N n;134 out[i].Nm = in[i].Nmeasure; 135 out[i].Nn = in[i].Nmissing; 108 136 out[i].code = in[i].code; 109 out[i].offset = in[i]. offset;110 out[i].missing = in[i].missing ;137 out[i].offset = in[i].measureOffset; 138 out[i].missing = in[i].missingOffset; 111 139 out[i].dR = in[i].dR; 112 140 out[i].dD = in[i].dD; … … 117 145 out[i].P = in[i].P; 118 146 out[i].dP = in[i].dP; 119 out[i].objID_hi = in[i].objID_hi; 120 out[i].objID_lo = in[i].objID_lo; 121 } 122 return (out); 123 } 124 125 /* convert internal averages to panstarrs-format averages */ 126 // 'primary is needed to conform with the API for Loneos and Elixir, but is not used 127 Average_PS1_DEV_1 *AverageInternalTo_PS1_DEV_1 (Average *in, int Nvalues, SecFilt *primary) { 128 129 int i; 130 Average_PS1_DEV_1 *out; 131 132 ALLOCATE (out, Average_PS1_DEV_1, Nvalues); 133 134 for (i = 0; i < Nvalues; i++) { 135 out[i].R = in[i].R; 136 out[i].D = in[i].D; 137 out[i].Xp = in[i].Xp; 138 out[i].Nm = in[i].Nm; 139 out[i].Nn = in[i].Nn; 140 out[i].code = in[i].code; 141 out[i].offset = in[i].offset; 142 out[i].missing = in[i].missing; 143 out[i].dR = in[i].dR; 144 out[i].dD = in[i].dD; 145 out[i].uR = in[i].uR; 146 out[i].uD = in[i].uD; 147 out[i].duR = in[i].duR; 148 out[i].duD = in[i].duD; 149 out[i].P = in[i].P; 150 out[i].dP = in[i].dP; 151 out[i].objID_hi = in[i].objID_hi; 152 out[i].objID_lo = in[i].objID_lo; 153 } 154 return (out); 155 } 156 157 /* convert panstarrs-format secfilts to internal secfilts */ 147 out[i].objID = in[i].objID; 148 out[i].catID = in[i].catID; 149 } 150 return (out); 151 } 152 158 153 SecFilt *SecFilt_PS1_DEV_1_ToInternal (SecFilt_PS1_DEV_1 *in, int Nvalues) { 159 154 … … 173 168 } 174 169 175 /* convert internal secfilts to panstarrs-format secfilts */176 170 SecFilt_PS1_DEV_1 *SecFiltInternalTo_PS1_DEV_1 (SecFilt *in, int Nvalues) { 177 171 … … 191 185 } 192 186 193 /* convert panstarrs-format images to internal images */194 187 Image *Image_PS1_DEV_1_ToInternal (Image_PS1_DEV_1 *in, int Nvalues) { 195 188 … … 300 293 return (out); 301 294 } 295 296 PhotCode_PS1_DEV_1 *PhotCode_Internal_To_PS1_DEV_1 (PhotCode *in, int Nvalues) { 297 298 int i; 299 PhotCode_PS1_DEV_1 *out; 300 301 ALLOCATE (out, PhotCode_PS1_DEV_1, Nvalues); 302 303 for (i = 0; i < Nvalues; i++) { 304 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 305 out[i].name[31] = 0; // force termination 306 307 out[i].code = in[i].code; 308 out[i].type = in[i].type; 309 out[i].C = in[i].C; 310 out[i].dC = in[i].dC; 311 out[i].dX = in[i].dX; 312 out[i].K = in[i].K; 313 out[i].c1 = in[i].c1; 314 out[i].c2 = in[i].c2; 315 out[i].equiv = in[i].equiv; 316 out[i].Nc = in[i].Nc; 317 memcpy (out[i].X, in[i].X, 4*sizeof(float)); 318 319 out[i].astromErrMagScale = out[i].astromErrMagScale; 320 out[i].photomErrSys = out[i].photomErrSys; 321 322 } 323 return (out); 324 } 325 326 PhotCode *PhotCode_PS1_DEV_1_To_Internal (PhotCode_PS1_DEV_1 *in, int Nvalues) { 327 328 int i; 329 PhotCode *out; 330 331 ALLOCATE (out, PhotCode, Nvalues); 332 333 for (i = 0; i < Nvalues; i++) { 334 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 335 out[i].name[31] = 0; // force termination 336 337 out[i].code = in[i].code; 338 out[i].type = in[i].type; 339 out[i].C = in[i].C; 340 out[i].dC = in[i].dC; 341 out[i].dX = in[i].dX; 342 out[i].K = in[i].K; 343 out[i].c1 = in[i].c1; 344 out[i].c2 = in[i].c2; 345 out[i].equiv = in[i].equiv; 346 out[i].Nc = in[i].Nc; 347 348 // not defined in PS1_DEV_1 349 out[i].astromErrSys = 0.0; 350 out[i].astromErrScale = 0.0; 351 out[i].astromErrMagScale = in[i].astromErrMagScale; 352 out[i].photomErrSys = in[i].photomErrSys; 353 354 memcpy (out[i].X, in[i].X, 4*sizeof(float)); 355 356 } 357 return (out); 358 } -
trunk/Ohana/src/libdvo/src/dvo_convert_elixir.c
r15511 r16810 16 16 out[i].dt = (in[i].dt == NAN_S_SHORT) ? NAN : in[i].dt * 0.001; 17 17 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001; 18 out[i].Mgal = (in[i].Mgal == NAN_S_SHORT) ? NAN : in[i].Mgal * 0.001; 18 19 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture 20 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags 21 out[i].Map = (in[i].Mgal == NAN_S_SHORT) ? NAN : in[i].Mgal * 0.001; 19 22 out[i].airmass = (in[i].airmass == NAN_S_SHORT) ? NAN : in[i].airmass* 0.001; 20 23 out[i].FWx = in[i].FWx; … … 39 42 out[i].dSky = 0; 40 43 out[i].qPSF = 0; 41 out[i].psf Prob= 0;44 out[i].psfChisq = 0; 42 45 out[i].crNsigma = 0; 43 46 out[i].extNsigma = 0; … … 66 69 out[i].dt = isnan(in[i].dt ) ? NAN_S_SHORT : in[i].dt * 1000.0; 67 70 out[i].Mcal = isnan(in[i].Mcal ) ? NAN_S_SHORT : in[i].Mcal * 1000.0; 68 out[i].Mgal = isnan(in[i].M gal ) ? NAN_S_SHORT : in[i].Mgal* 1000.0;71 out[i].Mgal = isnan(in[i].Map ) ? NAN_S_SHORT : in[i].Map * 1000.0; 69 72 out[i].airmass = isnan(in[i].airmass) ? NAN_S_SHORT : in[i].airmass * 1000.0; 70 73 … … 95 98 96 99 for (i = 0; i < Nvalues; i++) { 97 out[i].R = in[i].R;98 out[i].D = in[i].D;99 out[i].Xp = in[i].Xp;100 out[i].Nm = in[i].Nm;101 out[i].N n= in[i].Nn;102 out[i].code = in[i].code;103 out[i]. offset= in[i].offset;104 out[i].missing = in[i].missing;100 out[i].R = in[i].R; 101 out[i].D = in[i].D; 102 out[i].Xp = in[i].Xp; 103 out[i].Nmeasure = in[i].Nm; 104 out[i].Nmissing = in[i].Nn; 105 out[i].code = in[i].code; 106 out[i].measureOffset = in[i].offset; 107 out[i].missingOffset = in[i].missing; 105 108 106 109 /* these don't exist in Elixir */ … … 115 118 116 119 /* XXX add these later */ 117 out[i].objID _hi= 0;118 out[i]. objID_lo= 0;120 out[i].objID = 0; 121 out[i].catID = 0; 119 122 120 123 primary[0][i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; … … 139 142 out[i].D = in[i].D; 140 143 out[i].Xp = in[i].Xp; 141 out[i].Nm = in[i].Nm ;142 out[i].Nn = in[i].N n;144 out[i].Nm = in[i].Nmeasure; 145 out[i].Nn = in[i].Nmissing; 143 146 out[i].code = in[i].code; 144 out[i].offset = in[i]. offset;145 out[i].missing = in[i].missing ;147 out[i].offset = in[i].measureOffset; 148 out[i].missing = in[i].missingOffset; 146 149 147 150 out[i].M = isnan(primary[i].M) ? NAN_S_SHORT : primary[i].M * 1000.0; … … 297 300 return (out); 298 301 } 302 303 PhotCode_Elixir *PhotCode_Internal_To_Elixir (PhotCode *in, int Nvalues) { 304 305 int i; 306 PhotCode_Elixir *out; 307 308 ALLOCATE (out, PhotCode_Elixir, Nvalues); 309 310 for (i = 0; i < Nvalues; i++) { 311 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 312 out[i].name[31] = 0; // force termination 313 314 out[i].code = in[i].code; 315 out[i].type = in[i].type; 316 out[i].C = in[i].C; 317 out[i].dC = in[i].dC; 318 out[i].dX = in[i].dX; 319 out[i].K = in[i].K; 320 out[i].c1 = in[i].c1; 321 out[i].c2 = in[i].c2; 322 out[i].equiv = in[i].equiv; 323 out[i].Nc = in[i].Nc; 324 memcpy (out[i].X, in[i].X, 4*sizeof(float)); 325 } 326 return (out); 327 } 328 329 PhotCode *PhotCode_Elixir_To_Internal (PhotCode_Elixir *in, int Nvalues) { 330 331 int i; 332 PhotCode *out; 333 334 ALLOCATE (out, PhotCode, Nvalues); 335 336 for (i = 0; i < Nvalues; i++) { 337 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 338 out[i].name[31] = 0; // force termination 339 340 out[i].code = in[i].code; 341 out[i].type = in[i].type; 342 out[i].C = in[i].C; 343 out[i].dC = in[i].dC; 344 out[i].dX = in[i].dX; 345 out[i].K = in[i].K; 346 out[i].c1 = in[i].c1; 347 out[i].c2 = in[i].c2; 348 out[i].equiv = in[i].equiv; 349 out[i].Nc = in[i].Nc; 350 memcpy (out[i].X, in[i].X, 4*sizeof(float)); 351 352 // not defined in Elixir: 353 out[i].astromErrSys = 0.0; 354 out[i].astromErrScale = 0.0; 355 out[i].astromErrMagScale = 0.0; 356 out[i].photomErrSys = 0.0; 357 } 358 return (out); 359 } -
trunk/Ohana/src/libdvo/src/dvo_convert_loneos.c
r15511 r16810 24 24 25 25 /* these values don't exist in the Loneos format */ 26 out[i].Mgal = out[i].M; 27 out[i].dt = 0; 28 out[i].airmass = 0; 29 out[i].az = 0; 30 out[i].FWx = 0; 31 out[i].FWy = 0; 32 out[i].theta = 0; 33 out[i].stargal = 0; 34 out[i].Sky = 0; 35 out[i].dSky = 0; 36 out[i].qPSF = 0; 37 out[i].psfProb = 0; 26 27 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture 28 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags 29 out[i].Map = out[i].M; 30 out[i].dt = 0; 31 out[i].airmass = 0; 32 out[i].az = 0; 33 out[i].FWx = 0; 34 out[i].FWy = 0; 35 out[i].theta = 0; 36 out[i].stargal = 0; 37 out[i].Sky = 0; 38 out[i].dSky = 0; 39 out[i].qPSF = 0; 40 out[i].psfChisq = 0; 38 41 out[i].crNsigma = 0; 39 42 out[i].extNsigma = 0; … … 87 90 88 91 for (i = 0; i < Nvalues; i++) { 89 out[i].R = in[i].R;90 out[i].D = in[i].D;91 out[i].Xp = in[i].Xp;92 out[i].Nm = in[i].Nm;93 out[i].N n= in[i].Nn;94 out[i].code = in[i].code;95 out[i]. offset= in[i].offset;96 out[i].missing = in[i].missing;92 out[i].R = in[i].R; 93 out[i].D = in[i].D; 94 out[i].Xp = in[i].Xp; 95 out[i].Nmeasure = in[i].Nm; 96 out[i].Nmissing = in[i].Nn; 97 out[i].code = in[i].code; 98 out[i].measureOffset = in[i].offset; 99 out[i].missingOffset = in[i].missing; 97 100 98 101 /* these don't exist in Loneos */ … … 107 110 108 111 /* XXX add these later */ 109 out[i].objID _hi= 0;110 out[i]. objID_lo= 0;112 out[i].objID = 0; 113 out[i].catID = 0; 111 114 112 115 primary[0][i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; … … 131 134 out[i].D = in[i].D; 132 135 out[i].Xp = in[i].Xp; 133 out[i].Nm = in[i].Nm ;134 out[i].Nn = in[i].N n;136 out[i].Nm = in[i].Nmeasure; 137 out[i].Nn = in[i].Nmissing; 135 138 out[i].code = in[i].code; 136 out[i].offset = in[i]. offset;137 out[i].missing = in[i].missing ;139 out[i].offset = in[i].measureOffset; 140 out[i].missing = in[i].missingOffset; 138 141 139 142 out[i].M = isnan(primary[i].M) ? NAN_S_SHORT : primary[i].M * 1000.0; -
trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c
r15511 r16810 15 15 out[i].dM = in[i].dM; 16 16 out[i].Mcal = in[i].Mcal; 17 out[i].Mgal = in[i].Mgal; 17 18 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture 19 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags 20 out[i].Map = in[i].Mgal; 18 21 out[i].airmass = in[i].airmass; 19 22 out[i].az = in[i].az; … … 39 42 40 43 // these don't have a correspondence 41 out[i].psf Prob= 0;44 out[i].psfChisq = 0; 42 45 out[i].crNsigma = 0; 43 46 out[i].extNsigma = 0; … … 61 64 out[i].dM = in[i].dM; 62 65 out[i].Mcal = in[i].Mcal; 63 out[i].Mgal = in[i].M gal;66 out[i].Mgal = in[i].Map; 64 67 out[i].airmass = in[i].airmass; 65 68 out[i].az = in[i].az; … … 99 102 100 103 for (i = 0; i < Nvalues; i++) { 104 out[i].R = in[i].R; 105 out[i].D = in[i].D; 106 out[i].Xp = in[i].Xp; 107 out[i].Nmeasure = in[i].Nm; 108 out[i].Nmissing = in[i].Nn; 109 out[i].code = in[i].code; 110 out[i].measureOffset = in[i].offset; 111 out[i].missingOffset = in[i].missing; 112 out[i].dR = in[i].dR; 113 out[i].dD = in[i].dD; 114 out[i].uR = in[i].uR; 115 out[i].uD = in[i].uD; 116 out[i].duR = in[i].duR; 117 out[i].duD = in[i].duD; 118 out[i].P = in[i].P; 119 out[i].dP = in[i].dP; 120 out[i].objID = in[i].objID; 121 out[i].catID = in[i].catID; 122 } 123 return (out); 124 } 125 126 /* convert internal averages to panstarrs-format averages */ 127 // 'primary is needed to conform with the API for Loneos and Elixir, but is not used 128 Average_Panstarrs_DEV_0 *AverageInternalTo_Panstarrs_DEV_0 (Average *in, int Nvalues, SecFilt *primary) { 129 130 int i; 131 Average_Panstarrs_DEV_0 *out; 132 133 ALLOCATE (out, Average_Panstarrs_DEV_0, Nvalues); 134 135 for (i = 0; i < Nvalues; i++) { 101 136 out[i].R = in[i].R; 102 137 out[i].D = in[i].D; 103 138 out[i].Xp = in[i].Xp; 104 out[i].Nm = in[i].Nm ;105 out[i].Nn = in[i].N n;139 out[i].Nm = in[i].Nmeasure; 140 out[i].Nn = in[i].Nmissing; 106 141 out[i].code = in[i].code; 107 out[i].offset = in[i]. offset;108 out[i].missing = in[i].missing ;142 out[i].offset = in[i].measureOffset; 143 out[i].missing = in[i].missingOffset; 109 144 out[i].dR = in[i].dR; 110 145 out[i].dD = in[i].dD; … … 115 150 out[i].P = in[i].P; 116 151 out[i].dP = in[i].dP; 117 out[i].objID_hi = in[i].objID_hi; 118 out[i].objID_lo = in[i].objID_lo; 119 } 120 return (out); 121 } 122 123 /* convert internal averages to panstarrs-format averages */ 124 // 'primary is needed to conform with the API for Loneos and Elixir, but is not used 125 Average_Panstarrs_DEV_0 *AverageInternalTo_Panstarrs_DEV_0 (Average *in, int Nvalues, SecFilt *primary) { 126 127 int i; 128 Average_Panstarrs_DEV_0 *out; 129 130 ALLOCATE (out, Average_Panstarrs_DEV_0, Nvalues); 131 132 for (i = 0; i < Nvalues; i++) { 133 out[i].R = in[i].R; 134 out[i].D = in[i].D; 135 out[i].Xp = in[i].Xp; 136 out[i].Nm = in[i].Nm; 137 out[i].Nn = in[i].Nn; 138 out[i].code = in[i].code; 139 out[i].offset = in[i].offset; 140 out[i].missing = in[i].missing; 141 out[i].dR = in[i].dR; 142 out[i].dD = in[i].dD; 143 out[i].uR = in[i].uR; 144 out[i].uD = in[i].uD; 145 out[i].duR = in[i].duR; 146 out[i].duD = in[i].duD; 147 out[i].P = in[i].P; 148 out[i].dP = in[i].dP; 149 out[i].objID_hi = in[i].objID_hi; 150 out[i].objID_lo = in[i].objID_lo; 152 out[i].objID = in[i].objID; 153 out[i].catID = in[i].catID; 151 154 } 152 155 return (out); -
trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c
r15511 r16810 15 15 out[i].dM = in[i].dM; 16 16 out[i].Mcal = in[i].Mcal; 17 out[i].Mgal = in[i].Mgal; 17 18 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture 19 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags 20 out[i].Map = in[i].Mgal; 18 21 out[i].airmass = in[i].airmass; 19 22 out[i].az = in[i].az; … … 39 42 40 43 // these don't have a correspondence 41 out[i].psf Prob= 0;44 out[i].psfChisq = 0; 42 45 out[i].crNsigma = 0; 43 46 out[i].extNsigma = 0; … … 61 64 out[i].dM = in[i].dM; 62 65 out[i].Mcal = in[i].Mcal; 63 out[i].Mgal = in[i].M gal;66 out[i].Mgal = in[i].Map; 64 67 out[i].airmass = in[i].airmass; 65 68 out[i].az = in[i].az; … … 99 102 100 103 for (i = 0; i < Nvalues; i++) { 104 out[i].R = in[i].R; 105 out[i].D = in[i].D; 106 out[i].Xp = in[i].Xp; 107 out[i].Nmeasure = in[i].Nm; 108 out[i].Nmissing = in[i].Nn; 109 out[i].code = in[i].code; 110 out[i].measureOffset = in[i].offset; 111 out[i].missingOffset = in[i].missing; 112 out[i].dR = in[i].dR; 113 out[i].dD = in[i].dD; 114 out[i].uR = in[i].uR; 115 out[i].uD = in[i].uD; 116 out[i].duR = in[i].duR; 117 out[i].duD = in[i].duD; 118 out[i].P = in[i].P; 119 out[i].dP = in[i].dP; 120 out[i].objID = in[i].objID; 121 out[i].catID = in[i].catID; 122 } 123 return (out); 124 } 125 126 /* convert internal averages to panstarrs-format averages */ 127 // 'primary is needed to conform with the API for Loneos and Elixir, but is not used 128 Average_Panstarrs_DEV_1 *AverageInternalTo_Panstarrs_DEV_1 (Average *in, int Nvalues, SecFilt *primary) { 129 130 int i; 131 Average_Panstarrs_DEV_1 *out; 132 133 ALLOCATE (out, Average_Panstarrs_DEV_1, Nvalues); 134 135 for (i = 0; i < Nvalues; i++) { 101 136 out[i].R = in[i].R; 102 137 out[i].D = in[i].D; 103 138 out[i].Xp = in[i].Xp; 104 out[i].Nm = in[i].Nm ;105 out[i].Nn = in[i].N n;139 out[i].Nm = in[i].Nmeasure; 140 out[i].Nn = in[i].Nmissing; 106 141 out[i].code = in[i].code; 107 out[i].offset = in[i]. offset;108 out[i].missing = in[i].missing ;142 out[i].offset = in[i].measureOffset; 143 out[i].missing = in[i].missingOffset; 109 144 out[i].dR = in[i].dR; 110 145 out[i].dD = in[i].dD; … … 115 150 out[i].P = in[i].P; 116 151 out[i].dP = in[i].dP; 117 out[i].objID_hi = in[i].objID_hi; 118 out[i].objID_lo = in[i].objID_lo; 119 } 120 return (out); 121 } 122 123 /* convert internal averages to panstarrs-format averages */ 124 // 'primary is needed to conform with the API for Loneos and Elixir, but is not used 125 Average_Panstarrs_DEV_1 *AverageInternalTo_Panstarrs_DEV_1 (Average *in, int Nvalues, SecFilt *primary) { 126 127 int i; 128 Average_Panstarrs_DEV_1 *out; 129 130 ALLOCATE (out, Average_Panstarrs_DEV_1, Nvalues); 131 132 for (i = 0; i < Nvalues; i++) { 133 out[i].R = in[i].R; 134 out[i].D = in[i].D; 135 out[i].Xp = in[i].Xp; 136 out[i].Nm = in[i].Nm; 137 out[i].Nn = in[i].Nn; 138 out[i].code = in[i].code; 139 out[i].offset = in[i].offset; 140 out[i].missing = in[i].missing; 141 out[i].dR = in[i].dR; 142 out[i].dD = in[i].dD; 143 out[i].uR = in[i].uR; 144 out[i].uD = in[i].uD; 145 out[i].duR = in[i].duR; 146 out[i].duD = in[i].duD; 147 out[i].P = in[i].P; 148 out[i].dP = in[i].dP; 149 out[i].objID_hi = in[i].objID_hi; 150 out[i].objID_lo = in[i].objID_lo; 152 out[i].objID = in[i].objID; 153 out[i].catID = in[i].catID; 151 154 } 152 155 return (out); -
trunk/Ohana/src/libdvo/src/dvo_image.c
r15749 r16810 194 194 if (db[0].format == DVO_FORMAT_PANSTARRS_DEV_1) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PANSTARRS_DEV_1"); 195 195 if (db[0].format == DVO_FORMAT_PS1_DEV_1) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_DEV_1"); 196 if (db[0].format == DVO_FORMAT_PS1_DEV_2) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_DEV_2"); 196 197 197 198 return; -
trunk/Ohana/src/libdvo/src/dvo_image_raw.c
r15487 r16810 53 53 if (db[0].format == DVO_FORMAT_PANSTARRS_DEV_1) ImageSize = sizeof(Image_Panstarrs_DEV_1); 54 54 if (db[0].format == DVO_FORMAT_PS1_DEV_1) ImageSize = sizeof(Image_PS1_DEV_1); 55 if (db[0].format == DVO_FORMAT_PS1_DEV_2) ImageSize = sizeof(Image_PS1_DEV_2); 55 56 56 57 /* check that filesize makes sense */ … … 76 77 if (db[0].format == DVO_FORMAT_PANSTARRS_DEV_1) gfits_table_mkheader_Image_Panstarrs_DEV_1 (&db[0].theader); 77 78 if (db[0].format == DVO_FORMAT_PS1_DEV_1) gfits_table_mkheader_Image_PS1_DEV_1 (&db[0].theader); 79 if (db[0].format == DVO_FORMAT_PS1_DEV_2) gfits_table_mkheader_Image_PS1_DEV_2 (&db[0].theader); 78 80 79 81 /* read data from file */ -
trunk/Ohana/src/libdvo/src/dvo_photcode_ops.c
r15514 r16810 370 370 if (color == NULL) return (NAN); 371 371 if (color[0].type == PHOT_REF) { 372 for (i = 0; (i < average[0].Nm ) && (isnan(m1)); i++) {372 for (i = 0; (i < average[0].Nmeasure) && (isnan(m1)); i++) { 373 373 if (measure[i].photcode == color[0].code) { 374 374 m1 = measure[i].M; … … 384 384 if (color == NULL) return (NAN); 385 385 if (color[0].type == PHOT_REF) { 386 for (i = 0; (i < average[0].Nm ) && (isnan(m2)); i++) {386 for (i = 0; (i < average[0].Nmeasure) && (isnan(m2)); i++) { 387 387 if (measure[i].photcode == color[0].code) { 388 388 m2 = measure[i].M; … … 466 466 if (code == NULL) return (FALSE); 467 467 if (code[0].type == PHOT_REF) { 468 for (i = 0; i < average[0].Nm ; i++) {468 for (i = 0; i < average[0].Nmeasure; i++) { 469 469 if (measure[i].photcode == c1) { 470 470 M1 = measure[i].M; … … 482 482 if (code == NULL) return (FALSE); 483 483 if (code[0].type == PHOT_REF) { 484 for (i = 0; i < average[0].Nm ; i++) {484 for (i = 0; i < average[0].Nmeasure; i++) { 485 485 if (measure[i].photcode == c2) { 486 486 M2 = measure[i].M;
Note:
See TracChangeset
for help on using the changeset viewer.
