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

Problem in converting VIIRS hdf to geotif #2014

Closed
anikfal opened this issue Feb 8, 2022 · 3 comments
Closed

Problem in converting VIIRS hdf to geotif #2014

anikfal opened this issue Feb 8, 2022 · 3 comments

Comments

@anikfal
Copy link

anikfal commented Feb 8, 2022

Code:

from satpy.scene import Scene
import numpy as np

band = "I01"
I_file = "GIMGO-SVI01-SVI02-SVI03-SVI05_npp_d20210617_t0839481_e0845285_b49940_c20220126103725933335_oeac_ops.h5"
scn = Scene(reader='viirs_sdr', filenames=[I_file])
scn.load([band])
my_area = scn[band].attrs['area'].compute_optimal_bb_area({'proj': 'lcc', 'lon_0': 35., 'lat_0': 50., 'lat_1': 50., 'lat_2': 50.})
new_scn = scn.resample(my_area)
new_scn.save_datasets(writer='geotiff', dtype=np.float32, enhance=False)

Errors:

/home/anikfal/miniconda3/envs/mysat/lib/python3.10/site-packages/pyproj/crs/crs.py:1256: UserWarning: You will likely lose important projection information when converting to a PROJ string from another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
return self._crs.to_proj4(version=version)
Traceback (most recent call last):
File "/home/anikfal/sebal_10m/image/20210519/4band_extract.py", line 14, in
new_scn.save_datasets(writer='geotiff', dtype=np.float32, enhance=False)
File "/home/anikfal/11/satpy/satpy/scene.py", line 1143, in save_datasets
return writer.save_datasets(dataarrays, compute=compute, **save_kwargs)
File "/home/anikfal/11/satpy/satpy/writers/init.py", line 687, in save_datasets
results.append(self.save_dataset(ds, compute=False, **kwargs))
File "/home/anikfal/11/satpy/satpy/writers/init.py", line 813, in save_dataset
return self.save_image(img, filename=filename, compute=compute, fill_value=fill_value, **kwargs)
File "/home/anikfal/11/satpy/satpy/writers/geotiff.py", line 251, in save_image
return img.save(filename, fformat='tif', driver=driver,
File "/home/anikfal/miniconda3/envs/mysat/lib/python3.10/site-packages/trollimage/xrimage.py", line 423, in save
return self.rio_save(filename, fformat=fformat,
File "/home/anikfal/miniconda3/envs/mysat/lib/python3.10/site-packages/trollimage/xrimage.py", line 558, in rio_save
r_file = RIOFile(filename, 'w', driver=driver,
TypeError: trollimage.xrimage.RIOFile() got multiple values for keyword argument 'driver'

Environment Info:

  • OS: Fedora 33
  • Satpy Version: 0.33.1
  • PyResample Version: 1.22.1

Note:
The same code in the environment below, shows no problem/errors:

  • OS: CentOS 7
  • Satpy Version: 0.25.1
  • PyResample Version: 1.17.0
@gerritholl
Copy link
Collaborator

What's your version of trollimage? Do you still get this if you upgrade trollimage to the latest version?

@anikfal
Copy link
Author

anikfal commented Feb 8, 2022

Version of my trollimage is 1.16.1
It cannot be updated by the command below. It tries to solve environment ...
conda update trollimage

Maybe It's better to update the whole satpy.

@djhoese
Copy link
Member

djhoese commented Feb 8, 2022

You'd either need to downgrade satpy or upgrade trollimage. Sorry about that.

@anikfal anikfal closed this as completed Feb 9, 2022
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

3 participants