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

FY-4A REGC data got wrong area_def #2666

Open
sgxl opened this issue Dec 5, 2023 · 2 comments
Open

FY-4A REGC data got wrong area_def #2666

sgxl opened this issue Dec 5, 2023 · 2 comments

Comments

@sgxl
Copy link

sgxl commented Dec 5, 2023

Hi, thanks for maintaining satpy.

Describe the bug
When I read the Level-1 REGC(not full-disk data) files of FY-4A AGRI sensor using the satpy package, wrong area_def was gotten.

To Reproduce

print(f'The version of satpy: {satpy.__version__}')

print(f'Input filenames:')
for file in file_list_fy4a:
    print(f'-- {os.path.basename(file)}')

# Reading datas with satpy
reader_fy4a = satpy.Scene(filenames=file_list_fy4a, reader='agri_fy4a_l1')
reader_fy4a.load(['C12', 'C13'])
# get the area_def of the scene
area_fy4a = reader_fy4a.coarsest_area()
lons_fy4a, lats_fy4a = area_fy4a.get_lonlats()

# plot the distribution of Latitudes of each pixel of the scene
plt.imshow(lats_fy4a, cmap='rainbow')
plt.colorbar(shrink=0.5, label='Latitude')
plt.tight_layout()
plt.show()

Expected behavior
The REGC file is a small observation area of FY-4A scan mechanism, the area_def of the scene should cover China region (in the Northern Hemisphere).

But what I got is a wrong area_def in the southern hemisphere, I think there may be some code wrong while reading the REGC file of FY-4A, the area should be a subset the geostationary projection, and the indices for the subset is set in the attributes of HDF file of FY-4A. (sorry that I haven't check the source code yet because I am not familiar with the code structure for satpy now)
image

Actual results
image

Screenshots
Obviously, the figure beblow shows wrong latitude value distribution of each pixel. (detatils are in the "Expected behavior" section above, thanks)
image

I am not certained that whether it is a bug or my coding fault.

@djhoese
Copy link
Member

djhoese commented Dec 5, 2023

Here is where the area definition is created for this reader and the Begin/End Line Number attributes are read:

begin_cols = float(self.file_content["/attr/Begin Pixel Number"])
end_lines = float(self.file_content["/attr/End Line Number"])

However, you say you're using Satpy 0.42.2 which means you are missing a lot of changes to Satpy. This includes this:

#2533

which may include fixes for some of the stuff you're seeing. Could you try updating and see if it fixes things for you?

@sgxl
Copy link
Author

sgxl commented Dec 5, 2023

Thank you for your response. I will update my satpy package and try again. I apologize for not checking the posted issues carefully.

Here is where the area definition is created for this reader and the Begin/End Line Number attributes are read:

begin_cols = float(self.file_content["/attr/Begin Pixel Number"])
end_lines = float(self.file_content["/attr/End Line Number"])

However, you say you're using Satpy 0.42.2 which means you are missing a lot of changes to Satpy. This includes this:

#2533

which may include fixes for some of the stuff you're seeing. Could you try updating and see if it fixes things for you?

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

No branches or pull requests

2 participants