Changeset 3068
- Timestamp:
- Jan 19, 2005, 9:46:41 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/doc/modules/ModulesSDRS.tex (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/modules/ModulesSDRS.tex
r2818 r3068 1 %%% $Id: ModulesSDRS.tex,v 1.2 6 2004-12-24 02:30:50 price Exp $1 %%% $Id: ModulesSDRS.tex,v 1.27 2005-01-20 07:46:41 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 1036 1036 of the same type. 1037 1037 1038 \section{Object Detection, Measurement, and Classification Routines} 1039 1040 \subsection{Overview} 1041 1042 The process of finding, measurering, and classifying astronomical 1043 sources on images is one of the critical tasks of the IPP or any 1044 astronomical software system. In this section, we define structures 1045 and functions related to the task of source detection and measurement. 1046 The elements defined in this section are generally low-level 1047 components which can be connected together to construct a complete 1048 object measurement suite. An example pseudo-C program using these 1049 functions is provided in Appendix~\ref{psphot}. 1050 1051 We first define the collection of structures needed to carry 1052 information about the detected sources. A major challenge is to 1053 define what we mean by an astronomical object in the context of image 1054 source detection. An astronomical object may be as simple as a 1055 stellar point source, or it may consist of a more complex galaxy which 1056 has smooth extended structure, or it may consist of an irregular 1057 galaxy or galaxy group with substantial and complex sub-structure, or 1058 it may consist of complex non-stellar structures such as planetary 1059 nebular, reflection nebular, outflows and jets. 1060 1061 The simplest objects (ie, stars) can be sufficiently modelled by the 1062 point-source function (PSF). More complex objects (such as simple, 1063 smooth galaxies), may have approximate analytical models which 1064 represent their morphology with more-or-less accuracy. In the extreme 1065 cases, the objects are not well modelled at all and must be 1066 represented in other ways. Thus, one aspect of our data structures 1067 must be elements to specify if an object has been represented by a 1068 model, what the model parameters are, and how well it is represented 1069 by the model. Another aspect of the data structures must be a 1070 representation of the pixels associated with the object so complex 1071 structures may be reference without attempting to supply an analytical 1072 model. Finally, it is often useful to allow a single complex model to 1073 be represented as a collection of simpler contained structures which 1074 may be modelled. Thus, the representation of an object must be 1075 capable of identifying children, or substructures, of that object. 1076 1077 Two additional aspects must be considered. First, source detection 1078 need no be performed on a single image in isolation: it is necessary 1079 for multiple realizations of the same source in multiple images to be 1080 measured together (whether or not through simultaneous fitting in 1081 multiple bands or via application of the results from one image to 1082 another image). Second, it may be necessary for object measurements 1083 to be performed on pixels in which no source is actually detectable. 1084 For example, this is a convenient way to provide flux upper limits at 1085 the locations of known objects. 1086 1087 \subsection{Source Structures} 1088 1089 We start by defining a single source detected in a single band: 1090 \begin{verbatim} 1091 typedef struct { 1092 psPeak *peak; 1093 psPixels *pixels; 1094 psMoments *moments; 1095 psModel *models; 1096 psSourceType type; 1097 } psSource; 1098 \end{verbatim} 1099 1100 This source has the capacity for several types of measurements. The 1101 simplest measurement of a source is the location of the peak pixel 1102 associated with the source: 1103 \begin{verbatim} 1104 typedef struct { 1105 int x; 1106 int y; 1107 float counts; 1108 psPeakType class; 1109 } psPeak; 1110 \end{verbatim} 1111 1112 A peak pixel may have several features which may be determined when 1113 the peak is found or measured. These are carried by the 1114 \code{psPeakType} structure. The \code{PS_PEAK_LONE} represents a 1115 single pixel which is higher than its 8 immediate neighbors. The 1116 \code{PS_PEAK_EDGE} represents a peak pixel which touching the image 1117 edge. The \code{PS_PEAK_FLAT} represents a peak pixel which has more 1118 than a specific number of neighbors at the same value, within some 1119 tolarence: 1120 \begin{verbatim} 1121 typedef enum { 1122 PS_PEAK_LONE; 1123 PS_PEAK_EDGE; 1124 PS_PEAK_FLAT; 1125 } psPeakType; 1126 \end{verbatim} 1127 1128 In addition, the pixels which contain the source may be specified with 1129 the \code{psPixels} element. A \code{psPixels} collection identifies 1130 a group of pixels by specifying sets of pixel spans: 1131 \begin{verbatim} 1132 typedef struct { 1133 int nspan; 1134 int rmin, rmax; 1135 int cmin, cmax; 1136 psSpan *s; 1137 } psPixels; 1138 \end{verbatim} 1139 % 1140 \begin{verbatim} 1141 typedef struct { 1142 short row; 1143 short col0; 1144 short col1; 1145 } psSpan; 1146 \end{verbatim} 1147 1148 One of the simplest measurements which can be made quickly for an 1149 object are the object moments. We specify a structure to carry the 1150 moment information for a specific source: 1151 1152 \begin{verbatim} 1153 typedef struct { 1154 float x; 1155 float y; 1156 float Sx; 1157 float Sy; 1158 float Sxy; 1159 float Sum; 1160 float Peak; 1161 float Sky; 1162 int nPixels; 1163 } psMoments; 1164 \end{verbatim} 1165 1166 An object may be modelled with some analytical function. The result 1167 of the model includes the model parameters and their errors, along 1168 with the fit $\Chi^2$. 1169 1170 \begin{verbatim} 1171 typedef struct { 1172 psObjectModel type; 1173 int Nparams; 1174 float *params; 1175 float *dparams; 1176 float chisq; 1177 } psModel; 1178 \end{verbatim} 1179 1180 \begin{verbatim} 1181 typedef enum { 1182 PS_MODEL_GAUSS; 1183 PS_MODEL_PGAUSS; 1184 PS_MODEL_TWIST_GAUSS; 1185 PS_MODEL_WAUSS; 1186 PS_MODEL_SERSIC; 1187 PS_MODEL_SERSIC_BULGE; 1188 } psModelType; 1189 \end{verbatim} 1190 1191 \subsection{Basic Object Detection APIs} 1192 1193 \begin{verbatim} 1194 psVector *pmFindVectorPeaks (psVector vector, float threshold); 1195 \end{verbatim} 1196 1197 Find all local peaks in the given vector above the given threshold. A 1198 peak is defined as any element with a value greater than its two 1199 neighbors with a value above the threshold. Two types of special 1200 cases have to be addressed. If an element has the same value as the 1201 following element, it is not considered a peak. If an element has the 1202 same value as the preceeding element (but not the following), then it 1203 is considered a peak. Note that this rule (arbitrarily) identifies 1204 flat regions by their trailing edge. At the edges, the element must 1205 be higher than its neighbor, or equal for the end edge. This rule 1206 again places the peak associated with a flat region which touches the 1207 image edge at the image edge. The result fo this function is a vector 1208 containing the coordinates of the detected peaks. 1209 1210 \begin{verbatim} 1211 psList *pmFindImagePeaks (psImage image, float threshold); 1212 \end{verbatim} 1213 1214 Find all local peaks in the given image above the given threshold. 1215 This function should find all row peaks using 1216 \code{pmFindVectorPeaks}, then test each row peak and exclude peaks 1217 which are not local peaks. A peak is a local peak if it is higher 1218 than all 8 neighbors. \tbd{flat region?} The result of this function 1219 is a list of \code{psPeak} entries. 1220 1221 \begin{verbatim} 1222 psList *pmCullPeaks (psList peaks, float maxvalue, psRegion valid); 1223 \end{verbatim} 1224 1225 Remove certain types of peaks from a list of peaks based on the given 1226 criteria. Peaks should be eliminated if they have a peak value above 1227 the given maximum value limit or if the fall outside the valid 1228 region. 1229 1230 \begin{verbatim} 1231 psSource *pmSourceLocalSky (psImage *image, psPeak *peak, float inner_radius, float outer_radius), 1232 \end{verbatim} 1233 1234 Measure the local sky in the vicinity of the given \code{peak}. The 1235 image pixels in the square annulus with inner and outer radii as 1236 specified are used to measure the median (clipped mean?) (statistic 1237 from \code{psStats}?) in the vicinity of the the specified peak 1238 coordinates. The resulting sky is applied to the \code{psMoments} 1239 element of the allocated \code{psSource} structure. The input 1240 \code{peak} is also added to the \code{psSource} element, which is 1241 returned. 1242 1243 \begin{verbatim} 1244 psSource *pmSourceMoments (psImage *image, psSource *source, float radius), 1245 \end{verbatim} 1246 1247 Measure source moments for the given \code{source}, using the value of 1248 \code{source.moments.sky} provided. The resulting moment values are 1249 applied to the \code{source.moments} entry, and the source is 1250 retained. The moments are measured within the given radius of the 1251 \code{source.peak} coordinates. 1252 1253 \begin{verbatim} 1254 psSource *pmSourceRoughClass (psSource *source, float saturate, float SNlim, psRegion valid); 1255 \end{verbatim} 1256 1257 \begin{verbatim} 1258 pmSourceFitModel (psImage *image, psSource *source, psModelType model); 1259 \end{verbatim} 1260 1261 \begin{verbatim} 1262 pmSourceFitModel (psImage *image, psSource *source, psModelType model); 1263 \end{verbatim} 1264 1265 \subsection{Basic Object Models} 1266 1267 float PGaussian (psVector *deriv, psVector *params, psVector *x); 1268 1269 X = x[0] - param[2]; 1270 Y = x[1] - param[3]; 1271 1272 px = param[4]*X; 1273 py = param[5]*Y; 1274 1275 z = 0.5*SQ(px) + 0.5*SQ(py) + param[6]*X*Y; 1276 r = 1.0 / (1 + z + 0.5*z*z*(1 + z/3)); /* ~ exp (-Z) */ 1277 f = param[1]*r + param[0]; 1278 q = param[1]*r*r*(1 + z + 0.5*z*z); 1279 /* note difference from gaussian: q = param[1]*r */ 1280 1281 deriv[0] = +1; 1282 deriv[1] = +r; 1283 deriv[2] = q*(2*px*param[4] + param[6]*Y); 1284 deriv[3] = q*(2*py*param[5] + param[6]*X); 1285 deriv[4] = -2*q*px*X; 1286 deriv[5] = -2*q*py*Y; 1287 deriv[6] = -q*X*Y; 1288 1289 float Waussian (psVector *deriv, psVector *params, psVector *x); 1290 1291 X = x - param[2]; 1292 Y = y - param[2]; 1293 1294 px = param[4]*X; 1295 py = param[5]*Y; 1296 1297 z = 0.5*SQ(px) + 0.5*SQ(py) + param[6]*X*Y; 1298 k = 0.5*z*z*(1 + param[8]*z/3); 1299 r = 1.0 / (1 + z + param[7]*k); /* ~ exp (-Z) */ 1300 f = param[1]*r + param[0]; 1301 q = param[1]*r*r*(1 + param[7]*z*(1 + param[8]*z/2)); 1302 /* note difference from gaussian: q = param[1]*r */ 1303 1304 deriv[0] = +1; 1305 deriv[1] = +r; 1306 deriv[2] = q*(2*px*param[4] + param[6]*Y); 1307 deriv[3] = q*(2*py*param[5] + param[6]*X); 1308 deriv[4] = -2*q*px*X; 1309 deriv[5] = -2*q*py*Y; 1310 deriv[6] = -q*X*Y; 1311 deriv[7] = -100*param[1]*r*r*k; 1312 deriv[8] = -100*param[1]*r*r*param[7]*(z*z*z)/6; 1313 /* the values of 100 dampen the swing of param[7,8] */ 1314 1315 float TwistGaussian () 1316 1317 X = x - param[2]; 1318 Y = y - param[3]; 1319 1320 px1 = param[4]*X; 1321 py1 = param[5]*Y; 1322 px2 = param[7]*X; 1323 py2 = param[8]*Y; 1324 1325 z1 = 0.5*SQ(px1) + 0.5*SQ(py1) + param[4]*X*Y; 1326 z2 = 0.5*SQ(px2) + 0.5*SQ(py2) + param[9]*X*Y; 1327 1328 r = 1.0 / (1 + z1 + pow(z2,Npow)); 1329 f = param[5]*r + param[6]; 1330 1331 q1 = param[5]*SQ(r); 1332 q2 = param[5]*SQ(r)*Npow*pow(z2,(Npow-1)); 1333 1334 deriv[0] = +1; 1335 deriv[1] = +r; 1336 deriv[2] = q1*(2*px1*param[4] + param[6]*Y) + q2*(2*px2*param[7] + param[9]*Y); 1337 deriv[3] = q1*(2*py1*param[5] + param[6]*X) + q2*(2*py2*param[8] + param[9]*X); 1338 1339 /* these fudge factors impede the growth of param[4] beyond param[7] */ 1340 f1 = fabs(param[7]) / fabs(param[4]); 1341 f2 = (f1 < FSCALE) ? 1 : FFACTOR*(f1 - FSCALE) + 1; 1342 deriv[4] = -2*q1*px1*X*f2; 1343 1344 /* these fudge factors impede the growth of param[5] beyond param[8] */ 1345 f1 = fabs(param[8]) / fabs(param[5]); 1346 f2 = (f1 < FSCALE) ? 1 : FFACTOR*(f1 - FSCALE) + 1; 1347 deriv[5] = -2*q1*py1*Y*f2; 1348 1349 deriv[6] = -q1*X*Y; 1350 1351 deriv[7] = -2*q2*px2*X; 1352 deriv[8] = -2*q2*py2*Y; 1353 deriv[9] = -q2*X*Y; 1354 1355 1356 1038 1357 \section{Revision Change Log} 1039 1358 \input{ChangeLogSDRS.tex}
Note:
See TracChangeset
for help on using the changeset viewer.
