Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 6, 2024
1 parent 11f590d commit 61ced5c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions romancal/flatfield/flat_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,17 @@ def apply_flat_field(science, flat, include_var_flat=False):

# Update the variances using BASELINE algorithm. For guider data, it has
# not gone through ramp fitting so there is no Poisson noise or readnoise
flat_data_squared = flat_data ** 2
flat_data_squared = flat_data**2
science.var_poisson /= flat_data_squared
science.var_rnoise /= flat_data_squared

total_var = science.var_poisson + science.var_rnoise
if include_var_flat:
var_flat = science.data ** 2 / flat_data_squared * flat_err ** 2
var_flat = science.data**2 / flat_data_squared * flat_err**2
try:
science.var_flat = var_flat
except AttributeError:
science["var_flat"] = np.zeros(
shape=science.data.shape, dtype=np.float32)
science["var_flat"] = np.zeros(shape=science.data.shape, dtype=np.float32)
science.var_flat = var_flat
total_var += science.var_flat

Expand Down

0 comments on commit 61ced5c

Please sign in to comment.