From a0d7c35a6dd66cf7cb52bb6e22552ad554bf6295 Mon Sep 17 00:00:00 2001 From: Howard Bushouse Date: Wed, 6 Dec 2023 10:41:50 -0500 Subject: [PATCH 1/2] Fix suffix list test for new nsclean step --- jwst/lib/suffix.py | 1 + 1 file changed, 1 insertion(+) diff --git a/jwst/lib/suffix.py b/jwst/lib/suffix.py index 778c5db350..ade5b11d41 100644 --- a/jwst/lib/suffix.py +++ b/jwst/lib/suffix.py @@ -149,6 +149,7 @@ 'combine1dstep', 'tsophotometrystep', 'spec3pipeline', + 'nsclean', 'nscleanstep', 'outlierdetectionstep', 'groupscalestep', From c10f605025bd626f07c8a293fade542a0c9c3e93 Mon Sep 17 00:00:00 2001 From: Howard Bushouse Date: Wed, 6 Dec 2023 13:24:05 -0500 Subject: [PATCH 2/2] additional fixes --- README.md | 18 +++++++++--------- jwst/nsclean/lib.py | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index de9f36e89d..2d9b4a0962 100644 --- a/README.md +++ b/README.md @@ -88,15 +88,15 @@ used for Linux and Mac OS systems. Linux: - conda create -n jwstdp-1.8.2 --file https://ssb.stsci.edu/releases/jwstdp/1.8.2/conda_python_stable-deps.txt - conda activate jwstdp-1.8.2 - pip install -r https://ssb.stsci.edu/releases/jwstdp/1.8.2/reqs_stable-deps.txt + conda create -n jwstdp-1.12.5 --file https://ssb.stsci.edu/releases/jwstdp/1.12.5/conda_python_stable-deps.txt + conda activate jwstdp-1.12.5 + pip install -r https://ssb.stsci.edu/releases/jwstdp/1.12.5/reqs_stable-deps.txt MacOS: - conda create -n jwstdp-1.8.2 --file https://ssb.stsci.edu/releases/jwstdp/1.8.2/conda_python_macos-stable-deps.txt - conda activate jwstdp-1.8.2 - pip install -r https://ssb.stsci.edu/releases/jwstdp/1.8.2/reqs_macos-stable-deps.txt + conda create -n jwstdp-1.12.5 --file https://ssb.stsci.edu/releases/jwstdp/1.12.5/conda_python_macos-stable-deps.txt + conda activate jwstdp-1.12.5 + pip install -r https://ssb.stsci.edu/releases/jwstdp/1.12.5/reqs_macos-stable-deps.txt Each DMS delivery has its own installation instructions, which may be found in the corresponding release documentation linked from this page: @@ -210,10 +210,10 @@ the specified context and less than the context for the next release. | jwst tag | DMS build | SDP_VER | CRDS_CONTEXT | Released | Ops Install | Notes | |---------------------|-----------|----------|--------------|------------|-------------|-----------------------------------------------| -| 1.12.5 | B10.0.1 | 2023.3.0 | 1140 | 2023-10-19 | | Patch release B10.0.1 | -| 1.12.4 | | 2023.3.0 | 1135 | 2023-10-12 | | Pinning dependencies for external users | +| 1.12.5 | B10.0.1 | 2023.3.1 | 1166 | 2023-10-19 | 2023-12-05 | Patch release B10.0.1 | +| 1.12.4 | | | | 2023-10-12 | | Pinning dependencies for external users | | 1.12.3 | B10.0 | 2023.3.0 | 1135 | 2023-10-03 | 2023-12-05 | Final release candidate for B10.0 | -| 1.12.2 | B10.0rc3 | | 1135 | 2023-10-02 | (tentative) | Third release candidate for B10.0 | +| 1.12.2 | B10.0rc3 | | 1135 | 2023-10-02 | | Third release candidate for B10.0 | | 1.12.1 | B10.0rc2 | | 1132 | 2023-09-26 | | Second release candidate for B10.0 | | 1.12.0 | B10.0rc1 | | 1130 | 2023-09-18 | | First release candidate for B10.0 | | 1.11.4 | B9.3.1 | 2023.2.1 | 1107 | 2023-08-14 | 2023-08-24 | Final release for B9.3.1 patch | diff --git a/jwst/nsclean/lib.py b/jwst/nsclean/lib.py index c53c09ef2b..82a52a9e4a 100644 --- a/jwst/nsclean/lib.py +++ b/jwst/nsclean/lib.py @@ -91,7 +91,7 @@ def __init__(self, detector, mask, fc=1/(2*2048/16), kill_width=1/(2*2048/16)/4, FW = np.fft.rfft2(np.fft.ifftshift(W)) with np.errstate(divide='ignore'): self.P = 1 / np.fft.irfft2(np.fft.rfft2(np.array(self.mask, dtype=np.float32)) * FW, (self.ny,self.nx)) - self.P = np.where(self.mask==True, self.P, 0.) # Illuminated areas carry no weight + self.P = np.where(self.mask, self.P, 0.) # Illuminated areas carry no weight # Build a 1-dimensional Gaussian kernel for "buffing". Buffing is in the # dispersion direction only. In detector coordinates, this is axis zero. Even though @@ -484,7 +484,7 @@ def fit(self, return_fit=False, weight_fit=False): _M = np.hstack((self.mask, np.zeros((self.ny,self.nloh), dtype=np.bool_))).flatten() # Add new line overhead to mask with np.errstate(divide='ignore'): P = 1/np.fft.irfft(np.fft.rfft(np.array(_M, dtype=np.float32)) * FW, self.n) # Compute weights - P = P[_M==True] # Keep only background samples + P = P[_M] # Keep only background samples # NSClean's weighting requires the Moore-Penrose invers of A = P*B. # $A^+ = (A^H A)^{-1} A^H$