Changeset 37720
- Timestamp:
- Dec 5, 2014, 4:17:32 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src/relastro
- Files:
-
- 7 edited
-
include/relastro.h (modified) (2 diffs)
-
src/ImagePosIO.c (modified) (7 diffs)
-
src/UpdateObjectOffsets.c (modified) (1 diff)
-
src/args.c (modified) (1 diff)
-
src/initialize.c (modified) (1 diff)
-
src/relastro_parallel_regions.c (modified) (1 diff)
-
src/share_images_pos.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h
r37706 r37720 55 55 int nFitAstrom; 56 56 int flags; 57 float refColorBlue; 58 float refColorRed; 57 59 } ImagePos; 58 60 … … 283 285 int CLIP_THRESH; 284 286 int USE_BASIC_CHECK; 287 int APPLY_OFFSETS; // in parallel-regions mode, do not launch UpdateObjectOffsets unless -apply-offsets is called 285 288 286 289 int ExcludeBogus; -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/ImagePosIO.c
r37699 r37720 73 73 GET_COLUMN (dXpixSys, "XPIX_SYS_ERR", float); 74 74 GET_COLUMN (dYpixSys, "YPIX_SYS_ERR", float); 75 GET_COLUMN (refColorBlue, "REF_COLOR_BLUE", float); 76 GET_COLUMN (refColorRed, "REF_COLOR_RED", float); 75 77 GET_COLUMN (imageID, "ID", int); 76 78 GET_COLUMN (nFitAstrom, "NFIT", int); … … 86 88 for (i = 0; i < Nrow; i++) { 87 89 InitCoords(&image_pos[i].coords, NULL); 88 image_pos[i].coords.crval1 = crval1 [i]; 89 image_pos[i].coords.crval2 = crval2 [i]; 90 image_pos[i].coords.crpix1 = crpix1 [i]; 91 image_pos[i].coords.crpix2 = crpix2 [i]; 92 image_pos[i].coords.cdelt1 = cdelt1 [i]; 93 image_pos[i].coords.cdelt2 = cdelt2 [i]; 94 image_pos[i].coords.pc1_1 = pc1_1 [i]; 95 image_pos[i].coords.pc1_2 = pc1_2 [i]; 96 image_pos[i].coords.pc2_1 = pc2_1 [i]; 97 image_pos[i].coords.pc2_2 = pc2_2 [i]; 98 image_pos[i].coords.Npolyterms = Npolyterms[i]; 99 image_pos[i].dXpixSys = dXpixSys [i]; 100 image_pos[i].dYpixSys = dYpixSys [i]; 101 image_pos[i].imageID = imageID [i]; 102 image_pos[i].nFitAstrom = nFitAstrom[i]; 103 image_pos[i].flags = flags [i]; 90 image_pos[i].coords.crval1 = crval1 [i]; 91 image_pos[i].coords.crval2 = crval2 [i]; 92 image_pos[i].coords.crpix1 = crpix1 [i]; 93 image_pos[i].coords.crpix2 = crpix2 [i]; 94 image_pos[i].coords.cdelt1 = cdelt1 [i]; 95 image_pos[i].coords.cdelt2 = cdelt2 [i]; 96 image_pos[i].coords.pc1_1 = pc1_1 [i]; 97 image_pos[i].coords.pc1_2 = pc1_2 [i]; 98 image_pos[i].coords.pc2_1 = pc2_1 [i]; 99 image_pos[i].coords.pc2_2 = pc2_2 [i]; 100 image_pos[i].coords.Npolyterms = Npolyterms [i]; 101 image_pos[i].dXpixSys = dXpixSys [i]; 102 image_pos[i].dYpixSys = dYpixSys [i]; 103 image_pos[i].refColorBlue = refColorBlue[i]; 104 image_pos[i].refColorRed = refColorRed [i]; 105 image_pos[i].imageID = imageID [i]; 106 image_pos[i].nFitAstrom = nFitAstrom [i]; 107 image_pos[i].flags = flags [i]; 104 108 105 109 // polyterms and ctype are a bit different … … 109 113 fprintf (stderr, "loaded data for %lld images\n", (long long) Nrow); 110 114 111 free (crval1 ); 112 free (crval2 ); 113 free (crpix1 ); 114 free (crpix2 ); 115 free (cdelt1 ); 116 free (cdelt2 ); 117 free (pc1_1 ); 118 free (pc1_2 ); 119 free (pc2_1 ); 120 free (pc2_2 ); 121 free (polyterms ); 122 free (ctype ); 123 free (Npolyterms); 124 free (dXpixSys ); 125 free (dYpixSys ); 126 free (imageID ); 127 free (nFitAstrom); 128 free (flags ); 115 free (crval1 ); 116 free (crval2 ); 117 free (crpix1 ); 118 free (crpix2 ); 119 free (cdelt1 ); 120 free (cdelt2 ); 121 free (pc1_1 ); 122 free (pc1_2 ); 123 free (pc2_1 ); 124 free (pc2_2 ); 125 free (polyterms ); 126 free (ctype ); 127 free (Npolyterms ); 128 free (dXpixSys ); 129 free (dYpixSys ); 130 free (refColorBlue); 131 free (refColorRed ); 132 free (imageID ); 133 free (nFitAstrom ); 134 free (flags ); 129 135 130 136 *nimage_pos = Nrow; … … 154 160 gfits_create_table_header (&theader, "BINTABLE", "IMAGE_POS"); 155 161 156 gfits_define_bintable_column (&theader, "D", "CRVAL1", "word", "unit", 1.0, 0.0); 157 gfits_define_bintable_column (&theader, "D", "CRVAL2", "word", "unit", 1.0, 0.0); 158 gfits_define_bintable_column (&theader, "E", "CRPIX1", "word", "unit", 1.0, 0.0); 159 gfits_define_bintable_column (&theader, "E", "CRPIX2", "word", "unit", 1.0, 0.0); 160 gfits_define_bintable_column (&theader, "E", "CDELT1", "word", "unit", 1.0, 0.0); 161 gfits_define_bintable_column (&theader, "E", "CDELT2", "word", "unit", 1.0, 0.0); 162 gfits_define_bintable_column (&theader, "E", "PC1_1", "word", "unit", 1.0, 0.0); 163 gfits_define_bintable_column (&theader, "E", "PC1_2", "word", "unit", 1.0, 0.0); 164 gfits_define_bintable_column (&theader, "E", "PC2_1", "word", "unit", 1.0, 0.0); 165 gfits_define_bintable_column (&theader, "E", "PC2_2", "word", "unit", 1.0, 0.0); 166 gfits_define_bintable_column (&theader, "14E", "POLYTERMS", "word", "unit", 1.0, 0.0); 167 gfits_define_bintable_column (&theader, "15A", "CTYPE", "word", "unit", 1.0, 0.0); 168 gfits_define_bintable_column (&theader, "L", "NPOLYTERMS", "word", "unit", 1.0, 0.0); 169 gfits_define_bintable_column (&theader, "E", "XPIX_SYS_ERR", "word", "unit", 1.0, 0.0); 170 gfits_define_bintable_column (&theader, "E", "YPIX_SYS_ERR", "word", "unit", 1.0, 0.0); 171 gfits_define_bintable_column (&theader, "J", "ID", "image ID", "unitless", 1.0, 0.0); 172 gfits_define_bintable_column (&theader, "J", "NFIT", "number of fitted stars", "unitless", 1.0, 0.0); 173 gfits_define_bintable_column (&theader, "J", "FLAGS", "analysis flags", "unitless", 1.0, 0.0); 162 gfits_define_bintable_column (&theader, "D", "CRVAL1", "word", "unit", 1.0, 0.0); 163 gfits_define_bintable_column (&theader, "D", "CRVAL2", "word", "unit", 1.0, 0.0); 164 gfits_define_bintable_column (&theader, "E", "CRPIX1", "word", "unit", 1.0, 0.0); 165 gfits_define_bintable_column (&theader, "E", "CRPIX2", "word", "unit", 1.0, 0.0); 166 gfits_define_bintable_column (&theader, "E", "CDELT1", "word", "unit", 1.0, 0.0); 167 gfits_define_bintable_column (&theader, "E", "CDELT2", "word", "unit", 1.0, 0.0); 168 gfits_define_bintable_column (&theader, "E", "PC1_1", "word", "unit", 1.0, 0.0); 169 gfits_define_bintable_column (&theader, "E", "PC1_2", "word", "unit", 1.0, 0.0); 170 gfits_define_bintable_column (&theader, "E", "PC2_1", "word", "unit", 1.0, 0.0); 171 gfits_define_bintable_column (&theader, "E", "PC2_2", "word", "unit", 1.0, 0.0); 172 gfits_define_bintable_column (&theader, "14E", "POLYTERMS", "word", "unit", 1.0, 0.0); 173 gfits_define_bintable_column (&theader, "15A", "CTYPE", "word", "unit", 1.0, 0.0); 174 gfits_define_bintable_column (&theader, "L", "NPOLYTERMS", "word", "unit", 1.0, 0.0); 175 gfits_define_bintable_column (&theader, "E", "XPIX_SYS_ERR", "word", "unit", 1.0, 0.0); 176 gfits_define_bintable_column (&theader, "E", "YPIX_SYS_ERR", "word", "unit", 1.0, 0.0); 177 gfits_define_bintable_column (&theader, "E", "REF_COLOR_BLUE", "word", "unit", 1.0, 0.0); 178 gfits_define_bintable_column (&theader, "E", "REF_COLOR_RED", "word", "unit", 1.0, 0.0); 179 gfits_define_bintable_column (&theader, "J", "ID", "image ID", "unitless", 1.0, 0.0); 180 gfits_define_bintable_column (&theader, "J", "NFIT", "number of fitted stars", "unitless", 1.0, 0.0); 181 gfits_define_bintable_column (&theader, "J", "FLAGS", "analysis flags", "unitless", 1.0, 0.0); 174 182 175 183 // generate the output array that carries the data 176 184 gfits_create_table (&theader, &ftable); 177 185 178 double *crval1 ; 179 double *crval2 ; 180 float *crpix1 ; 181 float *crpix2 ; 182 float *cdelt1 ; 183 float *cdelt2 ; 184 float *pc1_1 ; 185 float *pc1_2 ; 186 float *pc2_1 ; 187 float *pc2_2 ; 188 float *polyterms ; 189 char *ctype ; 190 char *Npolyterms; 191 float *dXpixSys ; 192 float *dYpixSys ; 193 int *imageID ; 194 int *nFitAstrom; 195 int *flags ; 186 double *crval1 ; 187 double *crval2 ; 188 float *crpix1 ; 189 float *crpix2 ; 190 float *cdelt1 ; 191 float *cdelt2 ; 192 float *pc1_1 ; 193 float *pc1_2 ; 194 float *pc2_1 ; 195 float *pc2_2 ; 196 float *polyterms ; 197 char *ctype ; 198 char *Npolyterms ; 199 float *dXpixSys ; 200 float *dYpixSys ; 201 float *refColorBlue; 202 float *refColorRed ; 203 int *imageID ; 204 int *nFitAstrom ; 205 int *flags ; 196 206 197 207 // create intermediate storage arrays … … 211 221 ALLOCATE (dXpixSys , float , Nimage_pos); 212 222 ALLOCATE (dYpixSys , float , Nimage_pos); 223 ALLOCATE (refColorBlue, float , Nimage_pos); 224 ALLOCATE (refColorRed , float , Nimage_pos); 213 225 ALLOCATE (imageID , int , Nimage_pos); 214 226 ALLOCATE (nFitAstrom, int , Nimage_pos); … … 217 229 // assign the storage arrays 218 230 for (i = 0; i < Nimage_pos; i++) { 219 crval1 [i] = image_pos[i].coords.crval1 ; 220 crval2 [i] = image_pos[i].coords.crval2 ; 221 crpix1 [i] = image_pos[i].coords.crpix1 ; 222 crpix2 [i] = image_pos[i].coords.crpix2 ; 223 cdelt1 [i] = image_pos[i].coords.cdelt1 ; 224 cdelt2 [i] = image_pos[i].coords.cdelt2 ; 225 pc1_1 [i] = image_pos[i].coords.pc1_1 ; 226 pc1_2 [i] = image_pos[i].coords.pc1_2 ; 227 pc2_1 [i] = image_pos[i].coords.pc2_1 ; 228 pc2_2 [i] = image_pos[i].coords.pc2_2 ; 229 Npolyterms[i] = image_pos[i].coords.Npolyterms; 230 dXpixSys [i] = image_pos[i].dXpixSys ; 231 dYpixSys [i] = image_pos[i].dYpixSys ; 232 imageID [i] = image_pos[i].imageID ; 233 nFitAstrom[i] = image_pos[i].nFitAstrom ; 234 flags [i] = image_pos[i].flags ; 231 crval1 [i] = image_pos[i].coords.crval1 ; 232 crval2 [i] = image_pos[i].coords.crval2 ; 233 crpix1 [i] = image_pos[i].coords.crpix1 ; 234 crpix2 [i] = image_pos[i].coords.crpix2 ; 235 cdelt1 [i] = image_pos[i].coords.cdelt1 ; 236 cdelt2 [i] = image_pos[i].coords.cdelt2 ; 237 pc1_1 [i] = image_pos[i].coords.pc1_1 ; 238 pc1_2 [i] = image_pos[i].coords.pc1_2 ; 239 pc2_1 [i] = image_pos[i].coords.pc2_1 ; 240 pc2_2 [i] = image_pos[i].coords.pc2_2 ; 241 Npolyterms [i] = image_pos[i].coords.Npolyterms; 242 dXpixSys [i] = image_pos[i].dXpixSys ; 243 dYpixSys [i] = image_pos[i].dYpixSys ; 244 refColorBlue[i] = image_pos[i].refColorBlue ; 245 refColorRed [i] = image_pos[i].refColorRed ; 246 imageID [i] = image_pos[i].imageID ; 247 nFitAstrom [i] = image_pos[i].nFitAstrom ; 248 flags [i] = image_pos[i].flags ; 235 249 236 250 // polyterms and ctype are a bit different … … 240 254 241 255 // add the columns to the output array 242 gfits_set_bintable_column (&theader, &ftable, "CRVAL1", crval1 , Nimage_pos); 243 gfits_set_bintable_column (&theader, &ftable, "CRVAL2", crval2 , Nimage_pos); 244 gfits_set_bintable_column (&theader, &ftable, "CRPIX1", crpix1 , Nimage_pos); 245 gfits_set_bintable_column (&theader, &ftable, "CRPIX2", crpix2 , Nimage_pos); 246 gfits_set_bintable_column (&theader, &ftable, "CDELT1", cdelt1 , Nimage_pos); 247 gfits_set_bintable_column (&theader, &ftable, "CDELT2", cdelt2 , Nimage_pos); 248 gfits_set_bintable_column (&theader, &ftable, "PC1_1", pc1_1 , Nimage_pos); 249 gfits_set_bintable_column (&theader, &ftable, "PC1_2", pc1_2 , Nimage_pos); 250 gfits_set_bintable_column (&theader, &ftable, "PC2_1", pc2_1 , Nimage_pos); 251 gfits_set_bintable_column (&theader, &ftable, "PC2_2", pc2_2 , Nimage_pos); 252 gfits_set_bintable_column (&theader, &ftable, "POLYTERMS", polyterms , Nimage_pos); 253 gfits_set_bintable_column (&theader, &ftable, "CTYPE", ctype , Nimage_pos); 254 gfits_set_bintable_column (&theader, &ftable, "NPOLYTERMS", Npolyterms, Nimage_pos); 255 gfits_set_bintable_column (&theader, &ftable, "XPIX_SYS_ERR",dXpixSys , Nimage_pos); 256 gfits_set_bintable_column (&theader, &ftable, "YPIX_SYS_ERR",dYpixSys , Nimage_pos); 257 gfits_set_bintable_column (&theader, &ftable, "ID", imageID , Nimage_pos); 258 gfits_set_bintable_column (&theader, &ftable, "NFIT", nFitAstrom, Nimage_pos); 259 gfits_set_bintable_column (&theader, &ftable, "FLAGS", flags , Nimage_pos); 260 261 free (crval1 ); 262 free (crval2 ); 263 free (crpix1 ); 264 free (crpix2 ); 265 free (cdelt1 ); 266 free (cdelt2 ); 267 free (pc1_1 ); 268 free (pc1_2 ); 269 free (pc2_1 ); 270 free (pc2_2 ); 271 free (polyterms ); 272 free (ctype ); 273 free (Npolyterms); 274 free (dXpixSys ); 275 free (dYpixSys ); 276 free (imageID ); 277 free (nFitAstrom); 278 free (flags ); 256 gfits_set_bintable_column (&theader, &ftable, "CRVAL1", crval1 , Nimage_pos); 257 gfits_set_bintable_column (&theader, &ftable, "CRVAL2", crval2 , Nimage_pos); 258 gfits_set_bintable_column (&theader, &ftable, "CRPIX1", crpix1 , Nimage_pos); 259 gfits_set_bintable_column (&theader, &ftable, "CRPIX2", crpix2 , Nimage_pos); 260 gfits_set_bintable_column (&theader, &ftable, "CDELT1", cdelt1 , Nimage_pos); 261 gfits_set_bintable_column (&theader, &ftable, "CDELT2", cdelt2 , Nimage_pos); 262 gfits_set_bintable_column (&theader, &ftable, "PC1_1", pc1_1 , Nimage_pos); 263 gfits_set_bintable_column (&theader, &ftable, "PC1_2", pc1_2 , Nimage_pos); 264 gfits_set_bintable_column (&theader, &ftable, "PC2_1", pc2_1 , Nimage_pos); 265 gfits_set_bintable_column (&theader, &ftable, "PC2_2", pc2_2 , Nimage_pos); 266 gfits_set_bintable_column (&theader, &ftable, "POLYTERMS", polyterms , Nimage_pos); 267 gfits_set_bintable_column (&theader, &ftable, "CTYPE", ctype , Nimage_pos); 268 gfits_set_bintable_column (&theader, &ftable, "NPOLYTERMS", Npolyterms, Nimage_pos); 269 gfits_set_bintable_column (&theader, &ftable, "XPIX_SYS_ERR", dXpixSys , Nimage_pos); 270 gfits_set_bintable_column (&theader, &ftable, "YPIX_SYS_ERR", dYpixSys , Nimage_pos); 271 gfits_set_bintable_column (&theader, &ftable, "REF_COLOR_BLUE", refColorBlue, Nimage_pos); 272 gfits_set_bintable_column (&theader, &ftable, "REF_COLOR_RED", refColorRed , Nimage_pos); 273 gfits_set_bintable_column (&theader, &ftable, "ID", imageID , Nimage_pos); 274 gfits_set_bintable_column (&theader, &ftable, "NFIT", nFitAstrom, Nimage_pos); 275 gfits_set_bintable_column (&theader, &ftable, "FLAGS", flags , Nimage_pos); 276 277 free (crval1 ); 278 free (crval2 ); 279 free (crpix1 ); 280 free (crpix2 ); 281 free (cdelt1 ); 282 free (cdelt2 ); 283 free (pc1_1 ); 284 free (pc1_2 ); 285 free (pc2_1 ); 286 free (pc2_2 ); 287 free (polyterms ); 288 free (ctype ); 289 free (Npolyterms ); 290 free (dXpixSys ); 291 free (dYpixSys ); 292 free (refColorBlue); 293 free (refColorRed ); 294 free (imageID ); 295 free (nFitAstrom ); 296 free (flags ); 279 297 280 298 FILE *f = fopen (filename, "w"); -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateObjectOffsets.c
r37699 r37720 95 95 } 96 96 97 # if (0) 97 98 98 99 UpdateObjectOffsets_parallel_table (table, sky); 99 100 100 # if (0) 101 # else 102 101 103 int Ngroups; 102 104 HostTableGroup *groups = HostTableGroups (table, &Ngroups); -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/args.c
r37699 r37720 265 265 remove_argument (N, &argc, argv); 266 266 MaxDensityUse = TRUE; 267 } 268 269 APPLY_OFFSETS = FALSE; 270 if ((N = get_argument (argc, argv, "-apply-offsets"))) { 271 remove_argument (N, &argc, argv); 272 APPLY_OFFSETS = TRUE; 267 273 } 268 274 -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/initialize.c
r37661 r37720 9 9 10 10 if (DCR_BLUE_COLOR_POS) fprintf (stderr, "DCR_BLUE_COLOR_POS: %s - %s\n", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 11 if (DCR_ BLUE_COLOR_POS) fprintf (stderr, "DCR_BLUE_COLOR_POS: %s - %s\n", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG);11 if (DCR_RED_COLOR_POS) fprintf (stderr, "DCR_RED_COLOR_POS: %s - %s\n", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 12 12 13 13 if (PHOTCODE_KEEP_LIST) fprintf (stderr, "PHOTCODE_KEEP_LIST: %s\n", PHOTCODE_KEEP_LIST); -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/relastro_parallel_regions.c
r37699 r37720 71 71 72 72 // iterate over catalogs to make detection coordinates consistant 73 UpdateObjectOffsets (skylist, 0, NULL); 73 if (APPLY_OFFSETS) { 74 UpdateObjectOffsets (skylist, 0, NULL); 75 } 74 76 75 77 if (!PARALLEL) { -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/share_images_pos.c
r37699 r37720 88 88 images[seq].coords.mosaic = moscoords; 89 89 90 images[seq].dXpixSys = image_pos[i].dXpixSys ; 91 images[seq].dYpixSys = image_pos[i].dYpixSys ; 92 images[seq].imageID = image_pos[i].imageID ; 93 images[seq].nFitAstrom = image_pos[i].nFitAstrom; 94 images[seq].flags = image_pos[i].flags ; 90 images[seq].dXpixSys = image_pos[i].dXpixSys ; 91 images[seq].dYpixSys = image_pos[i].dYpixSys ; 92 images[seq].refColorBlue = image_pos[i].refColorBlue; 93 images[seq].refColorRed = image_pos[i].refColorRed; 94 images[seq].imageID = image_pos[i].imageID ; 95 images[seq].nFitAstrom = image_pos[i].nFitAstrom; 96 images[seq].flags = image_pos[i].flags ; 95 97 } 96 98 … … 146 148 image_pos->dXpixSys = image->dXpixSys; 147 149 image_pos->dYpixSys = image->dYpixSys; 150 image_pos->refColorBlue = image->refColorBlue; 151 image_pos->refColorRed = image->refColorRed; 148 152 image_pos->imageID = image->imageID; 149 153 image_pos->nFitAstrom = image->nFitAstrom;
Note:
See TracChangeset
for help on using the changeset viewer.
