Changeset 9891
- Timestamp:
- Nov 6, 2006, 11:22:21 PM (20 years ago)
- Location:
- trunk/psphot
- Files:
-
- 2 edited
-
doc/notes.txt (modified) (1 diff)
-
src/growthTest.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/doc/notes.txt
r9840 r9891 1 2 2006.11.06 3 4 I have added the aperture interpolation as a component of the 5 pmSourceMagnitudes function. 6 7 I am trying to make things a bit more organized, with more 8 consistent APIs. 9 10 * changed pmPSFtry to use the pmSourceMagnitudes API 11 * changed pmPSFtry to use new pmSource entries for each try (saving 12 * the pmModels generated) 13 14 other notes: 15 * moved psphotGrowthCurve -> pmGrowthCurveGenerate 16 17 things I know need to be added / fixed: 18 * measure bicube fit to peak from smoothed image 19 * use psphotEnsemble fit to re-measure normalization? 20 * extended object statistical measures 1 21 2 22 2006.11.02 -
trunk/psphot/src/growthTest.c
r9867 r9891 38 38 modelRef->params->data.F32[PM_PAR_I0] = 1000; 39 39 40 // test of psImageShift41 {42 // assign the x and y coords to the image center43 // create an object with center intensity of 100044 modelRef->params->data.F32[PM_PAR_XPOS] = 200+0.2;45 modelRef->params->data.F32[PM_PAR_YPOS] = 200+0.6;46 47 // create modelPSF from this model48 pmModel *model = pmModelFromPSF (modelRef, psf);49 50 // psRegion region = {180, 220, 180, 220};51 psRegion region = {0, 0, 0, 0};52 psImage *imageView = psImageSubset (readout->image, region);53 psImage *maskView = psImageSubset (readout->mask, region);54 55 psImageInit (imageView, 0.0);56 psImageInit (maskView, 0);57 pmModelAdd (imageView, maskView, model, false, false);58 float dx = 0.5 - model->params->data.F32[PM_PAR_XPOS] + (int)model->params->data.F32[PM_PAR_XPOS];59 float dy = 0.5 - model->params->data.F32[PM_PAR_YPOS] + (int)model->params->data.F32[PM_PAR_YPOS];60 psImage *tmpImage = tmp_psImageShift (imageView, dx, dy);61 62 psFits *fits;63 fits = psFitsOpen ("unshift_tmp.fits", "w");64 psFitsWriteImage (fits, NULL, imageView, 0, NULL);65 psFitsClose (fits);66 67 fits = psFitsOpen ("shift_tmp.fits", "w");68 psFitsWriteImage (fits, NULL, tmpImage, 0, NULL);69 psFitsClose (fits);70 }71 72 // test of psImageShift (Bilinear)73 {74 // assign the x and y coords to the image center75 // create an object with center intensity of 100076 modelRef->params->data.F32[PM_PAR_XPOS] = 200+0.2;77 modelRef->params->data.F32[PM_PAR_YPOS] = 200+0.6;78 79 // create modelPSF from this model80 pmModel *model = pmModelFromPSF (modelRef, psf);81 82 // psRegion region = {180, 220, 180, 220};83 psRegion region = {0, 0, 0, 0};84 psImage *imageView = psImageSubset (readout->image, region);85 psImage *maskView = psImageSubset (readout->mask, region);86 87 psImageInit (imageView, 0.0);88 psImageInit (maskView, 0);89 pmModelAdd (imageView, maskView, model, false, false);90 float dx = 0.5 - model->params->data.F32[PM_PAR_XPOS] + (int)model->params->data.F32[PM_PAR_XPOS];91 float dy = 0.5 - model->params->data.F32[PM_PAR_YPOS] + (int)model->params->data.F32[PM_PAR_YPOS];92 psImage *tmpImage = psImageShift (NULL, imageView, dx, dy, 0.0, PS_INTERPOLATE_BILINEAR);93 94 psFits *fits;95 fits = psFitsOpen ("unshift.fits", "w");96 psFitsWriteImage (fits, NULL, imageView, 0, NULL);97 psFitsClose (fits);98 99 fits = psFitsOpen ("shift.fits", "w");100 psFitsWriteImage (fits, NULL, tmpImage, 0, NULL);101 psFitsClose (fits);102 103 modelRef->params->data.F32[PM_PAR_XPOS] = 200+0.5;104 modelRef->params->data.F32[PM_PAR_YPOS] = 200+0.5;105 model = pmModelFromPSF (modelRef, psf);106 psImageInit (imageView, 0.0);107 psImageInit (maskView, 0);108 pmModelAdd (imageView, maskView, model, false, false);109 110 fits = psFitsOpen ("center.fits", "w");111 psFitsWriteImage (fits, NULL, imageView, 0, NULL);112 psFitsClose (fits);113 }114 115 // test of psImageShift116 {117 // assign the x and y coords to the image center118 // create an object with center intensity of 1000119 modelRef->params->data.F32[PM_PAR_XPOS] = 200+0.2;120 modelRef->params->data.F32[PM_PAR_YPOS] = 200+0.6;121 122 // create modelPSF from this model123 pmModel *model = pmModelFromPSF (modelRef, psf);124 125 // psRegion region = {180, 220, 180, 220};126 psRegion region = {0, 0, 0, 0};127 psImage *imageView = psImageSubset (readout->image, region);128 psImage *maskView = psImageSubset (readout->mask, region);129 130 psImageInit (imageView, 0.0);131 psImageInit (maskView, 0);132 pmModelAdd (imageView, maskView, model, false, false);133 float dx = 0.5 - model->params->data.F32[PM_PAR_XPOS] + (int)model->params->data.F32[PM_PAR_XPOS];134 float dy = 0.5 - model->params->data.F32[PM_PAR_YPOS] + (int)model->params->data.F32[PM_PAR_YPOS];135 psImage *tmpImage = psImageShift (NULL, imageView, dx, dy, 0.0, PS_INTERPOLATE_BICUBE);136 137 psFits *fits;138 fits = psFitsOpen ("unshift_2.fits", "w");139 psFitsWriteImage (fits, NULL, imageView, 0, NULL);140 psFitsClose (fits);141 142 fits = psFitsOpen ("shift_2.fits", "w");143 psFitsWriteImage (fits, NULL, tmpImage, 0, NULL);144 psFitsClose (fits);145 146 modelRef->params->data.F32[PM_PAR_XPOS] = 200+0.5;147 modelRef->params->data.F32[PM_PAR_YPOS] = 200+0.5;148 model = pmModelFromPSF (modelRef, psf);149 psImageInit (imageView, 0.0);150 psImageInit (maskView, 0);151 pmModelAdd (imageView, maskView, model, false, false);152 153 fits = psFitsOpen ("center_2.fits", "w");154 psFitsWriteImage (fits, NULL, imageView, 0, NULL);155 psFitsClose (fits);156 157 psImageInit (maskView, 0);158 psImageKeepCircle (maskView, model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], 2, "OR", PM_MASK_MARK);159 fits = psFitsOpen ("mask_2.fits", "w");160 psFitsWriteImage (fits, NULL, maskView, 0, NULL);161 psFitsClose (fits);162 163 psImageInit (maskView, 0);164 psImageKeepCircle (maskView, model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], 3, "OR", PM_MASK_MARK);165 fits = psFitsOpen ("mask_3.fits", "w");166 psFitsWriteImage (fits, NULL, maskView, 0, NULL);167 psFitsClose (fits);168 }169 170 // test of model insert, mask, shift171 {172 psFits *fits;173 pmModel *model;174 psRegion region = {180, 220, 180, 220};175 176 // create an object with center intensity of 1000 at 0.5,0.5 frac pixel center177 modelRef->params->data.F32[PM_PAR_XPOS] = 200+0.5;178 modelRef->params->data.F32[PM_PAR_YPOS] = 200+0.5;179 model = pmModelFromPSF (modelRef, psf);180 181 psImageInit (readout->image, 0.0);182 psImageInit (readout->mask, 0);183 184 psImage *image1 = psImageSubset (readout->image, region);185 psImage *mask1 = psImageSubset (readout->mask, region);186 psImageKeepCircle (mask1, model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], 3, "OR", PM_MASK_MARK);187 pmModelAdd (image1, mask1, model, false, false);188 189 // write ref object190 fits = psFitsOpen ("refobj.fits", "w");191 psFitsWriteImage (fits, NULL, image1, 0, NULL);192 psFitsClose (fits);193 194 // write ref mask195 fits = psFitsOpen ("refmask.fits", "w");196 psFitsWriteImage (fits, NULL, mask1, 0, NULL);197 psFitsClose (fits);198 199 // create an object with center intensity of 1000 at 0.3,0.6 frac pixel center200 modelRef->params->data.F32[PM_PAR_XPOS] = 200+0.3;201 modelRef->params->data.F32[PM_PAR_YPOS] = 200+0.6;202 model = pmModelFromPSF (modelRef, psf);203 204 psImageInit (readout->image, 0.0);205 psImageInit (readout->mask, 0);206 207 psImage *image2 = psImageSubset (readout->image, region);208 psImage *mask2 = psImageSubset (readout->mask, region);209 psImageKeepCircle (mask2, model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], 3, "OR", PM_MASK_MARK);210 pmModelAdd (image2, mask2, model, false, false);211 212 // write sci object213 fits = psFitsOpen ("sciobj.fits", "w");214 psFitsWriteImage (fits, NULL, image2, 0, NULL);215 psFitsClose (fits);216 217 // write sci mask218 fits = psFitsOpen ("scimask.fits", "w");219 psFitsWriteImage (fits, NULL, mask2, 0, NULL);220 psFitsClose (fits);221 222 // shift image to match ref object223 float dx = 0.5 - model->params->data.F32[PM_PAR_XPOS] + (int)model->params->data.F32[PM_PAR_XPOS];224 float dy = 0.5 - model->params->data.F32[PM_PAR_YPOS] + (int)model->params->data.F32[PM_PAR_YPOS];225 psImage *tmpImage = tmp_psImageShift (image2, dx, dy);226 227 fits = psFitsOpen ("scishift.fits", "w");228 psFitsWriteImage (fits, NULL, tmpImage, 0, NULL);229 psFitsClose (fits);230 }231 232 40 // generate the growth curve (element of psf) 233 41 psphotGrowthCurve (readout, psf, false); … … 259 67 pmModelAdd (imageView, maskView, model, false, false); 260 68 261 // fits = psFitsOpen ("imo.fits", "w");262 // psFitsWriteImage (fits, NULL, imageView, 0, NULL);263 // psFitsClose (fits);264 265 69 float dX = 0.5 - model->params->data.F32[PM_PAR_XPOS] + (int)model->params->data.F32[PM_PAR_XPOS]; 266 70 float dY = 0.5 - model->params->data.F32[PM_PAR_YPOS] + (int)model->params->data.F32[PM_PAR_YPOS];
Note:
See TracChangeset
for help on using the changeset viewer.
