Changeset 39311
- Timestamp:
- Jan 13, 2016, 4:20:51 PM (11 years ago)
- Location:
- trunk/Ohana/src/addstar
- Files:
-
- 8 edited
-
include/2mass.h (modified) (2 diffs)
-
include/tycho.h (modified) (1 diff)
-
src/args_loadtycho.c (modified) (1 diff)
-
src/find_matches_refstars.c (modified) (8 diffs)
-
src/get2mass_full.c (modified) (3 diffs)
-
src/get2mass_ops.c (modified) (1 diff)
-
src/load2mass_as_rawdata.c (modified) (1 diff)
-
src/loadtycho_ops.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/include/2mass.h
r38986 r39311 19 19 } TMStars; 20 20 21 short TM_J, TM_H, TM_K ;21 short TM_J, TM_H, TM_K, TM_B, TM_V; 22 22 23 23 SkyTable *get2mass_acc (SkyRegion *patch, char *path, char *accel); … … 46 46 // int get2mass_3star (Stars *star, char *line, int Nmax); 47 47 48 int get2mass_3star_full (Measure *measure, char *line, int Nmax);48 int get2mass_3star_full (Measure *measure, char *line, int *Nmeasure); 49 49 char *next2MASSfield (char *line); 50 50 int set2MASS_ph_qual (Measure *measure, char qual); -
trunk/Ohana/src/addstar/include/tycho.h
r38467 r39311 9 9 } Tycho_Stars; 10 10 11 int USE_PS1_EPOCH; 12 11 13 AddstarClientOptions args_loadtycho (int *argc, char **argv, AddstarClientOptions options); 12 14 -
trunk/Ohana/src/addstar/src/args_loadtycho.c
r38467 r39311 49 49 } 50 50 51 USE_PS1_EPOCH = FALSE; 52 if ((N = get_argument (*argc, argv, "-ps1-mean-epoch"))) { 53 USE_PS1_EPOCH = TRUE; 54 remove_argument (N, argc, argv); 55 } 56 51 57 /* extra error messages */ 52 58 VERBOSE = FALSE; -
trunk/Ohana/src/addstar/src/find_matches_refstars.c
r39306 r39311 1 1 # include "addstar.h" 2 # define DEBUG 0 2 3 3 4 // see bottom of this file for differences between find_matches_refstars.c and find_matches.c … … 14 15 int Nsecfilt; 15 16 17 if (DEBUG) ohana_memcheck(TRUE); 18 16 19 /* photcode data -- should not have to modify secfilt / average */ 17 20 Nsecfilt = GetPhotcodeNsecfilt (); … … 57 60 objID = tgtcat[0].objID; 58 61 catID = tgtcat[0].catID; 62 63 if (DEBUG) ohana_memcheck(TRUE); 59 64 60 65 /* project onto rectilinear grid with 1 arcsec pixels. the choice of ARC projection has … … 119 124 120 125 /****************** find matched stars ********************/ 126 if (DEBUG) ohana_memcheck(TRUE); 121 127 122 128 for (i = j = 0; (i < Nstars) && (j < Nave); ) { … … 251 257 i++; 252 258 } 259 if (DEBUG) ohana_memcheck(TRUE); 253 260 254 261 /* incorporate unmatched refcat stars */ … … 333 340 Nave ++; 334 341 } 342 if (DEBUG) ohana_memcheck(TRUE); 335 343 336 344 REALLOCATE (tgtcat[0].average, Average, Nave); … … 341 349 342 350 /* note stars which have been found in this tgtcat */ 343 for (i = 0; i < srccat->N measure; i++) {351 for (i = 0; i < srccat->Naverage; i++) { 344 352 if (srccat->found_t[i] > -1) { 345 353 srccat->found_t[i] = -2; … … 352 360 tgtcat[0].Nsecfilt_mem = Nave*Nsecfilt; 353 361 if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas: "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT", ("OFF_T_FMT" matches)\n", Nstars, Nave, Nmeas, Nmatch); 362 363 if (DEBUG) ohana_memcheck(TRUE); 354 364 355 365 free (X1); -
trunk/Ohana/src/addstar/src/get2mass_full.c
r38986 r39311 6 6 // fill in the data for a JHK triplet star. takes a pointer to the start of the line the 7 7 // RA and DEC have already been set 8 int get2mass_3star_full (Measure *measure, char *line, int Nmax) {8 int get2mass_3star_full (Measure *measure, char *line, int *Nmeasure) { 9 9 10 10 char *ptr; … … 14 14 if (line == NULL) Shutdown ("format error in 2mass"); 15 15 16 ptr = line; // ra (assumed to be already set) 16 ptr = line; // ra (set for average, but not yet measure) 17 double R = atof(ptr); 18 17 19 ptr = next2MASSfield (ptr); // dec (assumed to be already set) 20 double D = atof(ptr); 21 22 measure[2].R = measure[1].R = measure[0].R = R; 23 measure[2].D = measure[1].D = measure[0].D = D; 24 18 25 ptr = next2MASSfield (ptr); // err_maj 19 26 measure[0].FWx = ToShortPixels(strtod (ptr, NULL)); … … 153 160 measure[2].detID = 0; 154 161 measure[2].imageID = 0; 162 163 *Nmeasure = 3; 164 165 ptr = next2MASSfield (ptr); // a (optical source association) 166 167 // if we have Tycho data, add as a new measurement 168 if (*ptr == 'T') { 169 ptr = next2MASSfield (ptr); // dist_opt (optical source association) 170 float dR = atof(ptr) / 3600.0; // convert offset to degrees 171 172 ptr = next2MASSfield (ptr); // phi_opt (optical source association) 173 float phi = atof(ptr); 174 175 ptr = next2MASSfield (ptr); // B_opt (optical source association) 176 float B_j = atof(ptr); 177 178 ptr = next2MASSfield (ptr); // V_opt (optical source association) 179 float V_j = atof(ptr); 180 181 *Nmeasure = 5; 182 183 // inherit all info from the base measurement 184 measure[3] = measure[0]; 185 measure[4] = measure[0]; 186 187 float dDEC = dR * cos(RAD_DEG*phi); 188 float dRA = dR * sin(RAD_DEG*phi) / cos(RAD_DEG*measure[3].D); 189 190 // transformations from Bj,Vj to Bt,Vt from 2mass explanatory supplement: 191 float BV_t = (B_j - V_j) / 0.85; 192 float V_t = V_j + 0.09 * BV_t; 193 float B_t = BV_t + V_t; 194 195 measure[3].R -= dRA; 196 measure[3].D -= dDEC; 197 measure[3].photcode = TM_B; 198 measure[3].M = B_t; 199 measure[3].dM = 0.1; 200 201 measure[4].R = measure[3].R; 202 measure[4].D = measure[3].D; 203 measure[4].photcode = TM_V; 204 measure[4].M = V_t; 205 measure[4].dM = 0.1; 206 } 155 207 156 208 return TRUE; -
trunk/Ohana/src/addstar/src/get2mass_ops.c
r38986 r39311 12 12 NAMED_PHOTCODE (TM_H, "2MASS_H"); 13 13 NAMED_PHOTCODE (TM_K, "2MASS_K"); 14 15 NAMED_PHOTCODE (TM_B, "TYCHO_B_2MASS"); 16 NAMED_PHOTCODE (TM_V, "TYCHO_V_2MASS"); 14 17 15 18 FilterSkip = TimeSkip = Qentry = 0; -
trunk/Ohana/src/addstar/src/load2mass_as_rawdata.c
r38986 r39311 150 150 } 151 151 152 // make sure we have enough space here for up to 5 more measurements: 153 CHECK_REALLOCATE (newcat->measure, Measure, NMEAS, Nmeas + 5, 3000); 154 155 int Nmeasure = 0; // we are adding 3 (JHK) or 5 (+ B_T, V_T) measurements 156 152 157 newcat->average[Nave].R = tstars[j].R; 153 158 newcat->average[Nave].D = tstars[j].D; 154 get2mass_3star_full (&newcat->measure[Nmeas], &buffer[offset], Nbyte - offset);159 get2mass_3star_full (&newcat->measure[Nmeas], &buffer[offset], &Nmeasure); 155 160 156 161 tstars[j].flag = TRUE; 157 162 158 newcat->average[Nave].Nmeasure = 3;163 newcat->average[Nave].Nmeasure = Nmeasure; 159 164 newcat->average[Nave].measureOffset = Nmeas; 160 165 161 166 Nave ++; 162 Nmeas += 3;167 Nmeas += Nmeasure; 163 168 164 169 CHECK_REALLOCATE (newcat->average, Average, NAVE, Nave, 1000); 165 CHECK_REALLOCATE (newcat->measure, Measure, NMEAS, Nmeas, 3000);166 170 } 167 171 newcat->Naverage = Nave; -
trunk/Ohana/src/addstar/src/loadtycho_ops.c
r38467 r39311 61 61 Dref = Dobs; 62 62 Dps1 = Dobs; 63 } else { 64 star[0].average.dR = atof (&line[57]) / 1000.0; // e_RAmdeg 65 star[0].average.dD = atof (&line[61]) / 1000.0; // e_DEmdeg 63 goto got_positions; 64 } 66 65 67 star[0].average.uR = atof (&line[41]) / 1000.0; // pmRA 68 star[0].average.uD = atof (&line[49]) / 1000.0; // pmDE 66 star[0].average.dR = atof (&line[57]) / 1000.0; // e_RAmdeg 67 star[0].average.dD = atof (&line[61]) / 1000.0; // e_DEmdeg 68 69 star[0].average.uR = atof (&line[41]) / 1000.0; // pmRA 70 star[0].average.uD = atof (&line[49]) / 1000.0; // pmDE 71 72 star[0].average.duR = atof (&line[65]) / 1000.0; // e_pmRA 73 star[0].average.duD = atof (&line[70]) / 1000.0; // e_pmDE 74 75 if (line[13] == 'P') { 76 77 double Ttycho = 0.5*(jyR + jyD) + 1990.0; 69 78 70 star[0].average.duR = atof (&line[65]) / 1000.0; // e_pmRA 71 star[0].average.duD = atof (&line[70]) / 1000.0; // e_pmDE 79 Rref = Robs + ((2000.0 - Ttycho)/3600.0)*star[0].average.uR*cos(RAD_DEG*Dobs); 80 Dref = Dobs + ((2000.0 - Ttycho)/3600.0)*star[0].average.uD; 81 } 72 82 73 Rps1 = Rref + ((2012.0 - 2000.0)/3600.0)*star[0].average.uR*cos(RAD_DEG*Dref); 74 Dps1 = Dref + ((2012.0 - 2000.0)/3600.0)*star[0].average.uD; 75 76 // use the mean (J2000) position for average or determine J2012? 83 Rps1 = Rref + ((2012.0 - 2000.0)/3600.0)*star[0].average.uR*cos(RAD_DEG*Dref); 84 Dps1 = Dref + ((2012.0 - 2000.0)/3600.0)*star[0].average.uD; 85 86 // use the PS1 epoch for average 87 if (USE_PS1_EPOCH) { 77 88 star[0].average.R = Rps1; 78 89 star[0].average.D = Dps1; 79 90 star[0].average.Tmean = J2012; 91 } else { 92 star[0].average.R = Rref; 93 star[0].average.D = Dref; 80 94 star[0].average.Tmean = J2000; 81 95 } 82 96 83 float M_B = atof (&line[110]); // BTmag 84 float dM_B = atof (&line[117]); // e_BTmag 85 float M_V = atof (&line[123]); // VTmag 86 float dM_V = atof (&line[130]); // e_VTmag 97 got_positions: 98 { 99 float M_B = atof (&line[110]); // BTmag 100 float dM_B = atof (&line[117]); // e_BTmag 101 float M_V = atof (&line[123]); // VTmag 102 float dM_V = atof (&line[130]); // e_VTmag 87 103 88 // we have NGROUP measurements (B,V) x (MeanEpoch, J2000, J2012)89 star[0].measure[0].t = TychoEpoch;90 star[0].measure[1].t = TychoEpoch;91 star[0].measure[2].t = J2000;92 star[0].measure[3].t = J2000;93 star[0].measure[4].t = J2012;94 star[0].measure[5].t = J2012;104 // we have NGROUP measurements (B,V) x (MeanEpoch, J2000, J2012) 105 star[0].measure[0].t = TychoEpoch; 106 star[0].measure[1].t = TychoEpoch; 107 star[0].measure[2].t = J2000; 108 star[0].measure[3].t = J2000; 109 star[0].measure[4].t = J2012; 110 star[0].measure[5].t = J2012; 95 111 96 star[0].measure[0].R = Robs;97 star[0].measure[0].D = Dobs;98 star[0].measure[1].R = Robs;99 star[0].measure[1].D = Dobs;112 star[0].measure[0].R = Robs; 113 star[0].measure[0].D = Dobs; 114 star[0].measure[1].R = Robs; 115 star[0].measure[1].D = Dobs; 100 116 101 star[0].measure[2].R = Rref;102 star[0].measure[2].D = Dref;103 star[0].measure[3].R = Rref;104 star[0].measure[3].D = Dref;117 star[0].measure[2].R = Rref; 118 star[0].measure[2].D = Dref; 119 star[0].measure[3].R = Rref; 120 star[0].measure[3].D = Dref; 105 121 106 star[0].measure[4].R = Rps1;107 star[0].measure[4].D = Dps1;108 star[0].measure[5].R = Rps1;109 star[0].measure[5].D = Dps1;122 star[0].measure[4].R = Rps1; 123 star[0].measure[4].D = Dps1; 124 star[0].measure[5].R = Rps1; 125 star[0].measure[5].D = Dps1; 110 126 111 for (i = 0; i < NGROUP; i+=2) { 112 star[0].measure[i+0].M = M_B; 113 star[0].measure[i+0].dM = dM_B; 114 star[0].measure[i+0].photcode = TYCHO_B; 115 star[0].measure[i+1].M = M_V; 116 star[0].measure[i+1].dM = dM_V; 117 star[0].measure[i+1].photcode = TYCHO_V; 127 for (i = 0; i < NGROUP; i+=2) { 128 star[0].measure[i+0].M = M_B; 129 star[0].measure[i+0].dM = dM_B; 130 star[0].measure[i+0].photcode = TYCHO_B; 131 star[0].measure[i+1].M = M_V; 132 star[0].measure[i+1].dM = dM_V; 133 star[0].measure[i+1].photcode = TYCHO_V; 134 } 118 135 } 119 136 return TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.
