Skip to content

Commit

Permalink
linted
Browse files Browse the repository at this point in the history
  • Loading branch information
cylammarco committed Mar 24, 2023
1 parent 3b4f9bc commit 9107d7a
Show file tree
Hide file tree
Showing 16 changed files with 204 additions and 1,452 deletions.
20 changes: 19 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 22.1.0
rev: 23.1.0
hooks:
- id: black
language_version: python3.10
Expand All @@ -23,3 +23,21 @@ repos:
- id: check-docstring-first
- id: debug-statements
- id: requirements-txt-fixer

- repo: local
hooks:
- id: remarklint
name: remarklint
language: node
entry: remark
types: [markdown]
args: ["--frail", "--quiet"]
additional_dependencies:
[
remark,
remark-lint,
remark-cli,
remark-preset-lint-recommended,
remark-lint-list-item-indent,
remark-lint-no-undefined-references,
]
6 changes: 0 additions & 6 deletions src/aspired/extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,12 @@ def optimal_extraction_horne86(
is_optimal = True

while (f_diff > tol) | (v_diff > tol):

mask_cr = np.ones(len(P), dtype=bool)

if bad_mask is not None:

mask_cr = mask_cr & ~bad_mask.astype(bool)

if forced:

var_f = variances

f0 = f1
Expand All @@ -208,18 +205,15 @@ def optimal_extraction_horne86(
# step 6 - revise variance estimates
# var_f is the V in Horne87
if not forced:

var_f = readnoise**2.0 + np.abs(P * f0 + sky) / gain

# step 7 - cosmic ray mask, only start considering after the
# 2nd iteration. 1 pixel is masked at a time until convergence,
# once the pixel is masked, it will stay masked.
if i > 1:

ratio = (cosmicray_sigma**2.0 * var_f) / (f - P * f0) ** 2.0

if (ratio > 1).any():

mask_cr[np.argmax(ratio)] = False

denom = np.nansum((P**2.0 / var_f)[mask_cr])
Expand Down

0 comments on commit 9107d7a

Please sign in to comment.