Changeset 37038
- Timestamp:
- Jul 17, 2014, 10:14:00 AM (12 years ago)
- Location:
- trunk/Ohana/src/relastro
- Files:
-
- 20 edited
- 1 copied
-
doc/pv2.txt (copied) (copied from branches/eam_branches/ipp-20140610/Ohana/src/relastro/doc/pv2.txt )
-
include/relastro.h (modified) (4 diffs)
-
src/BrightCatalog.c (modified) (20 diffs)
-
src/FitChip.c (modified) (1 diff)
-
src/ImageOps.c (modified) (19 diffs)
-
src/MeanPosIO.c (modified) (1 diff)
-
src/MosaicOps.c (modified) (1 diff)
-
src/Shutdown.c (modified) (1 diff)
-
src/UpdateObjectOffsets.c (modified) (1 diff)
-
src/UpdateObjects.c (modified) (8 diffs)
-
src/args.c (modified) (2 diffs)
-
src/dvo_astrom_ops.c (modified) (3 diffs)
-
src/high_speed_objects.c (modified) (2 diffs)
-
src/hpm_objects.c (modified) (1 diff)
-
src/initialize.c (modified) (2 diffs)
-
src/launch_region_hosts.c (modified) (1 diff)
-
src/load_catalogs.c (modified) (3 diffs)
-
src/markObjects.c (modified) (2 diffs)
-
src/relastroVisual.c (modified) (2 diffs)
-
src/relastro_merge_source.c (modified) (1 diff)
-
src/share_mean_pos.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relastro/include/relastro.h
r36833 r37038 5 5 # include <assert.h> 6 6 # include <pthread.h> 7 8 # define MARKTIME(MSG,...) { \9 gettimeofday (&stopTimer, (void *) NULL); \10 float dtime = DTIME (stopTimer, startTimer); \11 fprintf (stderr, MSG, __VA_ARGS__); }12 13 # define INITTIME \14 struct timeval startTimer, stopTimer; \15 gettimeofday (&startTimer, (void *) NULL);16 7 17 8 // choose off_t or int depending on full-scale relphot analysis resources … … 84 75 double X, Y; /* Chip Coords - pixels */ 85 76 float Mag; 86 float Color; 77 float ColorBlue; 78 float ColorRed; 87 79 float dMag; 88 80 float dPos; … … 218 210 SkyRegionSelection SELECTION; 219 211 220 char *DCR_COLOR_POS, *DCR_COLOR_NEG; 221 PhotCode *DCR_PHOTCODE_POS, *DCR_PHOTCODE_NEG; 222 int DCR_NSEC_POS, DCR_NSEC_NEG; 212 char *DCR_BLUE_COLOR_POS, *DCR_BLUE_COLOR_NEG; 213 PhotCode *DCR_BLUE_PHOTCODE_POS, *DCR_BLUE_PHOTCODE_NEG; 214 int DCR_BLUE_NSEC_POS, DCR_BLUE_NSEC_NEG; 215 216 char *DCR_RED_COLOR_POS, *DCR_RED_COLOR_NEG; 217 PhotCode *DCR_RED_PHOTCODE_POS, *DCR_RED_PHOTCODE_NEG; 218 int DCR_RED_NSEC_POS, DCR_RED_NSEC_NEG; 223 219 224 220 int ImagSelect; … … 532 528 int select_mosaics_hostregion (RegionHostTable *regionHosts, Image *image, off_t Nimage); 533 529 534 float getColor (off_t meas, int cat); 530 float getColorBlue (off_t meas, int cat); 531 float getColorRed (off_t meas, int cat); 535 532 536 533 int strextend (char *input, char *format,...); -
trunk/Ohana/src/relastro/src/BrightCatalog.c
r36833 r37038 68 68 69 69 // need to create and assign to flat-field correction 70 GET_COLUMN( dR, "RA_OFF", float);71 GET_COLUMN( dD, "DEC_OFF", float);70 GET_COLUMN(R, "RA", double); 71 GET_COLUMN(D, "DEC", double); 72 72 GET_COLUMN(M, "MAG_SYS", float); 73 73 GET_COLUMN(Mcal, "MAG_CAL", float); … … 92 92 ALLOCATE (measure, MeasureTiny, Nrow); 93 93 for (i = 0; i < Nrow; i++) { 94 measure[i]. dR = dR[i];95 measure[i]. dD = dD[i];94 measure[i].R = R[i]; 95 measure[i].D = D[i]; 96 96 measure[i].M = M[i]; 97 97 measure[i].Mcal = Mcal[i]; … … 113 113 // fprintf (stderr, "loaded data for %lld measures\n", (long long) Nrow); 114 114 115 free ( dR);116 free ( dD);115 free (R ); 116 free (D ); 117 117 free (M ); 118 118 free (Mcal ); … … 145 145 if (!gfits_fread_ftable_data (f, &ftable, FALSE)) goto escape; 146 146 147 GET_COLUMN(R, "RA", double); 148 GET_COLUMN(D, "DEC", double); 149 GET_COLUMN(dR, "RA_ERR", float); 150 GET_COLUMN(dD, "DEC_ERR", float); 151 GET_COLUMN(uR, "U_RA", float); 152 GET_COLUMN(uD, "U_DEC", float); 153 GET_COLUMN(duR, "V_RA_ERR", float); 154 GET_COLUMN(duD, "V_DEC_ERR", float); 155 GET_COLUMN(P, "PAR", float); 156 GET_COLUMN(dP, "PAR_ERR", float); 157 GET_COLUMN(ChiSqAve, "CHISQ_POS", float); 158 GET_COLUMN(ChiSqPM, "CHISQ_PM", float); 159 GET_COLUMN(ChiSqPar, "CHISQ_PAP", float); 160 GET_COLUMN(Tmean, "MEAN_EPOCH", int); 161 GET_COLUMN(Trange, "TIME_RANGE", int); 162 GET_COLUMN(stargal, "STARGAL_SEP", float); 163 GET_COLUMN(Npos, "NUMBER_POS", short); 164 GET_COLUMN(Nmeasure, "NMEASURE", short); 165 GET_COLUMN(Nmissing, "NMISSING", short); 166 GET_COLUMN(Nextend, "NEXTEND", short); 167 GET_COLUMN(measureOffset, "OFF_MEASURE", int); 168 GET_COLUMN(missingOffset, "OFF_MISSING", int); 169 GET_COLUMN(refColor, "REF_COLOR", float); 170 GET_COLUMN(flags, "FLAGS", int); 171 GET_COLUMN(photFlagsUpper, "PHOTFLAGS_U", int); 172 GET_COLUMN(photFlagsLower, "PHOTFLAGS_L", int); 173 GET_COLUMN(objID, "OBJ_ID", int); 174 GET_COLUMN(catID, "CAT_ID", int); 175 GET_COLUMN(extID, "EXT_ID", int64_t); 147 GET_COLUMN(R, "RA", double); 148 GET_COLUMN(D, "DEC", double); 149 GET_COLUMN(dR, "RA_ERR", float); 150 GET_COLUMN(dD, "DEC_ERR", float); 151 GET_COLUMN(uR, "U_RA", float); 152 GET_COLUMN(uD, "U_DEC", float); 153 GET_COLUMN(duR, "V_RA_ERR", float); 154 GET_COLUMN(duD, "V_DEC_ERR", float); 155 GET_COLUMN(P, "PAR", float); 156 GET_COLUMN(dP, "PAR_ERR", float); 157 GET_COLUMN(ChiSqAve, "CHISQ_POS", float); 158 GET_COLUMN(ChiSqPM, "CHISQ_PM", float); 159 GET_COLUMN(ChiSqPar, "CHISQ_PAP", float); 160 GET_COLUMN(Tmean, "MEAN_EPOCH", int); 161 GET_COLUMN(Trange, "TIME_RANGE", int); 162 GET_COLUMN(stargal, "STARGAL_SEP", float); 163 GET_COLUMN(Npos, "NUMBER_POS", short); 164 GET_COLUMN(Nmeasure, "NMEASURE", short); 165 GET_COLUMN(Nmissing, "NMISSING", short); 166 GET_COLUMN(Nextend, "NEXTEND", short); 167 GET_COLUMN(measureOffset, "OFF_MEASURE", int); 168 GET_COLUMN(missingOffset, "OFF_MISSING", int); 169 GET_COLUMN(refColorBlue, "REF_COLOR_BLUE", float); 170 GET_COLUMN(refColorRed, "REF_COLOR_RED", float); 171 GET_COLUMN(flags, "FLAGS", int); 172 GET_COLUMN(photFlagsUpper, "PHOTFLAGS_U", int); 173 GET_COLUMN(photFlagsLower, "PHOTFLAGS_L", int); 174 GET_COLUMN(objID, "OBJ_ID", int); 175 GET_COLUMN(catID, "CAT_ID", int); 176 GET_COLUMN(extID, "EXT_ID", int64_t); 176 177 gfits_free_header (&theader); 177 178 gfits_free_table (&ftable); … … 202 203 average[i].measureOffset = measureOffset[i] ; 203 204 average[i].missingOffset = missingOffset[i] ; 204 average[i].refColor = refColor[i] ; 205 average[i].refColorBlue = refColorBlue[i] ; 206 average[i].refColorRed = refColorRed[i] ; 205 207 average[i].flags = flags[i] ; 206 208 average[i].photFlagsUpper = photFlagsUpper[i] ; … … 234 236 free (measureOffset); 235 237 free (missingOffset); 236 free (refColor); 238 free (refColorBlue); 239 free (refColorRed); 237 240 free (flags); 238 241 free (photFlagsUpper); … … 256 259 257 260 // need to create and assign to flat-field correction 258 GET_COLUMN(M, "MAG", float);259 GET_COLUMN(dM, "MAG_ERR", float);260 GET_COLUMN( Xm,"MAG_CHI", float);261 GET_COLUMN(flags, "FLAGS", int);262 GET_COLUMN(Ncode, "NCODE", short);263 GET_COLUMN(Nused, "NUSED", short);264 GET_COLUMN(M _20, "MAG_20", short);265 GET_COLUMN(M _80, "MAG_80", short);261 GET_COLUMN(M, "MAG", float); 262 GET_COLUMN(dM, "MAG_ERR", float); 263 GET_COLUMN(Mchisq, "MAG_CHI", float); 264 GET_COLUMN(flags, "FLAGS", int); 265 GET_COLUMN(Ncode, "NCODE", short); 266 GET_COLUMN(Nused, "NUSED", short); 267 GET_COLUMN(Mmin, "MAG_MIN", float); 268 GET_COLUMN(Mmax, "MAG_MAX", float); 266 269 gfits_free_header (&theader); 267 270 gfits_free_table (&ftable); … … 270 273 ALLOCATE (secfilt, SecFilt, Nrow); 271 274 for (i = 0; i < Nrow; i++) { 272 secfilt[i].M = M[i];273 secfilt[i].dM = dM[i];274 secfilt[i]. Xm = Xm[i];275 secfilt[i].flags = flags[i];276 secfilt[i].Ncode = Ncode[i];277 secfilt[i].Nused = Nused[i];278 secfilt[i].M _20 = M_20[i];279 secfilt[i].M _80 = M_80[i];275 secfilt[i].M = M[i]; 276 secfilt[i].dM = dM[i]; 277 secfilt[i].Mchisq = Mchisq[i]; 278 secfilt[i].flags = flags[i]; 279 secfilt[i].Ncode = Ncode[i]; 280 secfilt[i].Nused = Nused[i]; 281 secfilt[i].Mmin = Mmin[i]; 282 secfilt[i].Mmax = Mmax[i]; 280 283 } 281 284 fprintf (stderr, "loaded data for %lld averages\n", (long long) Nrow); … … 283 286 free (M ); 284 287 free (dM ); 285 free ( Xm);288 free (Mchisq); 286 289 free (flags); 287 290 free (Ncode); 288 291 free (Nused); 289 free (M _20);290 free (M _80);292 free (Mmin ); 293 free (Mmax ); 291 294 catalog->secfilt = secfilt; 292 295 // assert Nsecfilt * Naverage = Nrow? … … 351 354 gfits_define_bintable_column (&theader, "E", "Y_FIX", "ccd y fiex coord", "pix", 1.0, 0.0); 352 355 gfits_define_bintable_column (&theader, "E", "EXPTIME", "-2.5 * log (exposure time)", "sec", 1.0, 0.0); 353 gfits_define_bintable_column (&theader, "J", "TIME", "time of exp", "sec", 1.0, 1.0*0x8000);354 gfits_define_bintable_column (&theader, "J", "AVE_REF", "pointer to average table", NULL, 1.0, 1.0*0x8000);355 gfits_define_bintable_column (&theader, "J", "IMAGE_ID", "image", NULL, 1.0, 1.0*0x8000);356 gfits_define_bintable_column (&theader, "J", "DB_FLAGS", "flags", NULL, 1.0, 1.0*0x8000);357 gfits_define_bintable_column (&theader, "J", "PHOT_FLAGS", "photflags", NULL, 1.0, 1.0*0x8000);358 gfits_define_bintable_column (&theader, "J", "CAT_ID", "catalog", NULL, 1.0, 1.0*0x8000);359 gfits_define_bintable_column (&theader, "I", "PHOTCODE", "photcode", NULL, 1.0, 1.0*0x80);356 gfits_define_bintable_column (&theader, "J", "TIME", "time of exp", "sec", 1.0, 0.0); 357 gfits_define_bintable_column (&theader, "J", "AVE_REF", "pointer to average table", NULL, 1.0, 0.0); 358 gfits_define_bintable_column (&theader, "J", "IMAGE_ID", "image", NULL, 1.0, 0.0); 359 gfits_define_bintable_column (&theader, "J", "DB_FLAGS", "flags", NULL, 1.0, 0.0); 360 gfits_define_bintable_column (&theader, "J", "PHOT_FLAGS", "photflags", NULL, 1.0, 0.0); 361 gfits_define_bintable_column (&theader, "J", "CAT_ID", "catalog", NULL, 1.0, 0.0); 362 gfits_define_bintable_column (&theader, "I", "PHOTCODE", "photcode", NULL, 1.0, 0.0); 360 363 361 364 // generate the output array that carries the data … … 363 366 364 367 // create intermediate storage arrays 365 float *dR ; ALLOCATE (dR , float, catalog->Nmeasure);366 float *dD ; ALLOCATE (dD , float, catalog->Nmeasure);367 float *M ; ALLOCATE (M , float,catalog->Nmeasure);368 float *Mcal ; ALLOCATE (Mcal , float,catalog->Nmeasure);369 float *dM ; ALLOCATE (dM , float,catalog->Nmeasure);370 float *airmass ; ALLOCATE (airmass , float,catalog->Nmeasure);371 float *Xccd ; ALLOCATE (Xccd , float,catalog->Nmeasure);372 float *Yccd ; ALLOCATE (Yccd , float,catalog->Nmeasure);373 float *Xfix ; ALLOCATE (Xfix , float,catalog->Nmeasure);374 float *Yfix ; ALLOCATE (Yfix , float,catalog->Nmeasure);375 float *dt ; ALLOCATE (dt , float,catalog->Nmeasure);376 int *t ; ALLOCATE (t , int ,catalog->Nmeasure);377 int *averef ; ALLOCATE (averef , int ,catalog->Nmeasure);378 int *imageID ; ALLOCATE (imageID , int ,catalog->Nmeasure);379 int *dbFlags ; ALLOCATE (dbFlags , int ,catalog->Nmeasure);380 int *photFlags ; ALLOCATE (photFlags, int ,catalog->Nmeasure);381 int *catID ; ALLOCATE (catID , int ,catalog->Nmeasure);382 short *photcode ; ALLOCATE (photcode , short,catalog->Nmeasure);368 double *R ; ALLOCATE (R , double, catalog->Nmeasure); 369 double *D ; ALLOCATE (D , double, catalog->Nmeasure); 370 float *M ; ALLOCATE (M , float, catalog->Nmeasure); 371 float *Mcal ; ALLOCATE (Mcal , float, catalog->Nmeasure); 372 float *dM ; ALLOCATE (dM , float, catalog->Nmeasure); 373 float *airmass ; ALLOCATE (airmass , float, catalog->Nmeasure); 374 float *Xccd ; ALLOCATE (Xccd , float, catalog->Nmeasure); 375 float *Yccd ; ALLOCATE (Yccd , float, catalog->Nmeasure); 376 float *Xfix ; ALLOCATE (Xfix , float, catalog->Nmeasure); 377 float *Yfix ; ALLOCATE (Yfix , float, catalog->Nmeasure); 378 float *dt ; ALLOCATE (dt , float, catalog->Nmeasure); 379 int *t ; ALLOCATE (t , int , catalog->Nmeasure); 380 int *averef ; ALLOCATE (averef , int , catalog->Nmeasure); 381 int *imageID ; ALLOCATE (imageID , int , catalog->Nmeasure); 382 int *dbFlags ; ALLOCATE (dbFlags , int , catalog->Nmeasure); 383 int *photFlags ; ALLOCATE (photFlags, int , catalog->Nmeasure); 384 int *catID ; ALLOCATE (catID , int , catalog->Nmeasure); 385 short *photcode ; ALLOCATE (photcode , short, catalog->Nmeasure); 383 386 384 387 // assign the storage arrays 385 388 MeasureTiny *measure = catalog->measure; 386 389 for (i = 0; i < catalog->Nmeasure; i++) { 387 dR[i] = measure[i].dR;388 dD[i] = measure[i].dD;390 R[i] = measure[i].R ; 391 D[i] = measure[i].D ; 389 392 M[i] = measure[i].M ; 390 393 Mcal[i] = measure[i].Mcal ; … … 406 409 407 410 // add the columns to the output array 408 gfits_set_bintable_column (&theader, &ftable, "RA _OFF", dR,catalog->Nmeasure);409 gfits_set_bintable_column (&theader, &ftable, "DEC _OFF", dD,catalog->Nmeasure);411 gfits_set_bintable_column (&theader, &ftable, "RA", R, catalog->Nmeasure); 412 gfits_set_bintable_column (&theader, &ftable, "DEC", D, catalog->Nmeasure); 410 413 gfits_set_bintable_column (&theader, &ftable, "MAG_SYS", M, catalog->Nmeasure); 411 414 gfits_set_bintable_column (&theader, &ftable, "MAG_CAL", Mcal, catalog->Nmeasure); … … 425 428 gfits_set_bintable_column (&theader, &ftable, "PHOTCODE", photcode, catalog->Nmeasure); 426 429 427 free ( dR);428 free ( dD);430 free (R ); 431 free (D ); 429 432 free (M ); 430 433 free (Mcal ); … … 454 457 gfits_create_table_header (&theader, "BINTABLE", "AVERAGE"); 455 458 456 gfits_define_bintable_column (&theader, "D", "RA", "RA", "", 1.0, 0.0); 457 gfits_define_bintable_column (&theader, "D", "DEC", "DEC", "", 1.0, 0.0); 458 gfits_define_bintable_column (&theader, "E", "RA_ERR", "RA error", "", 1.0, 0.0); 459 gfits_define_bintable_column (&theader, "E", "DEC_ERR", "DEC error", "", 1.0, 0.0); 460 gfits_define_bintable_column (&theader, "E", "U_RA", "RA*cos(D) proper-motion", "", 1.0, 0.0); 461 gfits_define_bintable_column (&theader, "E", "U_DEC", "DEC proper-motion", "", 1.0, 0.0); 462 gfits_define_bintable_column (&theader, "E", "V_RA_ERR", "RA*cos(D) p-m error", "", 1.0, 0.0); 463 gfits_define_bintable_column (&theader, "E", "V_DEC_ERR", "DEC p-m error", "", 1.0, 0.0); 464 gfits_define_bintable_column (&theader, "E", "PAR", "parallax", "", 1.0, 0.0); 465 gfits_define_bintable_column (&theader, "E", "PAR_ERR", "parallax error", "", 1.0, 0.0); 466 gfits_define_bintable_column (&theader, "E", "CHISQ_POS", "astrometry analysis chisq", "", 1.0, 0.0); 467 gfits_define_bintable_column (&theader, "E", "CHISQ_PM", "astrometry analysis chisq", "", 1.0, 0.0); 468 gfits_define_bintable_column (&theader, "E", "CHISQ_PAP", "astrometry analysis chisq", "", 1.0, 0.0); 469 gfits_define_bintable_column (&theader, "J", "MEAN_EPOCH", "mean epoch (PM-PAR ref)", "", 1.0, 1.0*0x8000); 470 gfits_define_bintable_column (&theader, "J", "TIME_RANGE", "mean epoch (PM-PAR ref)", "", 1.0, 1.0*0x8000); 471 gfits_define_bintable_column (&theader, "E", "STARGAL_SEP", "star/galaxy separator", "", 1.0, 0.0); 472 gfits_define_bintable_column (&theader, "I", "NUMBER_POS", "number of detections used for astrometry", "", 1.0, 1.0*0x80); 473 gfits_define_bintable_column (&theader, "I", "NMEASURE", "number of psf measurements", "", 1.0, 1.0*0x80); 474 gfits_define_bintable_column (&theader, "I", "NMISSING", "number of missings", "", 1.0, 1.0*0x80); 475 gfits_define_bintable_column (&theader, "I", "NEXTEND", "number of extended measurements", "", 1.0, 1.0*0x80); 476 gfits_define_bintable_column (&theader, "J", "OFF_MEASURE", "offset to first psf measurement", "", 1.0, 1.0*0x8000); 477 gfits_define_bintable_column (&theader, "J", "OFF_MISSING", "offset to first missing obs", "", 1.0, 1.0*0x8000); 478 gfits_define_bintable_column (&theader, "E", "REF_COLOR", "reference color", "", 1.0, 0.0); 479 gfits_define_bintable_column (&theader, "J", "FLAGS", "average object flags (star; ghost; etc)", "", 1.0, 1.0*0x8000); 480 gfits_define_bintable_column (&theader, "J", "PHOTFLAGS_U", "upper bit of 2 bit summary of per-measure photflags", "", 1.0, 1.0*0x8000); 481 gfits_define_bintable_column (&theader, "J", "PHOTFLAGS_L", "lower bit of 2 bit summary of per-measure photflags", "", 1.0, 1.0*0x8000); 482 gfits_define_bintable_column (&theader, "J", "OBJ_ID", "unique ID for object in table", "", 1.0, 1.0*0x8000); 483 gfits_define_bintable_column (&theader, "J", "CAT_ID", "unique ID for table in which object was first realized", "", 1.0, 1.0*0x8000); 484 gfits_define_bintable_column (&theader, "K", "EXT_ID", "external ID for object (eg PSPS objID)", "", 1.0, 1.0*0x80000000); 459 gfits_define_bintable_column (&theader, "D", "RA", "RA", "", 1.0, 0.0); 460 gfits_define_bintable_column (&theader, "D", "DEC", "DEC", "", 1.0, 0.0); 461 gfits_define_bintable_column (&theader, "E", "RA_ERR", "RA error", "", 1.0, 0.0); 462 gfits_define_bintable_column (&theader, "E", "DEC_ERR", "DEC error", "", 1.0, 0.0); 463 gfits_define_bintable_column (&theader, "E", "U_RA", "RA*cos(D) proper-motion", "", 1.0, 0.0); 464 gfits_define_bintable_column (&theader, "E", "U_DEC", "DEC proper-motion", "", 1.0, 0.0); 465 gfits_define_bintable_column (&theader, "E", "V_RA_ERR", "RA*cos(D) p-m error", "", 1.0, 0.0); 466 gfits_define_bintable_column (&theader, "E", "V_DEC_ERR", "DEC p-m error", "", 1.0, 0.0); 467 gfits_define_bintable_column (&theader, "E", "PAR", "parallax", "", 1.0, 0.0); 468 gfits_define_bintable_column (&theader, "E", "PAR_ERR", "parallax error", "", 1.0, 0.0); 469 gfits_define_bintable_column (&theader, "E", "CHISQ_POS", "astrometry analysis chisq", "", 1.0, 0.0); 470 gfits_define_bintable_column (&theader, "E", "CHISQ_PM", "astrometry analysis chisq", "", 1.0, 0.0); 471 gfits_define_bintable_column (&theader, "E", "CHISQ_PAP", "astrometry analysis chisq", "", 1.0, 0.0); 472 gfits_define_bintable_column (&theader, "J", "MEAN_EPOCH", "mean epoch (PM-PAR ref)", "", 1.0, 0.00); 473 gfits_define_bintable_column (&theader, "J", "TIME_RANGE", "mean epoch (PM-PAR ref)", "", 1.0, 0.00); 474 gfits_define_bintable_column (&theader, "E", "STARGAL_SEP", "star/galaxy separator", "", 1.0, 0.0); 475 gfits_define_bintable_column (&theader, "I", "NUMBER_POS", "number of detections used for astrometry", "", 1.0, 0.0); 476 gfits_define_bintable_column (&theader, "I", "NMEASURE", "number of psf measurements", "", 1.0, 0.0); 477 gfits_define_bintable_column (&theader, "I", "NMISSING", "number of missings", "", 1.0, 0.0); 478 gfits_define_bintable_column (&theader, "I", "NEXTEND", "number of extended measurements", "", 1.0, 0.0); 479 gfits_define_bintable_column (&theader, "J", "OFF_MEASURE", "offset to first psf measurement", "", 1.0, 0.0); 480 gfits_define_bintable_column (&theader, "J", "OFF_MISSING", "offset to first missing obs", "", 1.0, 0.0); 481 gfits_define_bintable_column (&theader, "E", "REF_COLOR_BLUE", "reference color", "", 1.0, 0.0); 482 gfits_define_bintable_column (&theader, "E", "REF_COLOR_RED", "reference color", "", 1.0, 0.0); 483 gfits_define_bintable_column (&theader, "J", "FLAGS", "average object flags (star; ghost; etc)", "", 1.0, 0.0); 484 gfits_define_bintable_column (&theader, "J", "PHOTFLAGS_U", "upper bit of 2 bit summary of per-measure photflags", "", 1.0, 0.0); 485 gfits_define_bintable_column (&theader, "J", "PHOTFLAGS_L", "lower bit of 2 bit summary of per-measure photflags", "", 1.0, 0.0); 486 gfits_define_bintable_column (&theader, "J", "OBJ_ID", "unique ID for object in table", "", 1.0, 0.0); 487 gfits_define_bintable_column (&theader, "J", "CAT_ID", "unique ID for table in which object was first realized", "", 1.0, 0.0); 488 gfits_define_bintable_column (&theader, "K", "EXT_ID", "external ID for object (eg PSPS objID)", "", 1.0, 0.0); 485 489 486 490 // generate the output array that carries the data … … 510 514 int *measureOffset ; ALLOCATE (measureOffset , int , catalog->Naverage); 511 515 int *missingOffset ; ALLOCATE (missingOffset , int , catalog->Naverage); 512 float *refColor ; ALLOCATE (refColor , float , catalog->Naverage); 516 float *refColorBlue ; ALLOCATE (refColorBlue , float , catalog->Naverage); 517 float *refColorRed ; ALLOCATE (refColorRed , float , catalog->Naverage); 513 518 int *flags ; ALLOCATE (flags , int , catalog->Naverage); 514 519 int *photFlagsUpper; ALLOCATE (photFlagsUpper, int , catalog->Naverage); … … 543 548 measureOffset[i] = average[i].measureOffset ; 544 549 missingOffset[i] = average[i].missingOffset ; 545 refColor[i] = average[i].refColor ; 550 refColorBlue[i] = average[i].refColorBlue ; 551 refColorRed[i] = average[i].refColorRed ; 546 552 flags[i] = average[i].flags ; 547 553 photFlagsUpper[i] = average[i].photFlagsUpper ; … … 553 559 554 560 // add the columns to the output array 555 gfits_set_bintable_column (&theader, &ftable, "RA", R, catalog->Naverage); 556 gfits_set_bintable_column (&theader, &ftable, "DEC", D, catalog->Naverage); 557 gfits_set_bintable_column (&theader, &ftable, "RA_ERR", dR, catalog->Naverage); 558 gfits_set_bintable_column (&theader, &ftable, "DEC_ERR", dD, catalog->Naverage); 559 gfits_set_bintable_column (&theader, &ftable, "U_RA", uR, catalog->Naverage); 560 gfits_set_bintable_column (&theader, &ftable, "U_DEC", uD, catalog->Naverage); 561 gfits_set_bintable_column (&theader, &ftable, "V_RA_ERR", duR, catalog->Naverage); 562 gfits_set_bintable_column (&theader, &ftable, "V_DEC_ERR", duD, catalog->Naverage); 563 gfits_set_bintable_column (&theader, &ftable, "PAR", P, catalog->Naverage); 564 gfits_set_bintable_column (&theader, &ftable, "PAR_ERR", dP, catalog->Naverage); 565 gfits_set_bintable_column (&theader, &ftable, "CHISQ_POS", ChiSqAve, catalog->Naverage); 566 gfits_set_bintable_column (&theader, &ftable, "CHISQ_PM", ChiSqPM, catalog->Naverage); 567 gfits_set_bintable_column (&theader, &ftable, "CHISQ_PAP", ChiSqPar, catalog->Naverage); 568 gfits_set_bintable_column (&theader, &ftable, "MEAN_EPOCH", Tmean, catalog->Naverage); 569 gfits_set_bintable_column (&theader, &ftable, "TIME_RANGE", Trange, catalog->Naverage); 570 gfits_set_bintable_column (&theader, &ftable, "STARGAL_SEP", stargal, catalog->Naverage); 571 gfits_set_bintable_column (&theader, &ftable, "NUMBER_POS", Npos, catalog->Naverage); 572 gfits_set_bintable_column (&theader, &ftable, "NMEASURE", Nmeasure, catalog->Naverage); 573 gfits_set_bintable_column (&theader, &ftable, "NMISSING", Nmissing, catalog->Naverage); 574 gfits_set_bintable_column (&theader, &ftable, "NEXTEND", Nextend, catalog->Naverage); 575 gfits_set_bintable_column (&theader, &ftable, "OFF_MEASURE", measureOffset, catalog->Naverage); 576 gfits_set_bintable_column (&theader, &ftable, "OFF_MISSING", missingOffset, catalog->Naverage); 577 gfits_set_bintable_column (&theader, &ftable, "REF_COLOR", refColor, catalog->Naverage); 578 gfits_set_bintable_column (&theader, &ftable, "FLAGS", flags, catalog->Naverage); 579 gfits_set_bintable_column (&theader, &ftable, "PHOTFLAGS_U", photFlagsUpper, catalog->Naverage); 580 gfits_set_bintable_column (&theader, &ftable, "PHOTFLAGS_L", photFlagsLower, catalog->Naverage); 581 gfits_set_bintable_column (&theader, &ftable, "OBJ_ID", objID, catalog->Naverage); 582 gfits_set_bintable_column (&theader, &ftable, "CAT_ID", catID, catalog->Naverage); 583 gfits_set_bintable_column (&theader, &ftable, "EXT_ID", extID, catalog->Naverage); 561 gfits_set_bintable_column (&theader, &ftable, "RA", R, catalog->Naverage); 562 gfits_set_bintable_column (&theader, &ftable, "DEC", D, catalog->Naverage); 563 gfits_set_bintable_column (&theader, &ftable, "RA_ERR", dR, catalog->Naverage); 564 gfits_set_bintable_column (&theader, &ftable, "DEC_ERR", dD, catalog->Naverage); 565 gfits_set_bintable_column (&theader, &ftable, "U_RA", uR, catalog->Naverage); 566 gfits_set_bintable_column (&theader, &ftable, "U_DEC", uD, catalog->Naverage); 567 gfits_set_bintable_column (&theader, &ftable, "V_RA_ERR", duR, catalog->Naverage); 568 gfits_set_bintable_column (&theader, &ftable, "V_DEC_ERR", duD, catalog->Naverage); 569 gfits_set_bintable_column (&theader, &ftable, "PAR", P, catalog->Naverage); 570 gfits_set_bintable_column (&theader, &ftable, "PAR_ERR", dP, catalog->Naverage); 571 gfits_set_bintable_column (&theader, &ftable, "CHISQ_POS", ChiSqAve, catalog->Naverage); 572 gfits_set_bintable_column (&theader, &ftable, "CHISQ_PM", ChiSqPM, catalog->Naverage); 573 gfits_set_bintable_column (&theader, &ftable, "CHISQ_PAP", ChiSqPar, catalog->Naverage); 574 gfits_set_bintable_column (&theader, &ftable, "MEAN_EPOCH", Tmean, catalog->Naverage); 575 gfits_set_bintable_column (&theader, &ftable, "TIME_RANGE", Trange, catalog->Naverage); 576 gfits_set_bintable_column (&theader, &ftable, "STARGAL_SEP", stargal, catalog->Naverage); 577 gfits_set_bintable_column (&theader, &ftable, "NUMBER_POS", Npos, catalog->Naverage); 578 gfits_set_bintable_column (&theader, &ftable, "NMEASURE", Nmeasure, catalog->Naverage); 579 gfits_set_bintable_column (&theader, &ftable, "NMISSING", Nmissing, catalog->Naverage); 580 gfits_set_bintable_column (&theader, &ftable, "NEXTEND", Nextend, catalog->Naverage); 581 gfits_set_bintable_column (&theader, &ftable, "OFF_MEASURE", measureOffset, catalog->Naverage); 582 gfits_set_bintable_column (&theader, &ftable, "OFF_MISSING", missingOffset, catalog->Naverage); 583 gfits_set_bintable_column (&theader, &ftable, "REF_COLOR_BLUE", refColorBlue, catalog->Naverage); 584 gfits_set_bintable_column (&theader, &ftable, "REF_COLOR_RED", refColorRed, catalog->Naverage); 585 gfits_set_bintable_column (&theader, &ftable, "FLAGS", flags, catalog->Naverage); 586 gfits_set_bintable_column (&theader, &ftable, "PHOTFLAGS_U", photFlagsUpper, catalog->Naverage); 587 gfits_set_bintable_column (&theader, &ftable, "PHOTFLAGS_L", photFlagsLower, catalog->Naverage); 588 gfits_set_bintable_column (&theader, &ftable, "OBJ_ID", objID, catalog->Naverage); 589 gfits_set_bintable_column (&theader, &ftable, "CAT_ID", catID, catalog->Naverage); 590 gfits_set_bintable_column (&theader, &ftable, "EXT_ID", extID, catalog->Naverage); 584 591 585 592 free (R); … … 605 612 free (measureOffset); 606 613 free (missingOffset); 607 free (refColor); 614 free (refColorBlue); 615 free (refColorRed); 608 616 free (flags); 609 617 free (photFlagsUpper); … … 629 637 gfits_define_bintable_column (&theader, "I", "NCODE", "magnitude (err)", NULL, 1.0, 0.0); 630 638 gfits_define_bintable_column (&theader, "I", "NUSED", "airmass", NULL, 1.0, 0.0); 631 gfits_define_bintable_column (&theader, " I", "MAG_20", "ccd x coord", "pix", 1.0, 0.0);632 gfits_define_bintable_column (&theader, " I", "MAG_80", "ccd y coord", "pix", 1.0, 0.0);639 gfits_define_bintable_column (&theader, "E", "MAG_MIN", "ccd x coord", "pix", 1.0, 0.0); 640 gfits_define_bintable_column (&theader, "E", "MAG_MAX", "ccd y coord", "pix", 1.0, 0.0); 633 641 634 642 // generate the output array that carries the data … … 642 650 float *M ; ALLOCATE (M , float, Nsec); 643 651 float *dM ; ALLOCATE (dM , float, Nsec); 644 float * Xm ; ALLOCATE (Xm, float, Nsec);652 float *Mchisq ; ALLOCATE (Mchisq , float, Nsec); 645 653 int *flags ; ALLOCATE (flags , int, Nsec); 646 654 short *Ncode ; ALLOCATE (Ncode , short, Nsec); 647 655 short *Nused ; ALLOCATE (Nused , short, Nsec); 648 short *M_20 ; ALLOCATE (M_20 , short, Nsec);649 short *M_80 ; ALLOCATE (M_80 , short, Nsec);656 float *Mmin ; ALLOCATE (Mmin , float, Nsec); 657 float *Mmax ; ALLOCATE (Mmax , float, Nsec); 650 658 651 659 // assign the storage arrays 652 660 SecFilt *secfilt = catalog->secfilt; 653 661 for (i = 0; i < Nsec; i++) { 654 M [i] = secfilt[i]. M ;655 dM [i] = secfilt[i]. dM ;656 Xm [i] = secfilt[i]. Xm;657 flags [i] = secfilt[i]. flags ;658 Ncode [i] = secfilt[i]. Ncode ;659 Nused [i] = secfilt[i]. Nused ;660 M _20 [i] = secfilt[i]. M_20;661 M _80 [i] = secfilt[i]. M_80;662 M [i] = secfilt[i].M ; 663 dM [i] = secfilt[i].dM ; 664 Mchisq[i] = secfilt[i].Mchisq ; 665 flags [i] = secfilt[i].flags ; 666 Ncode [i] = secfilt[i].Ncode ; 667 Nused [i] = secfilt[i].Nused ; 668 Mmin [i] = secfilt[i].Mmin ; 669 Mmax [i] = secfilt[i].Mmax ; 662 670 } 663 671 664 672 // add the columns to the output array 665 gfits_set_bintable_column (&theader, &ftable, "MAG", M , Nsec);666 gfits_set_bintable_column (&theader, &ftable, "MAG_ERR", dM , Nsec);667 gfits_set_bintable_column (&theader, &ftable, "MAG_CHI", Xm, Nsec);668 gfits_set_bintable_column (&theader, &ftable, "FLAGS", flags , Nsec);669 gfits_set_bintable_column (&theader, &ftable, "NCODE", Ncode , Nsec);670 gfits_set_bintable_column (&theader, &ftable, "NUSED", Nused , Nsec);671 gfits_set_bintable_column (&theader, &ftable, "MAG_ 20", M_20, Nsec);672 gfits_set_bintable_column (&theader, &ftable, "MAG_ 80", M_80, Nsec);673 gfits_set_bintable_column (&theader, &ftable, "MAG", M , Nsec); 674 gfits_set_bintable_column (&theader, &ftable, "MAG_ERR", dM , Nsec); 675 gfits_set_bintable_column (&theader, &ftable, "MAG_CHI", Mchisq, Nsec); 676 gfits_set_bintable_column (&theader, &ftable, "FLAGS", flags , Nsec); 677 gfits_set_bintable_column (&theader, &ftable, "NCODE", Ncode , Nsec); 678 gfits_set_bintable_column (&theader, &ftable, "NUSED", Nused , Nsec); 679 gfits_set_bintable_column (&theader, &ftable, "MAG_MIN", Mmin , Nsec); 680 gfits_set_bintable_column (&theader, &ftable, "MAG_MAX", Mmax , Nsec); 673 681 674 682 free (M ); 675 683 free (dM ); 676 free ( Xm);684 free (Mchisq ); 677 685 free (flags ); 678 686 free (Ncode ); 679 687 free (Nused ); 680 free (M _20);681 free (M _80);688 free (Mmin ); 689 free (Mmax ); 682 690 683 691 gfits_fwrite_Theader (f, &theader); -
trunk/Ohana/src/relastro/src/FitChip.c
r36833 r37038 112 112 } 113 113 114 int Ncolor = 0; 114 int Ncolor; 115 float colorMedian; 115 116 float *colorList = NULL; 116 117 ALLOCATE (colorList, float, Nmatch); 117 118 119 // calculate the median blue color 120 Ncolor = 0; 118 121 for (i = 0; i < Nmatch; i++) { 119 122 if (!raw[i].mask) continue; 120 if (!isnan(ref[i].Color)) { 121 colorList[Ncolor] = ref[i].Color; 122 Ncolor ++; 123 } 123 if (isnan(ref[i].ColorBlue)) continue; 124 colorList[Ncolor] = ref[i].ColorBlue; 125 Ncolor ++; 124 126 } 125 127 fsort (colorList, Ncolor); 126 float colorMedian = (Ncolor > 0) ? colorList[(int)(0.5*Ncolor)] : NAN; 127 image[0].refColor = colorMedian; 128 colorMedian = (Ncolor > 0) ? colorList[(int)(0.5*Ncolor)] : NAN; 129 image[0].refColorBlue = colorMedian; 130 131 // calculate the median red color 132 Ncolor = 0; 133 for (i = 0; i < Nmatch; i++) { 134 if (!raw[i].mask) continue; 135 if (isnan(ref[i].ColorRed)) continue; 136 colorList[Ncolor] = ref[i].ColorRed; 137 Ncolor ++; 138 } 139 fsort (colorList, Ncolor); 140 colorMedian = (Ncolor > 0) ? colorList[(int)(0.5*Ncolor)] : NAN; 141 image[0].refColorRed = colorMedian; 142 128 143 free (colorList); 129 144 -
trunk/Ohana/src/relastro/src/ImageOps.c
r36833 r37038 345 345 */ 346 346 347 float getColor (off_t meas, int cat) {347 float getColorBlue (off_t meas, int cat) { 348 348 349 349 off_t i; … … 351 351 i = MeasureToImage[cat][meas]; 352 352 if (i == -1) return (NAN); 353 return (image[i].refColor); 353 return (image[i].refColorBlue); 354 } 355 356 float getColorRed (off_t meas, int cat) { 357 358 off_t i; 359 360 i = MeasureToImage[cat][meas]; 361 if (i == -1) return (NAN); 362 return (image[i].refColorRed); 354 363 } 355 364 … … 406 415 for (j = 0; j < average[0].Nmeasure; j++) { 407 416 off = average[0].measureOffset + j; 408 fprintf (stderr, " dR, dD, mag, dMag: %f, %f, %f, %f\n", measure[off].dR, measure[off].dD, measure[off].M, measure[off].dM);417 fprintf (stderr, "R, D, mag, dMag: %lf, %lf, %f, %f\n", measure[off].R, measure[off].D, measure[off].M, measure[off].dM); 409 418 } 410 419 return; … … 554 563 555 564 // complain if the new location is far from the old location 556 if (fabs(csdec*(measure[0]. dR - dR)) > DPOS_MAX_ASEC) {565 if (fabs(csdec*(measure[0].R - R)) > DPOS_MAX_ASEC) { 557 566 NoffRAori ++; 558 567 if (VERBOSE2) { 559 fprintf (stderr, "measurement moves far from original location (R): %f %f (%f %f %f %f)\n", average[0].R, average[0].D, measure[0]. dR, dR, csdec*(measure[0].dR - dR), dD);568 fprintf (stderr, "measurement moves far from original location (R): %f %f (%f %f %f %f)\n", average[0].R, average[0].D, measure[0].R, dR, csdec*(measure[0].R - R), dD); 560 569 dump_measures (&average[0], catalog[c].measure); 561 570 } 562 571 // abort(); 563 572 } 564 if (fabs(measure[0]. dD - dD) > DPOS_MAX_ASEC) {573 if (fabs(measure[0].D - D) > DPOS_MAX_ASEC) { 565 574 NoffDECori ++; 566 575 if (VERBOSE2) { 567 fprintf (stderr, "measurement moves far from original location (D): %f %f (%f %f %f)\n", average[0].R, average[0].D, dR, measure[0]. dD, dD);576 fprintf (stderr, "measurement moves far from original location (D): %f %f (%f %f %f)\n", average[0].R, average[0].D, dR, measure[0].D, dD); 568 577 dump_measures (&average[0], catalog[c].measure); 569 578 } // abort(); 570 579 } 571 580 572 dPos += SQ(measure[0].dR - dR) + SQ(measure[0].dD - dD); 581 // XXX NOTE : apply csdec: 582 dPos += SQ(measure[0].R - R) + SQ(measure[0].D - D); 573 583 nPos ++; 574 584 575 measure[0]. dR = dR;576 measure[0]. dD = dD;577 measureT[0]. dR = dR;578 measureT[0]. dD = dD;585 measure[0].R = R; 586 measure[0].D = D; 587 measureT[0].R = R; 588 measureT[0].D = D; 579 589 580 590 // set the systematic error for this image: … … 601 611 602 612 off_t i, m, c, n; 603 double X, Y, L, M, P, Q, R, D , dR, dD;613 double X, Y, L, M, P, Q, R, D; 604 614 605 615 Mosaic *mosaic; … … 649 659 n = measure[0].averef; 650 660 651 dR = dD = 0.0;652 661 if (moscoords == NULL) { 653 662 // this is a Simple image (not a mosaic) … … 660 669 LM_to_RD (&R, &D, P, Q, moscoords); 661 670 } 662 663 measure[0].dR = dR; 664 measure[0].dD = dD; 665 666 if (measure[0].dR > +180.0*3600.0) { 671 measure[0].R = R; 672 measure[0].D = D; 673 674 float dRoff = dvoOffsetR(measure, &catalog[c].average[n]); 675 676 if (dRoff > +180.0*3600.0) { 667 677 // average on high end of boundary, move star up 668 R += 360.0; 669 measure[0].dR = 3600.0*(catalog[c].average[n].R - R); 670 } 671 if (measure[0].dR < -180.0*3600.0) { 672 // average on low end of boundary, move star down 673 R -= 360.0; 674 measure[0].dR = 3600.0*(catalog[c].average[n].R - R); 678 measure[0].R += 360.0; 679 dRoff -= 360.0*3600.0; 680 } 681 if (dRoff < -180.0*3600.0) { 682 measure[0].R -= 360.0; 683 dRoff += 360.0*3600.0; 675 684 } 676 685 } … … 734 743 raw[i].mask |= MARK_TOO_FEW_MEAS; 735 744 } 736 if (!finite(measure[0]. dR) || !finite(measure[0].dD)) {745 if (!finite(measure[0].R) || !finite(measure[0].D)) { 737 746 raw[i].mask |= MARK_NAN_POS_ERROR; 738 747 } … … 803 812 ref[i].dPos = GetAstromErrorTiny (&measure[0], ERROR_MODE_POS); 804 813 805 if ((DCR_NSEC_POS >= 0) && (DCR_NSEC_NEG >= -1)) { 806 ref[i].Color = catalog[c].secfilt[n*Nsecfilt + DCR_NSEC_POS].M - catalog[c].secfilt[n*Nsecfilt + DCR_NSEC_NEG].M; 814 if ((DCR_BLUE_NSEC_POS >= 0) && (DCR_BLUE_NSEC_NEG >= -1)) { 815 ref[i].ColorBlue = catalog[c].secfilt[n*Nsecfilt + DCR_BLUE_NSEC_POS].M - catalog[c].secfilt[n*Nsecfilt + DCR_BLUE_NSEC_NEG].M; 816 } 817 if ((DCR_RED_NSEC_POS >= 0) && (DCR_RED_NSEC_NEG >= -1)) { 818 ref[i].ColorRed = catalog[c].secfilt[n*Nsecfilt + DCR_RED_NSEC_POS].M - catalog[c].secfilt[n*Nsecfilt + DCR_RED_NSEC_NEG].M; 807 819 } 808 820 … … 880 892 // skip measurements based on user selected criteria 881 893 if (!MeasFilterTest(&measure[k], FALSE)) continue; 882 R[N] = measure[k]. dR;883 D[N] = measure[k]. dD;894 R[N] = measure[k].R; 895 D[N] = measure[k].D; 884 896 dR[N] = GetAstromError (&measure[k], ERROR_MODE_RA); 885 897 dD[N] = GetAstromError (&measure[k], ERROR_MODE_DEC); … … 906 918 if (!MeasFilterTest(&measure[k], FALSE)) continue; 907 919 908 x = measure[k]. dR - statsR.median;909 y = measure[k]. dD - statsD.median;920 x = measure[k].R - statsR.median; 921 y = measure[k].D - statsD.median; 910 922 theta = atan2(y,x); 911 923 if ((x*x + y*y) > (SQR(statsR.sigma * Ns * cos(theta)) + … … 981 993 // skip measurements based on user selected criteria 982 994 if (!MeasFilterTest(&measure[k], FALSE)) continue; 983 R[N] = measure[k]. dR;984 D[N] = measure[k]. dD;995 R[N] = measure[k].R; 996 D[N] = measure[k].D; 985 997 dR[N] = GetAstromError(&measure[k], ERROR_MODE_RA); 986 998 dD[N] = GetAstromError(&measure[k], ERROR_MODE_DEC); … … 1002 1014 // skip bad measurements 1003 1015 if (!MeasFilterTest(&measure[k], FALSE)) continue; 1004 x = measure[k]. dR - statsR.median;1005 y = measure[k]. dD - statsD.median;1016 x = measure[k].R - statsR.median; 1017 y = measure[k].D - statsD.median; 1006 1018 theta = atan2(y,x); 1007 1019 d2[N] = (x*x + y*y) / (SQR(statsR.sigma * Ns * cos(theta)) + … … 1018 1030 for (k = 0; k < N; k++) { 1019 1031 off_t ind = (off_t) index[k]; 1020 R[k] = measure[ind]. dR;1021 D[k] = measure[ind]. dD;1032 R[k] = measure[ind].R; 1033 D[k] = measure[ind].D; 1022 1034 dR[k] = GetAstromError(&measure[ind], ERROR_MODE_RA); 1023 1035 dD[k] = GetAstromError(&measure[ind], ERROR_MODE_DEC); … … 1033 1045 //skip bad measurements 1034 1046 if (!MeasFilterTest(&measure[k], FALSE)) continue; 1035 x = measure[k]. dR - statsR.median;1036 y = measure[k]. dD - statsD.median;1047 x = measure[k].R - statsR.median; 1048 y = measure[k].D - statsD.median; 1037 1049 theta = atan2(y,x); 1038 1050 d2[N] = (x*x + y*y) / (SQR(statsR.sigma * Ns * cos(theta)) + … … 1068 1080 float mag; 1069 1081 1070 if (!finite(measure[0]. dR) || !finite(measure[0].dD)) return FALSE;1082 if (!finite(measure[0].R) || !finite(measure[0].D)) return FALSE; 1071 1083 if (!finite(measure[0].M)) return FALSE; //XXX is this necessary for all relastro tasks? 1072 1084 if (!finite(measure[0].dM)) return FALSE; //XXX is this necessary for all relastro tasks? … … 1120 1132 /* select measurements by mag limit */ 1121 1133 if (ImagSelect) { 1122 mag = PhotInstTiny (measure );1134 mag = PhotInstTiny (measure, MAG_CLASS_PSF); 1123 1135 if (mag < ImagMin || mag > ImagMax) return FALSE; 1124 1136 } … … 1135 1147 float mag; 1136 1148 1137 if (!finite(measure[0]. dR) || !finite(measure[0].dD)) return FALSE;1149 if (!finite(measure[0].R) || !finite(measure[0].D)) return FALSE; 1138 1150 if (!finite(measure[0].M)) return FALSE; //XXX is this necessary for all relastro tasks? 1139 1151 if (!finite(measure[0].dM)) return FALSE; //XXX is this necessary for all relastro tasks? … … 1187 1199 /* select measurements by mag limit */ 1188 1200 if (ImagSelect) { 1189 mag = PhotInst (measure );1201 mag = PhotInst (measure, MAG_CLASS_PSF); 1190 1202 if (mag < ImagMin || mag > ImagMax) return FALSE; 1191 1203 } -
trunk/Ohana/src/relastro/src/MeanPosIO.c
r36630 r37038 111 111 gfits_define_bintable_column (&theader, "D", "RA", "mean position, ra", "degrees", 1.0, 0.0); 112 112 gfits_define_bintable_column (&theader, "D", "DEC", "mean position, dec", "degrees", 1.0, 0.0); 113 gfits_define_bintable_column (&theader, "J", "OBJ_ID", "object ID", NULL, 1.0, 1.0*0x8000);114 gfits_define_bintable_column (&theader, "J", "CAT_ID", "catalog ID", NULL, 1.0, 1.0*0x8000);113 gfits_define_bintable_column (&theader, "J", "OBJ_ID", "object ID", NULL, 1.0, FT_BZERO_INT32); 114 gfits_define_bintable_column (&theader, "J", "CAT_ID", "catalog ID", NULL, 1.0, FT_BZERO_INT32); 115 115 116 116 // generate the output array that carries the data -
trunk/Ohana/src/relastro/src/MosaicOps.c
r36630 r37038 97 97 98 98 /* a new mosaic, define ranges */ 99 mosaic[Nmosaic].start = start;100 mosaic[Nmosaic].stop = stop;101 mosaic[Nmosaic].Mcal = 0.0;102 mosaic[Nmosaic].dMcal = 0.0;103 mosaic[Nmosaic].Xm = 0.0;104 mosaic[Nmosaic].flags = image[i].flags;105 mosaic[Nmosaic].secz = image[i].secz;106 mosaic[Nmosaic].coords = image[i].coords;99 mosaic[Nmosaic].start = start; 100 mosaic[Nmosaic].stop = stop; 101 mosaic[Nmosaic].Mcal = 0.0; 102 mosaic[Nmosaic].dMcal = 0.0; 103 mosaic[Nmosaic].Xm = 0.0; 104 mosaic[Nmosaic].flags = image[i].flags; 105 mosaic[Nmosaic].secz = image[i].secz; 106 mosaic[Nmosaic].coords = image[i].coords; 107 107 mosaic[Nmosaic].myImage = i; 108 108 -
trunk/Ohana/src/relastro/src/Shutdown.c
r12332 r37038 23 23 SetProtect (TRUE); 24 24 gfits_db_close (db); 25 fprintf (stderr, "ERROR: addstarhalted\n");25 fprintf (stderr, "ERROR: relastro halted\n"); 26 26 exit (1); 27 27 } -
trunk/Ohana/src/relastro/src/UpdateObjectOffsets.c
r36833 r37038 153 153 // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values 154 154 155 if (DCR_COLOR_POS && DCR_COLOR_NEG) { 156 strextend (command, "-dcr-color %s %s", DCR_COLOR_POS, DCR_COLOR_NEG); 155 if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) { 156 strextend (command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 157 } 158 if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) { 159 strextend (command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 157 160 } 158 161 -
trunk/Ohana/src/relastro/src/UpdateObjects.c
r36833 r37038 10 10 static double *T; 11 11 static double *dT; 12 static double *C; 12 static double *C_blue; 13 static double *C_red; 13 14 14 15 void initObjectData (Catalog *catalog, int Ncatalog) { … … 38 39 ALLOCATE (pY, double, MAX (1, Nmax)); 39 40 40 ALLOCATE (C, double, MAX (1, Nmax)); 41 ALLOCATE (C_blue, double, MAX (1, Nmax)); 42 ALLOCATE (C_red, double, MAX (1, Nmax)); 41 43 } 42 44 … … 58 60 free (pY); 59 61 60 free (C); 62 free (C_blue); 63 free (C_red); 61 64 } 62 65 … … 66 69 67 70 off_t j, k, m; 68 int i, N, Nc , Nsecfilt, mode, result, status, XVERB;71 int i, N, NcBlue, NcRed, Nsecfilt, mode, result, status, XVERB; 69 72 StatType statsR, statsD; 70 73 Coords coords; … … 130 133 } 131 134 132 Nc = 0; 135 NcBlue = 0; 136 NcRed = 0; 133 137 N = 0; 134 138 m = catalog[i].average[j].measureOffset; … … 149 153 char *date = ohana_sec_to_date (measure[k].t); 150 154 int dbFlagsBig = measureBig ? measureBig[k].dbFlags : 0; 151 fprintf (stderr, OFF_T_FMT" %f %f %s : 0x%08x : 0x%08x\n", k, measure[k]. dR, measure[k].dD, date, measure[k].dbFlags, dbFlagsBig);155 fprintf (stderr, OFF_T_FMT" %f %f %s : 0x%08x : 0x%08x\n", k, measure[k].R, measure[k].D, date, measure[k].dbFlags, dbFlagsBig); 152 156 free (date); 153 157 } … … 225 229 226 230 if (setRefColor) { 227 float color = getColor (m+k, i); 228 if (!isnan(color)) { 229 C[Nc] = color; 230 Nc++; 231 float colorBlue = getColorBlue (m+k, i); 232 if (!isnan(colorBlue)) { 233 C_blue[NcBlue] = colorBlue; 234 NcBlue++; 235 } 236 float colorRed = getColorRed (m+k, i); 237 if (!isnan(colorRed)) { 238 C_red[NcRed] = colorRed; 239 NcRed++; 231 240 } 232 241 } … … 360 369 361 370 if (setRefColor) { 362 dsort (C, Nc); 363 float colorMedian = (Nc > 0) ? C[(int)(0.5*Nc)] : NAN; 364 catalog[i].average[j].refColor = colorMedian; 371 float colorMedian; 372 dsort (C_blue, NcBlue); 373 colorMedian = (NcBlue > 0) ? C_blue[(int)(0.5*NcBlue)] : NAN; 374 catalog[i].average[j].refColorBlue = colorMedian; 375 dsort (C_red, NcRed); 376 colorMedian = (NcRed > 0) ? C_red[(int)(0.5*NcRed)] : NAN; 377 catalog[i].average[j].refColorRed = colorMedian; 365 378 } 366 379 -
trunk/Ohana/src/relastro/src/args.c
r36833 r37038 294 294 } 295 295 296 DCR_COLOR_POS = NULL; 297 DCR_COLOR_NEG = NULL; 298 if ((N = get_argument (argc, argv, "-dcr-color"))) { 299 remove_argument (N, &argc, argv); 300 DCR_COLOR_POS = strcreate(argv[N]); 301 remove_argument (N, &argc, argv); 302 DCR_COLOR_NEG = strcreate(argv[N]); 296 // eg g - r or r - i 297 DCR_BLUE_COLOR_POS = NULL; 298 DCR_BLUE_COLOR_NEG = NULL; 299 if ((N = get_argument (argc, argv, "-dcr-blue-color"))) { 300 remove_argument (N, &argc, argv); 301 DCR_BLUE_COLOR_POS = strcreate(argv[N]); 302 remove_argument (N, &argc, argv); 303 DCR_BLUE_COLOR_NEG = strcreate(argv[N]); 304 remove_argument (N, &argc, argv); 305 } 306 307 // eg, z - y or i - z 308 DCR_RED_COLOR_POS = NULL; 309 DCR_RED_COLOR_NEG = NULL; 310 if ((N = get_argument (argc, argv, "-dcr-red-color"))) { 311 remove_argument (N, &argc, argv); 312 DCR_RED_COLOR_POS = strcreate(argv[N]); 313 remove_argument (N, &argc, argv); 314 DCR_RED_COLOR_NEG = strcreate(argv[N]); 303 315 remove_argument (N, &argc, argv); 304 316 } … … 696 708 } 697 709 698 DCR_COLOR_POS = NULL; 699 DCR_COLOR_NEG = NULL; 700 if ((N = get_argument (argc, argv, "-dcr-color"))) { 701 remove_argument (N, &argc, argv); 702 DCR_COLOR_POS = strcreate(argv[N]); 703 remove_argument (N, &argc, argv); 704 DCR_COLOR_NEG = strcreate(argv[N]); 710 DCR_BLUE_COLOR_POS = NULL; 711 DCR_BLUE_COLOR_NEG = NULL; 712 if ((N = get_argument (argc, argv, "-dcr-blue-color"))) { 713 remove_argument (N, &argc, argv); 714 DCR_BLUE_COLOR_POS = strcreate(argv[N]); 715 remove_argument (N, &argc, argv); 716 DCR_BLUE_COLOR_NEG = strcreate(argv[N]); 717 remove_argument (N, &argc, argv); 718 } 719 DCR_RED_COLOR_POS = NULL; 720 DCR_RED_COLOR_NEG = NULL; 721 if ((N = get_argument (argc, argv, "-dcr-red-color"))) { 722 remove_argument (N, &argc, argv); 723 DCR_RED_COLOR_POS = strcreate(argv[N]); 724 remove_argument (N, &argc, argv); 725 DCR_RED_COLOR_NEG = strcreate(argv[N]); 705 726 remove_argument (N, &argc, argv); 706 727 } -
trunk/Ohana/src/relastro/src/dvo_astrom_ops.c
r36833 r37038 1 1 # include "relastro.h" 2 /* the Measure carries the instantaneous mean position at the epoch t */ 2 3 3 4 double getMeanR (MeasureTiny *measure, Average *average, SecFilt *secfilt) { … … 5 6 double ra; 6 7 7 /* the measure carries the instantaneous mean position at the epoch t */ 8 ra = average[0].R - measure[0].dR / 3600.0; 8 // old: ra = average[0].R - measure[0].dR / 3600.0; 9 if (!measure) return NAN; 10 ra = measure[0].R; 11 12 return (ra); 13 } 14 15 double getMeanD (MeasureTiny *measure, Average *average, SecFilt *secfilt) { 16 17 double dec; 18 19 // old: dec = average[0].D - measure[0].dD / 3600.0; 20 if (!measure) return NAN; 21 dec = measure[0].D; 22 23 return (dec); 24 } 25 26 int setMeanR (double ra_fit, MeasureTiny *measure, Average *average, SecFilt *secfilt) { 27 28 // old: measure[0].dR += (ra_fit - average[0].R) * 3600.0; 29 if (!measure) return FALSE; 30 measure[0].R = ra_fit; 31 32 return (TRUE); 33 } 34 35 int setMeanD (double dec_fit, MeasureTiny *measure, Average *average, SecFilt *secfilt) { 36 37 // old: measure[0].dD += (dec_fit - average[0].D) * 3600.0; 38 if (!measure) return FALSE; 39 measure[0].D = dec_fit; 40 41 return (TRUE); 42 } 43 44 double getMeanR_Big (Measure *measure, Average *average, SecFilt *secfilt) { 45 46 double ra; 47 48 // old: ra = average[0].R - measure[0].dR / 3600.0; 49 if (!measure) return NAN; 50 ra = measure[0].R; 51 52 return (ra); 53 } 54 55 double getMeanD_Big (Measure *measure, Average *average, SecFilt *secfilt) { 56 57 double dec; 58 59 // old: dec = average[0].D - measure[0].dD / 3600.0; 60 if (!measure) return NAN; 61 dec = measure[0].D; 62 63 return (dec); 64 } 65 66 int setMeanR_Big (double ra_fit, Measure *measure, Average *average, SecFilt *secfilt) { 67 68 // old: measure[0].dR += (ra_fit - average[0].R) * 3600.0; 69 if (!measure) return TRUE; 70 measure[0].R = ra_fit; 71 72 return (TRUE); 73 } 74 75 int setMeanD_Big (double dec_fit, Measure *measure, Average *average, SecFilt *secfilt) { 76 77 // measure[0].dD += (dec_fit - average[0].D) * 3600.0; 78 if (!measure) return TRUE; 79 measure[0].D = dec_fit; 80 81 return (TRUE); 82 } 9 83 10 84 /* possible corrections to mean ra: … … 18 92 */ 19 93 20 return (ra);21 }22 23 double getMeanD (MeasureTiny *measure, Average *average, SecFilt *secfilt) {24 25 double dec;26 27 /* the measure carries the instantaneous mean position at the epoch t */28 dec = average[0].D - measure[0].dD / 3600.0;29 30 /* possible corrections to mean ra:31 32 - proper-motion and parallax33 - abberation34 - precession and nutation, etc35 - refraction36 - DCR37 38 */39 40 return (dec);41 }42 43 int setMeanR (double ra_fit, MeasureTiny *measure, Average *average, SecFilt *secfilt) {44 45 /* math to get from new fitted position to new measure offset46 ra_obs = average[0].R - measure[0].dR / 3600.0;47 measure[0].dR = (ra_fit - ra_obs) * 3600.0;48 measure[0].dR = (ra_fit - average[0].R + measure[0].dR/3600) * 3600.049 measure[0].dR = (ra_fit - average[0].R) * 3600.0 + measure[0].dR;50 */51 52 /* the measure carries the instantaneous mean position at the epoch t */53 measure[0].dR += (ra_fit - average[0].R) * 3600.0;54 55 /* possible corrections to mean ra:56 57 - proper-motion and parallax58 - abberation59 - precession and nutation, etc60 - refraction61 - DCR62 63 */64 65 return (TRUE);66 }67 68 int setMeanD (double dec_fit, MeasureTiny *measure, Average *average, SecFilt *secfilt) {69 70 /* math to get from new fitted position to new measure offset71 dec_obs = average[0].D - measure[0].dD / 3600.0;72 measure[0].dD = (dec_fit - dec_obs) * 3600.0;73 measure[0].dD = (dec_fit - average[0].D + measure[0].dD/3600) * 3600.074 measure[0].dD = (dec_fit - average[0].D) * 3600.0 + measure[0].dD;75 */76 77 /* the measure carries the instantaneous mean position at the epoch t */78 measure[0].dD += (dec_fit - average[0].D) * 3600.0;79 80 /* possible corrections to mean ra:81 82 - proper-motion and parallax83 - abberation84 - precession and nutation, etc85 - refraction86 - DCR87 88 */89 90 return (TRUE);91 }92 93 double getMeanR_Big (Measure *measure, Average *average, SecFilt *secfilt) {94 95 double ra;96 97 /* the measure carries the instantaneous mean position at the epoch t */98 ra = average[0].R - measure[0].dR / 3600.0;99 100 /* possible corrections to mean ra:101 102 - proper-motion and parallax103 - abberation104 - precession and nutation, etc105 - refraction106 - DCR107 108 */109 110 return (ra);111 }112 113 double getMeanD_Big (Measure *measure, Average *average, SecFilt *secfilt) {114 115 double dec;116 117 /* the measure carries the instantaneous mean position at the epoch t */118 dec = average[0].D - measure[0].dD / 3600.0;119 120 /* possible corrections to mean ra:121 122 - proper-motion and parallax123 - abberation124 - precession and nutation, etc125 - refraction126 - DCR127 128 */129 130 return (dec);131 }132 133 int setMeanR_Big (double ra_fit, Measure *measure, Average *average, SecFilt *secfilt) {134 135 if (!measure) return TRUE;136 137 /* math to get from new fitted position to new measure offset138 ra_obs = average[0].R - measure[0].dR / 3600.0;139 measure[0].dR = (ra_fit - ra_obs) * 3600.0;140 measure[0].dR = (ra_fit - average[0].R + measure[0].dR/3600) * 3600.0141 measure[0].dR = (ra_fit - average[0].R) * 3600.0 + measure[0].dR;142 */143 144 /* the measure carries the instantaneous mean position at the epoch t */145 measure[0].dR += (ra_fit - average[0].R) * 3600.0;146 147 /* possible corrections to mean ra:148 149 - proper-motion and parallax150 - abberation151 - precession and nutation, etc152 - refraction153 - DCR154 155 */156 157 return (TRUE);158 }159 160 int setMeanD_Big (double dec_fit, Measure *measure, Average *average, SecFilt *secfilt) {161 162 if (!measure) return TRUE;163 164 /* math to get from new fitted position to new measure offset165 dec_obs = average[0].D - measure[0].dD / 3600.0;166 measure[0].dD = (dec_fit - dec_obs) * 3600.0;167 measure[0].dD = (dec_fit - average[0].D + measure[0].dD/3600) * 3600.0168 measure[0].dD = (dec_fit - average[0].D) * 3600.0 + measure[0].dD;169 */170 171 /* the measure carries the instantaneous mean position at the epoch t */172 measure[0].dD += (dec_fit - average[0].D) * 3600.0;173 174 /* possible corrections to mean ra:175 176 - proper-motion and parallax177 - abberation178 - precession and nutation, etc179 - refraction180 - DCR181 182 */183 184 return (TRUE);185 }186 -
trunk/Ohana/src/relastro/src/high_speed_objects.c
r36482 r37038 241 241 for(i1=0;i1<catalog[0].average[nv[l]].Nmeasure;i1++) { 242 242 catalogOut.measure[Nmatchmeas]=catalog[0].measure[m+i1]; 243 / *Set offset RA and Dec wrt correct average value*/244 catalogOut.measure[Nmatchmeas].dR=catalog[0].measure[m+i1].dR+3600.0*(catalog[0].average[nv[0]].R-catalog[0].average[nv[l]].R);245 catalogOut.measure[Nmatchmeas].dD=catalog[0].measure[m+i1].dD+3600.0*(catalog[0].average[nv[0]].D-catalog[0].average[nv[l]].D);243 // DROP no longer necessary to repoint R,D 244 // catalogOut.measure[Nmatchmeas].dR=catalog[0].measure[m+i1].dR+3600.0*(catalog[0].average[nv[0]].R-catalog[0].average[nv[l]].R); 245 // catalogOut.measure[Nmatchmeas].dD=catalog[0].measure[m+i1].dD+3600.0*(catalog[0].average[nv[0]].D-catalog[0].average[nv[l]].D); 246 246 catalogOut.measure[Nmatchmeas].averef = Nmatch; 247 247 Nmatchmeasobj++; … … 297 297 // XXX require a set or not? assert (Nset > 0); 298 298 299 if (!finite(measure[0]. dR)) return FALSE;300 if (!finite(measure[0]. dD)) return FALSE;301 if (!finite(measure[0].M)) return FALSE;299 if (!finite(measure[0].R)) return FALSE; 300 if (!finite(measure[0].D)) return FALSE; 301 if (!finite(measure[0].M)) return FALSE; 302 302 303 303 float dX = GetAstromError (measure, ERROR_MODE_RA); -
trunk/Ohana/src/relastro/src/hpm_objects.c
r36482 r37038 240 240 for (k = 0; k < catalog[0].average[nj].Nmeasure; k++) { 241 241 testcat.measure[Nmatchmeas] = catalog[0].measure[m+k]; 242 / * Set offset RA and Dec wrt correct average value*/243 testcat.measure[Nmatchmeas].dR = catalog[0].measure[m+k].dR + 3600.0*(catalog[0].average[ni].R - catalog[0].average[nj].R);244 testcat.measure[Nmatchmeas].dD = catalog[0].measure[m+k].dD + 3600.0*(catalog[0].average[ni].D - catalog[0].average[nj].D);242 // DROP: was needed when dR,dD were relative to average.R,D 243 // testcat.measure[Nmatchmeas].R = catalog[0].measure[m+k].R; 244 // testcat.measure[Nmatchmeas].D = catalog[0].measure[m+k].D; 245 245 testcat.measure[Nmatchmeas].averef = 0; 246 246 Nmatchmeas++; -
trunk/Ohana/src/relastro/src/initialize.c
r36833 r37038 8 8 if (RELASTRO_OP == OP_MERGE_SOURCE) return; 9 9 10 if (DCR_ COLOR_POS) fprintf (stderr, "DCR_COLOR_POS: %s\n", DCR_COLOR_POS);11 if (DCR_ COLOR_NEG) fprintf (stderr, "DCR_COLOR_NEG: %s\n", DCR_COLOR_NEG);10 if (DCR_BLUE_COLOR_POS) fprintf (stderr, "DCR_BLUE_COLOR_POS: %s - %s\n", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 11 if (DCR_BLUE_COLOR_POS) fprintf (stderr, "DCR_BLUE_COLOR_POS: %s - %s\n", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 12 12 13 13 if (PHOTCODE_KEEP_LIST) fprintf (stderr, "PHOTCODE_KEEP_LIST: %s\n", PHOTCODE_KEEP_LIST); … … 23 23 photcodesGroupB = ParsePhotcodeList (PHOTCODE_B_LIST, &NphotcodesGroupB, TRUE); 24 24 25 DCR_NSEC_POS = DCR_NSEC_NEG = -1; 26 if (DCR_COLOR_POS) { 27 DCR_PHOTCODE_POS = GetPhotcodebyName (DCR_COLOR_POS); 28 if (!DCR_PHOTCODE_POS) { 29 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", DCR_COLOR_POS); 25 // blue color elements 26 DCR_BLUE_NSEC_POS = DCR_BLUE_NSEC_NEG = -1; 27 if (DCR_BLUE_COLOR_POS) { 28 DCR_BLUE_PHOTCODE_POS = GetPhotcodebyName (DCR_BLUE_COLOR_POS); 29 if (!DCR_BLUE_PHOTCODE_POS) { 30 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", DCR_BLUE_COLOR_POS); 30 31 exit (1); 31 32 } 32 DCR_ NSEC_POS = GetPhotcodeNsec (DCR_PHOTCODE_POS[0].code);33 DCR_BLUE_NSEC_POS = GetPhotcodeNsec (DCR_BLUE_PHOTCODE_POS[0].code); 33 34 } 34 if (DCR_ COLOR_NEG) {35 DCR_ PHOTCODE_NEG = GetPhotcodebyName (DCR_COLOR_NEG);36 if (!DCR_ PHOTCODE_NEG) {37 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", DCR_ COLOR_NEG);35 if (DCR_BLUE_COLOR_NEG) { 36 DCR_BLUE_PHOTCODE_NEG = GetPhotcodebyName (DCR_BLUE_COLOR_NEG); 37 if (!DCR_BLUE_PHOTCODE_NEG) { 38 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", DCR_BLUE_COLOR_NEG); 38 39 exit (1); 39 40 } 40 DCR_NSEC_NEG = GetPhotcodeNsec (DCR_PHOTCODE_NEG[0].code); 41 DCR_BLUE_NSEC_NEG = GetPhotcodeNsec (DCR_BLUE_PHOTCODE_NEG[0].code); 42 } 43 44 // red color elements 45 DCR_RED_NSEC_POS = DCR_RED_NSEC_NEG = -1; 46 if (DCR_RED_COLOR_POS) { 47 DCR_RED_PHOTCODE_POS = GetPhotcodebyName (DCR_RED_COLOR_POS); 48 if (!DCR_RED_PHOTCODE_POS) { 49 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", DCR_RED_COLOR_POS); 50 exit (1); 51 } 52 DCR_RED_NSEC_POS = GetPhotcodeNsec (DCR_RED_PHOTCODE_POS[0].code); 53 } 54 if (DCR_RED_COLOR_NEG) { 55 DCR_RED_PHOTCODE_NEG = GetPhotcodebyName (DCR_RED_COLOR_NEG); 56 if (!DCR_RED_PHOTCODE_NEG) { 57 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", DCR_RED_COLOR_NEG); 58 exit (1); 59 } 60 DCR_RED_NSEC_NEG = GetPhotcodeNsec (DCR_RED_PHOTCODE_NEG[0].code); 41 61 } 42 62 -
trunk/Ohana/src/relastro/src/launch_region_hosts.c
r36871 r37038 81 81 if (ExcludeBogus) strextend (command, "-exclude-bogus %f", ExcludeBogusRadius); 82 82 83 if (DCR_COLOR_POS && DCR_COLOR_NEG) { 84 strextend (command, "-dcr-color %s %s", DCR_COLOR_POS, DCR_COLOR_NEG); 83 if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) { 84 strextend (command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 85 } 86 if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) { 87 strextend (command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 85 88 } 86 89 -
trunk/Ohana/src/relastro/src/load_catalogs.c
r36833 r37038 102 102 } 103 103 104 // if we are running with parallel_images but not a parallel database, we need to 105 // release the lock so the next image host can proceed 106 if (!hostID && syncfile) { 107 update_sync_file (syncfile, 1); 108 } 109 104 110 // only return the populated catalogs 105 111 REALLOCATE (catalog, Catalog, Ncat); … … 165 171 if (ExcludeBogus) strextend (command, "-exclude-bogus %f", ExcludeBogusRadius); 166 172 167 if (DCR_COLOR_POS && DCR_COLOR_NEG) { 168 strextend (command, "-dcr-color %s %s", DCR_COLOR_POS, DCR_COLOR_NEG); 173 if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) { 174 strextend (command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 175 } 176 if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) { 177 strextend (command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 169 178 } 170 179 … … 215 224 } 216 225 217 // update syncfile here (save lots of I/O time) 226 // update syncfile here (save lots of I/O time): 227 228 // at this point, the remote relastro_client jobs are done loading their data. in a 229 // parallel_images mode, the next image host can be launched while this image host now 230 // reads that 218 231 219 232 // NOTE: if I let all hosts load blindly, I saturate the data clients with too many -
trunk/Ohana/src/relastro/src/markObjects.c
r36630 r37038 8 8 // How strongly do I own this object? 9 9 for (i = 0; i < Ncatalog; i++) { 10 ALLOCATE (catalog[i].nOwn , int, catalog[i].Naverage);11 memset (catalog[i].nOwn , 0, catalog[i].Naverage*sizeof(int));10 ALLOCATE (catalog[i].nOwn_t, int, catalog[i].Naverage); 11 memset (catalog[i].nOwn_t, 0, catalog[i].Naverage*sizeof(int)); 12 12 for (j = 0; j < catalog[i].Naverage; j++) { 13 13 int nOwn = 0; … … 17 17 nOwn ++; 18 18 } 19 catalog[i].nOwn [j] = nOwn;19 catalog[i].nOwn_t[j] = nOwn; 20 20 } 21 21 } -
trunk/Ohana/src/relastro/src/relastroVisual.c
r31635 r37038 431 431 432 432 // populate vectors 433 ALLOCATE(Din, float, Nmeasure);434 ALLOCATE(Rin, float, Nmeasure);433 ALLOCATE(Din, float, Nmeasure); 434 ALLOCATE(Rin, float, Nmeasure); 435 435 ALLOCATE(Dout, float, Nmeasure); 436 436 ALLOCATE(Rout, float, Nmeasure); … … 451 451 meas = catalog[0].measure[m]; 452 452 if (!MeasFilterTest(&meas, FALSE)) continue; 453 xmin = MIN(xmin, meas. dR);454 xmax = MAX(xmax, meas. dR);455 ymin = MIN(ymin, meas. dD);456 ymax = MAX(ymax, meas. dD);453 xmin = MIN(xmin, meas.R); 454 xmax = MAX(xmax, meas.R); 455 ymin = MIN(ymin, meas.D); 456 ymax = MAX(ymax, meas.D); 457 457 458 458 if (meas.dbFlags & ID_MEAS_POOR_ASTROM) { 459 Rout[Nout] = ( float)(meas.dR);460 Dout[Nout] = ( float)(meas.dD);459 Rout[Nout] = (meas.R); 460 Dout[Nout] = (meas.D); 461 461 fprintf(stderr, "r: %f\td: %f\t outlier: 1\n", Rout[Nout], Dout[Nout]); 462 462 Nout++; 463 463 } else { 464 Rin[Nin] = ( float)(meas.dR);465 Din[Nin] = ( float)(meas.dD);464 Rin[Nin] = (meas.R); 465 Din[Nin] = (meas.D); 466 466 fprintf(stderr, "r: %f\td: %f\t outlier: 0\n", Rin[Nin], Din[Nin]); 467 467 Nin++; -
trunk/Ohana/src/relastro/src/relastro_merge_source.c
r34088 r37038 100 100 catalog_src.measure[m].averef = index_dst; 101 101 102 // OLD CODE: when measure.dR,dD were relative to average.R,D it was necessary to modify them 102 103 // get the instantaneous positions: 103 double R = catalog_src.average[index_src].R - catalog_src.measure[m].dR / 3600.0;104 double D = catalog_src.average[index_src].D - catalog_src.measure[m].dD / 3600.0;104 // DROP double R = catalog_src.average[index_src].R - catalog_src.measure[m].dR / 3600.0; 105 // DROP double D = catalog_src.average[index_src].D - catalog_src.measure[m].dD / 3600.0; 105 106 106 107 // update the offset coordinates to match the new source 107 catalog_src.measure[m].dR = 3600.0*(catalog_src.average[index_dst].R - R);108 catalog_src.measure[m].dD = 3600.0*(catalog_src.average[index_dst].D - D);108 // DROP catalog_src.measure[m].dR = 3600.0*(catalog_src.average[index_dst].R - R); 109 // DROP catalog_src.measure[m].dD = 3600.0*(catalog_src.average[index_dst].D - D); 109 110 } 110 111 -
trunk/Ohana/src/relastro/src/share_mean_pos.c
r36630 r37038 33 33 // XXX : sky objects without missing detections 34 34 // XXX watch out for detections which are not associated with an image (REF) 35 if (catalog[i].nOwn [j] == catalog[i].average[j].Nmeasure) continue;35 if (catalog[i].nOwn_t[j] == catalog[i].average[j].Nmeasure) continue; 36 36 37 37 set_mean_pos (&meanpos[Nmeanpos], &catalog[i].average[j]);
Note:
See TracChangeset
for help on using the changeset viewer.
