Skip to content

Commit

Permalink
Fix data type when getting a line offset for a segmented hrit_jma
Browse files Browse the repository at this point in the history
  • Loading branch information
k3a committed Oct 19, 2024
1 parent b02fd62 commit 7adbcdd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The following people have made contributions to this project:
- [Gerrit Holl (gerritholl)](https://github.com/gerritholl) - Deutscher Wetterdienst
- [David Hoese (djhoese)](https://github.com/djhoese)
- [Marc Honnorat (honnorat)](https://github.com/honnorat)
- [Mario Hros (k3a)](https://github.com/k3a)
- [Lloyd Hughes (system123)](https://github.com/system123)
- [Mikhail Itkin (mitkin)](https://github.com/mitkin)
- [Tommy Jasmin (tommyjasmin)](https://github.com/tommyjasmin)
Expand Down
4 changes: 2 additions & 2 deletions satpy/readers/hrit_jma.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ def _get_line_offset(self):
if self.is_segmented:
# loff in the file specifies the offset of the full disk image
# centre (1375/2750 for VIS/IR)
segment_number = self.mda["segment_sequence_number"] - 1
loff -= (self.mda["total_no_image_segm"] - segment_number - 1) * nlines
segment_number = int(self.mda["segment_sequence_number"]) - 1
loff -= (int(self.mda["total_no_image_segm"]) - segment_number - 1) * nlines
elif self.area_id in (NORTH_HEMIS, SOUTH_HEMIS):
# loff in the file specifies the start line of the half disk image
# in the full disk image
Expand Down
12 changes: 6 additions & 6 deletions satpy/tests/reader_tests/test_ahi_hrit.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def _get_mda(self, loff=5500.0, coff=5500.0, nlines=11000, ncols=11000,
proj_h8 = b"GEOS(140.70) "
proj_mtsat2 = b"GEOS(145.00) "
proj_name = proj_h8 if platform == "Himawari-8" else proj_mtsat2
return {"image_segm_seq_no": segno,
"total_no_image_segm": numseg,
return {"image_segm_seq_no": np.uint8(segno),
"total_no_image_segm": np.uint8(numseg),
"projection_name": proj_name,
"projection_parameters": {
"a": 6378169.00,
Expand All @@ -85,10 +85,10 @@ def _get_mda(self, loff=5500.0, coff=5500.0, nlines=11000, ncols=11000,
},
"cfac": 10233128,
"lfac": 10233128,
"coff": coff,
"loff": loff,
"number_of_columns": ncols,
"number_of_lines": nlines,
"coff": np.int32(coff),
"loff": np.int32(loff),
"number_of_columns": np.uint16(ncols),
"number_of_lines": np.uint16(nlines),
"image_data_function": idf,
"image_observation_time": self._get_acq_time(nlines)}

Expand Down

0 comments on commit 7adbcdd

Please sign in to comment.