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

Standardize units #259

Closed
wants to merge 9 commits into from
Closed

Standardize units #259

wants to merge 9 commits into from

Conversation

jdtsmith
Copy link
Contributor

What

This introduces a new file units.py which standardizes the units for science-packs, and eventually for the entire Features->Model->Fitter chain.

Why

This will:

  1. make a proper AREA-based Gaussian/Drude fitter possible (see Area Gauss/Drude #225)
  2. standardize the report of value in results Features tables
  3. ensure most values are within say 5 dex of unity for table glance-ability and to helping with underflow.

Note: we will convert any user input units into this format, and optionally convert tabulated/plotted output to the user's spectral units. But for specifying the PAHFIT science model to be fitted itself, these are the working units [1].

See this comment for information on how we can leverage astropy.units to understand user-input spectral units, e.g. to discriminate between flux density and spectral intensity (aka surface brightness).

Proposed PAHFIT working + output units summary:

Type Working Unit
Wavelength/FWHM/spectral_axis[2] µm
Temperature[2] K
Flux density mJy
Flux power 1e-22 W/m2
— OR —
Surface Brightness/Intensity MJy/sr
Surface Brightness Power 1e-10 W/m2/sr

[1] Internally, fitters may adopt any different units for convenience or other reasons, but that is a hidden implementation detail. For the user, these will be the working units.
[2] These are already effectively standards in our science packs

@codecov-commenter
Copy link

Codecov Report

Merging #259 (296abe2) into master (89baf2d) will increase coverage by 0.40%.
The diff coverage is 93.54%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #259      +/-   ##
==========================================
+ Coverage   64.78%   65.19%   +0.40%     
==========================================
  Files          14       15       +1     
  Lines        1045     1063      +18     
==========================================
+ Hits          677      693      +16     
- Misses        368      370       +2     
Impacted Files Coverage Δ
pahfit/features/features.py 74.50% <90.90%> (+0.15%) ⬆️
pahfit/units.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jdtsmith
Copy link
Contributor Author

Note that this supersedes #241 ; the tied-features component of which will be submitted as a separate PR after this gets merged.

@jdtsmith
Copy link
Contributor Author

jdtsmith commented May 9, 2024

An extended version of this PR is now in #284.

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