- Timestamp:
- May 1, 2018, 4:28:02 PM (8 years ago)
- Location:
- trunk/Ohana/src/relastro
- Files:
-
- 10 edited
-
include/relastro.h (modified) (1 diff)
-
src/BrightCatalog.c (modified) (1 diff)
-
src/UpdateMeasures.c (modified) (2 diffs)
-
src/UpdateObjects.c (modified) (4 diffs)
-
src/UpdateStacksWithFit.c (modified) (1 diff)
-
src/args.c (modified) (3 diffs)
-
src/launch_region_hosts.c (modified) (2 diffs)
-
src/relastro_images.c (modified) (1 diff)
-
src/relastro_parallel_images.c (modified) (1 diff)
-
src/select_images.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relastro/include/relastro.h
r40382 r40414 33 33 typedef enum {OP_NONE, OP_IMAGES, OP_HIGH_SPEED, OP_MERGE_SOURCE, OP_UPDATE_OBJECTS, OP_UPDATE_OFFSETS, OP_LOAD_OBJECTS, OP_HPM, OP_PARALLEL_REGIONS, OP_PARALLEL_IMAGES, OP_REPAIR_STACKS, OP_REPAIR_WARPS, OP_REPAIR_OBJECT_ID} RelastroOp; 34 34 35 typedef enum {TARGET_NONE, TARGET_SIMPLE, TARGET_CHIPS, SET_CHIPS, TARGET_MOSAICS} FitTarget;35 typedef enum {TARGET_NONE, TARGET_SIMPLE, TARGET_CHIPS, SET_CHIPS, SET_STACKS, TARGET_MOSAICS} FitTarget; 36 36 37 37 typedef enum { -
trunk/Ohana/src/relastro/src/BrightCatalog.c
r40291 r40414 364 364 gfits_define_bintable_column (&theader, "D", "DEC", "dec", "degrees", 1.0, 0.0); 365 365 gfits_define_bintable_column (&theader, "E", "MAG_SYS", "magnitude (sys)", NULL, 1.0, 0.0); 366 gfits_define_bintable_column (&theader, "E", "MAG_CAL", "magnitude (cal)", NULL, 1.0, 0.0); 366 gfits_define_bintable_column (&theader, "E", "MCAL_PSF", "magnitude (cal)", NULL, 1.0, 0.0); 367 gfits_define_bintable_column (&theader, "E", "MCAL_APER","magnitude (cal)", NULL, 1.0, 0.0); 367 368 gfits_define_bintable_column (&theader, "E", "MAG_ERR", "magnitude (err)", NULL, 1.0, 0.0); 368 369 gfits_define_bintable_column (&theader, "E", "AIRMASS", "airmass", NULL, 1.0, 0.0); -
trunk/Ohana/src/relastro/src/UpdateMeasures.c
r40291 r40414 47 47 } 48 48 49 off_t im = getImageByID (measureT->imageID); 49 Average *average = &catalog[i].average[measureB->averef]; 50 int FOUND_TEST = FALSE; 51 FOUND_TEST |= (average[0].objID == OBJ_ID_SRC) && (average[0].catID == CAT_ID_SRC); 52 FOUND_TEST |= (average[0].objID == OBJ_ID_DST) && (average[0].catID == CAT_ID_DST); 53 if (FOUND_TEST) { 54 fprintf (stderr, "found test object\n"); 55 } 56 57 // we need this below but cannot declare it after the label update_this_measure: 58 off_t im; 59 60 // we have a few options to include/exclude specific types of measurements 61 if (UPDATE_ALL_MEASURE) goto update_this_measure; 62 if (isGPC1chip (measureT->photcode) && UPDATE_PS1_CHIP_MEASURE) goto update_this_measure; 63 if (isGPC1stack (measureT->photcode) && UPDATE_PS1_STACK_MEASURE) goto update_this_measure; 64 if (isHSCchip (measureT->photcode) && UPDATE_HSC_MEASURE) goto update_this_measure; 65 if (isCFHchip (measureT->photcode) && UPDATE_CFH_MEASURE) goto update_this_measure; 66 continue; // skip all others 67 68 update_this_measure: 69 im = getImageByID (measureT->imageID); 50 70 if (im < 0) continue; // detections without imageIDs are not associated with a known image (eg, refs) 51 71 … … 114 134 } 115 135 116 // XXX this stuff is rather hackish, added to do GSC/HSC/Megacam astrometry 117 118 // only modify the chip coordinates 119 if (UPDATE_ALL_MEASURE) { 120 measureT->R = R; 121 measureT->D = D; 122 if (measureB) { 123 measureB->R = R; 124 measureB->D = D; 125 } 126 goto set_measure_done; 136 // modify the measure coordinates 137 measureT->R = R; 138 measureT->D = D; 139 if (measureB) { 140 measureB->R = R; 141 measureB->D = D; 127 142 } 128 // only modify the chip coordinates129 if (UPDATE_PS1_STACK_MEASURE && isGPC1stack (measureT->photcode)) {130 measureT->R = R;131 measureT->D = D;132 if (measureB) {133 measureB->R = R;134 measureB->D = D;135 }136 goto set_measure_done;137 }138 // only modify the chip coordinates139 if (UPDATE_PS1_CHIP_MEASURE && isGPC1chip (measureT->photcode)) {140 measureT->R = R;141 measureT->D = D;142 if (measureB) {143 measureB->R = R;144 measureB->D = D;145 }146 goto set_measure_done;147 }148 // only modify the chip coordinates149 if (UPDATE_HSC_MEASURE && isHSCchip (measureT->photcode)) {150 measureT->R = R;151 measureT->D = D;152 if (measureB) {153 measureB->R = R;154 measureB->D = D;155 }156 goto set_measure_done;157 }158 // only modify the chip coordinates159 if (UPDATE_CFH_MEASURE && isCFHchip (measureT->photcode)) {160 measureT->R = R;161 measureT->D = D;162 if (measureB) {163 measureB->R = R;164 measureB->D = D;165 }166 goto set_measure_done;167 }168 set_measure_done:169 continue; // XXX this line is needed only to support the label above170 143 } 171 144 if (VERBOSE) fprintf (stderr, "%s : Noff ori RA %d ( %d %d %d ), Noff ori DEC %d ( %d %d %d )\n", catalog[i].filename, NoffRAori, NoffRAchip, NoffRAstack, NoffRAwarp, NoffDECori, NoffDECchip, NoffDECstack, NoffDECwarp); -
trunk/Ohana/src/relastro/src/UpdateObjects.c
r39926 r40414 127 127 int k; 128 128 129 // we need to chose to do something here... 130 int valid = UPDATE_ALL_MEASURE; 131 valid |= UPDATE_PS1_CHIP_MEASURE; 132 valid |= UPDATE_HSC_MEASURE; 133 valid |= UPDATE_CFH_MEASURE; 134 if (!valid) return FALSE; 135 129 136 /* calculate the average value of R,D for a single star */ 130 131 137 FitAstromResult fitPos, fitPM, fitPar; 132 138 FitAstromResultInit (&fitPos); … … 583 589 int status; 584 590 591 // we need to chose to do something here... 592 if (!UPDATE_PS1_STACK_MEASURE) return FALSE; 593 585 594 // set the default values 586 595 average[0].Rstk = NAN; // RA in degrees … … 794 803 Npoints++; 795 804 805 // NOTE: if 'isStack' is true, we will never see these photcode values 796 806 hasGAIA = (measure[k].photcode == 1030); 797 807 has2MASS = ((measure[k].photcode >= 2011) && (measure[k].photcode <= 2013)); … … 808 818 } 809 819 810 // XXX flag measurements from stars with 2MASS 811 for (k = 0; k < average[0].Nmeasure; k++) { 812 // reset the bit to note that a detection was used (or not) 820 // flag measurements from stars with 2MASS, GAIA, TYCHO 821 // NOTE: if 'isStack' is TRUE, these will not be correctly set. 822 // ONLY do this loop if not(isStack) 823 for (k = 0; !isStack && (k < average[0].Nmeasure); k++) { 824 // reset the bit to note that an object does or does not have the value 813 825 if (has2MASS) { 814 826 measure[k].dbFlags |= ID_MEAS_OBJECT_HAS_2MASS; -
trunk/Ohana/src/relastro/src/UpdateStacksWithFit.c
r40382 r40414 73 73 // are all automatically updated in this block because they are re-generated from 74 74 // image.coords on each pass. 75 setImageRaw (catalog, Ncatalog, i, raw, Nraw, MODE_ MOSAIC);75 setImageRaw (catalog, Ncatalog, i, raw, Nraw, MODE_SIMPLE); 76 76 77 77 NnewFit ++; -
trunk/Ohana/src/relastro/src/args.c
r40382 r40414 68 68 } 69 69 70 // the default is to only measure the scatter for the stacks, not to perform a new fit 71 FIT_STACKS = FALSE; 72 if ((N = get_argument (argc, argv, "-fit-stacks"))) { 73 remove_argument (N, &argc, argv); 74 FIT_STACKS = TRUE; 75 } 76 70 77 REPAIR_STACKS = FALSE; 71 78 if ((N = get_argument (argc, argv, "-repair-stacks-on-update"))) { … … 189 196 } 190 197 } 191 if ((RELASTRO_OP == OP_PARALLEL_IMAGES) || (RELASTRO_OP == OP_IMAGES)) { 198 if (RELASTRO_OP == OP_UPDATE_OBJECTS) { 199 if (!UPDATE_ALL_MEASURE && !UPDATE_PS1_STACK_MEASURE && !UPDATE_PS1_CHIP_MEASURE && !UPDATE_HSC_MEASURE && !UPDATE_CFH_MEASURE) { 200 fprintf (stderr, "for -update-objects, need to select at least one of -update-all-cameras, -update-ps1-stack, -update-ps1-chip, -update-hsc, -update-cfh\n"); 201 exit (2); 202 } 203 } 204 if ((RELASTRO_OP == OP_PARALLEL_REGIONS) || (RELASTRO_OP == OP_PARALLEL_IMAGES) || (RELASTRO_OP == OP_IMAGES)) { 192 205 if (APPLY_OFFSETS && !UPDATE_ALL_MEASURE && !UPDATE_PS1_STACK_MEASURE && !UPDATE_PS1_CHIP_MEASURE && !UPDATE_HSC_MEASURE && !UPDATE_CFH_MEASURE) { 193 206 fprintf (stderr, "for [-images or -parallel-images] with -apply-offsets, need to select at least one of -update-ps1-stack, -update-ps1-chip, -update-hsc, -update-cfh\n"); … … 305 318 remove_argument (N, &argc, argv); 306 319 FIT_TARGET = SET_CHIPS; 320 } 321 if ((N = get_argument (argc, argv, "-set-stacks"))) { 322 remove_argument (N, &argc, argv); 323 FIT_TARGET = SET_STACKS; 307 324 } 308 325 -
trunk/Ohana/src/relastro/src/launch_region_hosts.c
r39926 r40414 117 117 strextend (&command, "-set-chips"); 118 118 break; 119 case SET_STACKS: 120 strextend (&command, "-set-stacks"); 121 break; 119 122 case TARGET_NONE: 120 123 abort(); … … 151 154 if (SKIP_CFH) strextend (&command, "-skip-cfh"); 152 155 156 if (FIT_STACKS) strextend (&command, "-fit-stacks"); 157 153 158 strextend (&command, "-nloop %d", NLOOP); 154 159 strextend (&command, "-threads %d", NTHREADS); -
trunk/Ohana/src/relastro/src/relastro_images.c
r40382 r40414 104 104 UpdateChips (catalog, Ncatalog, 0); // measure.X,Y -> R,D, fit image.coords 105 105 MARKTIME("update chips: %f sec\n", dtime); 106 106 break; 107 108 case SET_STACKS: 109 // we just want to fit the selected stacks to the mean positions 110 if (FIT_STACKS) { 111 // model astrometry for stacks 112 UpdateStacksWithFit (catalog, Ncatalog); 113 } else { 114 // measure scatter for stacks 115 UpdateStacks (catalog, Ncatalog); 116 } 117 MARKTIME("update stacks : %f sec\n", dtime); 107 118 break; 108 119 -
trunk/Ohana/src/relastro/src/relastro_parallel_images.c
r40382 r40414 163 163 break; 164 164 165 case SET_STACKS: 166 // we just want to fit the selected stacks to the mean positions 167 share_mean_pos (catalog, Ncatalog, regionHosts, 0); 168 slurp_mean_pos (catalog, Ncatalog, regionHosts, 0); 169 if (FIT_STACKS) { 170 // model astrometry for stacks 171 UpdateStacksWithFit (catalog, Ncatalog); 172 } else { 173 // measure scatter for stacks 174 UpdateStacks (catalog, Ncatalog); 175 } 176 share_image_pos (regionHosts, 0); 177 slurp_image_pos (catalog, Ncatalog, regionHosts, 0); 178 MARKTIME("update stacks : %f sec\n", dtime); 179 break; 180 165 181 case TARGET_MOSAICS: 166 182 for (i = 0; i < NLOOP; i++) { -
trunk/Ohana/src/relastro/src/select_images.c
r39926 r40414 114 114 } 115 115 if (FALSE && !strncmp(timage[i].name, "o6227g0311o", 10)) { 116 fprintf (stderr, "test image 2\n"); 117 } 118 119 // RINGS.V3.skycell.2634.034.stk.3411510.skycal.3811673.cmf[SkyChip.hdr] 120 if (!strncmp(timage[i].name, "RINGS.V3.skycell.2634.034.stk.3411510", strlen("RINGS.V3.skycell.2634.034.stk.3411510"))) { 116 121 fprintf (stderr, "test image 2\n"); 117 122 }
Note:
See TracChangeset
for help on using the changeset viewer.
