Changeset 36903
- Timestamp:
- Jun 17, 2014, 11:56:32 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140610/Ohana/src
- Files:
-
- 21 edited
-
addstar/src/SEDfit.c (modified) (1 diff)
-
addstar/src/find_matches.c (modified) (3 diffs)
-
addstar/src/find_matches_closest.c (modified) (3 diffs)
-
addstar/src/find_matches_closest_refstars.c (modified) (3 diffs)
-
addstar/src/find_matches_refstars.c (modified) (3 diffs)
-
addstar/src/load2mass_catalog.c (modified) (2 diffs)
-
addstar/src/replace_match.c (modified) (1 diff)
-
addstar/src/update_coords.c (modified) (3 diffs)
-
relastro/src/BrightCatalog.c (modified) (14 diffs)
-
relastro/src/ImageOps.c (modified) (6 diffs)
-
relastro/src/UpdateObjects.c (modified) (1 diff)
-
relastro/src/dvo_astrom_ops.c (modified) (3 diffs)
-
relastro/src/high_speed_objects.c (modified) (2 diffs)
-
relastro/src/hpm_objects.c (modified) (1 diff)
-
relastro/src/relastroVisual.c (modified) (2 diffs)
-
relastro/src/relastro_merge_source.c (modified) (1 diff)
-
relphot/src/BrightCatalog.c (modified) (16 diffs)
-
relphot/src/MosaicOps.c (modified) (2 diffs)
-
relphot/src/bcatalog.c (modified) (3 diffs)
-
relphot/src/setExclusions.c (modified) (1 diff)
-
relphot/src/setMrelCatalog.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/SEDfit.c
r34405 r36903 162 162 } 163 163 164 double R = incat[0].average[i].R; 165 double D = incat[0].average[i].D; 166 164 167 for (j = 0; valid && (j < Nmodel); j++) { 165 168 n = modelRow[j]; 166 169 dvo_measure_init (&outcat[0].measure[Nmeas]); 167 outcat[0].measure[Nmeas]. dR = 0.0;168 outcat[0].measure[Nmeas]. dD = 0.0;170 outcat[0].measure[Nmeas].R = R; 171 outcat[0].measure[Nmeas].D = D; 169 172 outcat[0].measure[Nmeas].M = table[0].row[minFit.row][0].mags[n] + minFit.Md; 170 173 outcat[0].measure[Nmeas].dM = 0.0; -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/find_matches.c
r36485 r36903 160 160 161 161 // the following measure elements cannot be set until here: 162 catalog[0].measure[Nmeas]. dR = 3600.0*(catalog[0].average[n].R - stars[N].average.R);163 catalog[0].measure[Nmeas]. dD = 3600.0*(catalog[0].average[n].D - stars[N].average.D);162 catalog[0].measure[Nmeas].R = stars[N].average.R; 163 catalog[0].measure[Nmeas].D = stars[N].average.D; 164 164 catalog[0].measure[Nmeas].dbFlags = 0; 165 165 catalog[0].measure[Nmeas].averef = n; // this must be an absolute sequence number, if partial average is loaded … … 167 167 catalog[0].measure[Nmeas].catID = catalog[0].catID; 168 168 169 float dRoff = dvoOffsetR(&catalog[0].measure[Nmeas], &catalog[0].average[n]); 170 169 171 // rationalize dR: 170 if ( catalog[0].measure[Nmeas].dR> +180.0*3600.0) {172 if (dRoff > +180.0*3600.0) { 171 173 // average on high end of boundary, move star up 172 stars[N].average.R += 360.0;173 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].average.R);174 } 175 if ( catalog[0].measure[Nmeas].dR< -180.0*3600.0) {174 catalog[0].measure[Nmeas].R += 360.0; 175 dRoff -= 360.0*3600.0; 176 } 177 if (dRoff < -180.0*3600.0) { 176 178 // average on low end of boundary, move star down 177 stars[N].average.R -= 360.0;178 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].average.R);179 } 180 if ( fabs(catalog[0].measure[Nmeas].dR)> 10*RADIUS) {179 catalog[0].measure[Nmeas].R -= 360.0; 180 dRoff += 360.0*3600.0; 181 } 182 if (dRoff > 10*RADIUS) { 181 183 fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n", 182 184 catalog[0].average[n].R, catalog[0].average[n].D, … … 274 276 275 277 // the following measure elements cannot be set until here: 276 catalog[0].measure[Nmeas]. dR = 0.0;277 catalog[0].measure[Nmeas]. dD = 0.0;278 catalog[0].measure[Nmeas].R = stars[i].average.R; 279 catalog[0].measure[Nmeas].D = stars[i].average.D; 278 280 catalog[0].measure[Nmeas].dbFlags = 0; 279 281 catalog[0].measure[Nmeas].averef = Nave; // XXX EAM : must be absolute Nave if partial read -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/find_matches_closest.c
r36485 r36903 187 187 188 188 /** dR,dD now represent arcsec **/ 189 catalog[0].measure[Nmeas]. dR = 3600.0*(catalog[0].average[n].R - stars[N].average.R);190 catalog[0].measure[Nmeas]. dD = 3600.0*(catalog[0].average[n].D - stars[N].average.D);189 catalog[0].measure[Nmeas].R = stars[N].average.R; 190 catalog[0].measure[Nmeas].D = stars[N].average.D; 191 191 catalog[0].measure[Nmeas].dbFlags = 0; 192 192 catalog[0].measure[Nmeas].averef = n; … … 194 194 catalog[0].measure[Nmeas].catID = catalog[0].catID; 195 195 196 float dRoff = dvoOffsetR(&catalog[0].measure[Nmeas], &catalog[0].average[n]); 197 196 198 // rationalize dR 197 if ( catalog[0].measure[Nmeas].dR> +180.0*3600.0) {199 if (dRoff > +180.0*3600.0) { 198 200 // average on high end of boundary, move star up 199 stars[N].average.R += 360.0;200 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].average.R);201 } 202 if ( catalog[0].measure[Nmeas].dR< -180.0*3600.0) {201 catalog[0].measure[Nmeas].R += 360.0; 202 dRoff -= 360.0*3600.0; 203 } 204 if (dRoff < -180.0*3600.0) { 203 205 // average on low end of boundary, move star down 204 stars[N].average.R -= 360.0;205 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].average.R);206 } 207 if ( fabs(catalog[0].measure[Nmeas].dR)> 10*RADIUS) {206 catalog[0].measure[Nmeas].R -= 360.0; 207 dRoff += 360.0*3600.0; 208 } 209 if (dRoff > 10*RADIUS) { 208 210 fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n", 209 211 catalog[0].average[n].R, catalog[0].average[n].D, … … 282 284 283 285 // the following measure elements cannot be set until here: 284 catalog[0].measure[Nmeas]. dR = 0.0; // astrometric offset, not error285 catalog[0].measure[Nmeas]. dD = 0.0; // astrometric offset, not error286 catalog[0].measure[Nmeas].R = stars[i].average.R; 287 catalog[0].measure[Nmeas].D = stars[i].average.D; 286 288 catalog[0].measure[Nmeas].dbFlags = 0; 287 289 catalog[0].measure[Nmeas].averef = Nave; -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/find_matches_closest_refstars.c
r36485 r36903 180 180 181 181 /** *** dR,dD now in arcsec *** **/ 182 catalog[0].measure[Nmeas]. dR = 3600.0*(catalog[0].average[n].R - stars[N][0].average.R);183 catalog[0].measure[Nmeas]. dD = 3600.0*(catalog[0].average[n].D - stars[N][0].average.D);182 catalog[0].measure[Nmeas].R = stars[N][0].average.R; 183 catalog[0].measure[Nmeas].D = stars[N][0].average.D; 184 184 catalog[0].measure[Nmeas].dbFlags = 0; 185 185 catalog[0].measure[Nmeas].averef = n; … … 187 187 catalog[0].measure[Nmeas].catID = catalog[0].catID; 188 188 189 float dRoff = dvoOffsetR(&catalog[0].measure[Nmeas], &catalog[0].average[n]); 190 189 191 // rationalize dR: 190 if ( catalog[0].measure[Nmeas].dR> +180.0*3600.0) {192 if (dRoff > +180.0*3600.0) { 191 193 // average on high end of boundary, move star up 192 stars[N][0].average.R += 360.0;193 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N][0].average.R);194 } 195 if ( catalog[0].measure[Nmeas].dR< -180.0*3600.0) {194 catalog[0].measure[Nmeas].R += 360.0; 195 dRoff -= 360.0*3600.0; 196 } 197 if (dRoff < -180.0*3600.0) { 196 198 // average on low end of boundary, move star down 197 stars[N][0].average.R -= 360.0;198 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N][0].average.R);199 catalog[0].measure[Nmeas].R -= 360.0; 200 dRoff += 360.0*3600.0; 199 201 } 200 202 … … 290 292 catalog[0].measure[Nmeas] = stars[N][0].measure; 291 293 292 catalog[0].measure[Nmeas]. dR = 0.0; // astrometric offset, not error293 catalog[0].measure[Nmeas]. dD = 0.0; // astrometric offset, not error294 catalog[0].measure[Nmeas].R = catalog[0].average[Nave].R; 295 catalog[0].measure[Nmeas].D = catalog[0].average[Nave].D; 294 296 catalog[0].measure[Nmeas].dbFlags = 0; 295 297 catalog[0].measure[Nmeas].averef = Nave; -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/find_matches_refstars.c
r36485 r36903 141 141 catalog[0].measure[Nmeas] = stars[N][0].measure; 142 142 143 /** *** dR,dD now in arcsec *****/144 catalog[0].measure[Nmeas]. dR = 3600.0*(catalog[0].average[n].R - stars[N][0].average.R);145 catalog[0].measure[Nmeas]. dD = 3600.0*(catalog[0].average[n].D - stars[N][0].average.D);143 /** measure now stores R,D **/ 144 catalog[0].measure[Nmeas].R = stars[N][0].average.R; 145 catalog[0].measure[Nmeas].D = stars[N][0].average.D; 146 146 catalog[0].measure[Nmeas].dbFlags = 0; 147 147 catalog[0].measure[Nmeas].averef = n; … … 149 149 catalog[0].measure[Nmeas].catID = catalog[0].catID; 150 150 151 float dRoff = dvoOffsetR(&catalog[0].measure[Nmeas], &catalog[0].average[n]); 152 151 153 // rationalize dR: 152 if ( catalog[0].measure[Nmeas].dR> +180.0*3600.0) {154 if (dRoff > +180.0*3600.0) { 153 155 // average on high end of boundary, move star up 154 stars[N][0].average.R += 360.0;155 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N][0].average.R);156 } 157 if ( catalog[0].measure[Nmeas].dR< -180.0*3600.0) {156 catalog[0].measure[Nmeas].R += 360.0; 157 dRoff -= 360.0*3600.0; 158 } 159 if (dRoff < -180.0*3600.0) { 158 160 // average on low end of boundary, move star down 159 stars[N][0].average.R -= 360.0;160 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N][0].average.R);161 catalog[0].measure[Nmeas].R -= 360.0; 162 dRoff += 360.0*3600.0; 161 163 } 162 164 … … 262 264 catalog[0].measure[Nmeas] = stars[N][0].measure; 263 265 264 catalog[0].measure[Nmeas]. dR = 0.0;265 catalog[0].measure[Nmeas]. dD = 0.0;266 catalog[0].measure[Nmeas].R = stars[N][0].average.R; 267 catalog[0].measure[Nmeas].D = stars[N][0].average.D; 266 268 267 269 catalog[0].measure[Nmeas].t = (stars[N][0].measure.t == 0) ? TIMEREF : stars[N][0].measure.t; /** careful : time_t vs e_time **/ -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/load2mass_catalog.c
r35416 r36903 17 17 for (i = 0; i < Nstars; i+=3) { 18 18 19 double R = stars[i].average.R; 20 double D = stars[i].average.D; 21 19 22 // construct an average object for this object 20 23 // XXX for now, the output objects will have limited astrometric interpretation... 21 24 // XXX every 3 stars represents 3 measurements and 1 average 22 25 dvo_average_init (&catalog[0].average[Nave]); 23 catalog[0].average[Nave].R = stars[i].average.R;24 catalog[0].average[Nave].D = stars[i].average.D;26 catalog[0].average[Nave].R = R; 27 catalog[0].average[Nave].D = D; 25 28 catalog[0].average[Nave].measureOffset = Nmeas; 26 29 … … 33 36 catalog[0].measure[Nmeas] = stars[i+j].measure; 34 37 35 catalog[0].measure[Nmeas]. dR = 0.0;36 catalog[0].measure[Nmeas]. dD = 0.0;38 catalog[0].measure[Nmeas].R = R; 39 catalog[0].measure[Nmeas].D = D; 37 40 catalog[0].measure[Nmeas].dt = NAN_S_SHORT; 38 41 -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/replace_match.c
r26278 r36903 12 12 j = i + m; 13 13 if (measure[j].photcode != star[0].measure.photcode) continue; 14 measure[j]. dR = 3600.0*(average[0].R - star[0].average.R);15 measure[j]. dD = 3600.0*(average[0].D - star[0].average.D);14 measure[j].R = star[0].average.R; 15 measure[j].D = star[0].average.D; 16 16 measure[j].M = star[0].measure.M; 17 17 measure[j].dM = star[0].measure.dM; -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/update_coords.c
r34405 r36903 19 19 continue; 20 20 } 21 R = measure[m]. dR;22 D = measure[m]. dD;21 R = measure[m].R; 22 D = measure[m].D; 23 23 r += R; 24 24 d += D; … … 33 33 r = r / Npt; /* these are corrections in 1/100 arcsec to RA and DEC */ 34 34 d = d / Npt; 35 average[0].R -= r / 3600.0;36 average[0].D -= d / 3600.0;35 average[0].R = r; 36 average[0].D = d; 37 37 m = average[0].measureOffset; /* first measurement of this star */ 38 for (i = 0; i < average[0].Nmeasure; i++) { 39 measure[m].dR -= r; 40 measure[m].dD -= d; 41 m = next[m]; 42 } 43 38 44 39 /* measure scatter, if possible */ 45 40 if (Npt < 2) return; … … 47 42 dR2 = r2 / Npt - r*r; 48 43 dD2 = d2 / Npt - d*d; 49 average[0].ChiSqAve = sqrt (dD2 + dR2 / SQ(cos(d*RAD_DEG)));44 average[0].ChiSqAve = 3600.0*sqrt (dD2 + dR2 / SQ(cos(d*RAD_DEG))); 50 45 /* ChiSqAve is supposed to be a chisq */ 51 46 -
branches/eam_branches/ipp-20140610/Ohana/src/relastro/src/BrightCatalog.c
r36833 r36903 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 ); … … 262 262 GET_COLUMN(Ncode, "NCODE", short); 263 263 GET_COLUMN(Nused, "NUSED", short); 264 GET_COLUMN(M _20, "MAG_20", short);265 GET_COLUMN(M _80, "MAG_80", short);264 GET_COLUMN(Mmin, "MAG_MIN", float); 265 GET_COLUMN(Mmax, "MAG_MAX", float); 266 266 gfits_free_header (&theader); 267 267 gfits_free_table (&ftable); … … 276 276 secfilt[i].Ncode = Ncode[i]; 277 277 secfilt[i].Nused = Nused[i]; 278 secfilt[i].M _20 = M_20[i];279 secfilt[i].M _80 = M_80[i];278 secfilt[i].Mmin = Mmin[i]; 279 secfilt[i].Mmax = Mmax[i]; 280 280 } 281 281 fprintf (stderr, "loaded data for %lld averages\n", (long long) Nrow); … … 287 287 free (Ncode); 288 288 free (Nused); 289 free (M _20);290 free (M _80);289 free (Mmin ); 290 free (Mmax ); 291 291 catalog->secfilt = secfilt; 292 292 // assert Nsecfilt * Naverage = Nrow? … … 363 363 364 364 // 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);365 double *R ; ALLOCATE (R , double, catalog->Nmeasure); 366 double *D ; ALLOCATE (D , double, 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); 383 383 384 384 // assign the storage arrays 385 385 MeasureTiny *measure = catalog->measure; 386 386 for (i = 0; i < catalog->Nmeasure; i++) { 387 dR[i] = measure[i].dR;388 dD[i] = measure[i].dD;387 R[i] = measure[i].R ; 388 D[i] = measure[i].D ; 389 389 M[i] = measure[i].M ; 390 390 Mcal[i] = measure[i].Mcal ; … … 406 406 407 407 // 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);408 gfits_set_bintable_column (&theader, &ftable, "RA", R, catalog->Nmeasure); 409 gfits_set_bintable_column (&theader, &ftable, "DEC", D, catalog->Nmeasure); 410 410 gfits_set_bintable_column (&theader, &ftable, "MAG_SYS", M, catalog->Nmeasure); 411 411 gfits_set_bintable_column (&theader, &ftable, "MAG_CAL", Mcal, catalog->Nmeasure); … … 425 425 gfits_set_bintable_column (&theader, &ftable, "PHOTCODE", photcode, catalog->Nmeasure); 426 426 427 free ( dR);428 free ( dD);427 free (R ); 428 free (D ); 429 429 free (M ); 430 430 free (Mcal ); … … 629 629 gfits_define_bintable_column (&theader, "I", "NCODE", "magnitude (err)", NULL, 1.0, 0.0); 630 630 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);631 gfits_define_bintable_column (&theader, "E", "MAG_MIN", "ccd x coord", "pix", 1.0, 0.0); 632 gfits_define_bintable_column (&theader, "E", "MAG_MAX", "ccd y coord", "pix", 1.0, 0.0); 633 633 634 634 // generate the output array that carries the data … … 646 646 short *Ncode ; ALLOCATE (Ncode , short, Nsec); 647 647 short *Nused ; ALLOCATE (Nused , short, Nsec); 648 short *M_20 ; ALLOCATE (M_20 , short, Nsec);649 short *M_80 ; ALLOCATE (M_80 , short, Nsec);648 float *Mmin ; ALLOCATE (Mmin , float, Nsec); 649 float *Mmax ; ALLOCATE (Mmax , float, Nsec); 650 650 651 651 // assign the storage arrays … … 658 658 Ncode [i] = secfilt[i]. Ncode ; 659 659 Nused [i] = secfilt[i]. Nused ; 660 M _20 [i] = secfilt[i]. M_20;661 M _80 [i] = secfilt[i]. M_80;660 Mmin [i] = secfilt[i]. Mmin ; 661 Mmax [i] = secfilt[i]. Mmax ; 662 662 } 663 663 … … 669 669 gfits_set_bintable_column (&theader, &ftable, "NCODE", Ncode, Nsec); 670 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);671 gfits_set_bintable_column (&theader, &ftable, "MAG_MIN", Mmin , Nsec); 672 gfits_set_bintable_column (&theader, &ftable, "MAG_MAX", Mmax , Nsec); 673 673 674 674 free (M ); … … 678 678 free (Ncode ); 679 679 free (Nused ); 680 free (M _20);681 free (M _80);680 free (Mmin ); 681 free (Mmax ); 682 682 683 683 gfits_fwrite_Theader (f, &theader); -
branches/eam_branches/ipp-20140610/Ohana/src/relastro/src/ImageOps.c
r36833 r36903 406 406 for (j = 0; j < average[0].Nmeasure; j++) { 407 407 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);408 fprintf (stderr, "R, D, mag, dMag: %lf, %lf, %f, %f\n", measure[off].R, measure[off].D, measure[off].M, measure[off].dM); 409 409 } 410 410 return; … … 554 554 555 555 // complain if the new location is far from the old location 556 if (fabs(csdec*(measure[0]. dR - dR)) > DPOS_MAX_ASEC) {556 if (fabs(csdec*(measure[0].R - R)) > DPOS_MAX_ASEC) { 557 557 NoffRAori ++; 558 558 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);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].R, dR, csdec*(measure[0].R - R), dD); 560 560 dump_measures (&average[0], catalog[c].measure); 561 561 } 562 562 // abort(); 563 563 } 564 if (fabs(measure[0]. dD - dD) > DPOS_MAX_ASEC) {564 if (fabs(measure[0].D - D) > DPOS_MAX_ASEC) { 565 565 NoffDECori ++; 566 566 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);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].D, dD); 568 568 dump_measures (&average[0], catalog[c].measure); 569 569 } // abort(); 570 570 } 571 571 572 dPos += SQ(measure[0].dR - dR) + SQ(measure[0].dD - dD); 572 // XXX NOTE : apply csdec: 573 dPos += SQ(measure[0].R - R) + SQ(measure[0].D - D); 573 574 nPos ++; 574 575 575 measure[0]. dR = dR;576 measure[0]. dD = dD;577 measureT[0]. dR = dR;578 measureT[0]. dD = dD;576 measure[0].R = R; 577 measure[0].D = D; 578 measureT[0].R = R; 579 measureT[0].D = D; 579 580 580 581 // set the systematic error for this image: … … 661 662 } 662 663 663 measure[0].dR = dR; 664 measure[0].dD = dD; 665 666 if (measure[0].dR > +180.0*3600.0) { 664 measure[0].R = R; 665 measure[0].D = D; 666 667 fprintf (stderr, "redo this\n") 668 if (dR > +180.0*3600.0) { 667 669 // average on high end of boundary, move star up 668 670 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) {671 measure[0].R = R; 672 } 673 if (dR < -180.0*3600.0) { 672 674 // average on low end of boundary, move star down 673 675 R -= 360.0; 674 measure[0]. dR = 3600.0*(catalog[c].average[n].R - R);676 measure[0].R = R; 675 677 } 676 678 } … … 734 736 raw[i].mask |= MARK_TOO_FEW_MEAS; 735 737 } 736 if (!finite(measure[0]. dR) || !finite(measure[0].dD)) {738 if (!finite(measure[0].R) || !finite(measure[0].D)) { 737 739 raw[i].mask |= MARK_NAN_POS_ERROR; 738 740 } … … 880 882 // skip measurements based on user selected criteria 881 883 if (!MeasFilterTest(&measure[k], FALSE)) continue; 882 R[N] = measure[k]. dR;883 D[N] = measure[k]. dD;884 R[N] = measure[k].R; 885 D[N] = measure[k].D; 884 886 dR[N] = GetAstromError (&measure[k], ERROR_MODE_RA); 885 887 dD[N] = GetAstromError (&measure[k], ERROR_MODE_DEC); … … 906 908 if (!MeasFilterTest(&measure[k], FALSE)) continue; 907 909 908 x = measure[k]. dR - statsR.median;909 y = measure[k]. dD - statsD.median;910 x = measure[k].R - statsR.median; 911 y = measure[k].D - statsD.median; 910 912 theta = atan2(y,x); 911 913 if ((x*x + y*y) > (SQR(statsR.sigma * Ns * cos(theta)) + -
branches/eam_branches/ipp-20140610/Ohana/src/relastro/src/UpdateObjects.c
r36833 r36903 149 149 char *date = ohana_sec_to_date (measure[k].t); 150 150 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);151 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 152 free (date); 153 153 } -
branches/eam_branches/ipp-20140610/Ohana/src/relastro/src/dvo_astrom_ops.c
r36833 r36903 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 -
branches/eam_branches/ipp-20140610/Ohana/src/relastro/src/high_speed_objects.c
r36482 r36903 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); -
branches/eam_branches/ipp-20140610/Ohana/src/relastro/src/hpm_objects.c
r36482 r36903 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++; -
branches/eam_branches/ipp-20140610/Ohana/src/relastro/src/relastroVisual.c
r31635 r36903 418 418 StatType statsR, StatType statsD, double thresh) { 419 419 420 float*Din, *Rin, *Dout, *Rout;420 double *Din, *Rin, *Dout, *Rout; 421 421 double xmin, xmax, ymin, ymax, range; 422 422 float xCirc[100], yCirc[100]; … … 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++; -
branches/eam_branches/ipp-20140610/Ohana/src/relastro/src/relastro_merge_source.c
r34088 r36903 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 -
branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/BrightCatalog.c
r36630 r36903 63 63 64 64 // need to create and assign to flat-field correction 65 GET_COLUMN( dR, "RA_OFF", float);66 GET_COLUMN( dD, "DEC_OFF", float);65 GET_COLUMN(R, "RA", double); 66 GET_COLUMN(D, "DEC", double); 67 67 GET_COLUMN(M, "MAG_SYS", float); 68 68 GET_COLUMN(Mcal, "MAG_CAL", float); … … 85 85 ALLOCATE (measure, MeasureTiny, Nrow); 86 86 for (i = 0; i < Nrow; i++) { 87 measure[i]. dR = dR[i];88 measure[i]. dD = dD[i];87 measure[i].R = R[i]; 88 measure[i].D = D[i]; 89 89 measure[i].M = M[i]; 90 90 measure[i].Mcal = Mcal[i]; … … 105 105 fprintf (stderr, "loaded data for %lld measure\n", (long long) Nrow); 106 106 107 free ( dR);108 free ( dD);107 free (R ); 108 free (D ); 109 109 free (M ); 110 110 free (Mcal ); … … 136 136 137 137 // need to create and assign to flat-field correction 138 GET_COLUMN(R, "RA", double);139 GET_COLUMN(D, "DEC", double);138 GET_COLUMN(R, "RA", double); 139 GET_COLUMN(D, "DEC", double); 140 140 GET_COLUMN(Nmeasure, "NMEAS", int); 141 141 GET_COLUMN(measureOffset, "MEASURE_OFF", int); … … 188 188 GET_COLUMN(Ncode, "NCODE", short); 189 189 GET_COLUMN(Nused, "NUSED", short); 190 GET_COLUMN(M _20, "MAG_20", short);191 GET_COLUMN(M _80, "MAG_80", short);190 GET_COLUMN(Mmin, "MAG_MIN", float); 191 GET_COLUMN(Mmax, "MAG_MAX", float); 192 192 gfits_free_header (&theader); 193 193 gfits_free_table (&ftable); … … 202 202 secfilt[i].Ncode = Ncode[i]; 203 203 secfilt[i].Nused = Nused[i]; 204 secfilt[i].M _20 = M_20[i];205 secfilt[i].M _80 = M_80[i];204 secfilt[i].Mmin = Mmin[i]; 205 secfilt[i].Mmax = Mmax[i]; 206 206 } 207 207 fprintf (stderr, "loaded data for %lld secfilt\n", (long long) Nrow); … … 213 213 free (Ncode); 214 214 free (Nused); 215 free (M _20);216 free (M _80);215 free (Mmin ); 216 free (Mmax ); 217 217 catalog->secfilt = secfilt; 218 218 // assert Nsecfilt * Naverage = Nrow? … … 265 265 gfits_create_table_header (&theader, "BINTABLE", "MEASURE_TINY"); 266 266 267 gfits_define_bintable_column (&theader, " E", "RA_OFF", "ra offset", "arcsec", 1.0, 0.0);268 gfits_define_bintable_column (&theader, " E", "DEC_OFF", "dec offset", "arcsec", 1.0, 0.0);267 gfits_define_bintable_column (&theader, "D", "RA", "ra", "degree", 1.0, 0.0); 268 gfits_define_bintable_column (&theader, "D", "DEC", "dec", "degree", 1.0, 0.0); 269 269 gfits_define_bintable_column (&theader, "E", "MAG_SYS", "magnitude (sys)", NULL, 1.0, 0.0); 270 270 gfits_define_bintable_column (&theader, "E", "MAG_CAL", "magnitude (cal)", NULL, 1.0, 0.0); … … 286 286 287 287 // create intermediate storage arrays 288 float *dR ; ALLOCATE (dR , float, catalog->Nmeasure);289 float *dD ; ALLOCATE (dD , float, catalog->Nmeasure);290 float *M ; ALLOCATE (M , float,catalog->Nmeasure);291 float *Mcal ; ALLOCATE (Mcal , float,catalog->Nmeasure);292 float *dM ; ALLOCATE (dM , float,catalog->Nmeasure);293 float *airmass ; ALLOCATE (airmass , float,catalog->Nmeasure);294 float *Xccd ; ALLOCATE (Xccd , float,catalog->Nmeasure);295 float *Yccd ; ALLOCATE (Yccd , float,catalog->Nmeasure);296 float *dt ; ALLOCATE (dt , float,catalog->Nmeasure);297 int *t ; ALLOCATE (t , int ,catalog->Nmeasure);298 int *averef ; ALLOCATE (averef , int ,catalog->Nmeasure);299 int *imageID ; ALLOCATE (imageID , int ,catalog->Nmeasure);300 int *dbFlags ; ALLOCATE (dbFlags , int ,catalog->Nmeasure);301 int *photFlags ; ALLOCATE (photFlags, int ,catalog->Nmeasure);302 int *catID ; ALLOCATE (catID , int ,catalog->Nmeasure);303 short *photcode ; ALLOCATE (photcode , short,catalog->Nmeasure);288 double *R ; ALLOCATE (R , double, catalog->Nmeasure); 289 double *D ; ALLOCATE (D , double, catalog->Nmeasure); 290 float *M ; ALLOCATE (M , float, catalog->Nmeasure); 291 float *Mcal ; ALLOCATE (Mcal , float, catalog->Nmeasure); 292 float *dM ; ALLOCATE (dM , float, catalog->Nmeasure); 293 float *airmass ; ALLOCATE (airmass , float, catalog->Nmeasure); 294 float *Xccd ; ALLOCATE (Xccd , float, catalog->Nmeasure); 295 float *Yccd ; ALLOCATE (Yccd , float, catalog->Nmeasure); 296 float *dt ; ALLOCATE (dt , float, catalog->Nmeasure); 297 int *t ; ALLOCATE (t , int , catalog->Nmeasure); 298 int *averef ; ALLOCATE (averef , int , catalog->Nmeasure); 299 int *imageID ; ALLOCATE (imageID , int , catalog->Nmeasure); 300 int *dbFlags ; ALLOCATE (dbFlags , int , catalog->Nmeasure); 301 int *photFlags ; ALLOCATE (photFlags, int , catalog->Nmeasure); 302 int *catID ; ALLOCATE (catID , int , catalog->Nmeasure); 303 short *photcode ; ALLOCATE (photcode , short, catalog->Nmeasure); 304 304 305 305 // assign the storage arrays 306 306 MeasureTiny *measure = catalog->measure; 307 307 for (i = 0; i < catalog->Nmeasure; i++) { 308 dR[i] = measure[i].dR ;309 dD[i] = measure[i].dD ;308 R[i] = measure[i].R ; 309 D[i] = measure[i].D ; 310 310 M[i] = measure[i].M ; 311 311 Mcal[i] = measure[i].Mcal ; … … 325 325 326 326 // add the columns to the output array 327 gfits_set_bintable_column (&theader, &ftable, "RA _OFF", dR,catalog->Nmeasure);328 gfits_set_bintable_column (&theader, &ftable, "DEC _OFF", dD,catalog->Nmeasure);327 gfits_set_bintable_column (&theader, &ftable, "RA", R, catalog->Nmeasure); 328 gfits_set_bintable_column (&theader, &ftable, "DEC", D, catalog->Nmeasure); 329 329 gfits_set_bintable_column (&theader, &ftable, "MAG_SYS", M, catalog->Nmeasure); 330 330 gfits_set_bintable_column (&theader, &ftable, "MAG_CAL", Mcal, catalog->Nmeasure); … … 342 342 gfits_set_bintable_column (&theader, &ftable, "PHOTCODE", photcode, catalog->Nmeasure); 343 343 344 free ( dR);345 free ( dD);344 free (R ); 345 free (D ); 346 346 free (M ); 347 347 free (Mcal ); … … 428 428 gfits_create_table_header (&theader, "BINTABLE", "SECFILT"); 429 429 430 gfits_define_bintable_column (&theader, "E", "MAG", " ra offset","arcsec", 1.0, 0.0);431 gfits_define_bintable_column (&theader, "E", "MAG_ERR", " dec offset","arcsec", 1.0, 0.0);432 gfits_define_bintable_column (&theader, "E", "MAG_CHI", " magnitude (sys)",NULL, 1.0, 0.0);433 gfits_define_bintable_column (&theader, "J", "FLAGS", " magnitude (cal)",NULL, 1.0, 0.0);434 gfits_define_bintable_column (&theader, "I", "NCODE", " magnitude (err)",NULL, 1.0, 0.0);435 gfits_define_bintable_column (&theader, "I", "NUSED", " airmass",NULL, 1.0, 0.0);436 gfits_define_bintable_column (&theader, " I", "MAG_20", "ccd x coord", "pix",1.0, 0.0);437 gfits_define_bintable_column (&theader, " I", "MAG_80", "ccd y coord", "pix",1.0, 0.0);430 gfits_define_bintable_column (&theader, "E", "MAG", "", "arcsec", 1.0, 0.0); 431 gfits_define_bintable_column (&theader, "E", "MAG_ERR", "", "arcsec", 1.0, 0.0); 432 gfits_define_bintable_column (&theader, "E", "MAG_CHI", "", NULL, 1.0, 0.0); 433 gfits_define_bintable_column (&theader, "J", "FLAGS", "", NULL, 1.0, 0.0); 434 gfits_define_bintable_column (&theader, "I", "NCODE", "", NULL, 1.0, 0.0); 435 gfits_define_bintable_column (&theader, "I", "NUSED", "", NULL, 1.0, 0.0); 436 gfits_define_bintable_column (&theader, "E", "MAG_MIN", "min valid mag", "mag", 1.0, 0.0); 437 gfits_define_bintable_column (&theader, "E", "MAG_MAX", "max valid mag", "mag", 1.0, 0.0); 438 438 439 439 // generate the output array that carries the data … … 451 451 short *Ncode ; ALLOCATE (Ncode , short, Nsec); 452 452 short *Nused ; ALLOCATE (Nused , short, Nsec); 453 short *M_20 ; ALLOCATE (M_20 , short, Nsec);454 short *M_80 ; ALLOCATE (M_80 , short, Nsec);453 float *Mmin ; ALLOCATE (Mmin , float, Nsec); 454 float *Mmax ; ALLOCATE (Mmax , float, Nsec); 455 455 456 456 // assign the storage arrays … … 463 463 Ncode [i] = secfilt[i]. Ncode ; 464 464 Nused [i] = secfilt[i]. Nused ; 465 M _20 [i] = secfilt[i]. M_20;466 M _80 [i] = secfilt[i]. M_80;465 Mmin [i] = secfilt[i]. Mmin ; 466 Mmax [i] = secfilt[i]. Mmax ; 467 467 } 468 468 … … 474 474 gfits_set_bintable_column (&theader, &ftable, "NCODE", Ncode, Nsec); 475 475 gfits_set_bintable_column (&theader, &ftable, "NUSED", Nused, Nsec); 476 gfits_set_bintable_column (&theader, &ftable, "MAG_ 20", M_20, Nsec);477 gfits_set_bintable_column (&theader, &ftable, "MAG_ 80", M_80, Nsec);476 gfits_set_bintable_column (&theader, &ftable, "MAG_MIN", Mmin , Nsec); 477 gfits_set_bintable_column (&theader, &ftable, "MAG_MAX", Mmax , Nsec); 478 478 479 479 free (M ); … … 483 483 free (Ncode ); 484 484 free (Nused ); 485 free (M _20);486 free (M _80);485 free (Mmin ); 486 free (Mmax ); 487 487 488 488 gfits_fwrite_Theader (f, &theader); -
branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/MosaicOps.c
r36630 r36903 1782 1782 void plot_mosaic_fields (Catalog *catalog) { 1783 1783 1784 off_t i, j, m, c, N, ave,Nimage;1784 off_t i, j, m, c, N, Nimage; 1785 1785 double *xlist, *ylist; 1786 1786 // double Xmin, Xmax, Ymin, Ymax; … … 1812 1812 if (catalog[c].measureT[m].dbFlags & (ID_MEAS_AREA | ID_MEAS_NOCAL)) continue; 1813 1813 1814 ave = catalog[c].measureT[m].averef;1815 xlist[N] = catalog[c]. averageT[ave].R - catalog[c].measureT[m].dR / 3600.0;1816 ylist[N] = catalog[c]. averageT[ave].D - catalog[c].measureT[m].dD / 3600.0;1814 // ave = catalog[c].measureT[m].averef; 1815 xlist[N] = catalog[c].measureT[m].R; 1816 ylist[N] = catalog[c].measureT[m].D; 1817 1817 N++; 1818 1818 } -
branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/bcatalog.c
r35416 r36903 55 55 if (RESET) { 56 56 int Ns; 57 58 # if (0) 57 59 DVOSecfiltFlags secfiltBits = 58 60 ID_SECF_STAR_FEW | … … 66 68 ID_SECF_USE_UBERCAL | 67 69 ID_SECF_OBJ_EXT; 70 # endif 71 68 72 for (Ns = 0; Ns < Nphotcodes; Ns++) { 69 73 … … 71 75 int Nsec = GetPhotcodeNsec(thisCode); 72 76 73 subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].M = NAN; 74 subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].Map = NAN; 75 subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].dM = NAN; 76 subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].Mstdev = NAN_S_SHORT; 77 subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].Xm = NAN; 78 subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].M_20 = NAN_S_SHORT; 79 subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].M_80 = NAN_S_SHORT; 80 subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].Ncode = 0; 81 subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].Nused = 0; 82 subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].flags &= ~secfiltBits; 83 subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].ubercalDist = 1000; 77 fprintf (stderr, "really use dvo_secfilt_init?"); 78 dvo_secfilt_init (&subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec]); 79 80 // subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].M = NAN; 81 // subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].Map = NAN; 82 // subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].dM = NAN; 83 // subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].Mstdev = NAN_S_SHORT; 84 // subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].Xm = NAN; 85 // subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].M_20 = NAN_S_SHORT; 86 // subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].M_80 = NAN_S_SHORT; 87 // subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].Ncode = 0; 88 // subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].Nused = 0; 89 // subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].flags &= ~secfiltBits; 90 // subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].ubercalDist = 1000; 84 91 } 85 92 } -
branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/setExclusions.c
r33651 r36903 35 35 /* select measurements by mag limit */ 36 36 if (AreaSelect) { 37 r = catalog[i]. averageT[j].R + catalog[i].measureT[m].dR / 3600.0;38 d = catalog[i]. averageT[j].D + catalog[i].measureT[m].dD / 3600.0;37 r = catalog[i].measureT[m].R; 38 d = catalog[i].measureT[m].D; 39 39 if ((coords = getCoords (m, i)) == NULL) goto markbad; 40 40 RD_to_XY (&x, &y, r, d, coords); -
branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/setMrelCatalog.c
r36630 r36903 350 350 secfilt[Nsec].Nused = psfstats->Nmeas; 351 351 352 secfilt[Nsec].M _80 = 1000 * psfstats->Upper80;353 secfilt[Nsec].M _20 = 1000 * psfstats->Lower20;352 secfilt[Nsec].Mmax = 1000 * psfstats->max; 353 secfilt[Nsec].Mmin = 1000 * psfstats->min; 354 354 355 355 // NOTE : use the modified weight for apmags as well as psf mags … … 581 581 582 582 // need to put in AB mag factor to get to Janskies (or uJy?) 583 secfilt[Nsec].F luxPSF= zpFactor * measure[k].FluxPSF;584 secfilt[Nsec].dF luxPSF= zpFactor * measure[k].dFluxPSF;585 secfilt[Nsec].F luxKron= zpFactor * measure[k].FluxKron;586 secfilt[Nsec].dF luxKron= zpFactor * measure[k].dFluxKron;583 secfilt[Nsec].FpsfStk = zpFactor * measure[k].FluxPSF; 584 secfilt[Nsec].dFpsfStk = zpFactor * measure[k].dFluxPSF; 585 secfilt[Nsec].FkronStk = zpFactor * measure[k].FluxKron; 586 secfilt[Nsec].dFkronStk = zpFactor * measure[k].dFluxKron; 587 587 588 588 secfilt[Nsec].stackDetectID = ID;
Note:
See TracChangeset
for help on using the changeset viewer.
