-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix units JSON units error in notebook (#3206)
* fix error loading various units (counts, nJy, etc) in notebook
- Loading branch information
1 parent
fc88465
commit 12d3b04
Showing
8 changed files
with
112 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,24 @@ | ||
import astropy.units as u | ||
|
||
__all__ = ["PIX2", "SPEC_PHOTON_FLUX_DENSITY_UNITS"] | ||
|
||
# define custom composite units here | ||
PIX2 = u.pix * u.pix | ||
|
||
|
||
def _spectral_and_photon_flux_density_units(): | ||
""" | ||
This function returns an alphabetically sorted list of string representations | ||
of spectral and photon flux density units. This list represents flux units | ||
that the unit conversion plugin supports conversion to and from if the input | ||
data unit is compatible with items in the list (i.e is equivalent directly | ||
or with u.spectral_density(cube_wave)). | ||
""" | ||
flux_units = ['Jy', 'mJy', 'uJy', 'MJy', 'W / (Hz m2)', 'eV / (Hz s m2)', | ||
'erg / (Hz s cm2)', 'erg / (Angstrom s cm2)', | ||
'ph / (Angstrom s cm2)', 'ph / (Hz s cm2)'] | ||
|
||
return sorted(flux_units) | ||
|
||
|
||
SPEC_PHOTON_FLUX_DENSITY_UNITS = _spectral_and_photon_flux_density_units() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters