-
Notifications
You must be signed in to change notification settings - Fork 293
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 geolocation errors of the FY-4 AGRI reader base #2533
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2533 +/- ##
==========================================
- Coverage 94.89% 94.89% -0.01%
==========================================
Files 349 349
Lines 50859 50855 -4
==========================================
- Hits 48263 48259 -4
Misses 2596 2596
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Pinging @simonrp84 who I think added this reader or helped me add it. |
Yes, this is my reader. Will have a look in next few days. |
@simonrp84 What can I do with this PR? |
Sorry, haven't had time to look at this. Will test this evening if possible. For reference, the |
Just tested this and it looks good for all modes of AGRI on FY-4A and -4B. Also works for GHI on FY-4B. |
Great. @djhoese If you have any suggestions |
Pull Request Test Coverage Report for Build 5737717677
💛 - Coveralls |
Thanks! |
Fix the offset calculations in FY-4 reader base according to HSD reader.
1.Area extent of the GEOS projection
This is calculated by column/line offset (COFF/LOFF), CFAC, width/height of the image using
get_area_extent
under_geos_area
. But, this method begins at (0, 0) which is fit for full-disk image. When the scan mode is regional, the initial column/line position is also important. And that is why FY-4 REGC mode got the wrong area.2.Comparison between Himawari HSD with FY-4
HSD reader, no matter whether the data is fulldisk / regional, also uses
get_area_extent
. The differences are:Himawari full-disk COFF/LOFF
[22000.5, 11000.5, 5500.5, 2750.5, 1375.5]
Himawari full-disk width/height
[44000, 22000, 11000, 5500, 2750]
FY-4 full-disk COFF/LOFF
[21983.5, 10991.5, 5495.5, 2747.5, 1373.5]
FY-4 full-disk width/height
[43968, 21984, 10992, 5496, 2748]
Apparently,
Himawari's offset = width(height) / 2 + 0.5
While
FY-4's offset = width(height) / 2 - 0.5
That 1 pixel diff could explain why FY-4's center coord isn't at (0, 0).
And the calculation:
Himawari:
When testing on a target-area scanning dataset
HS_H09_20230701_0000_B01_R301_R10_S0101.DAT
:The COFF/LOFF of HSD is stored inside the dataset, not fixed like FY-4. So it seems that these two numbers come from nowhere. But, if this regional image reprojected to full-disk frame, it is clear that the scanning start at col 5140 / line 2220.
This is a 1000x1000 B01 dataset. The fulldisk size of B01 is 11000 and the COFF/LOFF is 5500.5.
Therefore:
3.Back on FY-4
Because of the 1-pixel difference:
Further:
end_line + 1 = start_line + pdict['nlines']
Luckily, both
start_column
andend_line
are attributes in the FY-4 HDF files. So it is very easy to get them.4.Results
The center point back to zero.
And the REGC image