Changeset 37378
- Timestamp:
- Sep 8, 2014, 2:44:35 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src
- Files:
-
- 52 edited
-
addstar/include/addstar.h (modified) (1 diff)
-
addstar/src/LoadData.c (modified) (1 diff)
-
addstar/src/LoadStars.c (modified) (1 diff)
-
addstar/src/NewImage.c (modified) (1 diff)
-
addstar/src/ReadImageHeader.c (modified) (3 diffs)
-
addstar/src/UpdateDatabase_Image.c (modified) (1 diff)
-
addstar/src/args.c (modified) (1 diff)
-
addstar/src/args_client.c (modified) (1 diff)
-
addstar/src/fakeimage.c (modified) (2 diffs)
-
addstar/src/find_missing.c (modified) (2 diffs)
-
checkastro/src/ImageOps.c (modified) (2 diffs)
-
checkastro/src/load_images.c (modified) (1 diff)
-
checkastro/src/select_images.c (modified) (2 diffs)
-
delstar/src/ImageOpsFixLAP.c (modified) (1 diff)
-
delstar/src/delete_imagename.c (modified) (2 diffs)
-
delstar/src/delete_times.c (modified) (2 diffs)
-
dvomerge/Makefile (modified) (1 diff)
-
dvomerge/src/ImageOps.c (modified) (1 diff)
-
dvomerge/src/dvo_image_merge_dbs.c (modified) (1 diff)
-
dvomerge/src/dvorepairDeleteImageList.c (modified) (1 diff)
-
dvomerge/src/dvorepairFixImages.c (modified) (3 diffs)
-
getstar/include/dvoImageOverlaps.h (modified) (1 diff)
-
getstar/src/MatchCoords.c (modified) (1 diff)
-
getstar/src/MatchImages.c (modified) (2 diffs)
-
getstar/src/ReadImageFiles.c (modified) (1 diff)
-
getstar/src/ReadImageHeader.c (modified) (3 diffs)
-
getstar/src/WriteImages.c (modified) (3 diffs)
-
imregister/imphot/dumpfits.c (modified) (1 diff)
-
imregister/imphot/modify.c (modified) (1 diff)
-
mosastro/src/testcoords.c (modified) (1 diff)
-
opihi/cmd.astro/coords.c (modified) (1 diff)
-
opihi/cmd.astro/getcoords.c (modified) (2 diffs)
-
opihi/dvo/gimages.c (modified) (1 diff)
-
opihi/dvo/images.c (modified) (4 diffs)
-
opihi/dvo/imbox.c (modified) (1 diff)
-
opihi/dvo/imdata.c (modified) (1 diff)
-
opihi/dvo/imdense.c (modified) (1 diff)
-
opihi/dvo/imlist.c (modified) (1 diff)
-
opihi/dvo/imstats.c (modified) (1 diff)
-
opihi/dvo/skycoverage.c (modified) (1 diff)
-
opihi/dvo/subpix.c (modified) (2 diffs)
-
photdbc/src/copy_images.c (modified) (1 diff)
-
photdbc/src/select_images.c (modified) (2 diffs)
-
relastro/src/UpdateChips.c (modified) (1 diff)
-
relastro/src/assign_images.c (modified) (2 diffs)
-
relastro/src/load_images.c (modified) (1 diff)
-
relastro/src/select_images.c (modified) (2 diffs)
-
relphot/src/MosaicOps.c (modified) (1 diff)
-
relphot/src/assign_images.c (modified) (2 diffs)
-
relphot/src/load_images.c (modified) (1 diff)
-
relphot/src/select_images.c (modified) (2 diffs)
-
uniphot/src/find_image_sgroups.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/addstar/include/addstar.h
r37357 r37378 326 326 int strextend (char *input, char *format,...); 327 327 328 void initMosaicCoords (); 329 void saveMosaicCoords (Coords *input); 330 331 328 332 /** 329 333 there is an inconsistency to be resolved: fixed structures (like Image) -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/LoadData.c
r37357 r37378 33 33 // we need to perform that analysis here 34 34 GetZeroPointExposure (headers, headerSets, Nimages); 35 36 if (!options[0].mosaic) { 37 // we are requiring a single set of N x WRPs + 1 DIS per file set. 38 // NOTE: if the -mosaic was supplied, do not reset the mosaic coords here 39 initMosaicCoords (); 40 } 35 41 36 42 // now run through the images, interpret the headers and read the stars -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/LoadStars.c
r28241 r37378 88 88 exit (1); 89 89 } 90 /* supplied photcode is incompatible with multi-chip images */ 91 if ((NheaderSets > 1) && options[0].mosaic) { 92 fprintf (stderr, "ERROR: -mosaic cannot be supplied to multiple images\n"); 93 exit (1); 94 } 90 95 91 96 // if these are SDSS data, load with SDSS-specific wrapper -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/NewImage.c
r10939 r37378 33 33 goto reject; 34 34 } 35 saveMosaicCoords (mosaic); 35 36 } 36 37 -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/ReadImageHeader.c
r37036 r37378 1 1 # include "addstar.h" 2 3 // for DIS/WRP sets, we need to save the DIS set and supply it to the WRP entries 4 static Coords *mosaic = NULL; 5 6 void initMosaicCoords () { 7 mosaic = NULL; 8 } 9 10 void saveMosaicCoords (Coords *input) { 11 mosaic = input; 12 } 2 13 3 14 /* read an image header corresponding to a CMF / CMP data block */ … … 54 65 /* only load astrometry, NAXIS1,2, and time if this is a MOSAIC_PHU (ctype is ....-DIS) */ 55 66 if (!strcmp (&image[0].coords.ctype[4], "-DIS")) { 56 RegisterMosaic(&image[0].coords);67 saveMosaicCoords (&image[0].coords); 57 68 return (TRUE); 58 69 } … … 79 90 } 80 91 if (!strcmp (&image[0].coords.ctype[4], "-WRP")) { 81 if (! isRegisteredMosaic()) {92 if (!mosaic) { 82 93 fprintf (stderr, "no mosaic for WRP image (use -mosaic)\n"); 83 94 return (FALSE); 84 95 } 96 image[0].coords.mosaic = mosaic; 85 97 } else { 86 98 /* force image to lie in 0-360 range */ -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/UpdateDatabase_Image.c
r27435 r37378 21 21 22 22 /* find correpsonding regions for image */ 23 RegisterMosaic (mosaic);24 23 skylist = NULL; 25 24 newlist = NULL; -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/args.c
r37357 r37378 175 175 exit (1); 176 176 } 177 RegisterMosaic(&MOSAIC);177 saveMosaicCoords (&MOSAIC); 178 178 remove_argument (N, &argc, argv); 179 179 gfits_free_header (&header); -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/args_client.c
r33963 r37378 83 83 exit (1); 84 84 } 85 RegisterMosaic(&MOSAIC);85 saveMosaicCoords (&MOSAIC); 86 86 remove_argument (N, &argc, argv); 87 87 gfits_free_header (&header); -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/fakeimage.c
r37036 r37378 60 60 MOSAIC.polyterms[6][1] = pltscale; // M : X^2 Y^0 61 61 62 RegisterMosaic (&MOSAIC);63 64 62 /* some basic data about the chisp */ 65 63 ScanConfig (config, "NCHIPS", "%d", 0, &Nchips); … … 103 101 image[i+1].coords.polyterms[j][1] = 0; 104 102 } 103 image[i+1].coords.mosaic = &MOSAIC; 105 104 106 105 image[i+1].sidtime = 0.0; -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/find_missing.c
r10937 r37378 14 14 REALLOCATE (catalog[0].missing, Missing, NMISS); 15 15 } 16 if (!FindMosaicForImage (overlap, Noverlap, j)) continue;17 16 if (!in_image (catalog[0].average[Nave].R, catalog[0].average[Nave].D, &overlap[j])) continue; 18 17 add_miss_link (&catalog[0].average[Nave], next_miss, Nmiss); … … 27 26 /* add reference for undetected catalog stars */ 28 27 /* XXX allow this option only for single images? */ 29 if (!strcmp (&image[0].coords.ctype[4], "-WRP")) RegisterMosaic (mosaic);28 if (!strcmp (&image[0].coords.ctype[4], "-WRP")) image[0].coords = mosaic; 30 29 for (j = 0; (j < Nave) && !options.skip_missed; j++) { 31 30 n = N2[j]; -
branches/eam_branches/ipp-20140904/Ohana/src/checkastro/src/ImageOps.c
r36833 r37378 130 130 } 131 131 132 BuildChipMatch (image, Nimage);133 134 132 char output[128]; 135 133 snprintf (output, 128, "checkastrom.%+3.0f.%+3.0f.%03.0f.%03.0f.dat", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); … … 148 146 name = GetPhotcodeNamebyCode (image[i].photcode); 149 147 150 off_t myMosaic = FindMosaicForImage (image, Nimage, i);151 152 148 /* only check exposure center */ 153 149 double Rexp = NAN, Dexp = NAN, Rccd = NAN, Dccd = NAN; 154 150 155 if (myMosaic) { 156 myMosaic --; 157 XY_to_RD (&Rccd, &Dccd, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords); 158 XY_to_RD (&Rexp, &Dexp, 0.0, 0.0, &image[myMosaic].coords); 159 } 151 XY_to_RD (&Rccd, &Dccd, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords); 152 XY_to_RD (&Rexp, &Dexp, 0.0, 0.0, &image[i].parent->coords); 160 153 161 154 char *date = ohana_sec_to_date(image[i].tzero); -
branches/eam_branches/ipp-20140904/Ohana/src/checkastro/src/load_images.c
r36833 r37378 17 17 MARKTIME(" convert image table: %f sec\n", dtime); 18 18 19 BuildChipMatch (image, Nimage); 20 19 21 // select the images which overlap the selected sky regions 20 22 subset = select_images (skylist, image, Nimage, &LineNumber, &Nsubset); -
branches/eam_branches/ipp-20140904/Ohana/src/checkastro/src/select_images.c
r36833 r37378 43 43 44 44 if (VERBOSE) fprintf (stderr, "finding images\n"); 45 BuildChipMatch (timage, Ntimage);46 MARKTIME("build chip match: %f sec\n", dtime);47 45 48 46 nimage = 0; … … 83 81 } 84 82 85 // this adds 1.3 sec for 3M images86 off_t myMosaic = FindMosaicForImage (timage, Ntimage, i);87 if (!myMosaic) {88 fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", i);89 continue;90 }91 myMosaic --;92 93 83 /* only check exposure center */ 94 84 if (!strcmp(&timage[i].coords.ctype[4], "-DIS")) { 95 85 XY_to_RD (&Rexp, &Dexp, 0.0, 0.0, &timage[i].coords); 96 86 } else { 97 XY_to_RD (&Rexp, &Dexp, 0.0, 0.0, &timage[ myMosaic].coords);87 XY_to_RD (&Rexp, &Dexp, 0.0, 0.0, &timage[i].parent->coords); 98 88 } 99 89 Rexp = ohana_normalize_angle_to_midpoint (Rexp, RmidSkyRegion); -
branches/eam_branches/ipp-20140904/Ohana/src/delstar/src/ImageOpsFixLAP.c
r37040 r37378 320 320 if ((Nimage_valid[i] + Nimage_invalid[i] == 0) || (found_ratio < 0.995)) { 321 321 double r, d; 322 if (! FindMosaicForImage (image, Nimage, i)) {323 fprintf (stderr, "failed to get astrometry for %s\n", image[i].name);322 if (!strcmp(&image[i].coords.ctype[4], "-DIS")) { 323 XY_to_RD (&r, &d, 0.0, 0.0, &image[i].coords); 324 324 } else { 325 if (!strcmp(&image[i].coords.ctype[4], "-DIS")) { 326 XY_to_RD (&r, &d, 0.0, 0.0, &image[i].coords); 327 } else { 328 XY_to_RD (&r, &d, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords); 329 } 325 XY_to_RD (&r, &d, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords); 330 326 } 331 327 char *date = ohana_sec_to_date (image[i].tzero); -
branches/eam_branches/ipp-20140904/Ohana/src/delstar/src/delete_imagename.c
r34749 r37378 24 24 } 25 25 26 BuildChipMatch (image, Nimage); 27 26 28 /* find image in db by name */ 27 29 imlist = find_images_name (db, IMAGENAME, &Nimlist); … … 33 35 if (VERBOSE) fprintf (stderr, "deleting %s\n", image[j].name); 34 36 35 // XXX EAM : need to handle failure36 FindMosaicForImage (image, Nimage, j);37 37 skylist = SkyListByImage (sky, -1, &image[j]); 38 38 -
branches/eam_branches/ipp-20140904/Ohana/src/delstar/src/delete_times.c
r29001 r37378 31 31 } 32 32 33 BuildChipMatch (image, Nimage); 34 33 35 /* find images for time range, delete each image */ 34 36 imlist = find_images_time (db, START, END, PHOTCODE, &Nimlist); … … 39 41 if (VERBOSE) fprintf (stderr, "finding regions for %s\n", image[j].name); 40 42 41 // XXX EAM : need to handle failure42 FindMosaicForImage (image, Nimage, j);43 43 skyset = SkyListByImage (sky, -1, &image[j]); 44 44 -
branches/eam_branches/ipp-20140904/Ohana/src/dvomerge/Makefile
r35416 r37378 23 23 dvoverify_client : $(BIN)/dvoverify_client.$(ARCH) 24 24 25 all: dvomerge dvomerge_client dvoconvert dvosecfilt dvosecfilt_client dvo verify dvoverify_client25 all: dvomerge dvomerge_client dvoconvert dvosecfilt dvosecfilt_client dvorepair dvoverify dvoverify_client 26 26 27 27 # $(SRC)/dvomergeContinue.$(ARCH).o -
branches/eam_branches/ipp-20140904/Ohana/src/dvomerge/src/ImageOps.c
r29938 r37378 18 18 } 19 19 if (m == -1) return (NULL); 20 if (!FindMosaicForImage (image, Nimage, m)) return (NULL);21 20 return (&image[m]); 22 21 } -
branches/eam_branches/ipp-20140904/Ohana/src/dvomerge/src/dvo_image_merge_dbs.c
r37360 r37378 113 113 create_IDmap_lookup (IDmap); 114 114 115 if (!out[0].swapped) {116 gfits_convert_Image ((Image *) out[0].ftable.buffer, sizeof(Image), Nout);117 out[0].swapped = TRUE;118 }119 120 115 Nout += Nimages; 121 116 IDstart += Nimages; -
branches/eam_branches/ipp-20140904/Ohana/src/dvomerge/src/dvorepairDeleteImageList.c
r37046 r37378 114 114 index = deleteIDs[i]; 115 115 seq = imageIdx[index]; 116 if (!FindMosaicForImage (image, Nimage, seq)) {117 fprintf (stderr, "cannot find mosaic for %s, skipping\n", image[seq].name);118 continue;119 }120 116 121 117 XY_to_RD(&Rthis, &Dthis, 0, 0, &image[seq].coords); -
branches/eam_branches/ipp-20140904/Ohana/src/dvomerge/src/dvorepairFixImages.c
r29938 r37378 130 130 int MarkMosaicsToDelete(Image *image, off_t Nimage, int *deleteIndex) { 131 131 132 myAbort ("this function needs to be redone with a concept to match the old BuildChipMatch"); 133 134 # if (0) 135 132 136 off_t i; 133 137 … … 140 144 marked. Now find all WRP images for which none/some/all images are to be deleted. 141 145 */ 146 147 142 148 143 149 // make a copy of the ChipMatch table (generated by BuildChipMatch, see libdvo/src/mosaic_astrom.c) … … 237 243 free (ChipByMosaicID); 238 244 245 # endif 246 239 247 return TRUE; 240 248 } -
branches/eam_branches/ipp-20140904/Ohana/src/getstar/include/dvoImageOverlaps.h
r27435 r37378 37 37 int edge_check (double *x1, double *y1, double *x2, double *y2); 38 38 double opening_angle (double x1, double y1, double x2, double y2, double x3, double y3); 39 40 void initMosaicCoords (); 41 void saveMosaicCoords (Coords *input); -
branches/eam_branches/ipp-20140904/Ohana/src/getstar/src/MatchCoords.c
r31238 r37378 29 29 if (!WITH_PHU && !strcmp (&dbImages[i].coords.ctype[4], "-DIS")) continue; 30 30 if ( SOLO_PHU && strcmp (&dbImages[i].coords.ctype[4], "-DIS")) continue; 31 32 /* if any of these images are WRP images, need to find matching DIS */33 if (!FindMosaicForImage (dbImages, NdbImages, i)) continue;34 31 35 32 /* define image corners */ -
branches/eam_branches/ipp-20140904/Ohana/src/getstar/src/MatchImages.c
r36481 r37378 24 24 /* for mosaic astrometry, the grid should be w.r.t. the tangent-plane, not chip coords */ 25 25 if (!strcmp (&image[0].coords.ctype[4], "-WRP")) { 26 // if the input image is a mosaic, we need to register that mosaic for the calculations below 27 if (MOSAIC == NULL) { 28 fprintf (stderr, "no mosaic for WRP image (use -mosaic)\n"); 29 return NULL; 30 } 31 RegisterMosaic (MOSAIC); 32 33 tcoords = MOSAIC[0]; 26 myAssert (image[0].coords.mosaic, "should already have tested this"); 27 tcoords = image[0].coords.mosaic[0]; 34 28 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 35 29 tcoords.pc1_1 = tcoords.pc2_2 = 1.0; … … 77 71 if (!WITH_PHU && !strcmp (&dbImages[i].coords.ctype[4], "-DIS")) continue; 78 72 if ( SOLO_PHU && strcmp (&dbImages[i].coords.ctype[4], "-DIS")) continue; 79 80 /* if any of these images are WRP images, need to find matching DIS */81 if (!FindMosaicForImage (dbImages, NdbImages, i)) continue;82 73 83 74 /* define image corners */ -
branches/eam_branches/ipp-20140904/Ohana/src/getstar/src/ReadImageFiles.c
r36874 r37378 42 42 43 43 mode = GetFileMode (header); 44 45 initMosaicCoords (); 44 46 45 47 /*** load data from a single PHU or a collection of PHU files ***/ -
branches/eam_branches/ipp-20140904/Ohana/src/getstar/src/ReadImageHeader.c
r21508 r37378 1 1 # include "dvoImageOverlaps.h" 2 3 // for DIS/WRP sets, we need to save the DIS set and supply it to the WRP entries 4 static Coords *mosaic = NULL; 5 6 void initMosaicCoords () { 7 mosaic = NULL; 8 } 9 10 void saveMosaicCoords (Coords *input) { 11 mosaic = input; 12 } 2 13 3 14 /* read an image header corresponding to a CMF / CMP data block */ … … 44 55 /* only load astrometry, NAXIS1,2, and time if this is a MOSAIC_PHU (ctype is ....-DIS) */ 45 56 if (!strcmp (&image[0].coords.ctype[4], "-DIS")) { 46 MOSAIC = &image[0].coords;57 saveMosaicCoords (&image[0].coords); 47 58 return (TRUE); 48 59 } … … 56 67 } 57 68 if (!strcmp (&image[0].coords.ctype[4], "-WRP")) { 58 if ( MOSAIC== NULL) {69 if (mosaic == NULL) { 59 70 fprintf (stderr, "no mosaic for WRP image (use -mosaic)\n"); 60 71 return (FALSE); 61 72 } 62 RegisterMosaic (MOSAIC);73 image[0].coords.mosaic = mosaic; 63 74 } else { 64 75 /* force image to lie in 0-360 range */ -
branches/eam_branches/ipp-20140904/Ohana/src/getstar/src/WriteImages.c
r27435 r37378 5 5 6 6 int i, N; 7 int nWRP, newWRP,isWRP;7 int isWRP; 8 8 FILE *f; 9 9 … … 16 16 } 17 17 18 nWRP = -1;18 Image *mosaic = NULL; 19 19 isWRP = FALSE; 20 20 for (i = 0; i < Nmatches; i++) { 21 if (!strcmp (&images[0].coords.ctype[4], "-WRP")) { 22 if (!FindMosaicForImage (images, Nimages, i)) { 23 fprintf (stderr, "failed to find matching mosaic\n"); 24 exit (1); 25 } 21 N = matches[i]; 22 if (!strcmp (&images[N].coords.ctype[4], "-WRP")) { 26 23 if (isWRP) { 27 newWRP = GetRegisteredMosaic(); 28 if (newWRP != nWRP) { 24 if (mosaic != images[N].parent) { 29 25 fprintf (stderr, "only one mosaic allowed in an output file\n"); 30 26 exit (1); 31 27 } 32 28 } else { 33 nWRP = GetRegisteredMosaic(); 34 isWRP = TRUE; 29 mosaic = images[N].parent; 35 30 } 36 31 } … … 38 33 39 34 if (isWRP) { 40 WriteImageFITS (f, &images[nWRP]);35 WriteImageFITS (f, mosaic); 41 36 } else { 42 37 // write a blank -
branches/eam_branches/ipp-20140904/Ohana/src/imregister/imphot/dumpfits.c
r30617 r37378 34 34 35 35 ftable.header = &theader; 36 gfits_table_set_Image (&ftable, subset, Nmatch);36 // gfits_table_set_Image (&ftable, subset, Nmatch); 37 37 38 38 gfits_fwrite_header (f, &header); -
branches/eam_branches/ipp-20140904/Ohana/src/imregister/imphot/modify.c
r27435 r37378 30 30 gfits_vtable_from_ftable (&db[0].ftable, &db[0].vtable, match, Nmatch); 31 31 for (i = 0; i < Nmatch; i++) { 32 gfits_convert_Image ((Image *) db[0].vtable.buffer[i], sizeof (Image), 1); 32 fprintf (stderr, "need to work with real output format\n"); 33 exit (2); 34 // gfits_convert_Image ((Image *) db[0].vtable.buffer[i], sizeof (Image), 1); 33 35 } 34 36 gfits_db_update (db); -
branches/eam_branches/ipp-20140904/Ohana/src/mosastro/src/testcoords.c
r3404 r37378 53 53 exit (1); 54 54 } 55 RegisterMosaic (&field.project); 55 56 chip[0].map.mosaic = &field.project; 56 57 strcpy (chip[0].map.ctype, "DEC--WRP"); 57 58 for (i = 0; i < chip[0].Nmatch; i++) { -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.astro/coords.c
r33662 r37378 71 71 if ((mosbuffer = SelectBuffer (MOSAIC, OLDBUFFER, TRUE)) == NULL) goto escape; 72 72 GetCoords (&moscoords, &mosbuffer[0].header); 73 RegisterMosaic (&moscoords);73 coords.mosaic = &moscoords; 74 74 } 75 75 -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.astro/getcoords.c
r34345 r37378 54 54 if (!strcmp(&coords.ctype[4], "-WRP")) { 55 55 if (MOSAIC == NULL) { 56 gprint (GP_ERR, "must supply mosaic for WRP coords \n");56 gprint (GP_ERR, "must supply mosaic for WRP coords with -mosaic [buffer]\n"); 57 57 return (FALSE); 58 58 } … … 65 65 } 66 66 GetCoords (&moscoords, &mosbuffer[0].header); 67 RegisterMosaic (&moscoords);67 coords.mosaic = &moscoords; 68 68 } 69 69 -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/gimages.c
r36489 r37378 102 102 } 103 103 } 104 if (!FindMosaicForImage (image, Nimage, i)) continue;105 104 106 105 typehash = wordhash (&image[i].coords.ctype[4]); -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/images.c
r34584 r37378 152 152 SetVector (&Yvec, OPIHI_FLT, NPTS); 153 153 154 Image *mosaic = NULL; 155 154 156 ALLOCATE (plist, int, NPTS); 155 157 n = N = 0; … … 157 159 if (ByName && strncmp (image[i].name, name, strlen(name))) continue; 158 160 if (TimeSelect && ((image[i].tzero < tzero) || (image[i].tzero+image[i].trate*image[i].NY > tzero + trange))) continue; 159 if (!(Nmosaic = FindMosaicForImage (image, Nimage, i))) continue; 160 Nmosaic --; // XXX kind of a hack: FindMosaicForImage returns 0 or the mosaic seq number + 1 161 162 mosaic = image[i].parent; 163 Nmosaic = (SOLO_MOSAIC && mosaic) ? mosaic - image : -1; 164 161 165 if (photcode) { 162 166 if ( photcodeEquiv && (photcode[0].code != GetPhotcodeEquivCodebyCode(image[i].photcode))) continue; … … 170 174 typehash = wordhash (&image[i].coords.ctype[4]); 171 175 172 if (photcode && SOLO_MOSAIC ) {176 if (photcode && SOLO_MOSAIC && (Nmosaic >= 0)) { 173 177 // mosaic (DIS) images are not currently given a photcode : plot these via the WRP entries 174 178 /* DIS images represent a field, not a chip */ 175 179 if (typehash != ChipImage) continue; 176 180 if (foundMosaic[Nmosaic]) continue; 177 x[0] = -0.5* image[Nmosaic].NX; y[0] = -0.5*image[Nmosaic].NY;178 x[1] = +0.5* image[Nmosaic].NX; y[1] = -0.5*image[Nmosaic].NY;179 x[2] = +0.5* image[Nmosaic].NX; y[2] = +0.5*image[Nmosaic].NY;180 x[3] = -0.5* image[Nmosaic].NX; y[3] = +0.5*image[Nmosaic].NY;181 x[0] = -0.5*mosaic->NX; y[0] = -0.5*mosaic->NY; 182 x[1] = +0.5*mosaic->NX; y[1] = -0.5*mosaic->NY; 183 x[2] = +0.5*mosaic->NX; y[2] = +0.5*mosaic->NY; 184 x[3] = -0.5*mosaic->NX; y[3] = +0.5*mosaic->NY; 181 185 for (j = 0; j < Npts; j++) { 182 status = XY_to_RD (&r[j], &d[j], x[j], y[j], & image[Nmosaic].coords);186 status = XY_to_RD (&r[j], &d[j], x[j], y[j], &mosaic->coords); 183 187 if (!status) break; 184 188 r[j] = ohana_normalize_angle (r[j]); … … 198 202 199 203 /* DIS images represent a field, not a chip */ 200 if ((typehash == DistortImage) && !WITH_MOSAIC) continue; 201 if ((typehash != DistortImage) && SOLO_MOSAIC) continue; 204 if ((typehash == DistortImage) && !WITH_MOSAIC) continue; // do not plot the mosaic images 205 if ((typehash != DistortImage) && SOLO_MOSAIC) continue; // plot only the mosaic images 206 202 207 if (typehash == DistortImage) { 203 208 x[0] = -0.5*image[i].NX; y[0] = -0.5*image[i].NY; -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/imbox.c
r34584 r37378 43 43 SetVector (&Yvec, OPIHI_FLT, NPTS); 44 44 45 mosaic.ctype[0] = 0; 46 45 47 while (gfits_fread_header (f, &header)) { 46 48 if (!GetCoords (&coords, &header)) goto skip; 47 49 if (!SOLO_PHU && !strcmp (&coords.ctype[4], "-DIS")) { 48 50 mosaic = coords; 49 RegisterMosaic (&mosaic);50 51 goto skip; 52 } 53 if (!strcmp (&coords.ctype[4], "-WRP")) { 54 if (!mosaic.ctype[0]) { 55 fprintf (stderr, "PHU mosaic not found\n"); 56 return FALSE; 57 } 58 coords.mosaic = &mosaic; 51 59 } 52 60 -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/imdata.c
r37049 r37378 103 103 I = subset[i]; 104 104 105 if (!FindMosaicForImage (image, Nimage, I)) continue;106 105 skyset = SkyListByImage (sky, -1, &image[I]); 107 106 -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/imdense.c
r34584 r37378 42 42 /* project this image to screen display coords */ 43 43 status = FALSE; 44 if (!FindMosaicForImage (image, Nimage, i)) continue;45 44 XY_to_RD (&r, &d, x, y, &image[i].coords); 46 45 r = ohana_normalize_angle (r); -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/imlist.c
r34088 r37378 97 97 } 98 98 } 99 if (!FindMosaicForImage (image, Nimage, i)) continue;100 99 t = TimeValue (image[i].tzero, TimeReference, TimeFormat); 101 100 if (!strcmp(&image[i].coords.ctype[4], "-DIS")) { -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/imstats.c
r34584 r37378 44 44 else 45 45 Yvec.elements.Flt[i] = image[i].dMcal; 46 if (!FindMosaicForImage (image, Nimage, i)) continue;47 46 XY_to_RD (&r, &d, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords); 48 47 gprint (GP_ERR, "%d %8.4f %8.4f %10d %6d %5.3f %6.3f %6.3f\n", -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/skycoverage.c
r33963 r37378 284 284 } 285 285 } 286 287 if (!FindMosaicForImage (image, Nimage, i)) continue;288 286 289 287 typehash = wordhash (&image[i].coords.ctype[4]); -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/subpix.c
r37049 r37378 118 118 119 119 for (i = 0; i < Nimage; i++) { 120 if (!FindMosaicForImage (image, Nimage, i)) continue;121 120 status = RD_to_XY (&X, &Y, Ra, Dec, &image[i].coords); 122 121 if (!status || (X < 0) || (X > image[i].NX) || (Y < 0) || (Y > image[i].NY)) continue; … … 134 133 for (i = 0; i < Nsub; i++) { 135 134 I = index[i]; 136 if (!FindMosaicForImage (image, Nimage, I)) continue;137 135 Timage = image[I].tzero; 138 136 for (j = 0; j < Nmeasure; j++) { -
branches/eam_branches/ipp-20140904/Ohana/src/photdbc/src/copy_images.c
r36833 r37378 52 52 } 53 53 54 BuildChipMatch (image, Nimage); 55 // MARKTIME("build chip match: %f sec\n", dtime); 56 54 57 subset = select_images (skylist, image, Nimage, &LineNumber, &Nsubset, FALSE); 55 58 -
branches/eam_branches/ipp-20140904/Ohana/src/photdbc/src/select_images.c
r36833 r37378 92 92 93 93 if (VERBOSE) fprintf (stderr, "finding images\n"); 94 BuildChipMatch (timage, Ntimage);95 MARKTIME("build chip match: %f sec\n", dtime);96 94 97 95 nimage = 0; … … 115 113 keep_image: 116 114 117 // this adds 1.3 sec for 3M images118 if (!FindMosaicForImage (timage, Ntimage, i)) {119 fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", i);120 continue;121 }122 123 115 /* define image corners - note the DIS images (mosaic phu) are special */ 124 116 if (!strcmp(&timage[i].coords.ctype[4], "-DIS")) { -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateChips.c
r33652 r37378 494 494 } 495 495 496 // XXX if (!FindMosaicForImage (image, Nimage, i)) { } -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/assign_images.c
r36630 r37378 89 89 if (!strcmp(&image[j].coords.ctype[4], "-DIS")) continue; 90 90 91 // match the image to its corresponding ASTROMETRIC mosaic (not the same as the Mosaic above)92 if (!FindMosaicForImage (image, Nimage, j)) {93 if (VERBOSE2) fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", i);94 continue;95 }96 97 91 // Exclude images with crazy astrometry 98 92 // XXX NOTE : this is gpc1-specific … … 199 193 } 200 194 201 int calculate_host_image_bounds (RegionHostTable *regionHosts) {202 203 int i, n;204 off_t j;205 206 for (i = 0; i < regionHosts->Nhosts; i++) {207 208 RegionHostInfo *host = ®ionHosts->hosts[i];209 210 // XXX clear the chip match?211 212 BuildChipMatch (host->image, host->Nimage);213 214 double Rmin = 360.0;215 double Rmax = 0.0;216 double Dmin = +90.0;217 double Dmax = -90.0;218 219 for (j = 0; j < host->Nimage; j++) {220 221 Image *image = &host->image[j];222 223 if (!FindMosaicForImage (host->image, host->Nimage, j)) {224 fprintf (stderr, "missing astrometry? programming error?\n");225 abort ();226 }227 228 // define image corners229 for (n = 0; n < 4; n++) {230 double Xc, Yc, Rc, Dc;231 Xc = Xf[n]*image->NX;232 Yc = Yf[n]*image->NY;233 XY_to_RD (&Rc, &Dc, Xc, Yc, &image->coords);234 Rc = ohana_normalize_angle_to_midpoint (Rc, 180.0);235 236 Rmin = MIN (Rmin, Rc);237 Dmin = MIN (Dmin, Rc);238 239 Rmax = MAX (Rmax, Rc);240 Dmax = MAX (Dmax, Rc);241 }242 243 }244 245 host->RminCat = Rmin;246 host->DminCat = Dmin;247 host->RmaxCat = Rmax;248 host->DmaxCat = Dmax;249 250 // regionHosts needs to have the full outer boundary251 // (so reload_catalogs covers the correct region)252 regionHosts->Rmin = MIN(Rmin, regionHosts->Rmin);253 regionHosts->Rmax = MAX(Rmax, regionHosts->Rmax);254 regionHosts->Dmin = MIN(Dmin, regionHosts->Dmin);255 regionHosts->Dmax = MAX(Dmax, regionHosts->Dmax);256 }257 return TRUE;258 }259 260 261 195 // XXX add a search tree to speed this up? 262 196 int find_host_for_coords (RegionHostTable *regionHosts, double Rc, double Dc) { -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/load_images.c
r36630 r37378 16 16 } 17 17 MARKTIME(" convert image table: %f sec\n", dtime); 18 19 BuildChipMatch (image, Nimage); 20 MARKTIME("build chip match: %f sec\n", dtime); 18 21 19 22 // select the images which overlap the selected sky regions -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/select_images.c
r36630 r37378 104 104 105 105 if (VERBOSE) fprintf (stderr, "finding images\n"); 106 BuildChipMatch (timage, Ntimage);107 MARKTIME("build chip match: %f sec\n", dtime);108 106 109 107 nimage = 0; … … 148 146 } 149 147 150 // this adds 1.3 sec for 3M images151 if (!FindMosaicForImage (timage, Ntimage, i)) {152 fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", i);153 continue;154 }155 156 148 /* define image corners - note the DIS images (mosaic phu) are special */ 157 149 if (!strcmp(&timage[i].coords.ctype[4], "-DIS")) { -
branches/eam_branches/ipp-20140904/Ohana/src/relphot/src/MosaicOps.c
r37037 r37378 520 520 m = MosaicToImage[i][j]; 521 521 522 if (!FindMosaicForImage (image, Nimage, m)) {523 if (VERBOSE2) fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", i);524 continue;525 }526 527 522 NX = image[m].NX; 528 523 NY = image[m].NY; 529 XY_to_RD (&R, &D, 0.5*NX, 0.5*NY, &image[m].coords);524 if (!XY_to_RD (&R, &D, 0.5*NX, 0.5*NY, &image[m].coords)) continue; 530 525 R = ohana_normalize_angle_to_midpoint (R, 180.0); 531 526 -
branches/eam_branches/ipp-20140904/Ohana/src/relphot/src/assign_images.c
r37037 r37378 80 80 if (!strcmp(&image[j].coords.ctype[4], "-DIS")) continue; 81 81 82 // match the image to its corresponding ASTROMETRIC mosaic (not the same as the Mosaic above)83 if (!FindMosaicForImage (image, Nimage, j)) {84 if (VERBOSE2) fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", i);85 continue;86 }87 88 82 // Exclude images with crazy astrometry 89 83 // XXX NOTE : this is gpc1-specific … … 206 200 } 207 201 208 int calculate_host_image_bounds (RegionHostTable *regionHosts, double Rmid) {209 210 int i, n;211 off_t j;212 213 for (i = 0; i < regionHosts->Nhosts; i++) {214 215 RegionHostInfo *host = ®ionHosts->hosts[i];216 217 // XXX clear the chip match?218 219 BuildChipMatch (host->image, host->Nimage);220 221 double Rmin = 720.0;222 double Rmax = -360.0;223 double Dmin = +90.0;224 double Dmax = -90.0;225 226 for (j = 0; j < host->Nimage; j++) {227 228 Image *image = &host->image[j];229 230 if (!FindMosaicForImage (host->image, host->Nimage, j)) {231 fprintf (stderr, "missing astrometry? programming error?\n");232 abort ();233 }234 235 // define image corners236 for (n = 0; n < 4; n++) {237 double Xc, Yc, Rc, Dc;238 Xc = Xf[n]*image->NX;239 Yc = Yf[n]*image->NY;240 XY_to_RD (&Rc, &Dc, Xc, Yc, &image->coords);241 Rc = ohana_normalize_angle_to_midpoint (Rc, Rmid);242 243 Rmin = MIN (Rmin, Rc);244 Dmin = MIN (Dmin, Rc);245 246 Rmax = MAX (Rmax, Rc);247 Dmax = MAX (Dmax, Rc);248 }249 250 }251 252 // RminCat, RmaxCat may extended beyond 0.0 - 360.0253 host->RminCat = Rmin;254 host->DminCat = Dmin;255 host->RmaxCat = Rmax;256 host->DmaxCat = Dmax;257 258 // regionHosts needs to have the full outer boundary259 // (so reload_catalogs covers the correct region)260 regionHosts->Rmin = MIN(Rmin, regionHosts->Rmin);261 regionHosts->Rmax = MAX(Rmax, regionHosts->Rmax);262 regionHosts->Dmin = MIN(Dmin, regionHosts->Dmin);263 regionHosts->Dmax = MAX(Dmax, regionHosts->Dmax);264 }265 return TRUE;266 }267 268 269 202 // Rc is in range 0.0 - 360.0, hosts Rmin,Rmax in range 0.0 - 360.0 270 203 int find_host_for_coords (RegionHostTable *regionHosts, double Rc, double Dc) { -
branches/eam_branches/ipp-20140904/Ohana/src/relphot/src/load_images.c
r35759 r37378 27 27 } 28 28 MARKTIME("read image table: %f sec\n", dtime); 29 30 BuildChipMatch (image, Nimage); 31 MARKTIME("build chip match for %d images: %f sec\n", (int) Nimage, dtime); 29 32 30 33 // allocate and init an array to identify the images included in the subset -
branches/eam_branches/ipp-20140904/Ohana/src/relphot/src/select_images.c
r36491 r37378 93 93 94 94 if (VERBOSE) fprintf (stderr, "finding images\n"); 95 BuildChipMatch (timage, Ntimage);96 MARKTIME("build chip match for %d images: %f sec\n", (int) Ntimage, dtime);97 95 98 96 D_NIMAGE = 6000; … … 123 121 } 124 122 125 // this adds 1.3 sec for 3M images126 if (!FindMosaicForImage (timage, Ntimage, i)) {127 if (VERBOSE2) fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", i);128 continue;129 }130 131 123 /* define image corners - note the DIS images (mosaic phu) are special */ 132 124 if (!strcmp(&timage[i].coords.ctype[4], "-DIS")) { -
branches/eam_branches/ipp-20140904/Ohana/src/uniphot/src/find_image_sgroups.c
r36481 r37378 42 42 // if (!strcmp(&image[i].coords.ctype[4], "-DIS")) continue; 43 43 44 // this adds 1.3 sec for 3M images45 if (!FindMosaicForImage (image, Nimage, i)) {46 fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", i);47 continue;48 }49 50 44 /* define image center - note the DIS images (mosaic phu) are special */ 51 45 if (!strcmp(&image[i].coords.ctype[4], "-DIS")) { … … 83 77 // if (!strcmp(&image[j].coords.ctype[4], "-DIS")) continue; 84 78 85 // this adds 1.3 sec for 3M images86 if (!FindMosaicForImage (image, Nimage, j)) {87 fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", j);88 continue;89 }90 91 79 /* project image center to local coords, check radius */ 92 80 if (!strcmp(&image[j].coords.ctype[4], "-DIS")) {
Note:
See TracChangeset
for help on using the changeset viewer.
