Skip to content

Commit

Permalink
Merge pull request #2969 from mraspaud/fix-insat-geoloc
Browse files Browse the repository at this point in the history
Fix geos proj parameters for Insat 3d satellites
  • Loading branch information
mraspaud authored Nov 13, 2024
2 parents a68c801 + 73fc304 commit c214917
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions satpy/readers/insat3d_img_l1b_h5.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ def get_area_def(self, ds_id):
#fov = self.datatree.attrs["Field_of_View(degrees)"]
fov = 18
cfac = 2 ** 16 / (fov / cols)
lfac = 2 ** 16 / (fov / lines)

# From reverse engineering metadata from a netcdf file, we discovered
# the lfac is actually the same as cfac, ie dependent on cols, not lines!
lfac = 2 ** 16 / (fov / cols)

h = self.datatree.attrs["Observed_Altitude(km)"] * 1000
# WGS 84
Expand All @@ -191,8 +194,8 @@ def get_area_def(self, ds_id):
pdict = {
"cfac": cfac,
"lfac": lfac,
"coff": cols / 2,
"loff": lines / 2,
"coff": cols // 2 + 1,
"loff": lines // 2,
"ncols": cols,
"nlines": lines,
"scandir": "N2S",
Expand Down
2 changes: 2 additions & 0 deletions satpy/tests/reader_tests/test_insat3d_img_l1b_h5.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ def test_filehandler_returns_area(insat_filehandler):
area_def = fh.get_area_def(ds_id)
_ = area_def.get_lonlats(chunks=1000)
assert subsatellite_longitude == area_def.crs.to_cf()["longitude_of_projection_origin"]
np.testing.assert_allclose(area_def.area_extent, [-5620072.101427, -5640108.009097,
5620072.101427, 5644115.190631])


def test_filehandler_has_start_and_end_time(insat_filehandler):
Expand Down

0 comments on commit c214917

Please sign in to comment.