-
Notifications
You must be signed in to change notification settings - Fork 284
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
Fix re-loading of StaticImageCompositor composites in special cases #2243
Conversation
…nderlying sensor data is loaded.
@@ -419,12 +419,14 @@ composites: | |||
_night_background: | |||
compositor: !!python/name:satpy.composites.StaticImageCompositor | |||
standard_name: night_background | |||
sensor: 'viirs' |
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.
That doesn't seem right. Why VIIRS?
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.
The night background image is derived from VIIRS DNB data.
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.
I guess an alternative would be to set the sensor to generic
or something like that, but I figure we might as well set it to the correct thing...
Why do composites need a sensor? |
As mentioned on slack, in the multi-sensor case a set can be used |
Should If |
Not sure. I think my hope for a sensor value of
I'm not sure. Multiple sensors refer to the data making up the image. In that sensor multiple wavelengths make sense. However, multiple wavelengths should probably not be in an unordered set as I'm not sure how helpful that is after the fact. The more important thing is that the rest of Satpy won't understand what multiple wavelength ranges means. It is part of the DataID and is used to provide a "unique" identifier for a DataArray. What use case do you have for having the list/set of wavelength ranges that went into an RGB? |
Right; a set would be wrong here, a list would be more appropriate, because order matters and values are not guaranteed to be unique. I don't have a strong use case for retaining the units information. Nor am I quite sure what the use case is of having a set of sensors in the |
The sensor set is mostly to make enhancements happy since they can be organized in per-sensor files. |
@simonrp84 what is the status of this? I see tests are failing, is it something that we need to fix here? |
I'll clarify my feelings from above, I don't think this is the right fix for the original issue. I think Satpy should be fixed to handle a |
Fair enough, that makes sense - but I don't know the best way to fix satpy for handling |
As mentioned in my comment on #2242, re-loading a composite with no pre-requisites fails if the user hasn't loaded any satellite data first:
In the above code, the second
load
command will fail with an error as for the_night_background
composite thesensor
will beNone
.In this PR, I fix the problem by - optionally - allowing a
sensor
to be passed toStaticImageCompositor
via the YAML file. This will then be stored in the composite and prevents the error described above.