Question about grdimage using the radar data of moon


I am learning how to use GMT to draw radar images of the moon.The data source is from the PDS Geoscience website: official software cannot display the latitude and longitude information of the data。

In the first step, I converted the data to tif format。The code is:
gdal_translate -of GTiff lsz_03726_2s1_eku_24s295_v1.lbl lsz_03726_2s1_eku_24s295_v1.tif

then, Get file information. The code is: gdalinfo lsz_03726_2s1_eku_24s295_v1.tif. We can get this:
Corner Coordinates:
Upper Left ( 3489287.797, -487142.848) ( 64d55’50.39"W, 16d 3’53.79"S)
Lower Left ( 3489287.797, -977291.379) ( 64d55’50.39"W, 32d13’44.41"S)
Upper Right ( 3509424.397, -487142.848) ( 64d15’59.77"W, 16d 3’53.79"S)
Lower Right ( 3509424.397, -977291.379) ( 64d15’59.77"W, 32d13’44.41"S)
Center ( 3499356.097, -732217.114) ( 64d35’55.08"W, 24d 8’49.10"S)
Band 1 Block=1360x1 Type=Float32, ColorInterp=Gray
NoData Value=-3.40282265508890445e+38

and Draw radar image. The code is:
gmt makecpt -Cgray -T0/0.5
gmt grdimage lsz_03726_2s1_eku_24s295_v1.tif -R-65/-64/-33/-16 -JX05c

But there is a blank image.Software display:
grdimage [WARNING]: Your grid y’s or latitudes appear to be outside the map region and will be skipped.
grdimage [WARNING]: No grid or image inside plot domain.

but the R-65/-64/-33/-16 don’t exceed the range of the map.I don’t know what happened, please help me

First, if gdal_translate worked there good chances that you can use the original file directly in GMT without needing to convert it to geotiff.

Now, the error comes from the fact that you gave it a -R in geographical coordinates when the data is in projected coords (Cartesian). Use those coords in -R

hi :咧着嘴笑:
I just want to display the latitude and longitude information of the picture,as in the picture below.
How should I display the image, Do I have to convert the data from Cartesian coordinate system to geographic coordinate system?

I’m afraid so, but have a look at example 28 to see if the idea can be adapted to your case.


When I converted the Cartesian coordinate system to the geographic coordinate system, I found that a lot of information was lost, resulting in blurry images. code show as below:

gdalwarp -s_srs “+proj=ob_tran +R=1737400 +o_proj=eqc +o_lon_p=-0.15859 +o_lat_p=180.637223 +lon_0=104.042948 +wktext +no_defs” E:\GMTSthdy\highlat\1\89s140.tif
-t_srs “+proj=latlon +a=1737400 +b=1737400” -te -180 -90 180 -88.5 -ot float32 -overwrite E:\GMTSthdy\highlat\1\89s140lonlat.tif

gdal_translate E:\GMTSthdy\highlat\1\89s140lonlat.tif E:\GMTSthdy\highlat\1\

gmt figure E:\GMTSthdy\highlat\1\89s140 pdf
gmt makecpt -Cgray -T0/0.5
gmt grdimage E:\GMTSthdy\highlat\1\ -R-180/180/-90/-88.2 -JS0/-90/7c -Bxa30f15

The results are shown below, the one on the left is without geographic projection

I don’t know how to solve this problem,please help me.

If your PDS file holds an image do not convert to netcdf. Actually, do not covert to nc in any case. Just gdalwarp the original to geotiff and use it directly.

Any reason to have done this?

I tried to directly convert the file to Geotiff format and use it directly, but the result is still not good.code show as below:

gdalsrsinfo -e -o proj4 E:\GMTSthdy\highlat\1\lsz_02261_2s1_oku_89s140_v1.lbl

gdalwarp -of GTiff -s_srs “+proj=ob_tran +R=1737400 +o_proj=eqc +o_lon_p=-0.15859 +o_lat_p=180.637223 +lon_0=104.042948 +wktext +no_defs” E:\GMTSthdy\highlat\1\lsz_02261_2s1_oku_89s140_v1.lbl -t_srs “+proj=latlon +a=1737400 +b=1737400” -ot float32 -overwrite E:\GMTSthdy\highlat\1\lsz_02261_2s1_oku_89s140_v1.tif

gmt figure E:\GMTSthdy\highlat\1\89s140 pdf
gmt makecpt -Cgray -T0/0.5
gmt grdimage E:\GMTSthdy\highlat\1\lsz_02261_2s1_oku_89s140_v1.tif -R-180/180/-90/-89
The picture drawn is: 1
When using the gdalwarp command, will the latitude sampling accuracy be insufficient? Because my file data is near the South Pole, its latitude ranges from 88.5S to 90S, and the longitude range is almost 0E to 180E.
I don’t know how to draw the image without distortion, just like the first picture. Perhaps providing you with the data link is a better choice.
and the header file is (2.0 KB) .
The data volume is about ten megabytes. When using it, two files need to be placed in one path.
Looking forward to your reply.

Converting to geogs so close to the pole is not such a good idea but the data projection is not natively supported in GMT so I don’t see how create a frame in geogs that fits exactly the data extents.
Play around with gdalwarp -tr to a reasonable converted grid. Something around these lines (probably need to tell grdimage to use the Moon spheroid)

gdalwarp -of GTiff --config CENTER_LONG 180 lsz_02261_2s1_oku_89s140_v1.lbl -t_srs "+proj=latlon +a=1737400 +b=1737400" -tr 0.014 0.0014 -overwrite lixo.tiff
grdimage lixo.tiff -JS0/-90/10c -P >