Changeset 33852
- Timestamp:
- May 8, 2012, 5:36:55 PM (14 years ago)
- Location:
- tags/ipp-20120404
- Files:
-
- 17 edited
-
ippconfig/gpc1/ghost.model.mdc (modified) (2 diffs)
-
ippconfig/gpc1/ppImage.config (modified) (1 diff)
-
ippconfig/gpc1/psastro.config (modified) (1 diff)
-
ippconfig/recipes/filerules-mef.mdc (modified) (1 diff)
-
ippconfig/recipes/filerules-simple.mdc (modified) (1 diff)
-
ippconfig/recipes/filerules-split.mdc (modified) (2 diffs)
-
ippconfig/recipes/ppImage.config (modified) (1 diff)
-
ppImage/src/ppImage.h (modified) (1 diff)
-
ppImage/src/ppImageDetrendReadout.c (modified) (3 diffs)
-
ppImage/src/ppImageOptions.c (modified) (3 diffs)
-
ppImage/src/ppImageParseCamera.c (modified) (2 diffs)
-
psModules/src/detrend/pmDetrendDB.c (modified) (1 diff)
-
psModules/src/detrend/pmDetrendDB.h (modified) (1 diff)
-
psastro/src/psastroLoadCrosstalk.c (modified) (4 diffs)
-
psastro/src/psastroLoadGhosts.c (modified) (3 diffs)
-
psastro/src/psastroMaskUpdates.c (modified) (1 diff)
-
psastro/src/psastroMaskUtils.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20120404/ippconfig/gpc1/ghost.model.mdc
r23814 r33852 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 17 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 33 34 # Updated models of 2012-05-07 35 # Corrected(?) parity 36 # GHOST.CENTER.X METADATA 37 # NORDER_X S32 3 38 # NORDER_Y S32 3 39 # VAL_X00_Y00 F64 3.314569e+01 40 # VAL_X01_Y00 F64 1.110664e-02 41 # VAL_X02_Y00 F64 -1.904158e-07 42 # VAL_X03_Y00 F64 8.470224e-11 43 # VAL_X00_Y01 F64 -1.616877e-03 44 # VAL_X01_Y01 F64 1.646508e-07 45 # VAL_X02_Y01 F64 5.623381e-11 46 # VAL_X00_Y02 F64 -2.342888e-07 47 # VAL_X01_Y02 F64 1.023761e-10 48 # VAL_X00_Y03 F64 2.836980e-11 49 # NELEMENTS S32 10 50 # END 51 52 # GHOST.CENTER.Y METADATA 53 # NORDER_X S32 3 54 # NORDER_Y S32 3 55 # VAL_X00_Y00 F64 -2.860068e+01 56 # VAL_X01_Y00 F64 -8.790076e-03 57 # VAL_X02_Y00 F64 2.456534e-07 58 # VAL_X03_Y00 F64 2.947749e-11 59 # VAL_X00_Y01 F64 1.948855e-02 60 # VAL_X01_Y01 F64 -2.639927e-07 61 # VAL_X02_Y01 F64 4.951474e-11 62 # VAL_X00_Y02 F64 4.341716e-07 63 # VAL_X01_Y02 F64 1.643046e-10 64 # VAL_X00_Y03 F64 -1.737983e-12 65 # NELEMENTS S32 10 66 # END 67 68 # Switched order 1 69 GHOST.CENTER.X METADATA 2 70 NORDER_X S32 3 3 71 NORDER_Y S32 3 4 VAL_X00_Y00 F64 - 4.421024e+015 VAL_X01_Y00 F64 1.216270e-026 VAL_X02_Y00 F64 - 9.721643e-087 VAL_X03_Y00 F64 9.976554e-118 VAL_X00_Y01 F64 -1. 762476e-039 VAL_X01_Y01 F64 1.247212e-0710 VAL_X02_Y01 F64 3.629557e-1111 VAL_X00_Y02 F64 -1.040174e-0712 VAL_X01_Y02 F64 1.074674e-1013 VAL_X00_Y03 F64 1.564112e-1172 VAL_X00_Y00 F64 -1.215661e+02 73 VAL_X01_Y00 F64 1.321875e-02 74 VAL_X02_Y00 F64 -4.017026e-09 75 VAL_X03_Y00 F64 1.148288e-10 76 VAL_X00_Y01 F64 -1.908074e-03 77 VAL_X01_Y01 F64 8.479150e-08 78 VAL_X02_Y01 F64 1.635732e-11 79 VAL_X00_Y02 F64 2.625405e-08 80 VAL_X01_Y02 F64 1.125586e-10 81 VAL_X00_Y03 F64 2.912432e-12 14 82 NELEMENTS S32 10 15 83 END … … 18 86 NORDER_X S32 3 19 87 NORDER_Y S32 3 20 VAL_X00_Y00 F64 -2.189470e+0021 VAL_X01_Y00 F64 -4.186514e-0322 VAL_X02_Y00 F64 1.131554e-0723 VAL_X03_Y00 F64 1.415192e-1124 VAL_X00_Y01 F64 1.569104e-0225 VAL_X01_Y01 F64 - 1.782801e-0726 VAL_X02_Y01 F64 8.179602e-1127 VAL_X00_Y02 F64 2.577055e-0728 VAL_X01_Y02 F64 8.879423e-1129 VAL_X00_Y03 F64 5.767429e-1188 VAL_X00_Y00 F64 2.422174e+01 89 VAL_X01_Y00 F64 4.170486e-04 90 VAL_X02_Y00 F64 -1.934260e-08 91 VAL_X03_Y00 F64 -1.173657e-12 92 VAL_X00_Y01 F64 1.189352e-02 93 VAL_X01_Y01 F64 -9.256748e-08 94 VAL_X02_Y01 F64 1.140772e-10 95 VAL_X00_Y02 F64 8.123932e-08 96 VAL_X01_Y02 F64 1.328378e-11 97 VAL_X00_Y03 F64 1.170865e-10 30 98 NELEMENTS S32 10 31 99 END 32 100 101 102 103 # These are semi-major/minor axes 104 # These are my (CZW) quadratic solutions 105 # GHOST.INNER.MAJOR METADATA 106 # NORDER_X S32 2 107 # VAL_X00 F64 2.2622e+01 108 # VAL_X01 F64 1.3822e-02 109 # VAL_X02 F64 -3.7005e-07 110 # NELEMENTS S32 3 111 # END 112 113 # GHOST.INNER.MINOR METADATA 114 # NORDER_X S32 2 115 # VAL_X00 F64 4.9626e+01 116 # VAL_X01 F64 -2.4257e-04 117 # VAL_X02 F64 -1.2007e-07 118 # NELEMENTS S32 3 119 # END 120 121 # GHOST.OUTER.MAJOR METADATA 122 # NORDER_X S32 2 123 # VAL_X00 F64 9.6490e+01 124 # VAL_X01 F64 9.4250e-03 125 # VAL_X02 F64 6.5680e-07 126 # NELEMENTS S32 3 127 # END 128 129 # GHOST.OUTER.MINOR METADATA 130 # NORDER_X S32 2 131 # VAL_X00 F64 9.5450e+01 132 # VAL_X01 F64 2.8775e-03 133 # VAL_X02 F64 -3.1409e-07 134 # NELEMENTS S32 3 135 # END 136 137 # These are the original linear solutions 33 138 GHOST.INNER.MAJOR METADATA 34 139 NORDER_X S32 1 -
tags/ipp-20120404/ippconfig/gpc1/ppImage.config
r33642 r33852 25 25 NOISEMAP BOOL FALSE # Apply read noise map 26 26 27 27 # Final detrending options 28 HAS.VIDEO BOOL FALSE # Treat this OTA as if it has video data 29 USE.VIDEO.DARK BOOL FALSE # Use a video dark if we have video data? 30 USE.VIDEO.MASK BOOL TRUE # Use a video mask if we have video data? 28 31 29 32 -
tags/ipp-20120404/ippconfig/gpc1/psastro.config
r33668 r33852 130 130 ZEROPT F32 24.563 131 131 PHOTCODE STR g 132 GHOST_MAX_MAG F32 - 20.0132 GHOST_MAX_MAG F32 -18.0 133 133 END 134 134 PHOTCODE.DATA METADATA -
tags/ipp-20120404/ippconfig/recipes/filerules-mef.mdc
r33636 r33852 59 59 PPIMAGE.INPUT.SRC INPUT @FILES CHIP CMF 60 60 PPIMAGE.MASK INPUT @DETDB CHIP MASK 61 PPIMAGE.VIDEOMASK INPUT @DETDB CHIP MASK 61 62 PPIMAGE.BIAS INPUT @DETDB CHIP IMAGE 62 63 PPIMAGE.DARK INPUT @DETDB CHIP DARK 64 PPIMAGE.VIDEODARK INPUT @DETDB CHIP DARK 63 65 PPIMAGE.FLAT INPUT @DETDB CHIP IMAGE 64 66 PPIMAGE.FRINGE INPUT @DETDB CHIP FRINGE -
tags/ipp-20120404/ippconfig/recipes/filerules-simple.mdc
r33636 r33852 23 23 PPIMAGE.INPUT.SRC INPUT @FILES READOUT CMF 24 24 PPIMAGE.MASK INPUT @DETDB CHIP MASK 25 PPIMAGE.VIDEOMASK INPUT @DETDB CHIP MASK 25 26 PPIMAGE.BIAS INPUT @DETDB CHIP IMAGE 26 27 PPIMAGE.DARK INPUT @DETDB CHIP DARK 28 PPIMAGE.VIDEODARK INPUT @DETDB CHIP DARK 27 29 PPIMAGE.FLAT INPUT @DETDB CHIP IMAGE 28 30 PPIMAGE.FRINGE INPUT @DETDB CHIP FRINGE -
tags/ipp-20120404/ippconfig/recipes/filerules-split.mdc
r33690 r33852 36 36 PPIMAGE.INPUT INPUT @FILES CHIP IMAGE 37 37 PPIMAGE.INPUT.MASK INPUT @FILES CHIP MASK 38 PPIMAGE.VIDEOMASK INPUT @DETDB CHIP MASK 38 39 PPIMAGE.INPUT.VARIANCE INPUT @FILES CHIP VARIANCE 39 40 PPIMAGE.INPUT.PSF INPUT @FILES CHIP PSF … … 43 44 PPIMAGE.NOISEMAP INPUT @DETDB CHIP IMAGE 44 45 PPIMAGE.DARK INPUT @DETDB CHIP DARK 46 PPIMAGE.VIDEODARK INPUT @DETDB CHIP DARK 45 47 PPIMAGE.FLAT INPUT @DETDB CHIP IMAGE 46 48 PPIMAGE.FRINGE INPUT @DETDB CHIP FRINGE -
tags/ipp-20120404/ippconfig/recipes/ppImage.config
r33642 r33852 153 153 154 154 GAIN.OVERRIDE BOOL FALSE # Override a non-finite gain? 155 156 # Final detrending options 157 HAS.VIDEO BOOL FALSE # Treat this OTA as if it has video data 158 USE.VIDEO.DARK BOOL FALSE # Use a video dark if we have video data? 159 USE.VIDEO.MASK BOOL FALSE # Use a video mask if we have video data? 155 160 156 161 DETREND.CONSTRAINTS METADATA -
tags/ipp-20120404/ppImage/src/ppImage.h
r33590 r33852 57 57 bool addNoise; // Add noise to degrade MD image to 3pi 58 58 59 bool hasVideo; // Determine if this OTA has a video cell 60 bool useVideoDark; // Should we use a video dark if we can? 61 bool useVideoMask; // Should we use a video mask if we can? 62 59 63 // output files requested 60 64 bool BaseFITS; -
tags/ipp-20120404/ppImage/src/ppImageDetrendReadout.c
r33590 r33852 35 35 } 36 36 } 37 37 // Check to see if we're in a chip that contains video 38 bool hasVideo = false; 39 { 40 if (psMetadataLookupStr(NULL,input->parent->parent->hdu->header,"CELLMODE")) { 41 psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); 42 char *Vptr = strchr(psMetadataLookupStr(NULL,input->parent->parent->hdu->header,"CELLMODE"),'V'); 43 if (Vptr) { 44 hasVideo = true; 45 psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); 46 } 47 } 48 } 49 50 38 51 // Masking on the basis of pixel value needs to be done before anything else, so the values are pristine. 39 52 if (options->doMaskBuild) { … … 44 57 // apply the externally supplied mask to the input->mask pixels 45 58 if (options->doMask) { 46 pmReadout *mask = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.MASK"); 47 pmMaskBadPixels(input, mask, options->maskValue); 59 pmReadout *mask; 60 if ((options->useVideoMask)&&(hasVideo)) { 61 mask = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.VIDEOMASK"); 62 } 63 else { 64 mask = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.MASK"); 65 } 66 pmMaskBadPixels(input, mask, options->maskValue); 48 67 } 49 68 if (options->doMaskBurntool) { … … 80 99 psMetadata *recipe = psMetadataLookupPtr (&mdok, config->recipes, RECIPE_NAME); 81 100 assert(mdok && recipe); 82 if (psMetadataLookupBool(&mdok, recipe, "OLDDARK")) { 101 102 if ((options->useVideoDark)&&(hasVideo)) { 103 if (psMetadataLookupBool(&mdok, recipe, "OLDDARK")) { 104 oldDark = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.VIDEODARK"); 105 } else { 106 dark = pmFPAfileThisCell(config->files, detview, "PPIMAGE.VIDEODARK"); 107 } 108 } 109 else { 110 if (psMetadataLookupBool(&mdok, recipe, "OLDDARK")) { 83 111 oldDark = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.DARK"); 84 } else {112 } else { 85 113 dark = pmFPAfileThisCell(config->files, detview, "PPIMAGE.DARK"); 86 } 114 } 115 } 87 116 } 88 117 -
tags/ipp-20120404/ppImage/src/ppImageOptions.c
r33590 r33852 45 45 options->doMaskStats = false; // Calculate mask fractions 46 46 options->addNoise = false; //Degrade an MD image to a 3pi image 47 47 options->hasVideo = false; // Determine if this OTA has a video cell 48 options->useVideoDark = false; // Use video dark if we can? 49 options->useVideoMask = false; // Use video mask if we can? 48 50 // output files requested 49 51 options->BaseFITS = false; // create output image … … 362 364 options->fringeKeep = psMetadataLookupF32(NULL, recipe, "FRINGE.KEEP"); 363 365 366 // Video cell options 367 if (psMetadataLookup(recipe, "USE.VIDEO.DARK")) { 368 options->useVideoDark = psMetadataLookupBool(NULL,recipe,"USE.VIDEO.DARK"); 369 } 370 if (psMetadataLookup(recipe, "USE.VIDEO.MASK")) { 371 options->useVideoMask = psMetadataLookupBool(NULL,recipe,"USE.VIDEO.MASK"); 372 } 373 364 374 // Pattern correction 365 375 if (psMetadataLookup(format, "PATTERN.ROW.ORDER")) { … … 418 428 options->patternContinuityEdgeWidth = psMetadataLookupS32(NULL, recipe, "PATTERN.CONTINUITY.WIDTH"); 419 429 } 420 430 421 431 422 432 // Remnance options -
tags/ipp-20120404/ppImage/src/ppImageParseCamera.c
r29833 r33852 22 22 ppImageOptions *options = ppImageOptionsParse(config); 23 23 24 // parse the header to extract out whether this OTA has video cells. 25 // CZW: 2012-05-01 I'm somewhat ashamed of what needs to be done to get to the header. There has to be a simpler way, right? 26 /* pmFPAview *view = pmFPAviewAlloc(0);// View for level of interest */ 27 /* pmChip *chip; // Chip from FPA */ 28 /* while ((chip = pmFPAviewNextChip(view, input->fpa, 1)) != NULL) { */ 29 /* if (!chip->process || !chip->file_exists) { */ 30 /* continue; */ 31 /* } */ 32 /* /\* if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { *\/ */ 33 /* /\* continue; *\/ */ 34 /* /\* } *\/ */ 35 /* psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); */ 36 /* if (psMetadataLookupStr(NULL,chip->hdu->header,"CELLMODE")) { */ 37 /* psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); */ 38 /* char *Vptr = strchr(psMetadataLookupStr(NULL,chip->hdu->header,"CELLMODE"),'V'); */ 39 /* if (Vptr) { */ 40 /* options->hasVideo = true; */ 41 /* psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); */ 42 /* } */ 43 /* } */ 44 /* } */ 45 /* pmFPAviewReset(view); */ 46 /* psFree(view); */ 47 24 48 // the following are defined from the argument list, if given, 25 49 // otherwise they revert to the config information … … 42 66 } 43 67 if (options->doDark) { 44 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.DARK", "DARK", 45 PM_FPA_FILE_DARK, PM_DETREND_TYPE_DARK)) { 68 // Always load the regular Dark 69 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.DARK", "DARK", 70 PM_FPA_FILE_DARK, PM_DETREND_TYPE_DARK)) { 71 psError(PS_ERR_IO, false, "Can't find a dark image source"); 72 psFree(options); 73 return NULL; 74 } 75 // Sometimes load the video dark if we need it. 76 if (options->useVideoDark) { 77 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.VIDEODARK", "DARK", 78 PM_FPA_FILE_DARK, PM_DETREND_TYPE_VIDEODARK)) { 46 79 psError(PS_ERR_IO, false, "Can't find a dark image source"); 47 80 psFree(options); 48 81 return NULL; 49 82 } 83 } 50 84 } 51 85 if (options->doMask) { 52 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.MASK", "MASK", 53 PM_FPA_FILE_MASK, PM_DETREND_TYPE_MASK)) { 86 // Always load the regular mask 87 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.MASK", "MASK", 88 PM_FPA_FILE_MASK, PM_DETREND_TYPE_MASK)) { 89 psError(PS_ERR_IO, false, "Can't find a mask image source"); 90 psFree(options); 91 return NULL; 92 } 93 94 if (options->useVideoMask) { 95 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.VIDEOMASK", "MASK", 96 PM_FPA_FILE_MASK, PM_DETREND_TYPE_VIDEOMASK)) { 54 97 psError(PS_ERR_IO, false, "Can't find a mask image source"); 55 98 psFree(options); 56 99 return NULL; 57 100 } 101 } 58 102 } 59 103 if (options->doShutter) { -
tags/ipp-20120404/psModules/src/detrend/pmDetrendDB.c
r31067 r33852 107 107 DETREND_STRING_CASE(ASTROM); 108 108 DETREND_STRING_CASE(NOISEMAP); 109 DETREND_STRING_CASE(VIDEOMASK); 110 DETREND_STRING_CASE(VIDEODARK); 109 111 DETREND_STRING_CASE(LINEARITY); 110 112 default: -
tags/ipp-20120404/psModules/src/detrend/pmDetrendDB.h
r29833 r33852 36 36 PM_DETREND_TYPE_ASTROM, 37 37 PM_DETREND_TYPE_NOISEMAP, 38 PM_DETREND_TYPE_VIDEOMASK, 39 PM_DETREND_TYPE_VIDEODARK, 38 40 PM_DETREND_TYPE_LINEARITY, 39 41 } pmDetrendType; -
tags/ipp-20120404/psastro/src/psastroLoadCrosstalk.c
r26826 r33852 53 53 pmFPAview *viewMask = pmFPAviewAlloc (0); 54 54 55 float zeropt, exptime, MAX_MAG ;55 float zeropt, exptime, MAX_MAG, SPIKE_MAX_MAG; 56 56 57 57 psLogMsg ("psastro", PS_LOG_INFO, "determine crosstalk positions"); … … 105 105 MAX_MAG += MagOffset; 106 106 107 // Get the spike maximum, as well 108 SPIKE_MAX_MAG = psMetadataLookupF32(&status, recipe, "REFSTAR_MASK_BLEED_MAG_MAX"); 109 SPIKE_MAX_MAG += MagOffset; 110 107 111 psTrace("psastro.crosstalk",2,"%f %f %f %f\n",zeropt,exptime,MAX_MAG,MagOffset); 108 112 … … 259 263 260 264 pmAstromObj *crosstalk = pmAstromObjAlloc(); 261 265 262 266 crosstalk->Mag = ref->Mag - MagOffset; 263 267 crosstalk->chip->x = x_t_chip; … … 274 278 } 275 279 psArrayAdd(crosstalks,100,crosstalk); 276 280 277 281 psFree(targetChipName); 278 282 psFree(targetCellName); 279 283 psFree(crosstalk); 284 285 // Determine if we need to add a spike mask. 286 /* psWarning("BLAH: %g %g %g\n",ref->Mag,MagOffset,SPIKE_MAX_MAG); */ 287 if (ref->Mag < SPIKE_MAX_MAG) { 288 if ((X == 2)&&(! ((U == 3)||(U == 5)||(U == 6)))) { 289 psTrace ("psastro.crosstalk",2,"Cell (%d%d) on chip (%d%d) not a known crosstalk source.",U,V,X,Y); 290 continue; 291 } 292 if ((X == 3)&&(! ((U == 3)))) { 293 psTrace ("psastro.crosstalk",2,"Cell (%d%d) on chip (%d%d) not a known crosstalk source.",U,V,X,Y); 294 continue; 295 } 296 if ((X == 4)&&(! ((U == 3)))) { 297 psTrace ("psastro.crosstalk",2,"Cell (%d%d) on chip (%d%d) not a known crosstalk source.",U,V,X,Y); 298 continue; 299 } 300 if ((X == 5)&&(! ((U == 3)||(U == 5)||(U == 6)))) { 301 psTrace ("psastro.crosstalk",2,"Cell (%d%d) on chip (%d%d) not a known crosstalk source.",U,V,X,Y); 302 continue; 303 } 304 305 Xt = X; 306 Yt = Y; 307 Vt = V; 308 309 for (Ut = 0; Ut < 8; Ut++) { 310 311 psString targetChipName = NULL; 312 psStringAppend(&targetChipName,"XY%d%d",Xt,Yt); 313 psString targetCellName = NULL; 314 psStringAppend(&targetCellName,"xy%d%d",Ut,Vt); 315 316 psTrace ("psastro.crosstalk",2,"CTsource @ OTA%d%dxy%d%d@%f,%f CTtarget OTA%d%dxy%d%d@%f,%f [%s %s]", 317 X,Y,U,V,x_cell,y_cell,Xt,Yt,Ut,Vt,x_t_cell,y_t_cell, 318 targetChipName,targetCellName); 319 /* psWarning ("CT bleed ct @ OTA%d%dxy%d%d@%f,%f CTtarget OTA%d%dxy%d%d@%f,%f [%s %s]", */ 320 /* X,Y,U,V,x_cell,y_cell,Xt,Yt,Ut,Vt,x_t_cell,y_t_cell, */ 321 /* targetChipName,targetCellName); */ 322 323 pmCell *CTtargetCell = getCellByName (CTsourceChip,targetCellName); 324 if (!CTtargetCell) continue; 325 326 pmChipCoordsForCell(&x_t_chip,&y_t_chip,CTtargetCell,x_t_cell,y_t_cell); 327 328 psTrace ("psastro.crosstalk",2,"CTsource @ OTA%d%dxy%d%d@%f,%f CTtarget OTA%d%dxy%d%d@%f,%f ChipLoc: (%f,%f)", 329 X,Y,U,V,x_cell,y_cell,Xt,Yt,Ut,Vt,x_t_cell,y_t_cell,x_t_chip,y_t_chip); 330 331 // Hunt down the readout for the target, and save the chip position and magnitude of source star. 332 pmChip *targetChip = getChipByName(fpa,targetChipName); 333 if (!targetChip) continue; 334 if (!targetChip->cells) continue; 335 if (!targetChip->cells->n) continue; 336 337 pmCell *targetCell = targetChip->cells->data[0]; 338 if (!targetCell) continue; 339 if (!targetCell->readouts) continue; 340 if (!targetCell->readouts->n) continue; 341 pmReadout *targetReadout = targetCell->readouts->data[0]; 342 if (!targetReadout) continue; 343 344 pmAstromObj *crosstalk = pmAstromObjAlloc(); 345 346 crosstalk->Mag = ref->Mag; 347 crosstalk->chip->x = x_t_chip; 348 crosstalk->chip->y = y_t_chip; 349 350 psArray *crosstalks = psMetadataLookupPtr (&status, targetReadout->analysis, "PSASTRO.CROSSTALKS.SPIKES"); 351 if (crosstalks == NULL) { 352 crosstalks = psArrayAllocEmpty(100); 353 if (!psMetadataAdd(targetReadout->analysis,PS_LIST_TAIL,"PSASTRO.CROSSTALKS.SPIKES", PS_DATA_ARRAY, "crosstalk locations", crosstalks)) { 354 psError(PSASTRO_ERR_CONFIG, false, "failure to add crosstalks to readout"); 355 goto escape; 356 } 357 psFree(crosstalks); 358 } 359 psArrayAdd(crosstalks,100,crosstalk); 360 361 psFree(targetChipName); 362 psFree(targetCellName); 363 psFree(crosstalk); 364 } 365 } // End satspike crosstalks 366 367 280 368 } // refstars 281 369 } // readout -
tags/ipp-20120404/psastro/src/psastroLoadGhosts.c
r26259 r33852 128 128 for (int i = 0; i < refstars->n; i++) { 129 129 pmAstromObj *ref = refstars->data[i]; 130 psTrace("psastro.ghost",5,"Begin ghost %d/%ld: MAX_MAG: %g; ref_mag: %g @ (%.10g,%.10g)",i,refstars->n,MAX_MAG,ref->Mag,ref->sky->r * 180 / M_PI,ref->sky->d * 180.0 / M_PI); 130 131 if (ref->Mag > MAX_MAG) continue; 131 132 … … 163 164 pmChip *ghostChip = psastroFindChip (&ghost->chip->x, &ghost->chip->y, fpa, -ghost->srcFP->x, -ghost->srcFP->y); 164 165 // fprintf (stderr, "raw chip position: %f, %f ", ghost->chip->x, ghost->chip->y); 165 166 float ref_chip_x = ghost->chip->x; 167 float ref_chip_y = ghost->chip->y; 166 168 ghostChip = psastroFindChip (&ghost->chip->x, &ghost->chip->y, fpa, ghost->FP->x, ghost->FP->y); 167 169 // fprintf (stderr, "-> model chip position: %f, %f\n", ghost->chip->x, ghost->chip->y); 168 170 171 if (ghostChip) { 172 psTrace("psastro.ghost",5," in ghost: %d/%ld: ref: (%f,%f) or (%f,%f,%s) ghost: (%f,%f) or (%f,%f,%s) %f inner: (%f,%f,%f) outer: (%f,%f,%f)", 173 i,refstars->n, 174 ref->FP->x,ref->FP->y, 175 ref_chip_x,ref_chip_y,psMetadataLookupStr(NULL,chip->concepts,"CHIP.NAME"), 176 ghost->FP->x,ghost->FP->y, 177 ghost->chip->x,ghost->chip->y,psMetadataLookupStr(NULL,ghostChip->concepts,"CHIP.NAME"), 178 rSrc, 179 ghost->inner.major,ghost->inner.minor,ghost->inner.theta, 180 ghost->outer.major,ghost->outer.minor,ghost->outer.theta); 181 /* psWarning(" GHOST_DATA: %d/%ld: ref: (%f,%f) or (%f,%f,%s) ghost: (%f,%f) or (%f,%f,%s) %f inner: (%f,%f,%f) outer: (%f,%f,%f)", */ 182 /* i,refstars->n, */ 183 /* ref->FP->x,ref->FP->y, */ 184 /* ref_chip_x,ref_chip_y,psMetadataLookupStr(NULL,chip->concepts,"CHIP.NAME"), */ 185 /* ghost->FP->x,ghost->FP->y, */ 186 /* ghost->chip->x,ghost->chip->y,psMetadataLookupStr(NULL,ghostChip->concepts,"CHIP.NAME"), */ 187 /* rSrc, */ 188 /* ghost->inner.major,ghost->inner.minor,ghost->inner.theta, */ 189 /* ghost->outer.major,ghost->outer.minor,ghost->outer.theta); */ 190 } 191 else { 192 psTrace("psastro.ghost",5," in ghost: %d/%ld: ref: (%f,%f) ghost: (%f,%f) or (%f,%f,%s) inner: (%f,%f,%f) outer: (%f,%f,%f)", 193 i,refstars->n, 194 ref->FP->x,ref->FP->y, 195 ghost->FP->x,ghost->FP->y, 196 ghost->chip->x,ghost->chip->y,"NONE", 197 ghost->inner.major,ghost->inner.minor,ghost->inner.theta, 198 ghost->outer.major,ghost->outer.minor,ghost->outer.theta); 199 } 200 201 202 169 203 if (!ghostChip) goto skip; 170 204 if (!ghostChip->cells) goto skip; 171 205 if (!ghostChip->cells->n) goto skip; 206 207 172 208 pmCell *ghostCell = ghostChip->cells->data[0]; 173 209 if (!ghostCell) goto skip; … … 190 226 191 227 skip: 228 192 229 psFree (ghost); 193 230 } -
tags/ipp-20120404/psastro/src/psastroMaskUpdates.c
r30873 r33852 406 406 // XXX for now, assume cell binning is 1x1 relative to chip 407 407 psastroMaskCircle (readoutMask->mask, crosstalkMaskValue, ref->chip->x, ref->chip->y, radius, radius); 408 } 409 } 410 // Crosstalk Bleeds 411 psArray *bleedcrosstalks = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.CROSSTALKS.SPIKES"); 412 if (bleedcrosstalks) { 413 for (int i = 0; i < bleedcrosstalks->n; i++) { 414 pmAstromObj *ref = bleedcrosstalks->data[i]; 415 float width = REFSTAR_MASK_BLEED_MAG_SLOPE * (REFSTAR_MASK_BLEED_MAG_MAX - ref->Mag); 416 psTrace("psastro.crosstalk",2,"Masking spike on Chip %s @ (%f,%f) Magnitude: %f Radius %f\n", 417 psMetadataLookupStr(&status,readout->parent->parent->concepts,"CHIP.NAME"), 418 ref->chip->x,ref->chip->y,ref->Mag,width); 419 // XXX for now, assume cell binning is 1x1 relative to chip 420 pmCell *refCell = pmCellInChip(refChip,ref->chip->x,ref->chip->y); 421 if (refCell) { 422 float xCell = 0.0; 423 float yCell = 0.0; 424 pmCellCoordsForChip (&xCell, &yCell, refCell, ref->chip->x, ref->chip->y); 425 int ySize = psMetadataLookupS32(NULL,refCell->concepts,"CELL.YSIZE"); 426 /* psWarning("Masking CTspike on Chip %s @ (%f,%f) Magnitude: %f (%f %f) Radius %f Z: %d %d %d %d\n", */ 427 /* psMetadataLookupStr(&status,readout->parent->parent->concepts,"CHIP.NAME"), */ 428 /* ref->chip->x,ref->chip->y,ref->Mag,REFSTAR_MASK_BLEED_MAG_SLOPE,REFSTAR_MASK_BLEED_MAG_MAX,width, */ 429 /* (int) (ref->chip->x - 0.5 * width), (int) (ref->chip->y - yCell), */ 430 /* (int) (ref->chip->x+0.5 * width + 1), (int) (ref->chip->y + (ySize - yCell))); */ 431 psastroMaskRectangle (readoutMask->mask, crosstalkMaskValue, 432 (int) (ref->chip->x - 0.5 * width), (int) (ref->chip->y - yCell), 433 (int) (ref->chip->x+0.5 * width + 1), (int) (ref->chip->y + (ySize - yCell))); 434 } 408 435 } 409 436 } -
tags/ipp-20120404/psastro/src/psastroMaskUtils.c
r24045 r33852 135 135 // XXX optimize this 136 136 float A = 1.0; 137 float B = shape.sxy*y*PS_SQR(shape.sx);137 float B = 2.0 * shape.sxy*y*PS_SQR(shape.sx); 138 138 float C = PS_SQR(y*shape.sx/shape.sy) - PS_SQR(shape.sx); 139 139
Note:
See TracChangeset
for help on using the changeset viewer.
