Changeset 126
- Timestamp:
- Oct 29, 2003, 4:27:13 AM (23 years ago)
- Location:
- trunk/Ohana/src/imregister
- Files:
-
- 6 edited
-
photreg/args.photreg.c (modified) (4 diffs)
-
photreg/args.photsearch.c (modified) (3 diffs)
-
photreg/define.c (modified) (1 diff)
-
photreg/getImageData.c (modified) (2 diffs)
-
photreg/match.c (modified) (1 diff)
-
src/imphotsearch.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/imregister/photreg/args.photreg.c
r90 r126 6 6 int regargs (int argc, char **argv, PhotPars *newdata) { 7 7 8 int N, Np, required, photcode, Ntimes;8 int N, required, Ntimes; 9 9 double dtime; 10 10 unsigned long *tstart, *tstop; 11 PhotCode *photcode; 11 12 12 13 ConfigInit (&argc, argv); … … 19 20 if (get_argument (argc, argv, "--help")) usage (); 20 21 22 /* load photcode data */ 23 if (!LoadPhotcodes (PhotCodeFile)) { 24 fprintf (stderr, "error loading photcodes from %s\n", PhotCodeFile); 25 exit (1); 26 } 27 21 28 /* set the required database */ 22 set_db("phot");29 output.db = strcreate ("phot"); 23 30 if (N = get_argument (argc, argv, "-trans")) { 24 31 remove_argument (N, &argc, argv); 25 set_db ("trans"); 26 } 27 28 /* load photcode data */ 29 if (!LoadPhotcodes (PhotCodeFile, &photcodes)) { 30 fprintf (stderr, "error loading photcodes from %s\n", PhotCodeFile); 31 exit (1); 32 output.db = strcreate ("trans"); 32 33 } 33 34 … … 83 84 } 84 85 85 /* error on observed zero point*/86 /* photcode system */ 86 87 if (N = get_argument (argc, argv, "-photcode")) { 87 88 remove_argument (N, &argc, argv); 88 if ( !GetPhotcodeRefs (&photcodes, argv[N], &photcode, &Np)) {89 if ((photcode = GetPhotcodebyName (argv[N])) == NULL) { 89 90 fprintf (stderr, "ERROR: photcode not found in photcode table\n"); 90 91 exit (1); 91 92 } 92 newdata[0].photcode = photcode;93 93 remove_argument (N, &argc, argv); 94 94 required |= 0x10; … … 106 106 */ 107 107 108 newdata[0].ZPo = 0.001*photcodes.code[Np].C; 109 if (output.offset) { 110 newdata[0].ZP += newdata[0].ZPo; 111 } 112 newdata[0].K = photcodes.code[Np].K; 113 newdata[0].X = photcodes.code[Np].X; 114 newdata[0].c1 = photcodes.code[Np].c1; 115 newdata[0].c2 = photcodes.code[Np].c2; 108 newdata[0].photcode = photcode[0].code; 109 newdata[0].refcode = photcode[0].equiv; 110 newdata[0].K = photcode[0].K; 111 newdata[0].X = photcode[0].X; 112 newdata[0].c1 = photcode[0].c1; 113 newdata[0].c2 = photcode[0].c2; 116 114 115 newdata[0].ZPo = 0.001*photcode[0].C; 116 if (output.offset) newdata[0].ZP += newdata[0].ZPo; 117 117 } 118 118 -
trunk/Ohana/src/imregister/photreg/args.photsearch.c
r90 r126 4 4 int args (int argc, char **argv) { 5 5 6 int N ;6 int N, equiv; 7 7 8 8 ConfigInit (&argc, argv); 9 9 ConfigCamera (); 10 10 ConfigFilter (); 11 12 /* load photcode data */ 13 if (!LoadPhotcodes (PhotCodeFile)) { 14 fprintf (stderr, "error loading photcodes from %s\n", PhotCodeFile); 15 exit (1); 16 } 11 17 12 18 criteria.Ntimes = 0; … … 19 25 if (N = get_argument (argc, argv, "-photcode")) { 20 26 remove_argument (N, &argc, argv); 21 criteria.PhotCode = strcreate (argv[N]); 27 if ((criteria.photcode = GetPhotcodeCodebyName (argv[N])) == NULL) { 28 fprintf (stderr, "ERROR: photcode not found in table\n"); 29 exit (1); 30 } 22 31 remove_argument (N, &argc, argv); 23 32 criteria.PhotCodeSelect = TRUE; … … 106 115 } 107 116 108 /* load photcode data */109 if (!LoadPhotcodes (PhotCodeFile, &photcodes)) {110 fprintf (stderr, "error loading photcodes from %s\n", PhotCodeFile);111 exit (1);112 }113 114 117 /* set up photcode information */ 115 if (criteria.PhotCodeSelect) { 116 if (output.equiv) { 117 if (!GetPhotcodeEquiv (&photcodes, criteria.PhotCode, &criteria.PHOTCODE, &N)) { 118 fprintf (stderr, "ERROR: photcode not found in photcode table\n"); 119 exit (1); 120 } 121 } else { 122 if (!GetPhotcodeRefs (&photcodes, criteria.PhotCode, &criteria.PHOTCODE, &N)) { 123 fprintf (stderr, "ERROR: photcode not found in photcode table\n"); 124 exit (1); 125 } 118 if (criteria.PhotCodeSelect && output.equiv) { 119 if (!(equiv = GetPhotcodeEquivCodebyCode (criteria.photcode))) { 120 fprintf (stderr, "ERROR: photcode not found in photcode table\n"); 121 exit (1); 126 122 } 123 criteria.photcode = equiv; 127 124 } 128 125 } -
trunk/Ohana/src/imregister/photreg/define.c
r90 r126 30 30 fits_define_bintable_column (theader, "I", "C2_CODE", "code 2 for color", "photcode", 1.0, 0.0); 31 31 fits_define_bintable_column (theader, "I", "PHOTCODE", "photcode", "photcode", 1.0, 0.0); 32 fits_define_bintable_column (theader, "66A", "LABEL", "data label", "", 1.0, 0.0); 32 fits_define_bintable_column (theader, "64A", "LABEL", "data label", "", 1.0, 0.0); 33 fits_define_bintable_column (theader, "I", "REFCODE", "photcode", "photcode", 1.0, 0.0); 33 34 fits_define_bintable_column (theader, "J", "N_TIME", "number of times", "", 1.0, 0.0); 34 35 fits_define_bintable_column (theader, "J", "N_MEAS", "number of measurements", "", 1.0, 0.0); -
trunk/Ohana/src/imregister/photreg/getImageData.c
r90 r126 5 5 6 6 Header header; 7 char detector[64], filter[64], *PhotCode;7 char detector[64], filter[64], photcode[64]; 8 8 int i, ccd, Nfilter; 9 9 … … 60 60 } 61 61 62 ALLOCATE (PhotCode, char, 64); 63 sprintf (PhotCode, "%s.%s.%02d", detector, filter, ccd); 62 sprintf (photcode, "%s.%s.%02d", detector, filter, ccd); 63 if (!(criteria.photcode = GetPhotcodeCodebyName (photcode))) { 64 fprintf (stderr, "ERROR: photcode not found table\n"); 65 exit (1); 66 } 64 67 criteria.PhotCodeSelect = TRUE; 65 criteria.PhotCode = PhotCode;66 68 67 69 } -
trunk/Ohana/src/imregister/photreg/match.c
r90 r126 23 23 } 24 24 if (criteria.Ntimes && reject) continue; 25 if (criteria.PhotCodeSelect && (photdata[i].photcode != criteria. PHOTCODE)) continue;25 if (criteria.PhotCodeSelect && (photdata[i].photcode != criteria.photcode)) continue; 26 26 if (criteria.LabelSelect && strcmp (photdata[i].label, criteria.Label)) continue; 27 27 -
trunk/Ohana/src/imregister/src/imphotsearch.c
r90 r126 1 1 # include "imregister.h" 2 FILE *fsetlockfile (char *filename, double timeout, int type, int *state); 3 char *sec_to_date (unsigned long second); 2 4 3 static char PhotError[] = "unknown"; 5 PhotCodeData photcodes; 6 static char *version = "imphotsearch $Revision: 1.1 $"; 4 static char *version = "imphotsearch $Revision: 1.2 $"; 7 5 8 6 main (int argc, char **argv) { 9 7 10 8 FILE *f; 11 Header header, theader; 12 Matrix matrix; 13 FTable table; 14 int i, j, status, N, TimeSelect; 15 char *dBFile, *Label, *PhotCode, *timestr, *photstr; 16 int Nimage, nimage, Nskip, *index, Ntimes; 9 Header header; 10 int i, j, status, N; 11 char *dBFile, *timestr, *photstr; 12 int Nimage, nimage, *index, Ntimes; 17 13 unsigned long *tstart, *tstop; 18 14 int VERBOSE, FORCE_READ, PHOTCODE, dbstate, lockstate; 19 15 Image *image; 20 int PhotCodeSelect, LabelSelect, Np, Nin; 21 int Delete, *Dellist, Nkeep; 16 int PhotCodeSelect, Nin; 22 17 char *FitsOutput, *NameSelect; 23 18 int NameSelectLength; … … 28 23 ConfigInit (&argc, argv); 29 24 25 /* load photcode data */ 26 if (!LoadPhotcodes (PhotCodeFile)) { 27 fprintf (stderr, "error loading photcodes from %s\n", PhotCodeFile); 28 exit (1); 29 } 30 30 31 /* interpret command-line arguments */ 31 32 if (!get_trange_arguments (&argc, argv, &tstart, &tstop, &Ntimes)) { … … 34 35 } 35 36 37 /* select by image photcode */ 36 38 PhotCodeSelect = FALSE; 37 39 if (N = get_argument (argc, argv, "-photcode")) { 38 40 remove_argument (N, &argc, argv); 39 PhotCode = strcreate (argv[N]); 41 if (!(PHOTCODE = GetPhotcodeCodebyName (argv[N]))) { 42 fprintf (stderr, "ERROR: photcode not found in photcode table\n"); 43 exit (1); 44 } 40 45 remove_argument (N, &argc, argv); 41 46 PhotCodeSelect = TRUE; … … 75 80 } 76 81 77 /* load photcode data */78 if (!LoadPhotcodes (PhotCodeFile, &photcodes)) {79 fprintf (stderr, "error loading photcodes from %s\n", PhotCodeFile);80 exit (1);81 }82 if (PhotCodeSelect) {83 if (!GetPhotcodeRefs (&photcodes, argv[1], &PHOTCODE, &Np)) {84 fprintf (stderr, "ERROR: photcode not found in photcode table\n");85 exit (1);86 }87 }88 89 82 /* load image database - still a non-FITS file */ 90 83 dBFile = ImPhotDB; … … 158 151 159 152 /* convert photcode to filter name */ 160 photstr = GetPhot namebyCode (&photcodes,image[i].source);153 photstr = GetPhotcodeNamebyCode (image[i].source); 161 154 if (photstr == (char *) NULL) photstr = PhotError; 162 155 163 fprintf (stdout, "%s %s %s %7.4f %d\n", image[i].name, photstr, timestr, image[i].secz, image[i].nstar); 156 fprintf (stdout, "%s %s %s %7.4f %7.4f %7.4f %d\n", image[i].name, photstr, timestr, 157 0.001*image[i].Mcal, 0.001*image[i].dMcal, 0.001*image[i].secz, image[i].nstar); 164 158 free (timestr); 165 159 } … … 238 232 newdata = &image[index[i]]; 239 233 startstr = sec_to_date (newdata[0].tzero); 240 filtstr = GetPhot namebyCode (&photcodes,newdata[0].source);234 filtstr = GetPhotcodeNamebyCode (newdata[0].source); 241 235 zp = 0.001*newdata[0].Mcal; 242 236 dzp = 0.001*newdata[0].dMcal; … … 251 245 free (line); 252 246 free (startstr); 253 free (filtstr);254 247 } 255 248
Note:
See TracChangeset
for help on using the changeset viewer.
