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
Add low level moisture composite #2164
Conversation
Add a composite to visualise low level moisure using the ratio between 0.91 µm and 0.86 µm. Experimental.
Codecov Report
@@ Coverage Diff @@
## main #2164 +/- ##
=======================================
Coverage 94.19% 94.20%
=======================================
Files 295 297 +2
Lines 45376 45438 +62
=======================================
+ Hits 42743 42805 +62
Misses 2633 2633
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Is there any documentation available for this? A link to a paper or even to a powerpoint deck or something would be nice to explain what this composite is showing, I suspect ESSL has some training docs, for example? |
First attempt to add a colorised version of the low level moisture composite. Work in progress as the actual colors are not linear.
I don't know if anything is public. I'm in contact with ESSL for the colour version and will ask about public documentation. |
Fix syntax error in enhancements/generic.yaml by removing an erroneous hyphen-minus.
Rename the low level moisture to include essl in the name. Another attempt at the colorised ESSL low level moisture. It still looks wrong, continuing to debug.
Should the colorised version be done in the compositor or in an enhancement? At first I tried it in the compositor: def __call__(self, projectables, others=None, **info):
"""Generate the ESSL low level moisture composite."""
(nir_086, nir_091) = projectables
with xr.set_options(keep_attrs=True):
ratio = nir_091 / nir_086
ratio = self._scale_and_clip(ratio)
red = self._calc_red(ratio)
green = self._calc_green(ratio)
blue = self._calc_blue(ratio)
return super().__call__([red, green, blue], **info) where
but I'm not sure if that's the correct way to create an enhancement (it results in a RGB image with bands Looking elsewhere in Satpy, it would seem an enhancement is the better place to define and apply a colormap, but I'm not sure. From a conversation on slack, I learned that it's possible to define an enhancement that does nothing, and that this will suppress the application of any other enhancements. I will try that next. |
It depends what you consider this operation. If you consider it similar to "applying a colormap" then it makes sense in the enhancements. If you consider it "generating an RGB from a single band" then I'd say it is a composite. It is a fine line. In the enhancement case, the end result has to be within a normalized 0 to 1 range. The data is then scaled during saving to the output format (ex. geotiff) to the range of the data type (ex. 0 to 255 for uint8) and then clipped. Your |
I finally managed to implement it as an enhancement. The trick was to modify What remains is probably not a Satpy issue but rather related to tuning the parameters of the enhancement. For MODIS I'm getting close, but when I try the same for FCI, the results look totally off. It may be that the tuning parameters are quite sensitive to the exact boundaries, for example, for the scaling. Those may need to be different for FCI than for MODIS. For this test I downloaded Terra MODIS data for the same date for which the FCI test data were simulated, and then generated the low level moisture composites from this PR as well as the input channels using either the MODIS data or the FCI test data. The simulated FCI 0.865 µm channel appears much brighter than the MODIS 0.8585 µm channel. The simulated FCI 0.914 µm channel is also brighter than the MODIS 0.905 µm channel, but the difference is smaller here. The greyscale ratio image is much brighter for MODIS than for simulated FCI. The colorised MODIS image looks OK, but the colorised FCI image looks completely off. This could either be due to inaccuracies in the FCI simulated radiances, or due to actual differences in the spectral response function. If this is due to real differences in the spectral response function, we will need different recipes for this composite between MODIS and FCI. FCI simulated, 0.865 µm reflectivityFCI simulated, 0.914 µm reflectivityMODIS 0.8585 µm reflectivityMODIS, 0.905 µm reflectivityMODIS greyscale low level moisture, ESSL scalingMODIS greyscale low level moisture, automatic scaling (default stretch)MODIS colorized low level moistureSimulated FCI greyscale low level moisture, ESSL scalingSimulated FCI low level moisture, automatic scaling (default stretch)Simulated FCI colorized low level moisture |
Are the test failures in |
The satpos test was mentioned by someone else in another PR and had a |
In a comment to #2181 @ameraner has pointed out that there is a bug in the FCI simulated 0.865 µm reflectivity and that the values should be multiplied by 0.8 prior to applying the composite. When I do so, the FCI-based colorized composite looks better, but could still do with a cloud mask and tuning: |
There is a bug in the simulated FCI test data for the 0.865 µm channel. Add a correction in the enhancement colorisation to correct for this bug.
For the ESSL moisture colorisation, add to the documentation the equations used to calculate the colours. Add the readthedocs mathjax plugin.
Failing in |
I have no idea why, but I can actually reproduce this failure locally. I will check. |
In test_all_datasets_one_reader, update expected number of composites to account for new composites in visir.yaml.
Like for the true color RGB, here too now all tests pass except for the experimental run, which is allowed to fail. The colours will still need tweaking, but this should be done only after we have real measurements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this product, looks very interesting! Just a couple of inline questions.
I tried to add a
and
but the results look different:
I don't understand why they don't look the same. From the logs, both appear to get the configured enhancement:
and
|
Fix the daytime versions of the low level moisture composites. Remove the redundant MODIS low level moisture composite.
I found out the problem. Satpy was applying the default enhancement. I had to add |
The failing tests
pass locally, and don't seem likely to be related to my changes. |
Ugh I must have broken something in the new geotiepoints. I'll take a look. |
codebeat is confused (again), it says I have introduced problems in modules I haven't touched. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for adding this interesting composite
Add the ESSL composite to visualise low level moisture using the ratio between 0.91 µm and 0.86 µm. Experimental.
Greyscale version:
Test image produced from FCI test data for 2017-09-20 11:20, stretched between 0.35 and 0.86.
In the greyscale version, clouds are white. Areas with high low level moisture are dark.
The fine structure will be more visible in a colorised version.
This visualisation was developed by Hans-Peter Rösli, Pieter Groenemeijer, and the European Severe Storms Laboratory..
AUTHORS.md
if not there already