Changeset 41705 for trunk/psastro/src/psastroLoadGlints.c
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/tags/ipp-ps1-20210510 merged: 41663,41665,41669,41685-41704
- Property svn:mergeinfo changed
-
trunk/psastro
- Property svn:mergeinfo changed
/tags/ipp-ps1-20210510/psastro merged: 41669,41688-41689,41691-41692,41701,41703
- Property svn:mergeinfo changed
-
trunk/psastro/src/psastroLoadGlints.c
r41434 r41705 133 133 134 134 // select stars that land in this region 135 if (star->FP->x < glintRegion.x0) continue;136 if (star->FP->x > glintRegion.x1) continue;137 if (star->FP->y < glintRegion.y0) continue;138 if (star->FP->y > glintRegion.y1) continue;135 if (star->FP->x < glintRegion.x0) {continue;} 136 if (star->FP->x > glintRegion.x1) {continue;} 137 if (star->FP->y < glintRegion.y0) {continue;} 138 if (star->FP->y > glintRegion.y1) {continue;} 139 139 140 140 char *glintType = psMetadataLookupStr (&status, glintItem->data.md, "GLINT.TYPE"); … … 147 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 148 double glintLength = GLINT_LENGTH_MAG_SLOPE*(GLINT_LENGTH_MAG_ZERO - (star->Mag-MagOffset)); 149 double glintAngle = 0 ;149 double glintAngle = 0.; 150 150 151 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 … … 167 167 168 168 //do a rudimentary check of whether the glint enters the pixel FPA 169 if (!strcasecmp(glintType, "TOP") && ((star->FP->y - glintLength) > 20000.)) continue;170 if (!strcasecmp(glintType, "BOTTOM") && ((star->FP->y + glintLength) < -20000.)) continue;171 if (!strcasecmp(glintType, "LEFT") && ((star->FP->x + glintLength) < -20000.)) continue;172 if (!strcasecmp(glintType, "RIGHT") && ((star->FP->x - glintLength) > 20000.)) continue;169 if (!strcasecmp(glintType, "TOP") && ((star->FP->y - glintLength) > 20000.)) {continue;} 170 if (!strcasecmp(glintType, "BOTTOM") && ((star->FP->y + glintLength) < -20000.)) {continue;} 171 if (!strcasecmp(glintType, "LEFT") && ((star->FP->x + glintLength) < -20000.)) {continue;} 172 if (!strcasecmp(glintType, "RIGHT") && ((star->FP->x - glintLength) > 20000.)) {continue;} 173 173 174 174 if (!strcasecmp(glintType, "TOP") || !strcasecmp(glintType, "BOTTOM")) { … … 183 183 for (int nChip = 0; nChip < fpa->chips->n; nChip++) { 184 184 pmChip *chip = fpa->chips->data[nChip]; 185 if (!chip) continue;185 if (!chip) {continue;} 186 186 187 187 if (!psastroFindChipInXrange (fpa, nChip, star->FP->x, 20000.)) { … … 209 209 for (int nChip = 0; nChip < fpa->chips->n; nChip++) { 210 210 pmChip *chip = fpa->chips->data[nChip]; 211 if (!chip) continue;211 if (!chip) {continue;} 212 212 213 213 if (!psastroFindChipInXrange (fpa, nChip, star->FP->x, -20000.)) { … … 232 232 } 233 233 234 if(glintLength < GLINT_LENGTH_MIN_FPA) continue;234 if(glintLength < GLINT_LENGTH_MIN_FPA) {continue;} 235 235 236 236 x_glint->data.F32[0] = xFPA0; … … 245 245 246 246 pmChip *chip = fpa->chips->data[nChip]; 247 if (!chip) continue;247 if (!chip) {continue;} 248 248 249 249 if (!psastroFindChipInXrange (fpa, nChip, x_glint->data.F32[glint_point], y_glint->data.F32[glint_point])) { … … 262 262 263 263 // does this glint cross this chip? 264 if (yFPA0 > yFPAe) continue;265 if (yFPA1 < yFPAs) continue;264 if (yFPA0 > yFPAe) {continue;} 265 if (yFPA1 < yFPAs) {continue;} 266 266 267 267 … … 287 287 288 288 // select the 0th readout of the 0th cell for this chip 289 if (!chip->cells) continue;290 if (!chip->cells->n) continue;289 if (!chip->cells) {continue;} 290 if (!chip->cells->n) {continue;} 291 291 pmCell *glintCell = chip->cells->data[0]; 292 if (!glintCell) continue;293 if (!glintCell->readouts) continue;294 if (!glintCell->readouts->n) continue;292 if (!glintCell) {continue;} 293 if (!glintCell->readouts) {continue;} 294 if (!glintCell->readouts->n) {continue;} 295 295 pmReadout *glintReadout = glintCell->readouts->data[0]; 296 if (!glintReadout) continue;296 if (!glintReadout) {continue;} 297 297 298 298 // save the glints on the readout->analysis metadata, creating if needed … … 332 332 for (int nChip = 0; nChip < fpa->chips->n; nChip++) { 333 333 pmChip *chip = fpa->chips->data[nChip]; 334 if (!chip) continue;334 if (!chip) {continue;} 335 335 336 336 if (!psastroFindChipInXrange (fpa, nChip, 20000.,star->FP->y)) { … … 358 358 for (int nChip = 0; nChip < fpa->chips->n; nChip++) { 359 359 pmChip *chip = fpa->chips->data[nChip]; 360 if (!chip) continue;360 if (!chip) {continue;} 361 361 362 362 if (!psastroFindChipInXrange (fpa, nChip, -20000.,star->FP->y)) { … … 381 381 } 382 382 383 if(glintLength < GLINT_LENGTH_MIN_FPA) continue;383 if(glintLength < GLINT_LENGTH_MIN_FPA) {continue;} 384 384 385 385 x_glint->data.F32[0] = xFPA0; … … 393 393 394 394 pmChip *chip = fpa->chips->data[nChip]; 395 if (!chip) continue;395 if (!chip) {continue;} 396 396 397 397 if (!psastroFindChipInYrange (fpa, nChip, x_glint->data.F32[glint_point], y_glint->data.F32[glint_point])) { … … 410 410 411 411 // does this glint cross this chip? 412 if (xFPA0 > xFPAe) continue;413 if (xFPA1 < xFPAs) continue;412 if (xFPA0 > xFPAe) {continue;} 413 if (xFPA1 < xFPAs) {continue;} 414 414 415 415 //find the x-coord positions for this chip … … 433 433 434 434 // select the 0th readout of the 0th cell for this chip 435 if (!chip->cells) continue;436 if (!chip->cells->n) continue;435 if (!chip->cells) {continue;} 436 if (!chip->cells->n) {continue;} 437 437 pmCell *glintCell = chip->cells->data[0]; 438 if (!glintCell) continue;439 if (!glintCell->readouts) continue;440 if (!glintCell->readouts->n) continue;438 if (!glintCell) {continue;} 439 if (!glintCell->readouts) {continue;} 440 if (!glintCell->readouts->n) {continue;} 441 441 pmReadout *glintReadout = glintCell->readouts->data[0]; 442 if (!glintReadout) continue;442 if (!glintReadout) {continue;} 443 443 444 444 // save the glints on the readout->analysis metadata, creating if needed
Note:
See TracChangeset
for help on using the changeset viewer.
