Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robust extraction with better guess for regularisation parameter; fix degeneracies #139

Merged
merged 27 commits into from
Oct 11, 2023
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4f6253e
check for degenerate vectors in jacobian (causing impossibility to in…
Sep 28, 2023
d0dc522
update version number 3.0 -> 3.0.1
Sep 28, 2023
abee92b
if fitted regularisation parameter is away from optimal one by 3 orde…
Sep 28, 2023
18c18c6
fix A1 label
Sep 28, 2023
7640af2
fix A1 label
Sep 28, 2023
2804a09
fix print of target lines
Sep 28, 2023
145f5da
fix print of uncertainties
Sep 28, 2023
3e81e35
fix print of uncertainties
Sep 28, 2023
881913f
robust initialisation of polynomial parameters in fit_transverse_psf1…
Sep 29, 2023
f6b4fe6
prefit y_c parameters in ChromaticPSF2D before fitting all parameters
Sep 29, 2023
330d2b4
find_target: improve first guess on gamma Moffat parameter before fit
Sep 29, 2023
ac677fc
slight improvement of logging to better read the logs
Sep 29, 2023
bc3ee52
decrease guess in find_target
Sep 29, 2023
5f357fd
add float64 as pixel types for evaluate_moffat2d (useful for plots)
Sep 29, 2023
6ac50cf
test spectrum v3.0.1
Sep 29, 2023
d49989e
add lsst.utils disable_implicit_threading
Sep 29, 2023
a235dc0
tuning of find_target bounds
Sep 29, 2023
28eab6a
save memory in set_mask(): compute directly of PSF cube of type bool …
Oct 1, 2023
b1920b9
save memory: stay sparse when adding oultiers
Oct 1, 2023
f093c0d
save memory: don't recompute ChromaticPSF2D with full shape including…
Oct 1, 2023
4aafc00
add lsst_utils
Oct 1, 2023
064ae72
add outliers for any format of sparse weight matrix
Oct 1, 2023
1791159
add outliers for any format of sparse weight matrix
Oct 1, 2023
b2a67c2
robuts selection of best transverse profiles for ChromaticPSF1D fit i…
Oct 2, 2023
fbf38ab
remove deprecated warning from colormaps
Oct 3, 2023
674c9e3
repair fit_multispectra
Oct 3, 2023
4a6ef43
sync fit_spectrogram.py with extractor methods
Oct 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add outliers for any format of sparse weight matrix
Jérémy Neveu committed Oct 1, 2023
commit 064ae7229cabae0c7f581205edfa7f3996d342f4
11 changes: 7 additions & 4 deletions spectractor/fit/fitter.py
Original file line number Diff line number Diff line change
@@ -865,7 +865,7 @@ def prepare_weight_matrices(self):

Use sparse matrix:

>>> w.W = scipy.sparse.diags(np.ones(3)).tocsr()
>>> w.W = scipy.sparse.diags(np.ones(3))
>>> w.W.toarray()
array([[1., 0., 0.],
[0., 1., 0.],
@@ -918,9 +918,12 @@ def prepare_weight_matrices(self):
f"either made of 1D or 2D arrays of equal lengths or not for block diagonal matrices."
f"\nHere W type is {type(self.W)}, shape is {self.W.shape} and W is {self.W}.")
else:
self.W[:, bad_indices] = 0
self.W[bad_indices, :] = 0
self.W.eliminate_zeros()
format = self.W.getformat()
W = self.W.tocsr()
W[:, bad_indices] = 0
W[bad_indices, :] = 0
W.eliminate_zeros()
self.W = W.asformat(format=format)

def compute_W_with_model_error(self, model_err):
"""Propagate model uncertainties to weight matrix W.