Changeset 37662
- Timestamp:
- Nov 22, 2014, 1:09:35 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src/relastro/src
- Files:
-
- 7 edited
-
FrameCorrectionIO.c (modified) (2 diffs)
-
ImagePosIO.c (modified) (1 diff)
-
assign_images.c (modified) (1 diff)
-
launch_region_hosts.c (modified) (5 diffs)
-
load_images.c (modified) (1 diff)
-
relastro_parallel_images.c (modified) (2 diffs)
-
share_images_pos.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/FrameCorrectionIO.c
r37658 r37662 89 89 gfits_free_matrix (&matrix); 90 90 } else { 91 fprintf (stderr, "ERROR: FrameCorrectionSet %s has defined SHMAP_DD but not SHMAP_DR\n", filename); 92 exit (2); 91 if (strcmp (SHMAP_DD, "NONE")) { 92 fprintf (stderr, "ERROR: FrameCorrectionSet %s has defined SHMAP_DD but not SHMAP_DR\n", filename); 93 exit (2); 94 } 93 95 } 94 96 … … 127 129 gfits_free_matrix (&matrix); 128 130 } else { 129 fprintf (stderr, "ERROR: FrameCorrectionSet %s has defined LOCAL_DD but not LOCAL_DR\n", filename); 130 exit (2); 131 if (strcmp (LOCAL_DD, "NONE")) { 132 fprintf (stderr, "ERROR: FrameCorrectionSet %s has defined LOCAL_DD but not LOCAL_DR\n", filename); 133 exit (2); 134 } 131 135 } 132 136 fclose (f); -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/ImagePosIO.c
r36630 r37662 70 70 GET_COLUMN (polyterms, "POLYTERMS", float); // verify that we got 14 columns? 71 71 GET_COLUMN (ctype, "CTYPE", char); // verify that we got 15 columns? 72 GET_COLUMN (Npolyterms, "NPOLYTERMS", char);72 GET_COLUMN (Npolyterms, "NPOLYTERMS", byte); 73 73 GET_COLUMN (dXpixSys, "XPIX_SYS_ERR", float); 74 74 GET_COLUMN (dYpixSys, "YPIX_SYS_ERR", float); -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/assign_images.c
r37378 r37662 144 144 145 145 // this is a bit memory expensive : I am making a complete copy of the image table here 146 off_t Nsubset = regionHosts->hosts[i].Nimage; 147 regionHosts->hosts[i].image[Nsubset] = image[j]; 148 regionHosts->hosts[i].imseq[Nsubset] = j; 149 150 regionHosts->hosts[i].Nimage ++; 151 if (regionHosts->hosts[i].Nimage == regionHosts->hosts[i].NIMAGE) { 152 regionHosts->hosts[i].NIMAGE += D_NIMAGE; 153 REALLOCATE (regionHosts->hosts[i].image, Image, regionHosts->hosts[i].NIMAGE); 154 REALLOCATE (regionHosts->hosts[i].imseq, off_t, regionHosts->hosts[i].NIMAGE); 146 off_t Nsubset = host->Nimage; 147 host->image[Nsubset] = image[j]; 148 host->imseq[Nsubset] = j; 149 150 host->Nimage ++; 151 if (host->Nimage == host->NIMAGE) { 152 host->NIMAGE += D_NIMAGE; 153 REALLOCATE (host->image, Image, host->NIMAGE); 154 REALLOCATE (host->imseq, off_t, host->NIMAGE); 155 } 156 157 // save the astrometry maps, where they exist 158 if (image[j].coords.offsetMap) { 159 if (!host->astromTable) { 160 host->astromTable = AstromOffsetTableInit(); 161 } 162 AstromOffsetTableAddMapFromImage(host->astromTable, image[j]); 155 163 } 156 164 } -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/launch_region_hosts.c
r37658 r37662 8 8 // clear the I/O files 9 9 for (i = 0; i < regionHosts->Nhosts; i++) { 10 char *syncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "mean mags.sync");10 char *syncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanpos.sync"); 11 11 if (truncate (syncfile, 0)) fprintf (stderr, "trouble clearing syncfile %s\n", syncfile); 12 12 free (syncfile); 13 13 14 char *fitsfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "mean mags.fits");14 char *fitsfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanpos.fits"); 15 15 if (truncate (fitsfile, 0)) fprintf (stderr, "trouble clearing fitsfile %s\n", fitsfile); 16 16 free (fitsfile); 17 17 18 char *imsyncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "imagemags.sync"); 18 char *icrfsync = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "icrfobj.sync"); 19 if (truncate (icrfsync, 0)) fprintf (stderr, "trouble clearing icrfsync %s\n", icrfsync); 20 free (icrfsync); 21 22 char *icrffits = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "icrfobj.fits"); 23 if (truncate (icrffits, 0)) fprintf (stderr, "trouble clearing icrffits %s\n", icrffits); 24 free (icrffits); 25 26 char *imsyncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "imagepos.sync"); 19 27 if (truncate (imsyncfile, 0)) fprintf (stderr, "trouble clearing imsyncfile %s\n", imsyncfile); 20 28 free (imsyncfile); 21 29 22 char *imfitsfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "image mags.fits");30 char *imfitsfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "imagepos.fits"); 23 31 if (truncate (imfitsfile, 0)) fprintf (stderr, "trouble clearing imfitsfile %s\n", imfitsfile); 24 32 free (imfitsfile); … … 27 35 if (truncate (loopsyncfile, 0)) fprintf (stderr, "trouble clearing loopsyncfile %s\n", loopsyncfile); 28 36 free (loopsyncfile); 37 38 char imagename[1024]; 39 snprintf (imagename, 1024, "%s/Image.%d.fits", CATDIR, regionHosts->hosts[i].hostID); 40 if (unlink (imagename)) fprintf (stderr, "trouble clearing image %s\n", imagename); 29 41 } 42 43 char *framesync = make_filename (CATDIR, "master", 0, "frame.corr.sync"); 44 if (truncate (framesync, 0)) fprintf (stderr, "trouble clearing framesync %s\n", framesync); 45 free (framesync); 46 47 char *framefits = make_filename (CATDIR, "master", 0, "frame.corr.fits"); 48 if (truncate (framefits, 0)) fprintf (stderr, "trouble clearing framefits %s\n", framefits); 49 free (framefits); 30 50 31 51 for (i = 0; i < regionHosts->Nhosts; i++) { … … 40 60 // write the image subset for this host 41 61 ImageTableSave (filename, host->image, host->Nimage); 62 63 if (host->astromTable) { 64 char mapname[1024]; 65 snprintf (mapname, 1024, "%s/AstroMap.%d.fits", CATDIR, host->hostID); 66 67 // write the image subset for this host 68 AstromOffsetMapTableSave (host->astromTable, mapname); 69 } 42 70 43 71 char command[1024]; … … 100 128 strextend (command, "-D ADDSTAR_RADIUS %f", ADDSTAR_RADIUS); 101 129 130 strextend (command, "-D USE_GALAXY_MODEL %d", USE_GALAXY_MODEL); 131 102 132 strextend (command, "-D USE_ICRF_CORRECT %d", USE_ICRF_CORRECT); 103 133 strextend (command, "-D USE_ICRF_LOCAL %d", USE_ICRF_LOCAL); … … 138 168 } 139 169 170 if (USE_ICRF_CORRECT) return TRUE; 171 172 int status = HarvestRegionHosts (regionHosts); 173 return status; 174 } 175 176 int HarvestRegionHosts (RegionHostTable *regionHosts) { 177 178 int i; 179 140 180 if (PARALLEL_REGIONS_MANUAL) { 141 181 fprintf (stderr, "run the relastro_client commands above. when these are done, hit return\n"); -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/load_images.c
r37446 r37662 86 86 } 87 87 88 void put_astrom_table (AstromOffsetTable *myTable) { 89 table = myTable; 90 } 91 -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/relastro_parallel_images.c
r37658 r37662 30 30 } 31 31 32 // assign image->parent and image->coords.mosaic 33 BuildChipMatch (image, Nimage); 34 35 char mapfile[DVO_MAX_PATH]; 36 snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.%d.fits", CATDIR, REGION_HOST_ID); 37 AstromOffsetTable *table = AstromOffsetMapLoad (mapfile, VERBOSE); 38 39 // assign images.coords.offsetMap -> table->map[i] 40 if (table) { 41 AstromOffsetTableMatchChips (image, Nimage, table); 42 } else { 43 table = AstromOffsetTableInit (); 44 } 45 put_astrom_table (table); 46 32 47 // once we have read this table, we should remove it for repeat runs 33 48 // unlink (IMAGE_TABLE); // XXX a bit risky, add some protection? … … 50 65 free (syncfile); 51 66 67 // find ICRF QSOs for reference downstream (only if USE_ICRF_CORRECT) 68 select_catalog_ICRF (catalog, Ncatalog); 69 52 70 if (photcodesReset) { 53 71 photcodesKeep = photcodesReset; -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/share_images_pos.c
r36630 r37662 33 33 free (image_pos); 34 34 free (iposfile); 35 36 // save the per-chip residual table 37 AstromOffsetTable *table = get_astrom_table (); 38 if (table) { 39 char mapname[1024]; 40 snprintf (mapname, 1024, "%s/AstroMapUpdate.%d.fits", CATDIR, REGION_HOST_ID); 41 42 // write the image subset for this host 43 AstromOffsetMapTableSave (table, mapname); 44 } 35 45 36 46 char *syncfile = make_filename (CATDIR, hostname, REGION_HOST_ID, "imagepos.sync"); … … 83 93 free (image_pos); 84 94 95 // load the astrometry offset maps, if they exist, and apply 96 for (i = 0; i < regionHosts->Nhosts; i++) { 97 char mapname[1024]; 98 snprintf (mapname, 1024, "%s/AstroMapUpdate.%d.fits", CATDIR, regionHosts->hosts[i].hostID); 99 100 AstromOffsetTable *table = AstromOffsetMapLoad (mapname, VERBOSE); 101 102 // apply table entries here to existing images 103 for (j = 0; j < table->Nmap; j++) { 104 off_t seq = getImageByID (table->map[j][0].imageID); 105 images[seq].coords.offsetMap = table->map[j]; 106 // is this sufficient? 107 } 108 } 85 109 fprintf (stderr, "DONE grabbing image mags from other hosts\n"); 86 110
Note:
See TracChangeset
for help on using the changeset viewer.
