Changeset 26127
- Timestamp:
- Nov 13, 2009, 4:57:07 AM (16 years ago)
- Location:
- branches/eam_branches/20091113/psModules/src/objects
- Files:
-
- 3 edited
-
pmPSFtryMetric.c (modified) (1 diff)
-
pmSourceVisual.c (modified) (1 diff)
-
pmSourceVisual.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091113/psModules/src/objects/pmPSFtryMetric.c
r25754 r26127 76 76 77 77 pmSourceVisualPlotPSFMetric (psfTry); 78 pmSourceVisualPlotPSFMetricSubpix (psfTry); 78 79 79 80 psFree (stats); -
branches/eam_branches/20091113/psModules/src/objects/pmSourceVisual.c
r25979 r26127 73 73 74 74 float range; 75 range = graphdata.xmax - graphdata.xmin; 76 graphdata.xmax += 0.05*range; 77 graphdata.xmin -= 0.05*range; 78 range = graphdata.ymax - graphdata.ymin; 79 graphdata.ymax += 0.05*range; 80 graphdata.ymin -= 0.05*range; 81 82 // better choice for range? 83 // graphdata.xmin = -17.0; 84 // graphdata.xmax = -9.0; 85 graphdata.ymin = -0.51; 86 graphdata.ymax = +0.51; 87 88 KapaSetLimits (kapa1, &graphdata); 89 90 KapaSetFont (kapa1, "helvetica", 14); 91 KapaBox (kapa1, &graphdata); 92 KapaSendLabel (kapa1, "PSF Mag", KAPA_LABEL_XM); 93 KapaSendLabel (kapa1, "Ap Mag - PSF Mag", KAPA_LABEL_YM); 94 95 graphdata.color = KapaColorByName ("black"); 96 graphdata.ptype = 2; 97 graphdata.size = 0.5; 98 graphdata.style = 2; 99 graphdata.etype |= 0x01; 100 101 KapaPrepPlot (kapa1, n, &graphdata); 102 KapaPlotVector (kapa1, n, x->data.F32, "x"); 103 KapaPlotVector (kapa1, n, y->data.F32, "y"); 104 KapaPlotVector (kapa1, n, dy->data.F32, "dym"); 105 KapaPlotVector (kapa1, n, dy->data.F32, "dyp"); 106 107 psFree (x); 108 psFree (y); 109 psFree (dy); 110 111 pmVisualAskUser(NULL); 112 return true; 113 } 114 115 bool pmSourceVisualPlotPSFMetricSubpix (pmPSFtry *psfTry) { 116 117 KapaSection section; // put the positive profile in one and the residuals in another? 118 Graphdata graphdata; 119 120 if (!pmVisualIsVisual()) return true; 121 122 if (kapa1 == -1) { 123 kapa1 = KapaOpenNamedSocket ("kapa", "pmSource:plots"); 124 if (kapa1 == -1) { 125 fprintf (stderr, "failure to open kapa; visual mode disabled\n"); 126 pmVisualSetVisual(false); 127 return false; 128 } 129 } 130 131 KapaClearSections (kapa1); 132 KapaInitGraph (&graphdata); 133 134 int n; 135 float range; 136 psVector *x = psVectorAllocEmpty (psfTry->sources->n, PS_TYPE_F32); 137 psVector *y = psVectorAllocEmpty (psfTry->sources->n, PS_TYPE_F32); 138 psVector *dy = psVectorAllocEmpty(psfTry->sources->n, PS_TYPE_F32); 139 140 // section a: fractional-x pixel 141 section.dx = 1.0; 142 section.dy = 0.5; 143 section.x = 0.0; 144 section.y = 0.0; 145 section.name = NULL; 146 psStringAppend (§ion.name, "a1"); 147 KapaSetSection (kapa1, §ion); 148 psFree (section.name); 149 150 graphdata.xmin = +32.0; 151 graphdata.xmax = -32.0; 152 graphdata.ymin = +32.0; 153 graphdata.ymax = -32.0; 154 155 // construct the plot vectors 156 n = 0; 157 for (int i = 0; i < psfTry->sources->n; i++) { 158 if (psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PSFTRY_MASK_ALL) continue; 159 160 pmSource *source = psfTry->sources->data[i]; 161 x->data.F32[n] = source->modelEXT->params->data.F32[PM_PAR_XPOS] - (int)source->modelEXT->params->data.F32[PM_PAR_XPOS]; 162 163 y->data.F32[n] = psfTry->metric->data.F32[i]; 164 dy->data.F32[n] = psfTry->metricErr->data.F32[i]; 165 graphdata.xmin = PS_MIN(graphdata.xmin, x->data.F32[n]); 166 graphdata.xmax = PS_MAX(graphdata.xmax, x->data.F32[n]); 167 graphdata.ymin = PS_MIN(graphdata.ymin, y->data.F32[n]); 168 graphdata.ymax = PS_MAX(graphdata.ymax, y->data.F32[n]); 169 n++; 170 } 171 x->n = y->n = dy->n = n; 172 173 range = graphdata.xmax - graphdata.xmin; 174 graphdata.xmax += 0.05*range; 175 graphdata.xmin -= 0.05*range; 176 range = graphdata.ymax - graphdata.ymin; 177 graphdata.ymax += 0.05*range; 178 graphdata.ymin -= 0.05*range; 179 180 // better choice for range? 181 // graphdata.xmin = -17.0; 182 // graphdata.xmax = -9.0; 183 graphdata.ymin = -0.51; 184 graphdata.ymax = +0.51; 185 186 KapaSetLimits (kapa1, &graphdata); 187 188 KapaSetFont (kapa1, "helvetica", 14); 189 KapaBox (kapa1, &graphdata); 190 KapaSendLabel (kapa1, "PSF Mag", KAPA_LABEL_XM); 191 KapaSendLabel (kapa1, "Ap Mag - PSF Mag", KAPA_LABEL_YM); 192 193 graphdata.color = KapaColorByName ("black"); 194 graphdata.ptype = 2; 195 graphdata.size = 0.5; 196 graphdata.style = 2; 197 graphdata.etype |= 0x01; 198 199 KapaPrepPlot (kapa1, n, &graphdata); 200 KapaPlotVector (kapa1, n, x->data.F32, "x"); 201 KapaPlotVector (kapa1, n, y->data.F32, "y"); 202 KapaPlotVector (kapa1, n, dy->data.F32, "dym"); 203 KapaPlotVector (kapa1, n, dy->data.F32, "dyp"); 204 205 // *** section b: fractional-x pixel 206 section.dx = 1.0; 207 section.dy = 0.5; 208 section.x = 0.0; 209 section.y = 0.5; 210 section.name = NULL; 211 psStringAppend (§ion.name, "a2"); 212 KapaSetSection (kapa1, §ion); 213 psFree (section.name); 214 215 graphdata.xmin = +32.0; 216 graphdata.xmax = -32.0; 217 graphdata.ymin = +32.0; 218 graphdata.ymax = -32.0; 219 220 // construct the plot vectors 221 n = 0; 222 for (int i = 0; i < psfTry->sources->n; i++) { 223 if (psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PSFTRY_MASK_ALL) continue; 224 225 pmSource *source = psfTry->sources->data[i]; 226 x->data.F32[n] = source->modelEXT->params->data.F32[PM_PAR_YPOS] - (int)source->modelEXT->params->data.F32[PM_PAR_YPOS]; 227 228 y->data.F32[n] = psfTry->metric->data.F32[i]; 229 dy->data.F32[n] = psfTry->metricErr->data.F32[i]; 230 graphdata.xmin = PS_MIN(graphdata.xmin, x->data.F32[n]); 231 graphdata.xmax = PS_MAX(graphdata.xmax, x->data.F32[n]); 232 graphdata.ymin = PS_MIN(graphdata.ymin, y->data.F32[n]); 233 graphdata.ymax = PS_MAX(graphdata.ymax, y->data.F32[n]); 234 n++; 235 } 236 x->n = y->n = dy->n = n; 237 75 238 range = graphdata.xmax - graphdata.xmin; 76 239 graphdata.xmax += 0.05*range; -
branches/eam_branches/20091113/psModules/src/objects/pmSourceVisual.h
r25754 r26127 19 19 bool pmSourceVisualPSFModelResid (pmTrend2D *trend, psVector *x, psVector *y, psVector *param, psVector *mask); 20 20 bool pmSourceVisualPlotPSFMetric (pmPSFtry *try); 21 bool pmSourceVisualPlotPSFMetricSubpix (pmPSFtry *try); 22 21 23 bool pmSourceVisualShowModelFit (pmSource *source); 22 24 bool pmSourceVisualShowModelFits (pmPSF *psf, psArray *sources, psImageMaskType maskVal);
Note:
See TracChangeset
for help on using the changeset viewer.
