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

Add iue miri lrs and improve iue support #127

Merged
merged 14 commits into from
Dec 11, 2024
Merged

Add iue miri lrs and improve iue support #127

merged 14 commits into from
Dec 11, 2024

Conversation

karllark
Copy link
Owner

@karllark karllark commented Nov 6, 2024

Add in support for MIRI LRS. Includes StarData read and merge_obsspec merge functions. Included mocking of spectra from the stellar atmosphere models.

Add in support for mocking IUE spectra from stellar atmosphere models.

Expands documentation for the format of the DAT and spectra files and how to generate the spectra files.

Add in tests on the merge functions in merge_obsspec.

Switched from deprecated pkg_resources to importlib for getting paths.

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 51 lines in your changes missing coverage. Please review.

Project coverage is 40.73%. Comparing base (14d38b4) to head (aa17a86).
Report is 19 commits behind head on master.

Files with missing lines Patch % Lines
...easure_extinction/utils/make_obsdata_from_model.py 2.22% 44 Missing ⚠️
measure_extinction/stardata.py 50.00% 3 Missing ⚠️
measure_extinction/utils/plot_bandpasses.py 33.33% 2 Missing ⚠️
measure_extinction/utils/mock_spectra_data.py 50.00% 1 Missing ⚠️
measure_extinction/utils/scale_spex_spec.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #127      +/-   ##
==========================================
+ Coverage   39.47%   40.73%   +1.26%     
==========================================
  Files          22       22              
  Lines        3035     3071      +36     
==========================================
+ Hits         1198     1251      +53     
+ Misses       1837     1820      -17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@karllark karllark added the enhancement New feature or request label Nov 22, 2024
@karllark karllark changed the title Add iue miri lrs Add iue miri lrs and complete iue support Nov 22, 2024
@karllark karllark changed the title Add iue miri lrs and complete iue support Add iue miri lrs and improve iue support Nov 27, 2024
Copy link
Collaborator

@mdecleir mdecleir left a comment

Choose a reason for hiding this comment

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

Hi Karl,

Looks good overall, mostly corrected some typos, and added a few comments here and there to improve clarity.

docs/code_capabilities.rst Outdated Show resolved Hide resolved
@@ -4,19 +4,90 @@
Data Formats
############

The data for each stars is stored in a combination of an ASCII "DAT" file
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The data for each stars is stored in a combination of an ASCII "DAT" file
The data for each star are stored in a combination of an ASCII "DAT" file

docs/data_formats.rst Outdated Show resolved Hide resolved
docs/data_formats.rst Outdated Show resolved Hide resolved
docs/data_formats.rst Outdated Show resolved Hide resolved
measure_extinction/utils/make_obsdata_from_model.py Outdated Show resolved Hide resolved
iue_table["ERROR"] = Column(np.full((len(iue_table)), 1.0)) * fluxunit

rb_iue = merge_iue_obsspec([iue_table])
rb_iue["SIGMA"] = rb_iue["FLUX"] * 0.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the point of multiplying the flux by 0?

Copy link
Collaborator

Choose a reason for hiding this comment

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

And what is the difference between ERROR and SIGMA?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Multiplying by zero gives zero uncertainties. These are models, hence there is not uncertainty (ERROR or SIGMA). No difference, just words meaning the same thing. Different observed data uses different words for the uncertainty.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Added more comments.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Still somewhat confused here. For the iue_table["ERROR"], you set the values to 1, but for the rb_iue["SIGMA"], you set them to 0. Is there a particular reason for that? I guess in the second case, you could just set them to 0 instead of multiplying the flux by 0 (which I assume takes less memory/time).

Copy link
Owner Author

Choose a reason for hiding this comment

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

The ERRORs are used in the merging as weights. Hence setting them to 1 gives all the points equal weights. But in the end, there are no uncertainties on models, hence setting them to 0 for the final result makes sense.

measure_extinction/utils/make_obsdata_from_model.py Outdated Show resolved Hide resolved
measure_extinction/utils/merge_iue_spec.py Show resolved Hide resolved
@karllark karllark merged commit 0939263 into master Dec 11, 2024
29 checks passed
@karllark karllark deleted the add_iue_miri_lrs branch December 11, 2024 16:38
@@ -4,7 +4,7 @@
Data Formats
############

The data for each stars is stored in a combination of an ASCII "DAT" file
The data for each stars are stored in a combination of an ASCII "DAT" file
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The data for each stars are stored in a combination of an ASCII "DAT" file
The data for each star are stored in a combination of an ASCII "DAT" file

assert ckey in otable.keys()

nowaves = len(otable["WAVELENGTH"])
np.testing.assert_allclose(otable["FLUX"], np.full(nowaves, 1.5))
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 still confused.
If flux1=1, flux2=2, w1=1 and w2=0.5, then the weighted average is:
(f1w1+f2w2)/(w1+w2) = 2/1.5 = 1.3333

iue_table["ERROR"] = Column(np.full((len(iue_table)), 1.0)) * fluxunit

rb_iue = merge_iue_obsspec([iue_table])
rb_iue["SIGMA"] = rb_iue["FLUX"] * 0.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Still somewhat confused here. For the iue_table["ERROR"], you set the values to 1, but for the rb_iue["SIGMA"], you set them to 0. Is there a particular reason for that? I guess in the second case, you could just set them to 0 instead of multiplying the flux by 0 (which I assume takes less memory/time).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants