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

Fix gauss total_flux unit handling #154

Merged
merged 2 commits into from Jun 25, 2018

Conversation

pllim
Copy link
Contributor

@pllim pllim commented Jun 22, 2018

Fix #153

@mkelley , are you interested to review before I merge?

@pllim pllim added this to the 0.1.2 milestone Jun 22, 2018
DOC: Update GaussianFlux1D examples
@pllim pllim force-pushed the fix-gauss-totalflux-units branch from 00ae6a1 to d0ea38e Compare June 22, 2018 19:53
@coveralls
Copy link

coveralls commented Jun 22, 2018

Coverage Status

Coverage increased (+0.1%) to 97.234% when pulling 931e5f9 on pllim:fix-gauss-totalflux-units into 10f3843 on spacetelescope:master.

# happen here.
tf_unit = u.erg / (u.cm * u.cm * u.s)
if isinstance(total_flux, u.Quantity):
total_flux = total_flux.to(tf_unit)
Copy link

Choose a reason for hiding this comment

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

Could this conversion to tf_unit include an equivalency parameter so that total fluxes can be provided in units of, e.g., photons/s/cm2 or Jy Hz?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mkelley , I thought about that but I wasn't sure if using u.spectral_density(mean) would give the correct conversion. If you think that is correct, then I can certainly add it in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, wait. I take it back. I can't use spectral_density because it is integrated flux unit.

Copy link

Choose a reason for hiding this comment

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

Ah, yes. I was thinking there was an equivalency for flux.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about we merge this as is and see how things play out over at astropy/astropy#7593?

Copy link

Choose a reason for hiding this comment

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

Great!

@mkelley
Copy link

mkelley commented Jun 22, 2018

Except for that comment, the changes all make sense to me. Thanks for the prompt fix.

@pllim pllim merged commit a469593 into spacetelescope:master Jun 25, 2018
@pllim pllim deleted the fix-gauss-totalflux-units branch June 25, 2018 14:33
@pllim
Copy link
Contributor Author

pllim commented Jun 25, 2018

@mkelley , do you need an immediate bug fix release or can you wait? If you can wait, is there a deadline? Thanks for the review!

@mkelley
Copy link

mkelley commented Jun 25, 2018

There's no rush for me. I can use the amplitude normalized gaussian just fine.

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

Successfully merging this pull request may close these issues.

None yet

3 participants