0

I am trying to convert .h5 SMAP file to geotiff, but I keep getting

 File "<ipython-input-17-d6b129648904>", line 1
gdal_translate -a_srs "EPSG:3662" -a_ullr -20037508.3428 10018754.1714 20037508.3428 -10018754.1714 'HDF5:"SMAP_L3_SM_P_E_20170711_R15060_001.h5"://geotiff/' SMAP_L3_SM_P_E_20170711_R15060_001.tif
                                ^

SyntaxError: invalid syntax

I keep getting different answers on where to put the quotations. Also, I just want to confirm that if I use gdal_translate and specify that the output will be GeoTIFF, it will create a Geotiff file on my computer. I checked these resources already, but I am still stuck:

eLg
  • 519
  • 4
  • 11
  • 25
  • 1
    That looks like a shell command - it's meant to be used from something like bash or the Windows command prompt, not Python. It looks like you're in IPython, so you might be able to use it with a `!` at the front. – Thomas K May 28 '21 at 16:52
  • I tried to run this os.system(gdal_translate -a_srs "EPSG:3662" -a_ullr -20037508.3428 10018754.1714 20037508.3428 -10018754.1714 'HDF5:"SMAP_L3_SM_P_E_20170711_R15060_001.h5"://geotiff/' SMAP_L3_SM_P_E_20170711_R15060_001.tif'), but it did not create any file. Can you help me ? – eLg May 29 '21 at 04:51

0 Answers0