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

Use SNClass.check_overlaps(...) in the SNClass.plot_lc(...) instead of the hacky way it is now #11

Open
RobFirth opened this issue Feb 24, 2017 · 0 comments

Comments

@RobFirth
Copy link
Owner

RobFirth commented Feb 24, 2017

SNClass.check_overlaps(...) makees a list of overlapping filters. At the moment, SNClass.plot_lc(...) looks like:

if mark_spectra:

    for spec_key in self.spec:
        if verbose: print(np.nanmin(self.spec[spec_key].wavelength) - filter_uncertainty, self.phot.data_filters[filter_key]._lower_edge)
        if verbose: print(np.nanmax(self.spec[spec_key].wavelength) + filter_uncertainty, self.phot.data_filters[filter_key]._upper_edge)

        if verbose: print(self.spec[spec_key].data.meta["filename"] )
        too_blue =  self.phot.data_filters[filter_key]._lower_edge < np.nanmin(self.spec[spec_key].wavelength) - filter_uncertainty
        too_red = self.phot.data_filters[filter_key]._upper_edge > np.nanmax(self.spec[spec_key].wavelength) + filter_uncertainty
        # if self.spec[spec_key]. self.phot.data_filters[filter_key]._upper_edge and self.phot.data_filters[filter_key]._lower_edge
        if verbose: print(too_blue, too_red)
        if not too_red and not too_blue:
            ax1.plot([self.spec[spec_key].mjd_obs, self.spec[spec_key].mjd_obs],
                     [0.0, np.nanmax(self.phot.phot['flux'])*1.5],
                     ls = ':', color = hex['batman'], zorder = 0)

Should be able to replace it with:

for spectrum in self.spec:
    if filter in self.spec. _overlapping_filter_list:
        plot spec
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

No branches or pull requests

1 participant