Skip to content

Commit

Permalink
filter nan
Browse files Browse the repository at this point in the history
  • Loading branch information
PFLeget committed Nov 8, 2024
1 parent e28e3cc commit ccbbec5
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions python/lsst/pipe/tasks/computeExposureSummaryStats.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,16 +506,26 @@ def update_psf_stats(
[summary.psfTE4E1, summary.psfTE4E2, summary.psfTE4Ex],
]

for config, texoutput in zip(TExTreecorrConfig, TExOutput):

task = ComputeExPsfTask(config)
output = task.run(
e1Residuals, e2Residuals, ra, dec, units="degree"
)

texoutput[0] = output.metric_E1
texoutput[1] = output.metric_E2
texoutput[2] = output.metric_Ex
isNotNan = np.array([True] * len(ra))
isNotNan &= np.isfinite(ra)
isNotNan &= np.isfinite(dec)
isNotNan &= np.isfinite(e1Residuals)
isNotNan &= np.isfinite(e2Residuals)

if np.sum(isNotNan) > 1:

for config, texoutput in zip(TExTreecorrConfig, TExOutput):

task = ComputeExPsfTask(config)
output = task.run(
e1Residuals[isNotNan], e2Residuals[isNotNan],
ra[isNotNan], dec[isNotNan],
units="degree",
)

texoutput[0] = output.metric_E1
texoutput[1] = output.metric_E2
texoutput[2] = output.metric_Ex

if image_mask is not None:
maxDistToNearestPsf = maximum_nearest_psf_distance(
Expand Down

0 comments on commit ccbbec5

Please sign in to comment.