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

Saving and reloading a TIF does not preserve area name + id #2748

Open
simonrp84 opened this issue Feb 22, 2024 · 1 comment
Open

Saving and reloading a TIF does not preserve area name + id #2748

simonrp84 opened this issue Feb 22, 2024 · 1 comment

Comments

@simonrp84
Copy link
Member

Describe the bug
If I save a satpy Scene as a tif file and then reload it, the area attribute is not complete: It is missing the area_id, description and projection_id.

To Reproduce

scn = Scene(some_himawari_files, reader='ahi_hsd')
print(scn['B07'].attrs['area'])
scn.save_dataset('B07', filename='test.tif')

scn2 = Scene(['test.tif'], reader='generic_image')
scn2.load(['image'])
print(scn2['image'].attrs['area'])

Expected behavior
Printouts from scn and scn2 areas that are identical.

Actual results
The printout from scn2 does not have some attributes:
scn:

Area ID: FLDK
Description: AHI FLDK area
Projection ID: geosh9
Projection: {'a': '6378137', 'h': '35785863', 'lon_0': '140.7', 'no_defs': 'None', 'proj': 'geos', 'rf': '298.257024882273', 'type': 'crs', 'units': 'm', 'x_0': '0', 'y_0': '0'}
Number of columns: 5500
Number of rows: 5500
Area extent: (-5499999.9012, -5499999.9012, 5499999.9012, 5499999.9012)

scn2:

Area ID: None
Description: None
Projection ID: unknown
Projection: {'a': '6378137', 'h': '35785863', 'lon_0': '140.7', 'no_defs': 'None', 'proj': 'geos', 'rf': '298.257024882273', 'type': 'crs', 'units': 'm', 'x_0': '0', 'y_0': '0'}
Number of columns: 5500
Number of rows: 5500
Area extent: (-5499999.9012, -5499999.9012, 5499999.9012, 5499999.9012)

Environment Info:

  • OS: Win 10 and Ubuntu 20.04
  • Satpy Version: Latest main
@gerritholl
Copy link
Collaborator

I don't think that information can be portably stored in Thousands of Incompatible File Formats (TIFF) files. At DWD we used to have a production chain where we stored and read again TIFF files, but switched to NetCDF for this reason. Satpy could invent a way to store its metadata in a TIFF header and then introduce a specific reader for this (it wouldn't be a generic image reader but a dedicated satpy-tiff reader), but by then NetCDF-CF is arguably really the more appropriate fileformaat.

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