# Question about grdimage using the radar data of moon

**URL:** <https://forum.generic-mapping-tools.org/t/question-about-grdimage-using-the-radar-data-of-moon/841>\
**Category:** Q&A\
**Created:** [September 3, 2020, 8:34am UTC](https://forum.generic-mapping-tools.org/t/question-about-grdimage-using-the-radar-data-of-moon/841 "2020-09-03T08:34:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![brightness0906](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/brightness0906/32/499_2.png) [@brightness0906](https://forum.generic-mapping-tools.org/u/brightness0906)\
**Post date:** [September 3, 2020, 8:34am UTC](https://forum.generic-mapping-tools.org/t/question-about-grdimage-using-the-radar-data-of-moon/841/1 "2020-09-03T08:34:53Z")

</div>

Hi

I am learning how to use GMT to draw radar images of the moon.The data source is from the PDS Geoscience website: [https://ode.rsl.wustl.edu/moon/.The](https://ode.rsl.wustl.edu/moon/.The) 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

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [September 3, 2020, 9:28am UTC](https://forum.generic-mapping-tools.org/t/question-about-grdimage-using-the-radar-data-of-moon/841/2 "2020-09-03T09:28:51Z")

</div>

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**

---

<div class="post-metadata">

**Author:** ![brightness0906](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/brightness0906/32/499_2.png) [@brightness0906](https://forum.generic-mapping-tools.org/u/brightness0906)\
**Post date:** [September 3, 2020, 9:38am UTC](https://forum.generic-mapping-tools.org/t/question-about-grdimage-using-the-radar-data-of-moon/841/3 "2020-09-03T09:38:55Z")

</div>

> [@brightness0906](#):
>
> -JX05c

hi :咧着嘴笑:  
I just want to display the latitude and longitude information of the picture，as in the picture below.

 ![example](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/65b7b6ee8c152e223321a036e1b6c295b40ce7bc.png)  
How should I display the image, Do I have to convert the data from Cartesian coordinate system to geographic coordinate system?

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [September 3, 2020, 9:48am UTC](https://forum.generic-mapping-tools.org/t/question-about-grdimage-using-the-radar-data-of-moon/841/4 "2020-09-03T09:48:46Z")

</div>

I’m afraid so, but have a look at [example 28](https://docs.generic-mapping-tools.org/6.0/gallery/ex28.html#example-28) to see if the idea can be adapted to your case.

---

<div class="post-metadata">

**Author:** ![brightness0906](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/brightness0906/32/499_2.png) [@brightness0906](https://forum.generic-mapping-tools.org/u/brightness0906)\
**Post date:** [September 3, 2020, 2:31pm UTC](https://forum.generic-mapping-tools.org/t/question-about-grdimage-using-the-radar-data-of-moon/841/5 "2020-09-03T14:31:06Z")

</div>

hi

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\89s140lonlat.nc

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

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

 ![1](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/30aabdf8d0cf19b842a9e4c605a9d94b69d17426.png) ![2](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/51f2656ae983a1e6b9dfc3ae8bc201df83a4e3c1.png)

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

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [September 3, 2020, 4:18pm UTC](https://forum.generic-mapping-tools.org/t/question-about-grdimage-using-the-radar-data-of-moon/841/6 "2020-09-03T16:18:49Z")

</div>

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.

> [@brightness0906](#):
>
> -te -180 -90 180 -88.5

Any reason to have done this?

---

<div class="post-metadata">

**Author:** ![brightness0906](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/brightness0906/32/499_2.png) [@brightness0906](https://forum.generic-mapping-tools.org/u/brightness0906)\
**Post date:** [September 4, 2020, 1:41am UTC](https://forum.generic-mapping-tools.org/t/question-about-grdimage-using-the-radar-data-of-moon/841/7 "2020-09-04T01:41:20Z")

</div>

Hi  
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  
-JS0/-90/7c  
The picture drawn is:

 ![1](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/d49bce867b7f44bfdec87db7f08cf976afdcd3d5.png)  
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.  
[http://pds-geosciences.wustl.edu/lro/lro-l-mrflro-4-cdr-v1/lromrf\_0001/data/sar/02200\_02299/level2/lsz\_02261\_2s1\_oku\_89s140\_v1.img](http://pds-geosciences.wustl.edu/lro/lro-l-mrflro-4-cdr-v1/lromrf_0001/data/sar/02200_02299/level2/lsz_02261_2s1_oku_89s140_v1.img)  
and the header file is [lsz\_02261\_2s1\_oku\_89s140\_v1.zip](https://forum.generic-mapping-tools.org/uploads/short-url/kRsS9C1f8esbIdE63Ivn9h1vQR0.zip) (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.

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [September 4, 2020, 11:47am UTC](https://forum.generic-mapping-tools.org/t/question-about-grdimage-using-the-radar-data-of-moon/841/8 "2020-09-04T11:47:07Z")

</div>

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)

```auto
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 > lixo.ps

```
