WIP: Reflectance concepts#329
WIP: Reflectance concepts#329jianyangli wants to merge 7 commits intoNASA-Planetary-Science:mainfrom
Conversation
* Rename `reflectance` to `dimensionless_albedo` * Use disk-integrated albedo (product of geometric albedo and disk-integrated phase function) rather than disk-average bidirectional reflectance * Add conversion between albedo and cross-section with a given total flux/magnitude * Updated docstrings and doctests * Add optional parameters `rh` and `delta` for future implementation.
* Update test data with the new albedo definition (albedo = reflectance * pi) * Add tests for `albedo_unit` * Add tests for convertion between albedo and size * Expand tests to cover the conversion in both directions for all cases * Replace np.isclose and np.allclose by u.isclose or u.allclose
Including all tests and remote tests.
mkelley
left a comment
There was a problem hiding this comment.
Is the PDF supposed to be included with the source code?
Please add an item to the CHANGELOG and note the API change (reflectance was replaced).
| 'projected_size', | ||
| ] | ||
|
|
||
|
|
There was a problem hiding this comment.
I've recently learned that, in general, __all__ should be before import statements. https://peps.python.org/pep-0008/#module-level-dunder-names
There was a problem hiding this comment.
Strange. When I put __all__ before the import statements, pycodestyle check returns errors:
(dev) jyli@adeona code % pycodestyle sbpy/units/core.py
/Users/jyli/.env/dev/lib/python3.8/site-packages/pycodestyle.py:113: FutureWarning: Possible nested set at position 1
EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
sbpy/units/core.py:29:1: E402 module level import not at top of file
sbpy/units/core.py:30:1: E402 module level import not at top of file
sbpy/units/core.py:31:1: E402 module level import not at top of file
sbpy/units/core.py:32:1: E402 module level import not at top of file
sbpy/units/core.py:33:1: E402 module level import not at top of file
sbpy/units/core.py:34:1: E402 module level import not at top of file
sbpy/units/core.py:37:1: E402 module level import not at top of file
sbpy/units/core.py:38:1: E402 module level import not at top of file
sbpy/units/core.py:39:1: E402 module level import not at top of file
I'm confused. Maybe I'll just do # noqa: E402?
There was a problem hiding this comment.
Well that's annoying. PEP8 has conflicting advice here. https://peps.python.org/pep-0008/#imports Then leave it as is. I'd rather not salt our code with noqa comments.
| >>> alb = xsec.to(albedo_unit, dimensionless_albedo('V', flux=mag)) | ||
| >>> print('{0:.4f}'.format(alb)) | ||
| 0.0900 albedo | ||
| """ |
There was a problem hiding this comment.
Do you have a good reference for more information on albedo and reflectance concepts?
There was a problem hiding this comment.
Yes, I will need to include references when we have a decision on the best approach.
What PDF? |
|
|
This PR is WIP and for discussion related to #328