Skip to content
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

Metadata name problem in HY-2B L2B reader #1783

Closed
MengXin001 opened this issue Aug 3, 2021 · 6 comments · Fixed by #1785
Closed

Metadata name problem in HY-2B L2B reader #1783

MengXin001 opened this issue Aug 3, 2021 · 6 comments · Fixed by #1785
Assignees

Comments

@MengXin001
Copy link

MengXin001 commented Aug 3, 2021

  • First, I found that one of the names in Global_Attributes maybe changed from L2B_Number_WVC_cells to L2B_Expected_WVC_Cells.
    "L2B_Number_WVC_cells": self['/attr/L2B_Number_WVC_cells'],

    I use the data provided by NSOAS. Due to I don't have EUMETCast data that I can't verify whether it is different from the data distributed by EUM.
    Metadata
  • Second
    During the plotting process, found that if this error is not modified, an error will be reported as
Failed to load DataID(name='wvc_lat', resolution=25000, modifiers=()) from <HY2SCATL2BH5FileHandler: 'C:/...too long.h5'>
Traceback (most recent call last):
File "C:\ProgramData\Miniconda3\envs\my_satpy_env\lib\site-packages\satpy\readers\yaml_reader.py", line 689, in _load_dataset
projectable = fh.get_dataset(dsid, ds_info)
File "C:\ProgramData\Miniconda3\envs\my_satpy_env\lib\site-packages\satpy\readers\hy2_scat_l2b_h5.py", line 99, in get_dataset
data = self._mask_data(key['name'], data)
File "C:\ProgramData\Miniconda3\envs\my_satpy_env\lib\site-packages\satpy\readers\hy2_scat_l2b_h5.py", line 118, in _mask_data
valid_range = self[key_name].attrs['valid range']
KeyError: 'valid range'

I fixed valid range into valid_range in this line. Don’t know if I’m doing this correctly?

valid_range = self[key_name].attrs['valid range']

  • Third is about a question that is it support to draw wind direction vector arrows? The image I processed through composite only has the wind speed color filling map.

Thanks for your attention to this matter.

@djhoese
Copy link
Member

djhoese commented Aug 3, 2021

I think @TAlonglong originally wrote the reader so he may have to comment on the accuracy of 1 and 2. They both seem like they could be differences between your data provider and EUMETCast.

For your third question, Satpy only really deals with producing raster images of raster data. In the most generic sense it takes data arrays and writes them to some file format like geotiff or netcdf. For drawing vector arrows you'll probably want to look at providing the data to matplotlib. Xarray has a helper property for this. In Satpy, scn['some_product'] will give you an xarray DataArray and you can call scn['some_product'].plot(...) to plot the data using matplotlib with some logical defaults. You can find more here but I see a TODO on that page that they need to add an example of using .quiver which is what you would use in matplotlib to draw vector arrows.

@TAlonglong
Copy link
Collaborator

1: Yes, looks like this has changed. I will need to look into this.
2: As far as I can see valid range still is correct in the file I look at. But I agree using a space as an attribute name might not work on every platform. But I will have a look at this also.
3: djhoese has answered this.

@MengXin001
Copy link
Author

Thanks advices!
And the Attributes name between HY-2C and HY-2B has different name.
In HY2C the name is same as original L2B_Number_WVC_cells. (This specification looks strange)

@TAlonglong
Copy link
Collaborator

OK

Looking into this I see in the data files I have available the read is still correct. Meaning there are no L2B_Expected_WVC_Cells attribute in the data I have available-

On eumetcast we only have HY-2B data available as far as I can see. https://navigator.eumetsat.int/product/EO:EUM:DAT:0381?query=HY-2B&s=advanced

To make any progress I need accurate documentation of the file format or examples files I can partly reverse engineer the documentation from.

Sorry.

@MengXin001
Copy link
Author

@MengXin001
Copy link
Author

Got it! Thank you for your hard work!
H2B_OPER_SCA_L2B_OR_20210828T225139_20210829T003602_14257_pwp_250_07_owv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants