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 rebin mod post fit fix #116

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

petiay
Copy link

@petiay petiay commented Dec 6, 2023

Adds the option to rebin the model spectra to a given resolution over a WL range.
Rebinning structure is slightly different than in stardata.py but method is identical.

@petiay
Copy link
Author

petiay commented Dec 6, 2023

Not yet... did not mean to push a change to my home dir path in utils/helpers.py. Will revert temporarily.

Copy link

codecov bot commented Dec 6, 2023

Codecov Report

Attention: 30 lines in your changes are missing coverage. Please review.

Comparison is base (8f5019f) 41.07% compared to head (b9cbf10) 40.82%.

Files Patch % Lines
measure_extinction/modeldata.py 3.22% 30 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #116      +/-   ##
==========================================
- Coverage   41.07%   40.82%   -0.26%     
==========================================
  Files          21       21              
  Lines        2858     2878      +20     
==========================================
+ Hits         1174     1175       +1     
- Misses       1684     1703      +19     

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

@petiay
Copy link
Author

petiay commented Dec 6, 2023

@karllark, I am not given the option to formally request a review (but can convert to draft?), so feel free to take a look and see what you think.
(Not sure all the recorded commits are relevant. Obviously still getting the hang of git.)

Copy link
Owner

@karllark karllark left a comment

Choose a reason for hiding this comment

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

Some changes/responses needed.

new_uncs[j] = np.sum(full_flux_uncs[cspec][k][indxs]) / len(indxs)

# assign rebinned flux values to flux arrays
self.waves["STIS"] = new_waves
Copy link
Owner

Choose a reason for hiding this comment

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

Shouldn't this be cspec instead of "STIS"?

Comment on lines +161 to +168
full_fluxes = {}
full_flux_uncs = {}
full_fluxes[cspec] = np.zeros(
(self.n_models, len(moddata.data[cspec].fluxes))
)
full_flux_uncs[cspec] = np.zeros(
(self.n_models, len(moddata.data[cspec].fluxes))
)
Copy link
Owner

Choose a reason for hiding this comment

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

This seems like it is in the wrong place. Will this not re-initialize these variables for every value of k? This does not seem like the correct behavior.

Copy link
Owner

Choose a reason for hiding this comment

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

Almost feel that the self.n_models can be removed and just do full_fluxes and full_flux_uncs for each model. There is no need to have information about a previous model for rebinning, right?

Comment on lines -148 to -149
if self.temps_width2 == 0:
self.temps_width2 == 1.0
Copy link
Owner

Choose a reason for hiding this comment

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

Is there a reason these 2 lines (and the other two sets of two lines below) are removed? These are needed in case the width in a model parameter is zero (e.g., input a list of files w/o any variation in that parameter).

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.

2 participants