Changeset 33006
- Timestamp:
- Dec 22, 2011, 5:05:13 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20111122/Ohana/src/addstar
- Files:
-
- 6 edited
-
include/supercos.h (modified) (2 diffs)
-
src/args_loadsupercos.c (modified) (3 diffs)
-
src/loadsupercos.c (modified) (1 diff)
-
src/loadsupercos_ops.c (modified) (2 diffs)
-
src/loadsupercos_plates.c (modified) (3 diffs)
-
src/loadsupercos_rawdata.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/addstar/include/supercos.h
r32994 r33006 76 76 } FullDetection; 77 77 78 AddstarClientOptions args_loadsupercos (int argc, char **argv, AddstarClientOptions options);78 AddstarClientOptions args_loadsupercos (int *argc, char **argv, AddstarClientOptions options); 79 79 Survey *loadsupercos_survey (char *filename, int *nsurvey); 80 80 Image *loadsupercos_plates (Survey *survey, int Nsurvey, char *filename, int *nimage); … … 83 83 int loadsupercos_sortStars (Stars *tstars, int Ntstars); 84 84 int *loadsupercos_image_index (Image *image, int Nimage); 85 int loadsupercos_getST (char *line, double *st); -
branches/eam_branches/ipp-20111122/Ohana/src/addstar/src/args_loadsupercos.c
r32994 r33006 2 2 static void help (void); 3 3 4 AddstarClientOptions args_loadsupercos (int argc, char **argv, AddstarClientOptions options) {4 AddstarClientOptions args_loadsupercos (int *argc, char **argv, AddstarClientOptions options) { 5 5 6 6 int N; 7 7 8 8 /* check for help request */ 9 if (get_argument ( argc, argv, "-help") ||10 get_argument ( argc, argv, "-h")) {9 if (get_argument (*argc, argv, "-help") || 10 get_argument (*argc, argv, "-h")) { 11 11 help (); 12 12 } … … 28 28 /* only add to existing regions */ 29 29 options.existing_regions = FALSE; 30 if ((N = get_argument ( argc, argv, "-existing-regions"))) {30 if ((N = get_argument (*argc, argv, "-existing-regions"))) { 31 31 options.existing_regions = TRUE; 32 remove_argument (N, &argc, argv);32 remove_argument (N, argc, argv); 33 33 } 34 34 /* only add to existing objects */ 35 35 options.only_match = FALSE; 36 if ((N = get_argument ( argc, argv, "-only-match"))) {36 if ((N = get_argument (*argc, argv, "-only-match"))) { 37 37 options.only_match = TRUE; 38 remove_argument (N, &argc, argv);38 remove_argument (N, argc, argv); 39 39 } 40 40 /* replace measurement, don't duplicate (ref/cat only) */ 41 41 options.replace = FALSE; 42 if ((N = get_argument ( argc, argv, "-replace"))) {42 if ((N = get_argument (*argc, argv, "-replace"))) { 43 43 options.replace = TRUE; 44 remove_argument (N, &argc, argv);44 remove_argument (N, argc, argv); 45 45 } 46 46 47 47 /* extra error messages */ 48 48 VERBOSE = FALSE; 49 if ((N = get_argument ( argc, argv, "-v"))) {49 if ((N = get_argument (*argc, argv, "-v"))) { 50 50 VERBOSE = TRUE; 51 remove_argument (N, &argc, argv);51 remove_argument (N, argc, argv); 52 52 } 53 53 … … 69 69 DUMP = NULL; 70 70 71 if ( argc < 4) {71 if (*argc < 4) { 72 72 fprintf (stderr, "USAGE: loadsupercos [options] (surveys.csv) (plates.csv) (detections.bin) [..more files]\n"); 73 73 exit (2); -
branches/eam_branches/ipp-20111122/Ohana/src/addstar/src/loadsupercos.c
r32994 r33006 21 21 // need to construct these options with args_loadWISE... 22 22 options = ConfigInit (&argc, argv); 23 options = args_loadsupercos ( argc, argv, options);23 options = args_loadsupercos (&argc, argv, options); 24 24 25 25 // load the full sky description table: -
branches/eam_branches/ipp-20111122/Ohana/src/addstar/src/loadsupercos_ops.c
r32994 r33006 4 4 // this is defined in libohana/src/string.c but not generally exposed 5 5 char *_parse_nextword_csv (char *string); 6 7 6 8 7 int loadsupercos_getFilterInfo (char *line, char *emulsion, char *filterID) { … … 54 53 } 55 54 55 int loadsupercos_getST (char *line, double *st) { 56 57 int i; 58 char *p1 = line; 59 60 // lstObs is field 20 61 for (i = 1; i < 20; i++) { 62 p1 = _parse_nextword_csv (p1); 63 if (!p1) { 64 fprintf (stderr, "error parsing filter info for line %s\n", line); 65 abort(); 66 } 67 } 68 if (*p1 == ',') { 69 fprintf (stderr, "missing sidereal time info for line %s\n", line); 70 abort(); 71 } 72 73 char hour[3], minute[3]; 74 strncpy(hour, p1, 2); hour[2] = 0; 75 strncpy(minute, p1+2, 2); minute[2] = 0; 76 77 double minuteF = atof (minute); 78 double hourF = atof(hour); 79 *st = hourF + minuteF / 60.0; 80 81 return TRUE; 82 } 83 56 84 int loadsupercos_sortStars (Stars *tstars, int Ntstars) { 57 85 -
branches/eam_branches/ipp-20111122/Ohana/src/addstar/src/loadsupercos_plates.c
r32994 r33006 51 51 dparse_csv (&exptime, 21, line); 52 52 dparse_csv (&sidtime, 20, line); 53 loadsupercos_getST (line, &sidtime); 54 53 55 dparse_csv (&RAo, 14, line); 54 56 dparse_csv (&DECo, 15, line); … … 56 58 loadsupercos_getFilterInfo (line, emulsion, filterID); 57 59 58 altaz (&alt, &az, sidtime - RAo, DECo, survey[survey_id].latitude); 60 // need to pass sidereal time in degrees 61 altaz (&alt, &az, 15.0*sidtime - RAo, DECo, survey[survey_id].latitude); 59 62 60 63 float scale = stepsize * survey[survey_id].plateScale / 1000.0 / 3600.0; // scale in degrees / pixel … … 82 85 } 83 86 image[Nimage].exptime = exptime * 60.0; 84 image[Nimage].sidtime = sidtime; // XXX double check units87 image[Nimage].sidtime = sidtime; // sidereal time in hours 85 88 image[Nimage].latitude = survey[survey_id].latitude; 86 89 -
branches/eam_branches/ipp-20111122/Ohana/src/addstar/src/loadsupercos_rawdata.c
r32994 r33006 3 3 4 4 # define NBYTE 228 5 # define NRECORDS 1000 5 # define NRECORDS 1000000 6 6 # define DEBUG 0 7 7 … … 66 66 tstars[i].measure.Yccd = sstars[i].yCen; 67 67 68 tstars[i].measure.M = sstars[i].prfMag; 68 tstars[i].measure.M = sstars[i].sMag; 69 tstars[i].measure.Map = sstars[i].gMag; 69 70 tstars[i].measure.photFlags = sstars[i].class; 70 71 … … 83 84 84 85 double alt, az; 85 altaz (&alt, &az, sidtime - tstars[i].average.R, tstars[i].average.D, latitude);86 87 tstars[i].measure.airmass = 1.0 / cos( alt);86 altaz (&alt, &az, 15.0*sidtime - tstars[i].average.R, tstars[i].average.D, latitude); 87 88 tstars[i].measure.airmass = 1.0 / cos(RAD_DEG*alt); 88 89 tstars[i].measure.az = az; 89 90 tstars[i].measure.t = image[Ni].tzero; 90 91 tstars[i].measure.imageID = image[Ni].imageID; 92 tstars[i].measure.photcode = image[Ni].photcode; 91 93 92 94 tstars[i].measure.FWx = ToShortPixels(sstars[i].aU); … … 125 127 if (DEBUG) fprintf (stderr, "writing to %s\n", skylist[0].filename[0]); 126 128 129 int this_image_id = tstars[i].measure.imageID; 130 127 131 // loop over stars in this WISE region that are also in this output region 128 132 Nstars = 0; … … 132 136 for (j = i; j < Nrecords; j++) { 133 137 if (tstars[j].found != -1) continue; 138 139 if (tstars[j].measure.imageID != this_image_id) continue; 134 140 135 141 // check if in skyregion … … 151 157 } 152 158 153 if ( DEBUG) fprintf (stderr, "selected %d stars (%10.6f - %10.6f, %10.6f - %10.6f)\n", Nstars,159 if (VERBOSE) fprintf (stderr, "selected %d stars (%10.6f - %10.6f, %10.6f - %10.6f)\n", Nstars, 154 160 region[0].Rmin, region[0].Rmax, region[0].Dmin, region[0].Dmax); 155 161
Note:
See TracChangeset
for help on using the changeset viewer.
