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

V3.0.3: getObsAtmo #142

Merged
merged 24 commits into from
Dec 19, 2023
Merged

V3.0.3: getObsAtmo #142

merged 24 commits into from
Dec 19, 2023

Conversation

jeremyneveu
Copy link
Collaborator

@jeremyneveu jeremyneveu commented Nov 7, 2023

  • use getObsAtmo if available

@jeremyneveu jeremyneveu self-assigned this Nov 7, 2023
@coveralls
Copy link

coveralls commented Nov 7, 2023

Pull Request Test Coverage Report for Build 7248394356

  • 96 of 116 (82.76%) changed or added relevant lines in 11 files are covered.
  • 49 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.2%) to 90.45%

Changes Missing Coverage Covered Lines Changed/Added Lines %
spectractor/fit/fit_multispectra.py 27 28 96.43%
spectractor/fit/fit_spectrum.py 13 16 81.25%
spectractor/simulation/atmosphere.py 24 29 82.76%
spectractor/tools.py 2 7 28.57%
spectractor/config.py 6 12 50.0%
Files with Coverage Reduction New Missed Lines %
spectractor/fit/fit_multispectra.py 1 90.27%
spectractor/extractor/chromaticpsf.py 4 91.56%
spectractor/extractor/spectrum.py 6 92.0%
spectractor/astrometry.py 38 87.94%
Totals Coverage Status
Change from base Build 7207821764: -0.2%
Covered Lines: 7586
Relevant Lines: 8387

💛 - Coveralls

@@ -77,7 +77,7 @@ def _build_test_sample(nspectra=3, aerosols=0.05, ozone=300, pwv=5, angstrom_exp
>>> _build_test_sample(3)
"""
spec = Spectrum("./tests/data/reduc_20170530_134_spectrum.fits")
targets = ["HD111980", "MU COL", "ETADOR"]
targets = ["HD111980", "HD111980"] #, "MU COL", "ETADOR", "HD205905", "HD142331", "HD160617"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why you have the same target twice, or why the others are left commented out (I'd either remove them, or put them in, depending on whether they're needed or not)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I simplify the code.

Comment on lines +546 to +549
# if A1s.size > 1:
# m = 1
# A1s[0] = m * A1s.size - np.sum(A1s[1:])
# self.params.values[self.A1_first_index] = A1s[0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As always, I'd encourage delete of keep, but not leaving commented code, but it's up to you, of course.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but this one I will keep it because not sure of my code. fit_multispectra.py is still under construction and test

tmp_x, tmp_model, tmp_model_err = self.simulate(*tmp_p)
for s in range(model.shape[0]):
J[ip].append((tmp_model[s] - model[s]) / epsilon[ip])
# if "XXXX_" not in self.params.labels[ip]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, if this check is no longer necessary, why leave this in?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, removed

Comment on lines 984 to 985
#epsilon = np.array([0.0001, 1e-3, 5, 0.01, 0.01])
#epsilon = np.array(list(epsilon) + [1e-3] * fit_workspace.nspectra + [1e-4] * fit_workspace.nspectra)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And again.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@@ -614,7 +642,7 @@ def simulate(self, ozone, pwv, aerosols, angstrom_exponent=None):
... title=a.title, label=a.label)
>>> if parameters.DISPLAY: plt.show()
"""
if angstrom_exponent is not None and angstrom_exponent > 0:
if angstrom_exponent is not None and angstrom_exponent < 0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand the change from > to <. The error message makes it sound like anything that is not None should cause a problem, but this check is doing something different than the words suggest.

@jeremyneveu jeremyneveu merged commit 11430a0 into master Dec 19, 2023
2 of 3 checks passed
@jeremyneveu jeremyneveu mentioned this pull request Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants