Changeset 41367
- Timestamp:
- May 27, 2020, 2:21:31 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
-
ippconfig/gpc1/ghost.model.mdc (modified) (3 diffs)
-
ippconfig/gpc1/psastro.config (modified) (11 diffs)
-
ippconfig/gpc2/ghost.model.mdc (modified) (2 diffs)
-
ippconfig/gpc2/psastro.config (modified) (7 diffs)
-
ippconfig/recipes/psastro.config (modified) (1 diff)
-
psModules/src/objects/pmSourceIO.h (modified) (1 diff)
-
psModules/src/objects/pmSourceIO_Ghosts.c (modified) (5 diffs)
-
psModules/src/objects/pmSourceIO_Glints.c (modified) (5 diffs)
-
psastro/src/psastro.h (modified) (1 diff)
-
psastro/src/psastroChooseGlintStars.c (modified) (1 diff)
-
psastro/src/psastroConvert.c (modified) (1 diff)
-
psastro/src/psastroExtractGhosts.c (modified) (1 diff)
-
psastro/src/psastroExtractStars.c (modified) (1 diff)
-
psastro/src/psastroLoadCrosstalk.c (modified) (1 diff)
-
psastro/src/psastroLoadGhosts.c (modified) (5 diffs)
-
psastro/src/psastroLoadGlints.c (modified) (12 diffs)
-
psastro/src/psastroMaskUpdates.Mosaic.c (modified) (1 diff)
-
psastro/src/psastroMaskUpdates.c (modified) (2 diffs)
-
psastro/src/psastroZeroPoint.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippconfig/gpc1/ghost.model.mdc
r33850 r41367 1 # Original center models 2 # GHOST.CENTER.X METADATA 3 # NORDER_X S32 3 4 # NORDER_Y S32 3 5 # VAL_X00_Y00 F64 -4.421024e+01 6 # VAL_X01_Y00 F64 1.216270e-02 7 # VAL_X02_Y00 F64 -9.721643e-08 8 # VAL_X03_Y00 F64 9.976554e-11 9 # VAL_X00_Y01 F64 -1.762476e-03 10 # VAL_X01_Y01 F64 1.247212e-07 11 # VAL_X02_Y01 F64 3.629557e-11 12 # VAL_X00_Y02 F64 -1.040174e-07 13 # VAL_X01_Y02 F64 1.074674e-10 14 # VAL_X00_Y03 F64 1.564112e-11 15 # NELEMENTS S32 10 16 # END 1 # TdB20200522 ghost model fit for gpc1 2 #Inner radii are left from the default gpc1 values 17 3 18 # GHOST.CENTER.Y METADATA 19 # NORDER_X S32 3 20 # NORDER_Y S32 3 21 # VAL_X00_Y00 F64 -2.189470e+00 22 # VAL_X01_Y00 F64 -4.186514e-03 23 # VAL_X02_Y00 F64 1.131554e-07 24 # VAL_X03_Y00 F64 1.415192e-11 25 # VAL_X00_Y01 F64 1.569104e-02 26 # VAL_X01_Y01 F64 -1.782801e-07 27 # VAL_X02_Y01 F64 8.179602e-11 28 # VAL_X00_Y02 F64 2.577055e-07 29 # VAL_X01_Y02 F64 8.879423e-11 30 # VAL_X00_Y03 F64 5.767429e-11 31 # NELEMENTS S32 10 32 # END 4 GHOST.MIRROR.RAD METADATA 5 NORDER_X S32 1 6 VAL_X00 F64 -329.27244159 7 VAL_X01 F64 2.0664288 8 NELEMENTS S32 2 9 END 33 10 34 # Updated models of 2012-05-0735 # Corrected(?) parity36 # GHOST.CENTER.X METADATA37 # NORDER_X S32 338 # NORDER_Y S32 339 # VAL_X00_Y00 F64 3.314569e+0140 # VAL_X01_Y00 F64 1.110664e-0241 # VAL_X02_Y00 F64 -1.904158e-0742 # VAL_X03_Y00 F64 8.470224e-1143 # VAL_X00_Y01 F64 -1.616877e-0344 # VAL_X01_Y01 F64 1.646508e-0745 # VAL_X02_Y01 F64 5.623381e-1146 # VAL_X00_Y02 F64 -2.342888e-0747 # VAL_X01_Y02 F64 1.023761e-1048 # VAL_X00_Y03 F64 2.836980e-1149 # NELEMENTS S32 1050 # END51 52 # GHOST.CENTER.Y METADATA53 # NORDER_X S32 354 # NORDER_Y S32 355 # VAL_X00_Y00 F64 -2.860068e+0156 # VAL_X01_Y00 F64 -8.790076e-0357 # VAL_X02_Y00 F64 2.456534e-0758 # VAL_X03_Y00 F64 2.947749e-1159 # VAL_X00_Y01 F64 1.948855e-0260 # VAL_X01_Y01 F64 -2.639927e-0761 # VAL_X02_Y01 F64 4.951474e-1162 # VAL_X00_Y02 F64 4.341716e-0763 # VAL_X01_Y02 F64 1.643046e-1064 # VAL_X00_Y03 F64 -1.737983e-1265 # NELEMENTS S32 1066 # END67 68 # Switched order69 11 GHOST.CENTER.X METADATA 70 12 NORDER_X S32 3 71 13 NORDER_Y S32 3 72 VAL_X00_Y00 F64 -1. 215661e+0273 VAL_X01_Y00 F64 1.321875e-0274 VAL_X02_Y00 F64 - 4.017026e-0975 VAL_X03_Y00 F64 1.148288e-1076 VAL_X00_Y01 F64 - 1.908074e-0377 VAL_X01_Y01 F64 8.479150e-0878 VAL_X02_Y01 F64 1.635732e-1179 VAL_X00_Y02 F64 2.625405e-0880 VAL_X01_Y02 F64 1.125586e-1081 VAL_X00_Y03 F64 2.912432e-1214 VAL_X00_Y00 F64 -1.67627557e+01 15 VAL_X01_Y00 F64 -1.15377631e-02 16 VAL_X02_Y00 F64 -9.88483348e-08 17 VAL_X03_Y00 F64 4.14561887e-11 18 VAL_X00_Y01 F64 -9.13131313e-05 19 VAL_X01_Y01 F64 1.40192992e-08 20 VAL_X02_Y01 F64 9.78192800e-12 21 VAL_X00_Y02 F64 -9.82584386e-09 22 VAL_X01_Y02 F64 5.48708364e-11 23 VAL_X00_Y03 F64 5.09109210e-13 82 24 NELEMENTS S32 10 83 25 END … … 86 28 NORDER_X S32 3 87 29 NORDER_Y S32 3 88 VAL_X00_Y00 F64 2.422174e+0189 VAL_X01_Y00 F64 4.170486e-0490 VAL_X02_Y00 F64 - 1.934260e-0891 VAL_X03_Y00 F64 -1.173657e-1292 VAL_X00_Y01 F64 1.189352e-0293 VAL_X01_Y01 F64 - 9.256748e-0894 VAL_X02_Y01 F64 1.140772e-1095 VAL_X00_Y02 F64 8.123932e-0896 VAL_X01_Y02 F64 1.328378e-1197 VAL_X00_Y03 F64 1.170865e-1030 VAL_X00_Y00 F64 3.44511879e+00 31 VAL_X01_Y00 F64 -1.08538420e-03 32 VAL_X02_Y00 F64 -3.17872409e-08 33 VAL_X03_Y00 F64 5.29317184e-12 34 VAL_X00_Y01 F64 -1.22162715e-02 35 VAL_X01_Y01 F64 -2.30510155e-08 36 VAL_X02_Y01 F64 4.75814089e-11 37 VAL_X00_Y02 F64 -1.28748715e-07 38 VAL_X01_Y02 F64 5.78808885e-12 39 VAL_X00_Y03 F64 5.11500780e-11 98 40 NELEMENTS S32 10 99 41 END 100 42 101 102 103 # These are semi-major/minor axes104 # These are my (CZW) quadratic solutions105 # GHOST.INNER.MAJOR METADATA106 # NORDER_X S32 2107 # VAL_X00 F64 2.2622e+01108 # VAL_X01 F64 1.3822e-02109 # VAL_X02 F64 -3.7005e-07110 # NELEMENTS S32 3111 # END112 113 # GHOST.INNER.MINOR METADATA114 # NORDER_X S32 2115 # VAL_X00 F64 4.9626e+01116 # VAL_X01 F64 -2.4257e-04117 # VAL_X02 F64 -1.2007e-07118 # NELEMENTS S32 3119 # END120 121 # GHOST.OUTER.MAJOR METADATA122 # NORDER_X S32 2123 # VAL_X00 F64 9.6490e+01124 # VAL_X01 F64 9.4250e-03125 # VAL_X02 F64 6.5680e-07126 # NELEMENTS S32 3127 # END128 129 # GHOST.OUTER.MINOR METADATA130 # NORDER_X S32 2131 # VAL_X00 F64 9.5450e+01132 # VAL_X01 F64 2.8775e-03133 # VAL_X02 F64 -3.1409e-07134 # NELEMENTS S32 3135 # END136 137 # These are the original linear solutions138 43 GHOST.INNER.MAJOR METADATA 139 44 NORDER_X S32 1 … … 151 56 152 57 GHOST.OUTER.MAJOR METADATA 153 NORDER_X S32 1 154 VAL_X00 F64 7.928722e+01 155 VAL_X01 F64 1.722181e-02 156 NELEMENTS S32 2 58 NORDER_X S32 2 59 VAL_X00 F64 8.99331326e+01 60 VAL_X01 F64 1.17511553e-02 61 VAL_X02 F64 6.21923231e-07 62 NELEMENTS S32 3 157 63 END 158 64 159 65 GHOST.OUTER.MINOR METADATA 160 66 NORDER_X S32 1 161 VAL_X00 F64 1.3 14265e+02162 VAL_X01 F64 - 2.627153e-0367 VAL_X00 F64 1.36523263e+02 68 VAL_X01 F64 -3.5025434e-03 163 69 NELEMENTS S32 2 164 70 END -
trunk/ippconfig/gpc1/psastro.config
r40875 r41367 129 129 DVO.GETSTAR.PHOTCODE STR i 130 130 DVO.GETSTAR.MAX.RHO F32 10000.0 131 DVO.GETSTAR.MIN.MAG F32 12.0132 DVO.GETSTAR.MIN.MAG.INST F32 - 25.0131 DVO.GETSTAR.MIN.MAG F32 2.0 132 DVO.GETSTAR.MIN.MAG.INST F32 -35.0 133 133 134 134 # rather than mean, use specified EDGE: … … 144 144 PHOTCODE STR g 145 145 GHOST_MAX_MAG F32 -16.5 146 GLINT_MAX_MAG F32 -23.0 146 147 END 147 148 PHOTCODE.DATA METADATA … … 150 151 PHOTCODE STR r 151 152 GHOST_MAX_MAG F32 -20.0 153 GLINT_MAX_MAG F32 -23.0 152 154 END 153 155 PHOTCODE.DATA METADATA … … 155 157 ZEROPT F32 24.611 156 158 PHOTCODE STR i 157 GHOST_MAX_MAG F32 -25.0 159 GHOST_MAX_MAG F32 -22.0 160 GLINT_MAX_MAG F32 -23.4 158 161 END 159 162 PHOTCODE.DATA METADATA … … 161 164 ZEROPT F32 24.250 162 165 PHOTCODE STR z 163 GHOST_MAX_MAG F32 -25.0 166 GHOST_MAX_MAG F32 -22.0 167 GLINT_MAX_MAG F32 -23.4 164 168 END 165 169 PHOTCODE.DATA METADATA … … 167 171 ZEROPT F32 23.320 168 172 PHOTCODE STR y 169 GHOST_MAX_MAG F32 -25.0 173 GHOST_MAX_MAG F32 -21.5 174 GLINT_MAX_MAG F32 -23.0 170 175 END 171 176 PHOTCODE.DATA METADATA … … 173 178 ZEROPT F32 26.3 174 179 PHOTCODE STR r 175 GHOST_MAX_MAG F32 -20.0 180 GHOST_MAX_MAG F32 -20.4 181 GLINT_MAX_MAG F32 -24.4 176 182 END 177 183 … … 180 186 REFSTAR_MASK_SATSTAR_MAG_MAX F32 -15.0 181 187 REFSTAR_MASK_SATSTAR_MAG_SLOPE F32 10.15 182 # CZW: Original 2010-02-08 position angle offset 183 REFSTAR_MASK_SATSTAR_POS_ZERO F32 -0.798 184 # CZW: Updated 2011-02-18 position angle offset. As above, offset 0.5 degree. 185 # REFSTAR_MASK_SATSTAR_POS_ZERO F32 -0.78927 186 #REFSTAR_MASK_SATSTAR_POS_ZERO F32 -0.80237 187 #REFSTAR_MASK_SATSTAR_POS_ZERO F32 -0.81109 188 # Length = 10**(SLOPE*(MAG_MAX - InstMag)) - OFFSET 188 189 # TdB20200430: Updated satspike position angle offset 190 REFSTAR_MASK_SATSTAR_POS_ZERO F32 -0.79451 191 PSASTRO.MODEL.ROT.PARITY S32 1 192 193 #TdB20200229: The size of saturated star circles should be an exponential for gpc2 194 #rad(mag) = REFSTAR_MASK_SATSTAR_RAD_OFFSET + REFSTAR_MASK_SATSTAR_EXP**(REFSTAR_MASK_SATSTAR_MAG_MAX-mag) 195 REFSTAR_MASK_SATSTAR_MAG_MAX F32 -11.363 196 REFSTAR_MASK_SATSTAR_RAD_OFFSET F32 17.631 197 REFSTAR_MASK_SATSTAR_EXP F32 1.493 189 198 190 199 REFSTAR_MASK_SATSPIKE_MAG_SLOPE F32 0.096 … … 203 212 204 213 205 206 207 214 REFSTAR_MASK_BLEED BOOL FALSE 208 215 REFSTAR_MASK_BLEED_MAG_MAX F32 -15.0 … … 218 225 # GHOST_MAX_MAG F32 -20.0 219 226 220 GLINT_LENGTH_MAG_SLOPE F32 2500.0221 GLINT_LENGTH_MAG_ZERO F32 -20.0222 GLINT_WIDTH F32 150.0223 227 REFSTAR_COUNT_GHOSTS BOOL TRUE 224 228 REFSTAR_MASK_GHOST BOOL TRUE 225 226 # GHOST_CENTER_X_0 F32 66.2 227 # GHOST_CENTER_X_SLOPE F32 -0.02454 228 # GHOST_CENTER_Y_0 F32 16.6 229 # GHOST_CENTER_Y_SLOPE F32 +0.01565 230 # 231 # GHOST_INNER_MAJOR_0 F32 32.9 232 # GHOST_INNER_MAJOR_SLOPE F32 +0.00612 233 # GHOST_INNER_MINOR_0 F32 58.7 234 # GHOST_INNER_MINOR_SLOPE F32 -0.00258 235 # 236 # GHOST_OUTER_MAJOR_0 F32 90.6 237 # GHOST_OUTER_MAJOR_SLOPE F32 +0.01548 238 # GHOST_OUTER_MINOR_0 F32 133.9 239 # GHOST_OUTER_MINOR_SLOPE F32 -0.00288 229 PSASTRO.SAVE.GHOSTS BOOL TRUE # save ghost positions as table in output smf file 230 231 #TdB20200305: The length of glints as function of mag is recomputed for gpc2 232 #glint_length(mag) = GLINT_LENGTH_MAG_SLOPE*(GLINT_LENGTH_MAG_ZERO-mag) 233 GLINT_LENGTH_MAG_SLOPE F32 1901.0 234 GLINT_LENGTH_MAG_ZERO F32 -16.8 235 #TdB20200308: The length of glints also depends on position off the focal plane (perpendicular to pixel FPA), out to GLINT_LENGTH_POS_CUT 236 #glint_length(pos) = GLINT_LENGTH_POS_SLOPE*(GLINT_LENGTH_POS_REF-pos) 237 GLINT_LENGTH_POS_SLOPE F32 0.00019 238 GLINT_LENGTH_POS_REF F32 33821. 239 GLINT_LENGTH_POS_CUT F32 30700. 240 GLINT_LENGTH_MIN_FPA F32 1500.0 241 #TdB20200312: The angle that glints have depends on position along the focal plane (parallel to pixel FPA) 242 #glint_angle(pos) = GLINT_ANGLE_SLOPE*(GLINT_ANGLE_POS_REF-(pos/1000)) 243 GLINT_ANGLE_POS_SLOPE F32 0.07903 244 GLINT_ANGLE_POS_REF F32 -575.5 245 GLINT_WIDTH F32 80.0 246 247 # save glint positions? 248 PSASTRO.SAVE.GLINTS BOOL TRUE # save glint positions as table in output smf file 249 240 250 241 251 PR_RECIPE METADATA … … 244 254 245 255 REFSTAR_MASK_GLINTS BOOL TRUE 246 GLINT_MAX_MAG F32 -21. 0256 GLINT_MAX_MAG F32 -21. 247 257 GLINT.REGION MULTI 248 258 259 #TdB20200514: GPC1 does not show any glints coming from the left or right, at all, after searching thousands of images. So, shrinking the bounding boxes to zero. 249 260 GLINT.REGION METADATA 250 REGION STR [-38000:- 24000,-20000:+20000]261 REGION STR [-38000:-38000,-20000:+20000] 251 262 GLINT.TYPE STR LEFT 252 263 END 253 264 254 265 GLINT.REGION METADATA 255 REGION STR [+ 24000:+38000,-20000:+20000]266 REGION STR [+38000:+38000,-20000:+20000] 256 267 GLINT.TYPE STR RIGHT 257 268 END -
trunk/ippconfig/gpc2/ghost.model.mdc
r41348 r41367 1 1 # TdB20200327 ghost model fit for gpc2 2 2 3 # These are the original linear solutions for gpc14 3 GHOST.MIRROR.RAD METADATA 5 4 NORDER_X S32 1 … … 41 40 END 42 41 43 # These are the original linear solutions for gpc144 42 GHOST.INNER.MAJOR METADATA 45 43 NORDER_X S32 1 -
trunk/ippconfig/gpc2/psastro.config
r41350 r41367 145 145 PHOTCODE STR g 146 146 GHOST_MAX_MAG F32 -16.5 147 GLINT_MAX_MAG F32 -23.0 147 148 END 148 149 PHOTCODE.DATA METADATA … … 151 152 PHOTCODE STR r 152 153 GHOST_MAX_MAG F32 -20.0 154 GLINT_MAX_MAG F32 -23.0 153 155 END 154 156 PHOTCODE.DATA METADATA … … 157 159 PHOTCODE STR i 158 160 GHOST_MAX_MAG F32 -23.5 161 GLINT_MAX_MAG F32 -21.0 159 162 END 160 163 PHOTCODE.DATA METADATA … … 163 166 PHOTCODE STR z 164 167 GHOST_MAX_MAG F32 -25.0 168 GLINT_MAX_MAG F32 -23.0 165 169 END 166 170 PHOTCODE.DATA METADATA … … 169 173 PHOTCODE STR y 170 174 GHOST_MAX_MAG F32 -25.0 175 GLINT_MAX_MAG F32 -23.0 171 176 END 172 177 PHOTCODE.DATA METADATA … … 175 180 PHOTCODE STR r 176 181 GHOST_MAX_MAG F32 -23.5 182 GLINT_MAX_MAG F32 -21.0 177 183 END 178 184 … … 229 235 GLINT_LENGTH_MAG_SLOPE F32 1901.0 230 236 GLINT_LENGTH_MAG_ZERO F32 -16.8 231 #TdB20200308: The length of glints also depends on position off the focal plane (perpendicular to pixel FPA) 237 #TdB20200308: The length of glints also depends on position off the focal plane (perpendicular to pixel FPA), out to GLINT_LENGTH_POS_CUT 232 238 #glint_length(pos) = GLINT_LENGTH_POS_SLOPE*(GLINT_LENGTH_POS_REF-pos) 233 239 GLINT_LENGTH_POS_SLOPE F32 0.00019 234 GLINT_LENGTH_POS_REF F32 33821 240 GLINT_LENGTH_POS_REF F32 33821. 241 GLINT_LENGTH_POS_CUT F32 30000. 242 GLINT_LENGTH_MIN_FPA F32 1500.0 235 243 #TdB20200312: The angle that glints have depends on position along the focal plane (parallel to pixel FPA) 236 244 #glint_angle(pos) = GLINT_ANGLE_SLOPE*(GLINT_ANGLE_POS_REF-(pos/1000)) -
trunk/ippconfig/recipes/psastro.config
r41338 r41367 190 190 GLINT_LENGTH_POS_SLOPE F32 0.0 191 191 GLINT_LENGTH_POS_REF F32 0.0 192 GLINT_LENGTH_POS_CUT F32 0.0 193 GLINT_LENGTH_MIN_FPA F32 0.0 192 194 GLINT_ANGLE_POS_SLOPE F32 0.0 193 195 GLINT_ANGLE_POS_REF F32 0.0 -
trunk/psModules/src/objects/pmSourceIO.h
r41348 r41367 91 91 bool pmSourceIO_ReadMatchedRefs (psFits *fits, pmFPA *fpa, const pmConfig *config); 92 92 93 bool psastroZeroPointFromRecipeGlint (float *zeropt, float *exptime, float *ghostMaxMag, double *glintMaxMag, pmFPA *fpa, psMetadata *recipe); 93 94 bool pmSourceIO_WriteGlints (psFits *fits, pmFPA *fpa, pmConfig *config); 94 95 bool pmSourceIO_WriteGhosts (psFits *fits, pmFPA *fpa, pmConfig *config); -
trunk/psModules/src/objects/pmSourceIO_Ghosts.c
r41348 r41367 135 135 pmFPAview *view = pmFPAviewAlloc (0); 136 136 137 GET_1D_POLY ("GHOST.MIRROR.RAD", mirrorRad); 137 //We need to check whether we are dealing with an old style ghost_model, or a new style model. Check if the mirror_rad polynomial exists 138 float mirCheck = 0; 139 md = psMetadataLookupMetadata (&status, ghostModel, "GHOST.MIRROR.RAD"); 140 if (!md) { psLogMsg ("psastro", PS_LOG_INFO, "No ghost mirror_rad polynomial found. Assuming old-style ghost masking"); } 141 if (md) { 142 GET_1D_POLY ("GHOST.MIRROR.RAD", mirrorRad); 143 mirCheck = 1; 144 } 145 138 146 GET_2D_POLY ("GHOST.CENTER.X", centerX); 139 147 GET_2D_POLY ("GHOST.CENTER.Y", centerY); … … 143 151 GET_1D_POLY ("GHOST.INNER.MAJOR", innerMajor); 144 152 GET_1D_POLY ("GHOST.INNER.MINOR", innerMinor); 153 145 154 146 155 // select the input astrometry data (also carries the refstars) … … 153 162 154 163 // really error-out here? or just skip? 155 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, &MAX_MAG, fpa_ast, recipe)) {164 if (!psastroZeroPointFromRecipeGlint (&zeropt, &exptime, &MAX_MAG,NULL, fpa_ast, recipe)) { 156 165 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 157 166 goto escape; … … 201 210 double theta0 = atan2(ref->FP->y,ref->FP->x); 202 211 203 double ghost_offset_rad = psPolynomial1DEval (mirrorRad, rSrc); 204 double ghost_x_fpa_mirror = ref->FP->x + ((ref->FP->x*-1.)/abs(ref->FP->x)*abs(cos(theta0)*ghost_offset_rad)); 205 double ghost_y_fpa_mirror = ref->FP->y + ((ref->FP->y*-1.)/abs(ref->FP->y)*abs(sin(theta0)*ghost_offset_rad)); 206 207 // Now use the mirrored position together with the 2D ghost center fitting to get the actual ghost position in FPA coords 208 ghost->FP->x = ghost_x_fpa_mirror + psPolynomial2DEval(centerX, ghost_x_fpa_mirror, ghost_y_fpa_mirror); 209 ghost->FP->y = ghost_y_fpa_mirror + psPolynomial2DEval(centerY, ghost_x_fpa_mirror, ghost_y_fpa_mirror); 212 if(mirCheck) { 213 //TdB: first mirror the reference star positions (around the 0,0 pixel) using the radial offset coefficients and the ghost/star angle 214 double ghost_offset_rad = psPolynomial1DEval (mirrorRad, rSrc); 215 double ghost_x_fpa_mirror = ref->FP->x + ((ref->FP->x*-1.)/abs(ref->FP->x)*abs(cos(theta0)*ghost_offset_rad)); 216 double ghost_y_fpa_mirror = ref->FP->y + ((ref->FP->y*-1.)/abs(ref->FP->y)*abs(sin(theta0)*ghost_offset_rad)); 217 218 // Now use the mirrored position together with the 2D ghost center fitting to get the actual ghost position in FPA coords 219 ghost->FP->x = ghost_x_fpa_mirror + psPolynomial2DEval(centerX, ghost_x_fpa_mirror, ghost_y_fpa_mirror); 220 ghost->FP->y = ghost_y_fpa_mirror + psPolynomial2DEval(centerY, ghost_x_fpa_mirror, ghost_y_fpa_mirror); 221 } 222 if(!mirCheck) { 223 //Use the old-style ghost position determination 224 ghost->FP->x = -ref->FP->x + psPolynomial2DEval(centerX, -ref->FP->x, -ref->FP->y); 225 ghost->FP->y = -ref->FP->y + psPolynomial2DEval(centerY, -ref->FP->x, -ref->FP->y); 226 } 210 227 211 228 ghost->inner.major = psPolynomial1DEval (innerMajor, rSrc); … … 503 520 return true; 504 521 } 522 523 -
trunk/psModules/src/objects/pmSourceIO_Glints.c
r41349 r41367 78 78 if (!REFSTAR_MASK_GLINTS) return true; 79 79 80 // select the limiting magnitude80 // select relevant keywords 81 81 double GLINT_MAX_MAG = psMetadataLookupF32 (&status, recipe, "GLINT_MAX_MAG"); 82 82 double GLINT_LENGTH_MAG_SLOPE = psMetadataLookupF32 (&status, recipe, "GLINT_LENGTH_MAG_SLOPE"); 83 83 double GLINT_LENGTH_MAG_ZERO = psMetadataLookupF32 (&status, recipe, "GLINT_LENGTH_MAG_ZERO"); 84 double glintWidth = psMetadataLookupF32 (&status, recipe, "GLINT_WIDTH"); 85 86 //we will use one of the new keywords to differentiate between an old and new style glint treatment 87 float glintCheck = 0; 84 88 double GLINT_LENGTH_POS_SLOPE = psMetadataLookupF32 (&status, recipe, "GLINT_LENGTH_POS_SLOPE"); 89 if (!status) { glintCheck = 1; } 85 90 double GLINT_LENGTH_POS_REF = psMetadataLookupF32 (&status, recipe, "GLINT_LENGTH_POS_REF"); 91 double GLINT_LENGTH_POS_CUT = psMetadataLookupF32 (&status, recipe, "GLINT_LENGTH_POS_CUT"); 86 92 double GLINT_ANGLE_POS_SLOPE = psMetadataLookupF32 (&status, recipe, "GLINT_ANGLE_POS_SLOPE"); 87 93 double GLINT_ANGLE_POS_REF = psMetadataLookupF32 (&status, recipe, "GLINT_ANGLE_POS_REF"); 88 double glintWidth = psMetadataLookupF32 (&status, recipe, "GLINT_WIDTH"); 94 89 95 bool GLINT_OUTPUT = psMetadataLookupBool(&status, recipe, "PSASTRO.SAVE.GLINTS"); 90 96 if (!GLINT_OUTPUT) return true; … … 111 117 // use the zero point and exposure time to convert to apparent mags: M_ap = M_inst + C_0 + 2.5*log(exptime) 112 118 pmFPA *fpa_ast = astrom->fpa; 113 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, fpa_ast, recipe)) {119 if (!psastroZeroPointFromRecipeGlint (&zeropt, &exptime, NULL,&GLINT_MAX_MAG, fpa_ast, recipe)) { 114 120 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 115 121 return false; … … 167 173 } 168 174 175 double glintLength = GLINT_LENGTH_MAG_SLOPE*(GLINT_LENGTH_MAG_ZERO - star->Mag); 169 176 double glintAngle = 0; 170 //compute the angle of the glint, which depends on position parallel to the FPX 171 if (!strcasecmp(glintType, "TOP") || !strcasecmp(glintType, "BOTTOM") ){ 172 glintAngle = PM_RAD_DEG * (GLINT_ANGLE_POS_SLOPE*((GLINT_ANGLE_POS_REF - star->FP->x)/1000.)); 173 } 174 if (!strcasecmp(glintType, "LEFT") || !strcasecmp(glintType, "RIGHT") ) { 175 glintAngle = PM_RAD_DEG * (GLINT_ANGLE_POS_SLOPE*((GLINT_ANGLE_POS_REF - star->FP->y)/1000.));176 } 177 178 double glintLength = GLINT_LENGTH_MAG_SLOPE*(GLINT_LENGTH_MAG_ZERO - star->Mag); 179 //Besides brightness, the length of the glints also depends on the position of the star compared to the focal plane. But, seemingly only for stars closer than 30k pixels180 if ((!strcasecmp(glintType, "TOP") || !strcasecmp(glintType, "BOTTOM")) && abs(star->FP->y) < 30000){181 glintLength /= GLINT_LENGTH_POS_SLOPE*(GLINT_LENGTH_POS_REF - abs(star->FP->y));182 183 } 184 if ((!strcasecmp(glintType, "LEFT") || !strcasecmp(glintType, "RIGHT")) && abs(star->FP->x) < 30000 ) { 185 glintLength /= GLINT_LENGTH_POS_SLOPE*(GLINT_LENGTH_POS_REF - abs(star->FP->x));177 178 //Besides brightness, the length of the glints also depends on the position of the star compared to the focal plane. But, seemingly only for stars closer than about 30k pixels 179 if(glintCheck) { 180 if ((!strcasecmp(glintType, "TOP") || !strcasecmp(glintType, "BOTTOM")) && abs(star->FP->y) < GLINT_LENGTH_POS_CUT ){ 181 glintLength /= GLINT_LENGTH_POS_SLOPE*(GLINT_LENGTH_POS_REF - abs(star->FP->y)); 182 } 183 if ((!strcasecmp(glintType, "LEFT") || !strcasecmp(glintType, "RIGHT")) && abs(star->FP->x) < GLINT_LENGTH_POS_CUT ) { 184 glintLength /= GLINT_LENGTH_POS_SLOPE*(GLINT_LENGTH_POS_REF - abs(star->FP->x)); 185 } 186 //also compute the angle of the glint, which depends on position parallel to the FPX 187 if (!strcasecmp(glintType, "TOP") || !strcasecmp(glintType, "BOTTOM") ){ 188 glintAngle = PM_RAD_DEG * (GLINT_ANGLE_POS_SLOPE*((GLINT_ANGLE_POS_REF - star->FP->x)/1000.)); 189 } 190 if (!strcasecmp(glintType, "LEFT") || !strcasecmp(glintType, "RIGHT") ) { 191 glintAngle = PM_RAD_DEG * (GLINT_ANGLE_POS_SLOPE*((GLINT_ANGLE_POS_REF - star->FP->y)/1000.)); 192 } 186 193 } 187 194 … … 230 237 } 231 238 232 233 bool psastroZeroPointFromRecipe (float *zeropt, float *exptime, float *ghostMaxMag, pmFPA *fpa, psMetadata *recipe) { 239 bool psastroZeroPointFromRecipeGlint (float *zeropt, float *exptime, float *ghostMaxMag, double *glintMaxMag, pmFPA *fpa, psMetadata *recipe) { 234 240 235 241 bool status; … … 279 285 psLogMsg ("psastro", PS_LOG_INFO, "found GHOST_MAX_MAG %f",*ghostMaxMag); 280 286 } 287 if (glintMaxMag) { 288 float MaxMag = psMetadataLookupF32 (&status, refItem->data.md, "GLINT_MAX_MAG"); 289 if (status) { 290 *glintMaxMag = MaxMag ; 291 //MEH null is a pain.. so only log if set 292 psLogMsg ("psastro", PS_LOG_INFO, "found GLINT_MAX_MAG %f",*glintMaxMag); 293 } 294 } 295 281 296 //MEH what zpt is set to 282 297 psLogMsg ("psastro", PS_LOG_INFO, "found ZEROPT %f",*zeropt); -
trunk/psastro/src/psastro.h
r41290 r41367 156 156 psVector *psastroZeroPointReadoutAccum(psVector *dMag, pmReadout *readout, float exptime, float refminMag, float refmaxMag); 157 157 bool psastroZeroPointAnalysis (psMetadata *header, psVector *dMag, float zeropt, psMetadata *recipe); 158 bool psastroZeroPointFromRecipe (float *zeropt, float *exptime, float *ghostMaxMag, pmFPA *fpa, psMetadata *recipe);158 bool psastroZeroPointFromRecipe (float *zeropt, float *exptime, float *ghostMaxMag, double *glintMaxMag, pmFPA *fpa, psMetadata *recipe); 159 159 bool psastroZeroPointRefMagLimitFromRecipe (float *refminMag, float *refmaxMag, pmFPA *fpa, psMetadata *recipe); 160 160 -
trunk/psastro/src/psastroChooseGlintStars.c
r24645 r41367 37 37 38 38 // really error-out here? or just skip? 39 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, fpa, recipe)) {39 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, NULL, fpa, recipe)) { 40 40 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 41 41 return false; -
trunk/psastro/src/psastroConvert.c
r39926 r41367 65 65 66 66 // really error-out here? or just skip? 67 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, fpa, recipe)) {67 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, NULL, fpa, recipe)) { 68 68 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 69 69 zeropt = 0.0; -
trunk/psastro/src/psastroExtractGhosts.c
r24648 r41367 53 53 54 54 // really error-out here? or just skip? 55 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, fpa, recipe)) {55 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, NULL, fpa, recipe)) { 56 56 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 57 57 return false; -
trunk/psastro/src/psastroExtractStars.c
r24648 r41367 65 65 66 66 // really error-out here? or just skip? 67 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, fpa, recipe)) {67 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, NULL, fpa, recipe)) { 68 68 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 69 69 return false; -
trunk/psastro/src/psastroLoadCrosstalk.c
r36837 r41367 94 94 95 95 // really error-out here? or just skip? 96 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, &MAX_MAG, fpa, recipe)) {96 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, &MAX_MAG, NULL, fpa, recipe)) { 97 97 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 98 98 goto escape; -
trunk/psastro/src/psastroLoadGhosts.c
r41348 r41367 113 113 pmFPAview *view = pmFPAviewAlloc (0); 114 114 115 GET_1D_POLY ("GHOST.MIRROR.RAD", mirrorRad); 115 //We need to check whether we are dealing with an old style ghost_model, or a new style model. Check if the mirror_rad polynomial exists 116 float mirCheck = 0; 117 md = psMetadataLookupMetadata (&status, ghostModel, "GHOST.MIRROR.RAD"); 118 if (!md) { psLogMsg ("psastro", PS_LOG_INFO, "No ghost mirror_rad polynomial found. Assuming old-style ghost masking"); } 119 if (md) { 120 GET_1D_POLY ("GHOST.MIRROR.RAD", mirrorRad); 121 mirCheck = 1; 122 } 123 116 124 GET_2D_POLY ("GHOST.CENTER.X", centerX); 117 125 GET_2D_POLY ("GHOST.CENTER.Y", centerY); … … 131 139 132 140 // raise an error if the config is broken 133 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, &MAX_MAG, fpa, recipe)) {141 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, &MAX_MAG, NULL, fpa, recipe)) { 134 142 psError(PSASTRO_ERR_CONFIG, true, "failed to load zeropt data from recipe"); 135 143 goto escape; … … 179 187 ghost->srcFP->y = ref->FP->y; 180 188 181 //TdB: first mirror the reference star positions (around the 0,0 pixel) using the radial offset coefficients and the ghost/star angle182 189 double rSrc = hypot (ref->FP->x, ref->FP->y); 183 190 double theta0 = atan2(ref->FP->y,ref->FP->x); 184 191 185 double ghost_offset_rad = psPolynomial1DEval (mirrorRad, rSrc); 186 double ghost_x_fpa_mirror = ref->FP->x + ((ref->FP->x*-1.)/abs(ref->FP->x)*abs(cos(theta0)*ghost_offset_rad)); 187 double ghost_y_fpa_mirror = ref->FP->y + ((ref->FP->y*-1.)/abs(ref->FP->y)*abs(sin(theta0)*ghost_offset_rad)); 188 189 // Now use the mirrored position together with the 2D ghost center fitting to get the actual ghost position in FPA coords 190 ghost->FP->x = ghost_x_fpa_mirror + psPolynomial2DEval(centerX, ghost_x_fpa_mirror, ghost_y_fpa_mirror); 191 ghost->FP->y = ghost_y_fpa_mirror + psPolynomial2DEval(centerY, ghost_x_fpa_mirror, ghost_y_fpa_mirror); 192 if(mirCheck) { 193 //TdB: first mirror the reference star positions (around the 0,0 pixel) using the radial offset coefficients and the ghost/star angle 194 double ghost_offset_rad = psPolynomial1DEval (mirrorRad, rSrc); 195 double ghost_x_fpa_mirror = ref->FP->x + ((ref->FP->x*-1.)/abs(ref->FP->x)*abs(cos(theta0)*ghost_offset_rad)); 196 double ghost_y_fpa_mirror = ref->FP->y + ((ref->FP->y*-1.)/abs(ref->FP->y)*abs(sin(theta0)*ghost_offset_rad)); 197 198 // Now use the mirrored position together with the 2D ghost center fitting to get the actual ghost position in FPA coords 199 ghost->FP->x = ghost_x_fpa_mirror + psPolynomial2DEval(centerX, ghost_x_fpa_mirror, ghost_y_fpa_mirror); 200 ghost->FP->y = ghost_y_fpa_mirror + psPolynomial2DEval(centerY, ghost_x_fpa_mirror, ghost_y_fpa_mirror); 201 } 202 if(!mirCheck) { 203 //Use the old-style ghost position determination 204 ghost->FP->x = -ref->FP->x + psPolynomial2DEval(centerX, -ref->FP->x, -ref->FP->y); 205 ghost->FP->y = -ref->FP->y + psPolynomial2DEval(centerY, -ref->FP->x, -ref->FP->y); 206 } 192 207 193 208 ghost->inner.major = psPolynomial1DEval (innerMajor, rSrc); … … 210 225 ghostChip = psastroFindChip (&ghost->chip->x, &ghost->chip->y, fpa, ghost->FP->x, ghost->FP->y); 211 226 // fprintf (stderr, "-> model chip position: %f, %f\n", ghost->chip->x, ghost->chip->y); 227 212 228 213 229 if (ghostChip) { … … 356 372 357 373 // if a filter is defined, but the recipe elements are missing, the config is broken. 358 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, &MAX_MAG, fpa, recipe)) {374 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, &MAX_MAG, NULL, fpa, recipe)) { 359 375 psError(PSASTRO_ERR_CONFIG, true, "failed to load zeropt data from recipe"); 360 376 goto escape; -
trunk/psastro/src/psastroLoadGlints.c
r41348 r41367 26 26 bool status; 27 27 float zeropt, exptime; 28 psVector *x_glint = psVectorAlloc(2,PS_TYPE_F32); 29 psVector *y_glint = psVectorAlloc(2,PS_TYPE_F32); 28 30 29 31 psLogMsg ("psastro", PS_LOG_INFO, "determine glint positions"); … … 39 41 if (!REFSTAR_MASK_GLINTS) return true; 40 42 41 // select the limiting magnitude43 // select relevant keywords 42 44 double GLINT_MAX_MAG = psMetadataLookupF32 (&status, recipe, "GLINT_MAX_MAG"); 43 45 double GLINT_LENGTH_MAG_SLOPE = psMetadataLookupF32 (&status, recipe, "GLINT_LENGTH_MAG_SLOPE"); 44 46 double GLINT_LENGTH_MAG_ZERO = psMetadataLookupF32 (&status, recipe, "GLINT_LENGTH_MAG_ZERO"); 47 double glintWidth = psMetadataLookupF32 (&status, recipe, "GLINT_WIDTH"); 48 double pixelScale = psMetadataLookupF32 (&status, recipe, "PSASTRO.PIXEL.SCALE"); 49 50 //we will use one of the new keywords to differentiate between an old and new style glint treatment 51 float glintCheck = 0; 45 52 double GLINT_LENGTH_POS_SLOPE = psMetadataLookupF32 (&status, recipe, "GLINT_LENGTH_POS_SLOPE"); 53 if (!status) { 54 psLogMsg ("psastro", PS_LOG_INFO, "Assuming old-style glint masking, given the recipe keywords"); 55 glintCheck = 1; 56 } 46 57 double GLINT_LENGTH_POS_REF = psMetadataLookupF32 (&status, recipe, "GLINT_LENGTH_POS_REF"); 58 double GLINT_LENGTH_POS_CUT = psMetadataLookupF32 (&status, recipe, "GLINT_LENGTH_POS_CUT"); 59 double GLINT_LENGTH_MIN_FPA = psMetadataLookupF32 (&status, recipe, "GLINT_LENGTH_MIN_FPA"); 60 if (!status) GLINT_LENGTH_MIN_FPA=1000.; 47 61 double GLINT_ANGLE_POS_SLOPE = psMetadataLookupF32 (&status, recipe, "GLINT_ANGLE_POS_SLOPE"); 48 62 double GLINT_ANGLE_POS_REF = psMetadataLookupF32 (&status, recipe, "GLINT_ANGLE_POS_REF"); 49 double glintWidth = psMetadataLookupF32 (&status, recipe, "GLINT_WIDTH"); 50 double pixelScale = psMetadataLookupF32 (&status, recipe, "PSASTRO.PIXEL.SCALE"); 63 51 64 52 65 // select the set of glint regions (GLINT.REGION is a MULTI of METADATA items) … … 70 83 71 84 // really error-out here? or just skip? 72 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, fpa, recipe)) {85 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, &GLINT_MAX_MAG, fpa, recipe)) { 73 86 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 74 87 return false; … … 79 92 float MagOffset = zeropt + 2.5*log10(exptime); 80 93 GLINT_MAX_MAG += MagOffset; 81 GLINT_LENGTH_MAG_ZERO += MagOffset;94 //GLINT_LENGTH_MAG_ZERO += MagOffset; 82 95 83 96 // select the raw objects for this readout (loaded in psastroExtract.c) … … 91 104 psastroChipBounds (fpa); 92 105 93 94 106 // find the possible glint stars, and convert the position to FPA coordinates. 95 107 // search for stars within the glint regions … … 97 109 98 110 pmAstromObj *star = glintStars->data[i]; 99 if (star->Mag > GLINT_MAX_MAG) continue; // XXX should not be needed...111 if (star->Mag > GLINT_MAX_MAG) continue; 100 112 101 113 // project glint star to the focal-plane 102 114 psProject (star->TP, star->sky, fpa->toSky); 103 115 psPlaneTransformApply (star->FP, fpa->fromTPA, star->TP); 104 fprintf (stderr, "glint: %7.2f @ %8.1f, %8.1f (%f %f) %8.1f %8.1f\n", star->Mag, star->FP->x, star->FP->y, star->sky->r * PS_DEG_RAD, star->sky->d * PS_DEG_RAD, star->TP->x,star->TP->y);116 //fprintf (stderr, "glint: %7.2f @ %8.1f, %8.1f (%f %f) %8.1f %8.1f\n", star->Mag, star->FP->x, star->FP->y, star->sky->r * PS_DEG_RAD, star->sky->d * PS_DEG_RAD, star->TP->x,star->TP->y); 105 117 106 118 // find the GLINT.REGION this star lands in (if any) … … 132 144 } 133 145 134 double glintLength = GLINT_LENGTH_MAG_SLOPE*(GLINT_LENGTH_MAG_ZERO - star->Mag); 146 //double glintLength = GLINT_LENGTH_MAG_SLOPE*(GLINT_LENGTH_MAG_ZERO - star->Mag); 147 //glint length should depend on the brightness on image, i.e. in instrumental mag. The same instrumental mag in different filters should likely give the same glint length. 148 double glintLength = GLINT_LENGTH_MAG_SLOPE*(GLINT_LENGTH_MAG_ZERO - (star->Mag-MagOffset)); 135 149 double glintAngle = 0; 136 150 137 //Besides brightness, the length of the glints also depends on the position of the star compared to the focal plane. But, seemingly only for stars closer than 30k pixels138 if ((!strcasecmp(glintType, "TOP") || !strcasecmp(glintType, "BOTTOM")) && abs(star->FP->y) < 30000 ){ 139 glintLength /= GLINT_LENGTH_POS_SLOPE*(GLINT_LENGTH_POS_REF - abs(star->FP->y)); 140 141 }142 if ((!strcasecmp(glintType, "LEFT") || !strcasecmp(glintType, "RIGHT")) && abs(star->FP->x) < 30000) {143 glintLength /= GLINT_LENGTH_POS_SLOPE*(GLINT_LENGTH_POS_REF - abs(star->FP->x));144 }145 //also compute the angle of the glint, which depends on position parallel to the FPX146 if (!strcasecmp(glintType, "TOP") || !strcasecmp(glintType, "BOTTOM") ){147 glintAngle = PM_RAD_DEG * (GLINT_ANGLE_POS_SLOPE*((GLINT_ANGLE_POS_REF - star->FP->x)/1000.));148 149 } 150 if (!strcasecmp(glintType, "LEFT") || !strcasecmp(glintType, "RIGHT") ) { 151 glintAngle = PM_RAD_DEG * (GLINT_ANGLE_POS_SLOPE*((GLINT_ANGLE_POS_REF - star->FP->y)/1000.));151 //Besides brightness, the length of the glints also depends on the position of the star compared to the focal plane. But, seemingly only for stars closer than about 30k pixels 152 if(glintCheck) { 153 if ((!strcasecmp(glintType, "TOP") || !strcasecmp(glintType, "BOTTOM")) && abs(star->FP->y) < GLINT_LENGTH_POS_CUT ){ 154 glintLength /= GLINT_LENGTH_POS_SLOPE*(GLINT_LENGTH_POS_REF - abs(star->FP->y)); 155 } 156 if ((!strcasecmp(glintType, "LEFT") || !strcasecmp(glintType, "RIGHT")) && abs(star->FP->x) < GLINT_LENGTH_POS_CUT ) { 157 glintLength /= GLINT_LENGTH_POS_SLOPE*(GLINT_LENGTH_POS_REF - abs(star->FP->x)); 158 } 159 //also compute the angle of the glint, which depends on position parallel to the FPX 160 if (!strcasecmp(glintType, "TOP") || !strcasecmp(glintType, "BOTTOM") ){ 161 glintAngle = PM_RAD_DEG * (GLINT_ANGLE_POS_SLOPE*((GLINT_ANGLE_POS_REF - star->FP->x)/1000.)); 162 } 163 if (!strcasecmp(glintType, "LEFT") || !strcasecmp(glintType, "RIGHT") ) { 164 glintAngle = PM_RAD_DEG * (GLINT_ANGLE_POS_SLOPE*((GLINT_ANGLE_POS_REF - star->FP->y)/1000.)); 165 } 152 166 } 153 167 … … 157 171 if (!strcasecmp(glintType, "LEFT") && ((star->FP->x + glintLength) < -20000.)) continue; 158 172 if (!strcasecmp(glintType, "RIGHT") && ((star->FP->x - glintLength) > 20000.)) continue; 159 160 psVector *x_glint = psVectorAlloc(2,PS_TYPE_F32);161 psVector *y_glint = psVectorAlloc(2,PS_TYPE_F32);162 173 163 174 if (!strcasecmp(glintType, "TOP") || !strcasecmp(glintType, "BOTTOM")) { … … 220 231 yFPA1 = yFPA0 + glintLength*cos(glintAngle); 221 232 } 233 234 if(glintLength < GLINT_LENGTH_MIN_FPA) continue; 222 235 223 236 x_glint->data.F32[0] = xFPA0; … … 294 307 psFree (glints); 295 308 } 296 297 fprintf (stderr, "glint %s : %d %f,%f to %f,%f (%f %f %f)\n", glintType, nChip, xChip0, yChip0, xChip1, yChip1, glint_length, glintWidth, chip_angle); 298 psVector *glint = psVectorAlloc(5,PS_TYPE_F32); 309 psVector *glint = psVectorAlloc(5,PS_TYPE_F32); 299 310 glint->data.F32[0] = xChip0; 300 311 glint->data.F32[1] = yChip0; … … 369 380 yFPA1 = yFPA0 + glintLength*sin(glintAngle*-1.); 370 381 } 382 383 if(glintLength < GLINT_LENGTH_MIN_FPA) continue; 371 384 372 385 x_glint->data.F32[0] = xFPA0; … … 441 454 } 442 455 443 fprintf (stderr, "glint %s : %d %f,%f to %f,%f (%f %f %f)\n", glintType, nChip, xChip0, yChip0, xChip1, yChip1, glint_length, glintWidth, chip_angle);444 445 456 psVector *glint = psVectorAlloc(5,PS_TYPE_F32); 446 457 glint->data.F32[0] = xChip0; -
trunk/psastro/src/psastroMaskUpdates.Mosaic.c
r21183 r41367 56 56 57 57 // really error-out here? or just skip? 58 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, fpa, recipe)) {58 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, NULL, fpa, recipe)) { 59 59 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 60 60 return false; -
trunk/psastro/src/psastroMaskUpdates.c
r41348 r41367 184 184 185 185 // really error-out here? or just skip? 186 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, &GHOST_MAX_MAG, fpa, recipe)) {186 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, &GHOST_MAX_MAG, NULL, fpa, recipe)) { 187 187 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 188 188 return false; … … 443 443 //psLogMsg ("psastro", 3, "glint: %f %f %f %f\n", glint->x0, glint->y0, glint->x1, glint->y1); 444 444 //psastroMaskRectangle (readoutMask->mask, glintMaskValue, glint->x0, glint->y0, glint->x1, glint->y1); 445 446 psLogMsg ("psastro", 3, "glint: %d %f %f %f %f %f\n",i, glint->data.F32[0], glint->data.F32[1],glint->data.F32[2], glint->data.F32[3], glint->data.F32[4]);447 445 psastroMaskBox (readoutMask->mask, glintMaskValue, glint->data.F32[0], glint->data.F32[1], 448 446 glint->data.F32[2], glint->data.F32[3], glint->data.F32[4]); -
trunk/psastro/src/psastroZeroPoint.c
r37552 r41367 55 55 56 56 // really error-out here? or just skip? 57 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, fpa, recipe)) {57 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, NULL, fpa, recipe)) { 58 58 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 59 59 return false; … … 480 480 return false; } 481 481 482 bool psastroZeroPointFromRecipe (float *zeropt, float *exptime, float *ghostMaxMag, pmFPA *fpa, psMetadata *recipe) {482 bool psastroZeroPointFromRecipe (float *zeropt, float *exptime, float *ghostMaxMag, double *glintMaxMag, pmFPA *fpa, psMetadata *recipe) { 483 483 484 484 bool status; … … 527 527 //MEH null is a pain.. so only log if set 528 528 psLogMsg ("psastro", PS_LOG_INFO, "found GHOST_MAX_MAG %f",*ghostMaxMag); 529 } 530 if (glintMaxMag) { 531 float MaxMag = psMetadataLookupF32 (&status, refItem->data.md, "GLINT_MAX_MAG"); 532 if (status) { 533 *glintMaxMag = MaxMag ; 534 //MEH null is a pain.. so only log if set 535 psLogMsg ("psastro", PS_LOG_INFO, "found GLINT_MAX_MAG %f",*glintMaxMag); 536 } 529 537 } 530 538 //MEH what zpt is set to
Note:
See TracChangeset
for help on using the changeset viewer.
