Introduce unnormalized_reflectance calibration level - #3292
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3292 +/- ##
========================================
Coverage 96.30% 96.30%
========================================
Files 466 466
Lines 59090 59340 +250
========================================
+ Hits 56908 57149 +241
- Misses 2182 2191 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Pull Request Test Coverage Report for Build 19459512598Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
radiance_factor calibration level and standard nameunnormalized_reflectance calibration level
sfinkens
left a comment
There was a problem hiding this comment.
Monumental effort 💪 The scissors idea really works well. Except for the calibration update, the YAML changes are mostly auto-formatting, right?
| if dataset_id.get("calibration") == "reflectance": | ||
| warnings.warn("Reflectance is not a correct calibration for GMS-5/VISSR, " | ||
| "please use 'unnormalized_reflectance'", | ||
| DeprecationWarning) |
There was a problem hiding this comment.
This appears in many files, maybe factorize?
There was a problem hiding this comment.
We are going to remove these just after release 0.61.0, so in this case I think it's better to have it explicitly in each affected reader.
| Satpy reads reflective data and carries two calibration levels for it: unnormalized_reflectance and reflectance. | ||
| The difference is that reflectance is normalised by the cosine of the sun zenith angle, while the | ||
| unnormalized_reflectance is not. | ||
|
|
||
| Unnormalized_reflectance: |
There was a problem hiding this comment.
| Satpy reads reflective data and carries two calibration levels for it: unnormalized_reflectance and reflectance. | |
| The difference is that reflectance is normalised by the cosine of the sun zenith angle, while the | |
| unnormalized_reflectance is not. | |
| Unnormalized_reflectance: | |
| Satpy reads reflective data and carries two calibration levels for it: ``unnormalized_reflectance`` and ``reflectance``. | |
| The difference is that ``reflectance`` is normalised by the cosine of the sun zenith angle, while the | |
| ``unnormalized_reflectance`` is not. | |
| Unnormalized reflectance: |
pnuu
left a comment
There was a problem hiding this comment.
I didn't go through all the changes, so I only added one suggestion to FAQ to highlight the "programmatic" words.
Are all the pre-v1.0 warnings marked with the "scissors"?
What I saw (and did in the early stages my self) looks good in general.
gerritholl
left a comment
There was a problem hiding this comment.
Looks good, thanks for the work! Some small comments/questions inline.
|
|
||
| 1. The geolocation is in a separate file, used for all bands | ||
| 2. VIS data is calibrated to Albedo (or reflectance) | ||
| 2. VIS data is calibrated to Albedo (or unnormalized_reflectance) |
There was a problem hiding this comment.
albedo is not reflectance or unnormalized reflectance, is there actually an albedo product (level 2)?
There was a problem hiding this comment.
not that I know of, but I do not have experience with this reader.
| from satpy.readers.core.file_handlers import BaseFileHandler | ||
| from satpy.utils import get_legacy_chunk_size | ||
|
|
||
| # >8 v1.0 |
There was a problem hiding this comment.
Is this comment in the wrong place?
| raise ValueError("Calibration parameter should be radiance, " | ||
| "reflectance or brightness_temperature") | ||
| # 8< v1.0 | ||
| "reflectance, " |
There was a problem hiding this comment.
Maybe we shouldn't suggest a calibration parameter that is deprecated?
There was a problem hiding this comment.
it's for backwards compatibility until we move on to 1.0
There was a problem hiding this comment.
Yes, reflectance is still supported, but here we are suggesting to the user what calibrations to use, which is essentially documentation. I would argue that reflectance should work, but we should not mention that it works. A user might read this error message, decide to use reflectance, and then gets a warning that this is deprecated.
|
|
||
| res.load(["VIS", "VNIR", "TIR1", "TIR3", "solar_azimuth_angle", "land_water_mask"]) | ||
| # 8< v1.0 | ||
| assert len(available_datasets) == 31 |
There was a problem hiding this comment.
Why has the number of available datasets increased?
There was a problem hiding this comment.
I guess because we added unnormalised reflectance items to the list
yes |
Co-authored-by: Gerrit Holl <gerrit.holl@gmail.com>
Co-authored-by: Panu Lahtinen <pnuu+git@iki.fi>
I hope so :) |
|
One other thought: maybe the warning messages should include a message that the returned value for "reflectance" is not a reflectance due to the missing SZA normalisation, but is actually the unnormalised reflectance. The way it is now, users could get the impression that satpy so far returns reflectance but is switching to unnormalised reflectance (changed physics), whereas in reality we are only correcting the name. |
ameraner
left a comment
There was a problem hiding this comment.
Great work, thank you! Just some notes on the FAQ.
|
|
||
| Reflectance: | ||
|
|
||
| ρ = L_vis × solar_irradiance / πcos(sza) |
There was a problem hiding this comment.
aren't we missing the Sun-Earth distance correction in these formulas?
There was a problem hiding this comment.
Depends how you define the solar irradiance?
There was a problem hiding this comment.
Yes, but the solar irradiance is pretty much always defined at 1AU, hence the need to have the distance correction term...
There was a problem hiding this comment.
FYI the link to the FCI L1c guide with the formula: https://user.eumetsat.int/resources/user-guides/mtg-fci-level-1c-data-guide#ID-Converting-from-effective-radiance-to-reflectance-for-VNIR-channels
There was a problem hiding this comment.
I think for clarity it's useful to include the Sun-Earth distance here
| What are the reflectance vs unnormalized reflectance quantities for reflective channels | ||
| --------------------------------------------------------------------------------------- | ||
|
|
||
| Satpy reads reflective data and carries two calibration levels for it: `unnormalized_reflectance` and `reflectance`. |
There was a problem hiding this comment.
a suggestion
| Satpy reads reflective data and carries two calibration levels for it: `unnormalized_reflectance` and `reflectance`. | |
| Satpy reads data from reflective/solar channels and carries two calibration levels for it: `unnormalized_reflectance` and `reflectance`. |
This PR introduce the
unnormalized_reflectancecalibration level to refer to reflectance not yet normalised by the solar pathlength, along with the corresponding standard name.reflectance_channel_XTop of the Atmosphere Reflectance, which is obtained using the scene center sun angle