Dear GMT community forum,
We are having problems with a (n alleged) geoTIFF file created by NASA containing data from the Magellan mission to Venus. Actually several of them, but for the purposes of this post, I will confine myself to a relatively small file (although we eventually want to use a huge one).
We are trying to use pyGMT to display this Synthetic Aperture Radar (SAR) data for Venus volcanic structures, but apparently the GMT means of importing a geoTIFF (via GDAL) does not recognize the geographic nature of the data, interpreting the geographic bounds (lon/lat) that we are requesting as the native (x/y) coordinates of the TIFF image.
And yes, our end product will be used with pyGMT, but I’m also using “regular” GMT6 to work on this, and both modes are experiencing the same problem, so this is not a “GMT” vs “pyGMT” issue, but rather an overall GMT issue with reading these particular geoTIFFs.
Here is the output of grdinfo for the file we are trying to use:
(base) MP-McGovern-14:Venus mcgovern$ gmt6 grdinfo Venus_Magellan_C3-MDIR_Global_Mosaic_2025m.tif
Venus_Magellan_C3-MDIR_Global_Mosaic_2025m.tif: Title: Grid imported via GDAL
Venus_Magellan_C3-MDIR_Global_Mosaic_2025m.tif: Command:
Venus_Magellan_C3-MDIR_Global_Mosaic_2025m.tif: Remark:
Venus_Magellan_C3-MDIR_Global_Mosaic_2025m.tif: Pixel node registration used [Cartesian grid]
Venus_Magellan_C3-MDIR_Global_Mosaic_2025m.tif: Grid file format: gd = Import/export through GDAL
Venus_Magellan_C3-MDIR_Global_Mosaic_2025m.tif: x_min: -19009777.1469 x_max: 19009597.8531 x_inc: 2025 name: x n_columns: 18775
Venus_Magellan_C3-MDIR_Global_Mosaic_2025m.tif: y_min: -9505811.42656 y_max: 9504888.57344 y_inc: 2025 name: y n_rows: 9388
Venus_Magellan_C3-MDIR_Global_Mosaic_2025m.tif: z_min: 1 z_max: 244 name: z
Venus_Magellan_C3-MDIR_Global_Mosaic_2025m.tif: scale_factor: 1 add_offset: 0
+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +R=6051000 +units=m +no_defs
Note that the x and y information is in the raw image coordinate system and not lon/lat like it should be. Consider the equivalent output from a Mars data file (also from the same source, the NASA/USGS Astropedia site):
(base) MP-McGovern-14:HRSC_MOLA mcgovern$ gmt6 grdinfo Mars_HRSC_MOLA_BlendDEM_Global_200mp_v2.tif
Mars_HRSC_MOLA_BlendDEM_Global_200mp_v2.tif: Title: Grid imported via GDAL
Mars_HRSC_MOLA_BlendDEM_Global_200mp_v2.tif: Command:
Mars_HRSC_MOLA_BlendDEM_Global_200mp_v2.tif: Remark:
Mars_HRSC_MOLA_BlendDEM_Global_200mp_v2.tif: Pixel node registration used [Geographic grid]
Mars_HRSC_MOLA_BlendDEM_Global_200mp_v2.tif: Grid file format: gd = Import/export through GDAL
Mars_HRSC_MOLA_BlendDEM_Global_200mp_v2.tif: x_min: -180 x_max: 179.998447904 x_inc: 0.00337412083064 name: x n_columns: 106694
Mars_HRSC_MOLA_BlendDEM_Global_200mp_v2.tif: y_min: -89.9992239522 y_max: 90 y_inc: 0.00337412083064 name: y n_rows: 53347
Mars_HRSC_MOLA_BlendDEM_Global_200mp_v2.tif: z_min: -7917 z_max: 20834 name: z
Mars_HRSC_MOLA_BlendDEM_Global_200mp_v2.tif: scale_factor: 1 add_offset: 0
+proj=longlat +R=3396190 +no_defs
They are both geoTIFFs generated by the same agency/department, but this one (when imported by GDAL) was interpreted with the boundaries being in the correct lon/lat system, while the Venus one (also imported by GDAL) was not interpreted correctly. I will note at this point that we have tried things like grdcut, grdconvert, and even gdal_translate on the first (Venus) file, and none of these are able to recognize the geographic coordinate system. I also have some ideas about brute-force switching out of the coordinate systems (i.e., re-writing the file with the old data and new (geographical) coordinates, but I hope to avoid that (especially because the big file we’d like to use is 110 GB!!)
One difference that I see is in the last lines of the grdinfo readouts: the (correctly behaving) mars file has the simple readout “+proj=longlat +R=3396190 +no_defs”, while the (incorrectly behaving) Venus file has the more complex readout “+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +R=6051000 +units=m +no_defs”. Perhaps this information is incorrect and causing my problem? And if we edited it, perhaps the file could allow recognition of the geographic coordinate system?
Any advice y’all could give us as to how to force recognition of the geographic coordinate system would be gratefully accepted!
Best regards,
Pat McGovern