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 a reader for FY-4A LMI level 2 data #1103
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1103 +/- ##
==========================================
+ Coverage 89.34% 89.44% +0.10%
==========================================
Files 195 201 +6
Lines 28785 29560 +775
==========================================
+ Hits 25717 26439 +722
- Misses 3068 3121 +53
Continue to review full report at Codecov.
|
@djhoese I have to assign the BTW, if I assign the |
# assign 'y' coords which is useful for multiscene, | ||
# although the units isn't meters | ||
len_data = data.coords['y'].shape[0] | ||
data.coords['y'] = np.arange(len_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.
Why do you need to assign these? I don't think you need y
coordinates here. Maybe I'm wrong and naming it y
is a bad idea, but I think that is consistent with other readers and the rest of Satpy. The dimension should be y
, but no coords
for it. My thought was instead that you add a data.coords['time'] = [... series of times ...]
then the MultiScene timeseries
function could be updated to look at that coordinate. So time
would be the only coordinate you add in the reader, the base reader will then add lon
and lat
for you.
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.
Got it! Here's the method:
tseries = pd.DatetimeIndex(np.repeat(data.attrs['start_time'], data.shape[0]))
data = data.expand_dims({'time': tseries})
data = data.rename({'x': 'y'})
Example:
<xarray.DataArray 'ER' (time: 31, y: 31)>
dask.array<where, shape=(31, 31), dtype=float32, chunksize=(31, 31), chunktype=numpy.ndarray>
Coordinates:
* time (time) datetime64[ns] 2019-07-25T05:25:10 ... 2019-07-25T05:25:10
Dimensions without coordinates: y
But, I will get this error when using MultiScene
by mscn = MultiScene.from_files(filenames, reader='lmi_l2', group_keys=('start_time', 'subtask_num'))
and imgs = mscn.blend(blend_function=timeseries)
:
ValueError: arguments without labels along dimension 'y' cannot be aligned because they have different dimension sizes: {8, 74, 44, 45, 86, 55, 24, 60, 93, 31}
The modification of MultiScene
is mentioned in #1173.
Here's an example of plotting the number of events on 7800m resolution. Code
|
That seems reasonable. I think it depends on what you are doing and what you hope to get out of it. |
This PR adds a reader for the FY-4A LMI (Lightning Mapping Imager) L2 data format which are NetCDF files.
flake8 satpy