Changeset 5322
- Timestamp:
- Oct 13, 2005, 2:40:16 PM (21 years ago)
- Location:
- trunk/Ohana/src/addstar
- Files:
-
- 17 edited
-
include/addstar.h (modified) (6 diffs)
-
src/ConfigInit.c (modified) (5 diffs)
-
src/NewImage.c (modified) (1 diff)
-
src/SocketOps.c (modified) (1 diff)
-
src/addstar.c (modified) (12 diffs)
-
src/addstarc.c (modified) (1 diff)
-
src/addstard.c (modified) (1 diff)
-
src/args.c (modified) (3 diffs)
-
src/args_client.c (modified) (1 diff)
-
src/args_server.c (modified) (6 diffs)
-
src/find_matches.c (modified) (8 diffs)
-
src/find_matches_closest.c (modified) (7 diffs)
-
src/find_matches_refstars.c (modified) (4 diffs)
-
src/gcatalog.c (modified) (1 diff)
-
src/load_pt_catalog.c (modified) (3 diffs)
-
src/replace_match.c (modified) (1 diff)
-
src/wcatalog.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/include/addstar.h
r5285 r5322 51 51 char STKeyword[64]; 52 52 53 /* these globals modify the behavior of gstars (KEEP) */ 54 double SNLIMIT; 55 int ACCEPT_ASTROM; // accept even bad astrometry solutions (NASTRO == 0) 56 int TEXTMODE; // force input file to be loaded as RAW 57 char *DUMP; // dump out intermediate results 58 int XOVERSCAN; // used to modify stored image dimensions 59 int YOVERSCAN; // used to modify stored image dimensions 60 int XMIN; // used to filter loaded star list 61 int XMAX; // used to filter loaded star list 62 int YMIN; // used to filter loaded star list 63 int YMAX; // used to filter loaded star list 64 double Latitude; // carried into image structure from config 65 66 /* these globals are used separately by both client and server (KEEP) */ 67 double ZeroPt; // double check for consistency 68 int VERBOSE; 69 53 70 /* add to options as an int / keep the global? */ 54 71 PhotCode *thiscode; … … 59 76 /* globals set by command-line options (AddstarClientOptions) */ 60 77 /* move into AddstarClientOptions completely */ 61 # if ( 1)62 int MODE;63 int EXISTING_REGIONS;64 int ONLY_MATCH;65 int SKIP_MISSED;66 int REPLACE;67 int CLOSEST;68 int NOSORT;69 int UPDATE;70 int ONLY_IMAGES;71 int CALIBRATE;78 # if (0) 79 int MODE; 80 int EXISTING_REGIONS; 81 int ONLY_MATCH; 82 int SKIP_MISSED; 83 int REPLACE; 84 int CLOSEST; 85 int NOSORT; 86 int UPDATE; 87 int ONLY_IMAGES; 88 int CALIBRATE; 72 89 double DEFAULT_RADIUS; // XXX add to AddstarClientOptions 73 90 double NSIGMA; // XXX add to AddstarClientOptions 74 91 # endif 75 76 /* these globals modify the behavior of gstars (KEEP) */77 double SNLIMIT;78 int ACCEPT_ASTROM; // accept even bad astrometry solutions (NASTRO == 0)79 int TEXTMODE;80 int VERBOSE;81 char *DUMP;82 int XOVERSCAN; // used to modify stored image dimensions83 int YOVERSCAN;84 int XMIN; // used to filter loaded star list85 int XMAX;86 int YMIN;87 int YMAX;88 double Latitude; // carried into image structure from config89 92 90 93 /* modify server behavoir (make this an addstar cleanup mode?) */ … … 99 102 time_t TIMEREF; // used by MODE REF 100 103 GSCRegion UserPatch; // used by MODE CAT 101 char *SELECT_2MASS_QUALITY; // used only by get2mass_as 102 103 double ZeroPt; // double check for consistency (image header / config file): KEEP global 104 105 int FITS_INPUT; // unused??? 106 int ADDREFS; // unused??? 107 int DUMP_MATCHES; // un-set??? 104 char *SELECT_2MASS_QUALITY; // used only by get2mass_as 108 105 109 106 /*** addstar prototypes ***/ 110 107 void AddToCalibration PROTO((Average *average, Measure *measure, Measure *new, int *next, int Nstar)); 111 void ConfigInitPROTO((int *argc, char **argv));108 AddstarClientOptions ConfigInit PROTO((int *argc, char **argv)); 112 109 void FindCalibration PROTO((Image *image)); 113 110 int FindDecBand PROTO((double dec, double *DEC0, double *DEC1)); … … 125 122 float airmass PROTO((float secz_image, double ra, double dec, double st, double latitude)); 126 123 void aregion PROTO((GSCRegion *region, FILE *f, double ra, double dec)); 127 int args PROTO((int argc, char **argv));124 AddstarClientOptions args PROTO((int argc, char **argv, AddstarClientOptions options)); 128 125 void check_permissions PROTO((char *basefile)); 129 126 int dump_rawstars PROTO((Stars *stars, int Nstars)); 130 127 int edge_check PROTO((double *x1, double *y1, double *x2, double *y2)); 131 void find_matches PROTO((GSCRegion *region, Stars *stars, int Nstars, Catalog *catalog, Image *image, Image *overlap, int Noverlap ));132 void find_matches_closest PROTO((GSCRegion *region, Stars *stars, int Nstars, Catalog *catalog, Image *image, Image *overlap, int Noverlap ));133 void find_matches_refstars PROTO((GSCRegion *region, Stars **stars, int Nstars, Catalog *catalog ));128 void find_matches PROTO((GSCRegion *region, Stars *stars, int Nstars, Catalog *catalog, Image *image, Image *overlap, int Noverlap, AddstarClientOptions options)); 129 void find_matches_closest PROTO((GSCRegion *region, Stars *stars, int Nstars, Catalog *catalog, Image *image, Image *overlap, int Noverlap, AddstarClientOptions options)); 130 void find_matches_refstars PROTO((GSCRegion *region, Stars **stars, int Nstars, Catalog *catalog, AddstarClientOptions options)); 134 131 Stars **find_subset PROTO((GSCRegion *region, Stars *stars, int Nstars, int *NSTARS)); 135 132 int gcatalog PROTO((Catalog *catalog)); … … 189 186 Missing *sort_missing (Average *average, int Naverage, Missing *missing, int Nmissing, int *next_miss); 190 187 191 int InitServerSocket (char *hostname, SockAddress *Address);192 int WaitServerSocket (int InitSocket, SockAddress *Address, int *validIP, int Nvalid);193 int GetClientSocket (char *hostname);194 195 188 /** 196 189 there is an inconsistency to be resolved: fixed structures (like Image) … … 202 195 **/ 203 196 204 AddstarClientOptions args_client (int argc, char **argv); 205 206 int args_server (int argc, char **argv); 197 /** function for client / server **/ 198 199 AddstarClientOptions args_client (int argc, char **argv, AddstarClientOptions options); 200 201 void args_server (int argc, char **argv); 202 207 203 int CheckPassword (int BindSocket); 208 204 int NewImage (int BindSocket); 205 206 int InitServerSocket (char *hostname, SockAddress *Address); 207 int WaitServerSocket (int InitSocket, SockAddress *Address, int *validIP, int Nvalid); 208 int GetClientSocket (char *hostname); 209 -
trunk/Ohana/src/addstar/src/ConfigInit.c
r5265 r5322 1 1 # include "addstar.h" 2 2 3 voidConfigInit (int *argc, char **argv) {3 AddstarClientOptions ConfigInit (int *argc, char **argv) { 4 4 5 5 char *config, *file; 6 6 char RadiusWord[80]; 7 7 char PhotCodeFile[256]; 8 AddstarClientOptions options; 8 9 9 10 /*** load configuration info ***/ … … 19 20 XMIN = XMAX = YMIN = YMAX = 0; 20 21 21 ScanConfig (config, "RADIUS", "%s", 0, RadiusWord); 22 ScanConfig (config, "NSIGMA", "%lf", 0, &NSIGMA); 22 /* used by client to interpret input data */ 23 23 ScanConfig (config, "XOVERSCAN", "%d", 0, &XOVERSCAN); 24 24 ScanConfig (config, "YOVERSCAN", "%d", 0, &YOVERSCAN); … … 28 28 ScanConfig (config, "ADDSTAR_YMAX", "%d", 0, &YMAX); 29 29 ScanConfig (config, "MIN_SN_FSTAT", "%lf", 0, &SNLIMIT); 30 31 ScanConfig (config, "2MASS_DIR_AS", "%s", 0, TWO_MASS_DIR_AS);32 ScanConfig (config, "2MASS_DIR_DR2", "%s", 0, TWO_MASS_DIR_DR2);33 ScanConfig (config, "GSCDIR", "%s", 0, GSCDIR);34 ScanConfig (config, "USNO_CDROM", "%s", 0, CDROM);35 36 ScanConfig (config, "IMAGE_CATALOG", "%s", 0, ImageCat);37 ScanConfig (config, "GSCFILE", "%s", 0, GSCFILE);38 ScanConfig (config, "CATDIR", "%s", 0, CATDIR);39 ScanConfig (config, "CATMODE", "%s", 0, CATMODE);40 ScanConfig (config, "CATFORMAT", "%s", 0, CATFORMAT);41 ScanConfig (config, "PHOTCODE_FILE", "%s", 0, PhotCodeFile);42 30 43 31 /* used by parse_time to find time-related keywords */ … … 55 43 ScanConfig (config, "OBSERVATORY-LATITUDE", "%lf", 0, &Latitude); 56 44 ScanConfig (config, "SUBPIX_DATAFILE", "%s", 0, SubpixDatafile); 45 46 /* location of needed data sources */ 47 ScanConfig (config, "2MASS_DIR_AS", "%s", 0, TWO_MASS_DIR_AS); 48 ScanConfig (config, "2MASS_DIR_DR2", "%s", 0, TWO_MASS_DIR_DR2); 49 ScanConfig (config, "GSCDIR", "%s", 0, GSCDIR); 50 ScanConfig (config, "USNO_CDROM", "%s", 0, CDROM); 51 52 ScanConfig (config, "IMAGE_CATALOG", "%s", 0, ImageCat); 53 ScanConfig (config, "GSCFILE", "%s", 0, GSCFILE); 54 ScanConfig (config, "CATDIR", "%s", 0, CATDIR); 55 ScanConfig (config, "CATMODE", "%s", 0, CATMODE); 56 ScanConfig (config, "CATFORMAT", "%s", 0, CATFORMAT); 57 ScanConfig (config, "PHOTCODE_FILE", "%s", 0, PhotCodeFile); 57 58 58 59 /* used by client/server setup */ … … 92 93 } 93 94 95 /* set the default search radius */ 96 ScanConfig (config, "RADIUS", "%s", 0, RadiusWord); 97 ScanConfig (config, "NSIGMA", "%lf", 0, &options.Nsigma); 94 98 if (!strcasecmp (RadiusWord, "header")) { 95 DEFAULT_RADIUS= 0;99 options.radius = 0; 96 100 } else { 97 DEFAULT_RADIUS= atof (RadiusWord);101 options.radius = atof (RadiusWord); 98 102 } 99 103 -
trunk/Ohana/src/addstar/src/NewImage.c
r5288 r5322 38 38 39 39 for (i = 0; i < Nimage; i++) { 40 fprintf (stderr, "name: %s \n", image[i].name);40 fprintf (stderr, "name: %s, %d stars\n", image[i].name, Nstars); 41 41 } 42 42 -
trunk/Ohana/src/addstar/src/SocketOps.c
r5271 r5322 11 11 12 12 host = gethostbyname (hostname); 13 fprintf (stderr, "errno: %d\n", h_errno); 14 fprintf (stderr, "host: %d\n", host); 13 15 14 16 bzero (hostip, 80); 15 17 for (i = 0; i < host[0].h_length; i++) { 16 sprintf (tmpline, "% 3u", (0xff & host[0].h_addr[i]));18 sprintf (tmpline, "%u", (0xff & host[0].h_addr[i])); 17 19 strcat (hostip, tmpline); 18 20 if (i < host[0].h_length - 1) strcat (hostip, "."); -
trunk/Ohana/src/addstar/src/addstar.c
r5239 r5322 10 10 Catalog catalog; 11 11 FITS_DB db; 12 AddstarClientOptions options; 12 13 13 14 double dtime; … … 17 18 18 19 SetSignals (); 19 ConfigInit (&argc, argv);20 args (argc, argv);20 options = ConfigInit (&argc, argv); 21 options = args (argc, argv, options); 21 22 22 23 stars = NULL; … … 24 25 regions = NULL; 25 26 set_db (&db); 27 if (options.update) { 28 catalog.catflags = LOAD_AVES | LOAD_MEAS_META | LOAD_MISS | LOAD_SECF; 29 } else { 30 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 31 } 26 32 27 33 if (SKYPROBE) load_subpix (); … … 33 39 fprintf (stderr, "mark: lock_image_db: time %9.4f sec\n", dtime); 34 40 35 switch ( MODE) {41 switch (options.mode) { 36 42 case M_IMAGE: 37 43 stars = gstars (argv[1], &Nstars, &image); … … 50 56 break; 51 57 } 52 if ( ONLY_MATCH || EXISTING_REGIONS) {58 if (options.only_match || options.existing_regions) { 53 59 regions = gregion_match (regions, &Nregions); 54 60 } … … 64 70 gettimeofday (&t1, NULL); 65 71 66 if (!load_pt_catalog (&catalog, ®ions[i])) continue; 72 load_pt_catalog (&catalog, ®ions[i]); 73 74 /* for only_match, skip empty catalogs XXX EAM : this leaves behind empty files */ 75 if ((catalog.Nave_disk == 0) && options.only_match) { 76 unlock_catalog (&catalog); 77 continue; 78 } 79 67 80 Nm = catalog.Nmeasure + catalog.Nmeas_off; 68 81 Na = catalog.Naverage; … … 78 91 gettimeofday (&t1, NULL); 79 92 80 switch ( MODE) {93 switch (options.mode) { 81 94 case M_IMAGE: 82 95 Nsubset = Nstars; 83 if ( CLOSEST) {84 find_matches_closest (®ions[i], stars, Nstars, &catalog, &image, overlap, Noverlap );96 if (options.closest) { 97 find_matches_closest (®ions[i], stars, Nstars, &catalog, &image, overlap, Noverlap, options); 85 98 } else { 86 find_matches (®ions[i], stars, Nstars, &catalog, &image, overlap, Noverlap );99 find_matches (®ions[i], stars, Nstars, &catalog, &image, overlap, Noverlap, options); 87 100 } 88 101 break; … … 91 104 case M_REFLIST: 92 105 subset = find_subset (®ions[i], stars, Nstars, &Nsubset); 93 find_matches_refstars (®ions[i], subset, Nsubset, &catalog );106 find_matches_refstars (®ions[i], subset, Nsubset, &catalog, options); 94 107 if (Nsubset) free (subset); 95 108 break; … … 105 118 unlock_catalog (&catalog); 106 119 } else { 107 save_pt_catalog (&catalog); 120 SetProtect (TRUE); 121 if (!options.only_images) wcatalog (&catalog); 122 SetProtect (FALSE); 123 unlock_catalog (&catalog); 108 124 } 109 125 … … 118 134 fprintf (stderr, "mark: match: time %9.4f sec\n", dtime); 119 135 120 if ( CALIBRATE) { FindCalibration (&image); }136 if (options.calibrate) { FindCalibration (&image); } 121 137 122 138 if (db.dbstate == LCK_EMPTY) { … … 127 143 128 144 /* write out new image */ 129 if ( MODE== M_IMAGE) {145 if (options.mode == M_IMAGE) { 130 146 dvo_image_addrows (&db, &image, 1); 131 147 SetProtect (TRUE); … … 143 159 144 160 /* names: 145 146 161 catalog - existing object db table 147 regions - sky area which may or maycontain data162 regions - sky area which may or may not contain data 148 163 patch - RA,DEC bounded portion of sky 149 150 164 */ -
trunk/Ohana/src/addstar/src/addstarc.c
r5288 r5322 10 10 11 11 /* load config and options */ 12 ConfigInit (&argc, argv);13 options = args_client (argc, argv );12 options = ConfigInit (&argc, argv); 13 options = args_client (argc, argv, options); 14 14 15 15 /* load data */ -
trunk/Ohana/src/addstar/src/addstard.c
r5271 r5322 6 6 SockAddress Address; 7 7 IOBuffer message; 8 AddstarClientOptions options; 8 9 9 ConfigInit (&argc, argv);10 options = ConfigInit (&argc, argv); 10 11 args_server (argc, argv); 11 12 -
trunk/Ohana/src/addstar/src/args.c
r5268 r5322 1 1 # include "addstar.h" 2 void help (void); 3 4 AddstarClientOptions args (int argc, char **argv, AddstarClientOptions options) { 5 6 int N; 7 8 /* check for help request */ 9 if (get_argument (argc, argv, "-help") || 10 get_argument (argc, argv, "-h")) { 11 help (); 12 } 13 14 /*** check for command line options ***/ 15 16 /* basic mode: image, list, refcat */ 17 options.mode = M_IMAGE; 18 if ((N = get_argument (argc, argv, "-ref"))) { 19 options.mode = M_REFLIST; 20 remove_argument (N, &argc, argv); 21 } 22 if ((N = get_argument (argc, argv, "-cat"))) { 23 options.mode = M_REFCAT; 24 remove_argument (N, &argc, argv); 25 } 26 27 /*** provide additional data ***/ 28 /* restrict to a portion of the sky? (REFCAT only) */ 29 UserPatch.RA[0] = 0; 30 UserPatch.RA[1] = 360; 31 UserPatch.DEC[0] = -90; 32 UserPatch.DEC[1] = +90; 33 if ((N = get_argument (argc, argv, "-region"))) { 34 remove_argument (N, &argc, argv); 35 UserPatch.RA[0] = atof (argv[N]); 36 remove_argument (N, &argc, argv); 37 UserPatch.RA[1] = atof (argv[N]); 38 remove_argument (N, &argc, argv); 39 UserPatch.DEC[0] = atof (argv[N]); 40 remove_argument (N, &argc, argv); 41 UserPatch.DEC[1] = atof (argv[N]); 42 remove_argument (N, &argc, argv); 43 } 44 /* override any header PHOTCODE values */ 45 thiscode = NULL; 46 options.photcode = 0; 47 if ((N = get_argument (argc, argv, "-p"))) { 48 remove_argument (N, &argc, argv); 49 options.photcode = GetPhotcodeCodebyName (argv[N]); 50 thiscode = GetPhotcodebyName (argv[N]); 51 remove_argument (N, &argc, argv); 52 } 53 /* provide a time for dataset */ 54 TIMEREF = 0; 55 if ((N = get_argument (argc, argv, "-time"))) { 56 time_t tmp; 57 remove_argument (N, &argc, argv); 58 if (!str_to_time (argv[N], &tmp)) { 59 fprintf (stderr, "syntax error in time\n"); 60 exit (1); 61 } 62 TIMEREF = tmp; 63 remove_argument (N, &argc, argv); 64 } 65 /* provide a mosaic for distortion */ 66 MOSAIC = NULL; 67 options.mosaic = FALSE; 68 if ((N = get_argument (argc, argv, "-mosaic"))) { 69 Header header; 70 ALLOCATE (MOSAIC, Coords, 1); 71 72 remove_argument (N, &argc, argv); 73 if (!fits_read_header (argv[N], &header)) { 74 fprintf (stderr, "ERROR: can't read header for mosaic %s\n", argv[N]); 75 exit (1); 76 } 77 if (!GetCoords (MOSAIC, &header)) { 78 fprintf (stderr, "ERROR: no astrometric solution in header\n"); 79 exit (1); 80 } 81 if (strcmp(&MOSAIC[0].ctype[4], "-DIS")) { 82 fprintf (stderr, "ERROR: not a mosaic distortion header\n"); 83 exit (1); 84 } 85 remove_argument (N, &argc, argv); 86 fits_free_header (&header); 87 options.mosaic = TRUE; 88 } 89 90 /*** modify behavior ***/ 91 /* only add to existing objects */ 92 options.existing_regions = FALSE; 93 if ((N = get_argument (argc, argv, "-existing-regions"))) { 94 options.existing_regions = TRUE; 95 remove_argument (N, &argc, argv); 96 } 97 /* only add to existing objects */ 98 options.only_match = FALSE; 99 if ((N = get_argument (argc, argv, "-only-match"))) { 100 options.only_match = TRUE; 101 remove_argument (N, &argc, argv); 102 } 103 /* don't add missed pts to Missed table (image only) */ 104 options.skip_missed = FALSE; 105 if ((N = get_argument (argc, argv, "-missed"))) { 106 options.skip_missed = TRUE; 107 remove_argument (N, &argc, argv); 108 } 109 /* replace measurement, don't duplicate (ref/cat only) */ 110 options.replace = FALSE; 111 if ((N = get_argument (argc, argv, "-replace"))) { 112 options.replace = TRUE; 113 remove_argument (N, &argc, argv); 114 } 115 /* use 'closest star' matching, rather than traditional method */ 116 options.closest = FALSE; 117 if ((N = get_argument (argc, argv, "-closest"))) { 118 options.closest = TRUE; 119 remove_argument (N, &argc, argv); 120 } 121 122 /* don't re-sort the measure sequence */ 123 options.nosort = FALSE; 124 if ((N = get_argument (argc, argv, "-nosort"))) { 125 options.nosort = TRUE; 126 remove_argument (N, &argc, argv); 127 } 128 /* only add new rows (-update) or re-write complete measure table (forces -nosort) */ 129 options.update = FALSE; 130 if ((N = get_argument (argc, argv, "-update"))) { 131 options.update = TRUE; 132 options.nosort = TRUE; 133 remove_argument (N, &argc, argv); 134 } 135 136 /* only add image potion to image table */ 137 options.only_images = FALSE; 138 if ((N = get_argument (argc, argv, "-image"))) { 139 options.only_images = TRUE; 140 remove_argument (N, &argc, argv); 141 } 142 /* apply average zpt offset calibration (image only) */ 143 options.calibrate = FALSE; 144 if ((N = get_argument (argc, argv, "-cal"))) { 145 options.calibrate = TRUE; 146 remove_argument (N, &argc, argv); 147 } 148 149 /*** optional situations ***/ 150 /* treat data specially for skyprobe (calibration, subpix) */ 151 SKYPROBE = FALSE; 152 if ((N = get_argument (argc, argv, "-skyprobe"))) { 153 SKYPROBE = TRUE; 154 remove_argument (N, &argc, argv); 155 /* XXX EAM : define airmass calculation method? 156 set calibrate to true 157 perhaps a 'skyprobe' data format (for image.sky issue) 158 */ 159 } 160 /* define 2MASS quality flags to keep */ 161 SELECT_2MASS_QUALITY = NULL; 162 if ((N = get_argument (argc, argv, "-2massquality"))) { 163 remove_argument (N, &argc, argv); 164 SELECT_2MASS_QUALITY = strcreate (argv[N]); 165 remove_argument (N, &argc, argv); 166 } 167 /* accept bad header astrometry */ 168 ACCEPT_ASTROM = FALSE; 169 if ((N = get_argument (argc, argv, "-accept"))) { 170 ACCEPT_ASTROM = TRUE; 171 remove_argument (N, &argc, argv); 172 } 173 /* force read of image database with mismatched NSTARS & size */ 174 FORCE_READ = FALSE; 175 if ((N = get_argument (argc, argv, "-force"))) { 176 FORCE_READ = TRUE; 177 remove_argument (N, &argc, argv); 178 } 179 /* force read of image database with mismatched NSTARS & size */ 180 TEXTMODE = FALSE; 181 if ((N = get_argument (argc, argv, "-textmode"))) { 182 TEXTMODE = TRUE; 183 remove_argument (N, &argc, argv); 184 } 185 /* extra error messages */ 186 VERBOSE = FALSE; 187 if ((N = get_argument (argc, argv, "-v"))) { 188 VERBOSE = TRUE; 189 remove_argument (N, &argc, argv); 190 } 191 DUMP = NULL; 192 if ((N = get_argument (argc, argv, "-dump"))) { 193 remove_argument (N, &argc, argv); 194 DUMP = strcreate(argv[N]); 195 remove_argument (N, &argc, argv); 196 } 197 198 199 if (argc != 2) { 200 fprintf (stderr, "USAGE: addstar (filename)\n"); 201 fprintf (stderr, "USAGE: addstar -cat (catalog)\n"); 202 fprintf (stderr, "USAGE: addstar -ref (filename)\n"); 203 exit (2); 204 } 205 return (options); 206 } 2 207 3 208 void help () { … … 16 221 fprintf (stderr, " -time (YYYY/MM/DD,HH:MM:SS) : specify date/time (override header)\n"); 17 222 fprintf (stderr, " -mosaic (filename) : identify associated mosaic frame for chip image\n"); 18 fprintf (stderr, " - fits : input file is FITS table, not TEXTtable\n");223 fprintf (stderr, " -textmode : input file is RAW TEXT table, not FITS table\n"); 19 224 fprintf (stderr, " -existing-regions : only add measurements to existing catalog files\n"); 20 225 fprintf (stderr, " -only-match : only add measurements to existing objects\n"); … … 36 241 } 37 242 38 int args (int argc, char **argv) {39 40 int N;41 42 /* check for help request */43 if (get_argument (argc, argv, "-help") ||44 get_argument (argc, argv, "-h")) {45 help ();46 }47 48 /*** check for command line options ***/49 50 /* basic mode: image, list, refcat */51 MODE = M_IMAGE;52 if ((N = get_argument (argc, argv, "-ref"))) {53 MODE = M_REFLIST;54 remove_argument (N, &argc, argv);55 }56 if ((N = get_argument (argc, argv, "-cat"))) {57 MODE = M_REFCAT;58 remove_argument (N, &argc, argv);59 }60 61 /*** provide additional data ***/62 /* restrict to a portion of the sky? (REFCAT only) */63 UserPatch.RA[0] = 0;64 UserPatch.RA[1] = 360;65 UserPatch.DEC[0] = -90;66 UserPatch.DEC[1] = +90;67 if ((N = get_argument (argc, argv, "-region"))) {68 remove_argument (N, &argc, argv);69 UserPatch.RA[0] = atof (argv[N]);70 remove_argument (N, &argc, argv);71 UserPatch.RA[1] = atof (argv[N]);72 remove_argument (N, &argc, argv);73 UserPatch.DEC[0] = atof (argv[N]);74 remove_argument (N, &argc, argv);75 UserPatch.DEC[1] = atof (argv[N]);76 remove_argument (N, &argc, argv);77 }78 /* override any header PHOTCODE values */79 thiscode = NULL;80 if ((N = get_argument (argc, argv, "-p"))) {81 remove_argument (N, &argc, argv);82 thiscode = GetPhotcodebyName (argv[N]);83 remove_argument (N, &argc, argv);84 }85 /* provide a time for dataset */86 TIMEREF = 0;87 if ((N = get_argument (argc, argv, "-time"))) {88 remove_argument (N, &argc, argv);89 if (!str_to_time (argv[N], &TIMEREF)) {90 fprintf (stderr, "syntax error in time\n");91 exit (1);92 }93 remove_argument (N, &argc, argv);94 }95 /* provide a mosaic for distortion */96 MOSAIC = NULL;97 if ((N = get_argument (argc, argv, "-mosaic"))) {98 Header header;99 ALLOCATE (MOSAIC, Coords, 1);100 101 remove_argument (N, &argc, argv);102 if (!fits_read_header (argv[N], &header)) {103 fprintf (stderr, "ERROR: can't read header for mosaic %s\n", argv[N]);104 exit (1);105 }106 if (!GetCoords (MOSAIC, &header)) {107 fprintf (stderr, "ERROR: no astrometric solution in header\n");108 exit (1);109 }110 if (strcmp(&MOSAIC[0].ctype[4], "-DIS")) {111 fprintf (stderr, "ERROR: not a mosaic distortion header\n");112 exit (1);113 }114 remove_argument (N, &argc, argv);115 fits_free_header (&header);116 }117 FITS_INPUT = FALSE;118 if ((N = get_argument (argc, argv, "-fits"))) {119 FITS_INPUT = TRUE;120 remove_argument (N, &argc, argv);121 }122 123 /*** modify behavior ***/124 /* only add to existing objects */125 EXISTING_REGIONS = FALSE;126 if ((N = get_argument (argc, argv, "-existing-regions"))) {127 EXISTING_REGIONS = TRUE;128 remove_argument (N, &argc, argv);129 }130 /* only add to existing objects */131 ONLY_MATCH = FALSE;132 if ((N = get_argument (argc, argv, "-only-match"))) {133 ONLY_MATCH = TRUE;134 remove_argument (N, &argc, argv);135 }136 /* don't add missed pts to Missed table (image only) */137 SKIP_MISSED = FALSE;138 if ((N = get_argument (argc, argv, "-missed"))) {139 SKIP_MISSED = TRUE;140 remove_argument (N, &argc, argv);141 }142 /* replace measurement, don't duplicate (ref/cat only) */143 REPLACE = FALSE;144 if ((N = get_argument (argc, argv, "-replace"))) {145 REPLACE = TRUE;146 remove_argument (N, &argc, argv);147 }148 /* use 'closest star' matching, rather than traditional method */149 CLOSEST = FALSE;150 if ((N = get_argument (argc, argv, "-closest"))) {151 CLOSEST = TRUE;152 remove_argument (N, &argc, argv);153 }154 155 /* don't re-sort the measure sequence */156 NOSORT = FALSE;157 if ((N = get_argument (argc, argv, "-nosort"))) {158 NOSORT = TRUE;159 remove_argument (N, &argc, argv);160 }161 /* only add new rows (-update) or re-write complete measure table (forces -nosort) */162 UPDATE = FALSE;163 if ((N = get_argument (argc, argv, "-update"))) {164 UPDATE = TRUE;165 NOSORT = TRUE;166 remove_argument (N, &argc, argv);167 }168 169 /* only add image potion to image table */170 ONLY_IMAGES = FALSE;171 if ((N = get_argument (argc, argv, "-image"))) {172 ONLY_IMAGES = TRUE;173 remove_argument (N, &argc, argv);174 }175 /* apply average zpt offset calibration (image only) */176 CALIBRATE = FALSE;177 if ((N = get_argument (argc, argv, "-cal"))) {178 CALIBRATE = TRUE;179 remove_argument (N, &argc, argv);180 }181 /* define 2MASS quality flags to keep */182 SELECT_2MASS_QUALITY = NULL;183 if ((N = get_argument (argc, argv, "-2massquality"))) {184 remove_argument (N, &argc, argv);185 SELECT_2MASS_QUALITY = strcreate (argv[N]);186 remove_argument (N, &argc, argv);187 }188 189 /*** optional situations ***/190 /* treat data specially for skyprobe (calibration, subpix) */191 SKYPROBE = FALSE;192 if ((N = get_argument (argc, argv, "-skyprobe"))) {193 SKYPROBE = TRUE;194 remove_argument (N, &argc, argv);195 /* XXX EAM : define airmass calculation method?196 set calibrate to true197 perhaps a 'skyprobe' data format (for image.sky issue)198 */199 }200 /* accept bad header astrometry */201 ACCEPT_ASTROM = FALSE;202 if ((N = get_argument (argc, argv, "-accept"))) {203 ACCEPT_ASTROM = TRUE;204 remove_argument (N, &argc, argv);205 }206 /* force read of image database with mismatched NSTARS & size */207 FORCE_READ = FALSE;208 if ((N = get_argument (argc, argv, "-force"))) {209 FORCE_READ = TRUE;210 remove_argument (N, &argc, argv);211 }212 /* force read of image database with mismatched NSTARS & size */213 TEXTMODE = FALSE;214 if ((N = get_argument (argc, argv, "-textmode"))) {215 TEXTMODE = TRUE;216 remove_argument (N, &argc, argv);217 }218 /* extra error messages */219 VERBOSE = FALSE;220 if ((N = get_argument (argc, argv, "-v"))) {221 VERBOSE = TRUE;222 remove_argument (N, &argc, argv);223 }224 DUMP = NULL;225 if ((N = get_argument (argc, argv, "-dump"))) {226 remove_argument (N, &argc, argv);227 DUMP = strcreate(argv[N]);228 remove_argument (N, &argc, argv);229 }230 231 232 if (argc != 2) {233 fprintf (stderr, "USAGE: addstar (filename)\n");234 fprintf (stderr, "USAGE: addstar -cat (catalog)\n");235 fprintf (stderr, "USAGE: addstar -ref (filename)\n");236 exit (2);237 }238 return (TRUE);239 }240 241 243 /** addstar modes: 242 244 -
trunk/Ohana/src/addstar/src/args_client.c
r5271 r5322 2 2 void help (void); 3 3 4 AddstarClientOptions args_client (int argc, char **argv ) {4 AddstarClientOptions args_client (int argc, char **argv, AddstarClientOptions options) { 5 5 6 6 int N; 7 AddstarClientOptions options; // used to pass options to server8 7 9 8 /* check for help request */ -
trunk/Ohana/src/addstar/src/args_server.c
r5271 r5322 2 2 void help (void); 3 3 4 intargs_server (int argc, char **argv) {4 void args_server (int argc, char **argv) { 5 5 6 6 int N; … … 12 12 } 13 13 14 /* basic mode: image, list, refcat */15 MODE = M_IMAGE;16 if ((N = get_argument (argc, argv, "-ref"))) {17 MODE = M_REFLIST;18 remove_argument (N, &argc, argv);19 }20 if ((N = get_argument (argc, argv, "-cat"))) {21 MODE = M_REFCAT;22 remove_argument (N, &argc, argv);23 }24 25 /*** provide additional data ***/26 14 /* restrict to a portion of the sky? (REFCAT only) */ 27 15 UserPatch.RA[0] = 0; … … 40 28 remove_argument (N, &argc, argv); 41 29 } 42 /* override any header PHOTCODE values */43 thiscode = NULL;44 if ((N = get_argument (argc, argv, "-p"))) {45 remove_argument (N, &argc, argv);46 thiscode = GetPhotcodebyName (argv[N]);47 remove_argument (N, &argc, argv);48 }49 /* provide a time for dataset */50 TIMEREF = 0;51 if ((N = get_argument (argc, argv, "-time"))) {52 remove_argument (N, &argc, argv);53 if (!str_to_time (argv[N], &TIMEREF)) {54 fprintf (stderr, "syntax error in time\n");55 exit (1);56 }57 remove_argument (N, &argc, argv);58 }59 /* provide a mosaic for distortion */60 MOSAIC = NULL;61 if ((N = get_argument (argc, argv, "-mosaic"))) {62 Header header;63 ALLOCATE (MOSAIC, Coords, 1);64 65 remove_argument (N, &argc, argv);66 if (!fits_read_header (argv[N], &header)) {67 fprintf (stderr, "ERROR: can't read header for mosaic %s\n", argv[N]);68 exit (1);69 }70 if (!GetCoords (MOSAIC, &header)) {71 fprintf (stderr, "ERROR: no astrometric solution in header\n");72 exit (1);73 }74 if (strcmp(&MOSAIC[0].ctype[4], "-DIS")) {75 fprintf (stderr, "ERROR: not a mosaic distortion header\n");76 exit (1);77 }78 remove_argument (N, &argc, argv);79 fits_free_header (&header);80 }81 FITS_INPUT = FALSE;82 if ((N = get_argument (argc, argv, "-fits"))) {83 FITS_INPUT = TRUE;84 remove_argument (N, &argc, argv);85 }86 30 87 /*** modify behavior ***/88 /* only add to existing objects */89 EXISTING_REGIONS = FALSE;90 if ((N = get_argument (argc, argv, "-existing-regions"))) {91 EXISTING_REGIONS = TRUE;92 remove_argument (N, &argc, argv);93 }94 /* only add to existing objects */95 ONLY_MATCH = FALSE;96 if ((N = get_argument (argc, argv, "-only-match"))) {97 ONLY_MATCH = TRUE;98 remove_argument (N, &argc, argv);99 }100 /* don't add missed pts to Missed table (image only) */101 SKIP_MISSED = FALSE;102 if ((N = get_argument (argc, argv, "-missed"))) {103 SKIP_MISSED = TRUE;104 remove_argument (N, &argc, argv);105 }106 /* replace measurement, don't duplicate (ref/cat only) */107 REPLACE = FALSE;108 if ((N = get_argument (argc, argv, "-replace"))) {109 REPLACE = TRUE;110 remove_argument (N, &argc, argv);111 }112 /* use 'closest star' matching, rather than traditional method */113 CLOSEST = FALSE;114 if ((N = get_argument (argc, argv, "-closest"))) {115 CLOSEST = TRUE;116 remove_argument (N, &argc, argv);117 }118 119 /* don't re-sort the measure sequence */120 NOSORT = FALSE;121 if ((N = get_argument (argc, argv, "-nosort"))) {122 NOSORT = TRUE;123 remove_argument (N, &argc, argv);124 }125 /* only add new rows (-update) or re-write complete measure table (forces -nosort) */126 UPDATE = FALSE;127 if ((N = get_argument (argc, argv, "-update"))) {128 UPDATE = TRUE;129 NOSORT = TRUE;130 remove_argument (N, &argc, argv);131 }132 133 /* only add image potion to image table */134 ONLY_IMAGES = FALSE;135 if ((N = get_argument (argc, argv, "-image"))) {136 ONLY_IMAGES = TRUE;137 remove_argument (N, &argc, argv);138 }139 /* apply average zpt offset calibration (image only) */140 CALIBRATE = FALSE;141 if ((N = get_argument (argc, argv, "-cal"))) {142 CALIBRATE = TRUE;143 remove_argument (N, &argc, argv);144 }145 31 /* define 2MASS quality flags to keep */ 146 32 SELECT_2MASS_QUALITY = NULL; … … 151 37 } 152 38 153 /*** optional situations ***/154 /* treat data specially for skyprobe (calibration, subpix) */155 SKYPROBE = FALSE;156 if ((N = get_argument (argc, argv, "-skyprobe"))) {157 SKYPROBE = TRUE;158 remove_argument (N, &argc, argv);159 }160 /* accept bad header astrometry */161 ACCEPT_ASTROM = FALSE;162 if ((N = get_argument (argc, argv, "-accept"))) {163 ACCEPT_ASTROM = TRUE;164 remove_argument (N, &argc, argv);165 }166 39 /* force read of image database with mismatched NSTARS & size */ 167 40 FORCE_READ = FALSE; … … 170 43 remove_argument (N, &argc, argv); 171 44 } 172 /* force read of image database with mismatched NSTARS & size */ 173 TEXTMODE = FALSE; 174 if ((N = get_argument (argc, argv, "-textmode"))) { 175 TEXTMODE = TRUE; 176 remove_argument (N, &argc, argv); 177 } 45 178 46 /* extra error messages */ 179 47 VERBOSE = FALSE; 180 48 if ((N = get_argument (argc, argv, "-v"))) { 181 49 VERBOSE = TRUE; 182 remove_argument (N, &argc, argv);183 }184 DUMP = NULL;185 if ((N = get_argument (argc, argv, "-dump"))) {186 remove_argument (N, &argc, argv);187 DUMP = strcreate(argv[N]);188 50 remove_argument (N, &argc, argv); 189 51 } … … 199 61 200 62 fprintf (stderr, "USAGE\n"); 201 fprintf (stderr, " addstar (filename)\n"); 202 fprintf (stderr, " add specified image (cmp format) to database\n\n"); 203 fprintf (stderr, " addstar -ref (filename)"); 204 fprintf (stderr, " add ASCII data (ra dec mag dmag) to database\n\n"); 205 fprintf (stderr, " addstar -cat (catalog)"); 206 fprintf (stderr, " add data from catalog (USNO/2MASS/GSC) to database\n\n"); 207 208 fprintf (stderr, " optional flags:\n"); 209 fprintf (stderr, " -region ra ra dec dec : only add data in specified region (-ref mode only)\n"); 210 fprintf (stderr, " -p (photcode) : specify photcode (override header)\n"); 211 fprintf (stderr, " -time (YYYY/MM/DD,HH:MM:SS) : specify date/time (override header)\n"); 212 fprintf (stderr, " -mosaic (filename) : identify associated mosaic frame for chip image\n"); 213 fprintf (stderr, " -fits : input file is FITS table, not TEXT table\n"); 214 fprintf (stderr, " -existing-regions : only add measurements to existing catalog files\n"); 215 fprintf (stderr, " -only-match : only add measurements to existing objects\n"); 216 fprintf (stderr, " -missed : skipped 'missed' entries\n"); 217 fprintf (stderr, " -replace : replace time/photcode measurements (no duplication)\n"); 218 fprintf (stderr, " -closest : use closest-star algorith\n"); 219 fprintf (stderr, " -nosort : don't re-sort the measure entries (improves speed)\n"); 220 fprintf (stderr, " -update : only update the new rows (foreces -nosort)\n"); 221 fprintf (stderr, " -image : only insert image data\n"); 222 fprintf (stderr, " -cal : perform zero-point calibration\n"); 223 fprintf (stderr, " -skyprobe : specify skyprobe mode\n"); 224 fprintf (stderr, " -accept : accept bad astrometry from header\n"); 63 fprintf (stderr, " addstard (host)\n"); 225 64 fprintf (stderr, " -force : force read of database with inconsistent info\n"); 226 65 fprintf (stderr, " -v : verbose mode\n"); 227 fprintf (stderr, " -dump (mode) : output test data\n");228 66 fprintf (stderr, " -help : this list\n"); 229 67 fprintf (stderr, " -h : this list\n\n"); 230 68 exit (2); 231 69 } 232 233 /** addstar modes:234 235 addstar (image.smp) - add cmp/smp image data to db236 addstar -ref (file.dat) (photcode)237 addstar -cat (USNO/2MASS/GSC) -region (ra dec - ra dec)238 239 -replace : ref/cat - replace existing match (photcode/time)240 -match : ref/cat - only add measures to existing averages241 242 ref types:243 ASCII - RA,DEC,M,dM in a table244 245 addstar246 247 **/248 -
trunk/Ohana/src/addstar/src/find_matches.c
r5287 r5322 1 1 # include "addstar.h" 2 2 3 void find_matches (GSCRegion *region, Stars *stars, int Nstars, Catalog *catalog, Image *image, Image *overlap, int Noverlap ) {3 void find_matches (GSCRegion *region, Stars *stars, int Nstars, Catalog *catalog, Image *image, Image *overlap, int Noverlap, AddstarClientOptions options) { 4 4 5 5 int i, j, n, N, J; … … 85 85 86 86 /* choose a radius for matches */ 87 if ( DEFAULT_RADIUS== 0) {88 RADIUS = NSIGMA* 0.02 * image[0].cerror; /* 0.02 corrects cerror to arcsec from storage units */87 if (options.radius == 0) { 88 RADIUS = options.Nsigma * 0.02 * image[0].cerror; /* 0.02 corrects cerror to arcsec from storage units */ 89 89 } else { 90 RADIUS = DEFAULT_RADIUS; /* provided by config */90 RADIUS = options.radius; /* provided by config */ 91 91 } 92 92 RADIUS2 = RADIUS*RADIUS; … … 162 162 163 163 /* adds the measurement to the calibration if appropriate color terms are found */ 164 if ( CALIBRATE) {164 if (options.calibrate) { 165 165 AddToCalibration (&catalog[0].average[n], catalog[0].measure, &catalog[0].measure[Nmeas], next_meas, N); 166 166 } … … 190 190 Nmeas ++; 191 191 192 if (! UPDATE) {192 if (!options.update) { 193 193 /* in UPDATE mode, newly calculated coordinates are not saved */ 194 194 update_coords (&catalog[0].average[n], &catalog[0].measure[0], next_meas); … … 200 200 /* add reference for undetected catalog stars */ 201 201 if (!strcmp (&image[0].coords.ctype[4], "-WRP")) RegisterMosaic (MOSAIC); 202 for (j = 0; (j < Nave) && ! SKIP_MISSED; j++) {202 for (j = 0; (j < Nave) && !options.skip_missed; j++) { 203 203 n = N2[j]; 204 204 if (catalog[0].found[n] < 0) { … … 224 224 /* incorporate unmatched image stars, if this star is in field of this catalog */ 225 225 /* these new entries are all written out in UPDATE mode */ 226 for (i = 0; (i < Nstars) && ! ONLY_MATCH; i++) {226 for (i = 0; (i < Nstars) && !options.only_match; i++) { 227 227 /* make sure there is space for next entry */ 228 228 if (Nmeas >= NMEAS) { … … 285 285 286 286 /** now add references from all previous non-detection observations of this spot on the sky */ 287 for (j = 0; (j < Noverlap) && ! SKIP_MISSED; j++) {287 for (j = 0; (j < Noverlap) && !options.skip_missed; j++) { 288 288 /* make sure there is space for next entry */ 289 289 if (Nmiss >= NMISS) { … … 316 316 REALLOCATE (catalog[0].missing, Missing, Nmiss); 317 317 318 if ( NOSORT) {318 if (options.nosort) { 319 319 catalog[0].sorted = FALSE; 320 320 } else { -
trunk/Ohana/src/addstar/src/find_matches_closest.c
r5287 r5322 1 1 # include "addstar.h" 2 2 3 void find_matches_closest (GSCRegion *region, Stars *stars, int Nstars, Catalog *catalog, Image *image, Image *overlap, int Noverlap ) {3 void find_matches_closest (GSCRegion *region, Stars *stars, int Nstars, Catalog *catalog, Image *image, Image *overlap, int Noverlap, AddstarClientOptions options) { 4 4 5 5 int i, j, n, N, J, Jmin; … … 85 85 86 86 /* choose a radius for matches */ 87 if ( DEFAULT_RADIUS== 0) {88 RADIUS = NSIGMA* 0.02 * image[0].cerror; /* 0.02 corrects cerror to arcsec from storage units */87 if (options.radius == 0) { 88 RADIUS = options.Nsigma * 0.02 * image[0].cerror; /* 0.02 corrects cerror to arcsec from storage units */ 89 89 } else { 90 RADIUS = DEFAULT_RADIUS; /* provided by config */90 RADIUS = options.radius; /* provided by config */ 91 91 } 92 92 RADIUS2 = RADIUS*RADIUS; … … 178 178 179 179 /* adds the measurement to the calibration if appropriate color terms are found */ 180 if ( CALIBRATE) {180 if (options.calibrate) { 181 181 AddToCalibration (&catalog[0].average[n], catalog[0].measure, &catalog[0].measure[Nmeas], next_meas, N); 182 182 } … … 198 198 /** add reference for undetected catalog stars **/ 199 199 if (!strcmp (&image[0].coords.ctype[4], "-WRP")) RegisterMosaic (MOSAIC); 200 for (j = 0; (j < Nave) && ! SKIP_MISSED; j++) {200 for (j = 0; (j < Nave) && !options.skip_missed; j++) { 201 201 n = N2[j]; 202 202 if (catalog[0].found[n] < 0) { … … 222 222 /** incorporate unmatched image stars, if this star is in field of this catalog **/ 223 223 /* these new entries are all written out in UPDATE mode */ 224 for (i = 0; (i < Nstars) && ! ONLY_MATCH; i++) {224 for (i = 0; (i < Nstars) && !options.only_match; i++) { 225 225 /* make sure there is space for next entry */ 226 226 if (Nmeas >= NMEAS) { … … 283 283 284 284 /** now add references from all previous non-detection observations of this spot on the sky */ 285 for (j = 0; (j < Noverlap) && ! SKIP_MISSED; j++) {285 for (j = 0; (j < Noverlap) && !options.skip_missed; j++) { 286 286 /* make sure there is space for next entry */ 287 287 if (Nmiss >= NMISS) { … … 314 314 REALLOCATE (catalog[0].missing, Missing, Nmiss); 315 315 316 if ( NOSORT) {316 if (options.nosort) { 317 317 catalog[0].sorted = FALSE; 318 318 } else { -
trunk/Ohana/src/addstar/src/find_matches_refstars.c
r4865 r5322 1 1 # include "addstar.h" 2 2 3 void find_matches_refstars (GSCRegion *region, Stars **stars, int Nstars, Catalog *catalog ) {3 void find_matches_refstars (GSCRegion *region, Stars **stars, int Nstars, Catalog *catalog, AddstarClientOptions options) { 4 4 5 5 int i, j, k, n, m, N, J; … … 82 82 83 83 /* choose a radius for matches */ 84 if ( DEFAULT_RADIUS== 0) {84 if (options.radius == 0) { 85 85 RADIUS = 2.0; /* hardwired default for refstars */ 86 86 } else { 87 RADIUS = DEFAULT_RADIUS; /* provided by config */87 RADIUS = options.radius; /* provided by config */ 88 88 } 89 89 RADIUS2 = RADIUS*RADIUS; … … 115 115 116 116 /** in replace mode, search for entry and replace values M, dM, R, D */ 117 if ( REPLACE&& replace_match (&catalog[0].average[n], &catalog[0].measure[m], stars[N])) continue;117 if (options.replace && replace_match (&catalog[0].average[n], &catalog[0].measure[m], stars[N])) continue; 118 118 119 119 /** insert star in measurement list */ … … 189 189 the reference up-to-date with known stars only */ 190 190 191 for (i = 0; (i < Nstars) && ! ONLY_MATCH; i++) {191 for (i = 0; (i < Nstars) && !options.only_match; i++) { 192 192 N = N1[i]; 193 193 if (stars[N][0].found >= 0) continue; -
trunk/Ohana/src/addstar/src/gcatalog.c
r5234 r5322 9 9 10 10 /* read catalog header */ 11 if (UPDATE) { 12 mode = LOAD_AVES | LOAD_MEAS_META | LOAD_MISS | LOAD_SECF; 13 } else { 14 mode = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 15 } 16 if (!load_catalog (catalog, mode, VERBOSE)) { 11 if (!load_catalog (catalog, VERBOSE)) { 17 12 fprintf (stderr, "ERROR: failure loading catalog\n"); 18 13 exit (1); -
trunk/Ohana/src/addstar/src/load_pt_catalog.c
r3376 r5322 11 11 switch (lock_catalog (catalog, LCK_XCLD)) { 12 12 case 0: 13 /* catalog file is locked. this is an unexpected error because14 ImageCat was NOT locked so we should be the only locking entity */15 13 fprintf (stderr, "ERROR: can't lock file %s\n", catalog[0].filename); 16 14 exit (1); … … 19 17 break; 20 18 case 2: 21 if (ONLY_MATCH) return (FALSE);22 19 mkcatalog (region, catalog); /* fills in new header info */ 23 20 break; … … 25 22 return (TRUE); 26 23 } 24 25 /* If the catalog file is locked, something weird is happening... this is an unexpected error 26 because ImageCat was NOT locked so we should be the only locking entity. However, this logic 27 breaks down for the server design: image and catalog are updated independently... */ -
trunk/Ohana/src/addstar/src/replace_match.c
r5239 r5322 5 5 int i; 6 6 7 if (!REPLACE) return (FALSE); 8 9 /** in replace mode, search for entry and replace values M, dM, R, D */ 7 /* search for entry and replace values M, dM, R, D */ 10 8 for (i = 0; i < average[0].Nm; i++) { 11 9 if (measure[i].source != thiscode[0].code) continue; -
trunk/Ohana/src/addstar/src/wcatalog.c
r5234 r5322 9 9 fits_modify (&catalog[0].header, "SORTED", "%t", 1, catalog[0].sorted); 10 10 11 if (UPDATE) { 11 /* if partial load, must use update */ 12 if (catalog[0].Nmeas_off != 0) { 12 13 if (!update_catalog (catalog, VERBOSE)) { 13 14 fprintf (stderr, "ERROR: failure updating catalog\n");
Note:
See TracChangeset
for help on using the changeset viewer.
