GenericMappingTools / gmtserver-admin

Cache data and script for managing the GMT data server
GNU Lesser General Public License v3.0
7 stars 3 forks source link

Add lunar DEM file to remote server #167

Closed willschlitzer closed 8 months ago

willschlitzer commented 1 year ago

Per a discussion at the forum, I'm hoping to add a lunar topographic relief grid to the GMT remote server.

Esteban82 commented 1 year ago

We need to define the moon cpt to finish this #182.

I think a grayscale is the default option. But, its a bit boring to me.

But, what do you think about this version with blue? I prefer this. I think that its nicer than the gray. Also, it is very easy to change to the grayscale if a user want it.

image

In the below link its says they used this "cpt":

Elevation_m Red Green Blue
-9000.0 56 2 123
-8000.0 0 0 89
-7000.0 0 94 187
-5000.0 60 157 255
0.0 215 255 255
2000.0 255 255 255
4000.0 192 192 192
6000.0 128 128 128
7000.0 83 83 83
8000.0 51 51 51
10000.0 52 31 31

Link: https://astrogeology.usgs.gov/search/map/Moon/LMMP/LOLA-derived/Lunar_LRO_LOLA_ClrShade_Global_64ppd_BlueSteel

In this link of the USGS there are posters of both versions (gray and with blue): https://pubs.usgs.gov/sim/3316/

PaulWessel commented 1 year ago

Nice, i like it! Ok with @joa-quim ?

joa-quim commented 1 year ago

Yes, looks nice. And we can say the blue is due to transparency and what is seen is the Moon background.

Esteban82 commented 1 year ago

Great!!

Anyone else? @willschlitzer ?

anbj commented 1 year ago

Will this be added to https://docs.generic-mapping-tools.org/dev/datasets/remote-data.html#currently-available-remote-data-sets?

PaulWessel commented 1 year ago

@Esteban82, make sure you add that CPT (but after formatting it to our standards -see the others in cache), then add it to cache.

PaulWessel commented 1 year ago

Will this be added to https://docs.generic-mapping-tools.org/dev/datasets/remote-data.html#currently-available-remote-data-sets?

Yes, with Mars, etc etc

anbj commented 1 year ago

Will this be added to https://docs.generic-mapping-tools.org/dev/datasets/remote-data.html#currently-available-remote-data-sets?

Yes, with Mars, etc etc

rejoice: engage.

Esteban82 commented 1 year ago

@Esteban82, make sure you add that CPT (but after formatting it to our standards -see the others in cache), then add it to cache.

Yes!! I am on it.

I would need to know the extreme values or the original grid to make the cpt. In the figure below its says (-9130/10780). Which is similar to Paul's proposal (-9200/10800).

Esteban82 commented 1 year ago

There is an issue with the colorbar

The values published above go from -9000 to 10000 but the grid

Here I compare both colorbar:

Mine with original range values (from -9000 to 10000): colorbar

Extended up from -9200 to 11000 (I repeat the colors from the lowest and highest up to those values, see CPT below). colorbar2

Here is the original legend from USGS (Link) image

Moon CPT

Here is the moon CPT in case you want to see it.

# Default CPT for @moon_relief ...
# See ...
# Original done by ...
# Converted to GMT format by Federico Esteban, March 10 2023.
#
# COLOR_MODEL = RGB
-9200   56/2/123    -9000   56/2/123
-9000   56/2/123    -8000   0/0/89
-8000   0/0/89      -7000   0/94/187
-7000   0/94/187    -5000   60/157/255
-5000   60/157/255  0       215/255/255
0       215/255/255 2000    255/255/255
2000    255/255/255 4000    192/192/192
4000    192/192/192 6000    128/128/128
6000    128/128/128 7000    83/83/83
7000    83/83/83    8000    51/51/51
8000    51/51/51    10000   52/31/31
10000   52/31/31    11000   52/31/31
B   56/2/123
F   52/31/31
N   white
PaulWessel commented 1 year ago

I ould not repeat the last slice. maybe use makecpt to resample their original to the chosen limits?

Esteban82 commented 1 year ago

I ould not repeat the last slice.

I repeat them in order to get those values in the colorbar. For the map is the same because I use the extrem color for F and B.

Esteban82 commented 1 year ago

Both CPT: Repeating slice (above) and resampling the value (Paul's idea, below).

colorbar2 colorbar3

For me, they look the same, so I would go for Paul's idea (CPT below)

# COLOR_MODEL = RGB
-9200   56/2/123    -8000   0/0/89
-8000   0/0/89      -7000   0/94/187
-7000   0/94/187    -5000   60/157/255
-5000   60/157/255  0       215/255/255
0       215/255/255 2000    255/255/255
2000    255/255/255 4000    192/192/192
4000    192/192/192 6000    128/128/128
6000    128/128/128 7000    83/83/83
7000    83/83/83    8000    51/51/51
8000    51/51/51    11000   52/31/31
B   56/2/123
F   52/31/31
N   white
PaulWessel commented 1 year ago

Yep, cannot tell but good to not add in a constant slice after all the increasing ones.

joa-quim commented 1 year ago

There is one thing wrong with this CPT. We should have a kind of hinge at zero. I mean, the blues should stop exactly at 0 and the gray scale from 0 up. Even if this makes it different from the NASA colormap.

PaulWessel commented 1 year ago

Hm, what does z = 0 mean for the moon? Does it really require a hinge? But it is close so perhaps not crazy.

joa-quim commented 1 year ago

I didn't mean to put a true hinge in the cpt but just to let it be defined like that. There is nothing preventing us to use this cpt on Earth where it likely will also make nice figures.

PaulWessel commented 1 year ago

@Esteban82, do you want to try that and put up a moon map with white at zero?

Esteban82 commented 1 year ago

Here are the maps.

moon_relief

CPT with white at 0 used for map below.


# COLOR_MODEL = RGB
-9200   56/2/123    -8000   0/0/89
-8000   0/0/89      -7000   0/94/187
-7000   0/94/187    -5000   60/157/255
-5000   60/157/255  -2000   215/255/255
-2000   215/255/255 0       255/255/255
0       255/255/255 4000    192/192/192
4000    192/192/192 6000    128/128/128
6000    128/128/128 7000    83/83/83
7000    83/83/83    8000    51/51/51
8000    51/51/51    11000   52/31/31
Esteban82 commented 1 year ago

Yes, it is better with the white at 0. In this way, our map also is more similar to USGS maps posted yesterday.

Here I think that there is an issue. With white a 0, the maps look similar but the colorbars don't.

I suppose that:

  1. there was an error in the USGS Maps (when they draw the legend and post the "CPT" values) or
  2. the grids values are somehow different. The heights of the USGS moon is related to an sphercial moon (the USGS). Ours too or are related to the moon ellipsoid?

In any case, I think we should use white at zero for our moon cpt.

PaulWessel commented 1 year ago

From https://astrogeology.usgs.gov/search/details/Moon/LRO/LOLA/Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014/cub it says spherical moon.

Esteban82 commented 1 year ago

Yes, sphercial and both have the same radius (1737.4 km).

Esteban82 commented 1 year ago

I read both description of the moon products and the only differences is the resolution of the final grid. So, we can discard option 1 (of my previous supposiotions)

Esteban82 commented 1 year ago

I agree we should put white at 0. Now, my doubt is how to adapt the rest of the values? To start, I have to change the value of the 215/255/255 (ca. ligthcyian1 for GMT). In the previous map I use -2000. Also, I wonder if we should adapt the values for the gray colors?

Original NASA CPT with comments:

Elevation_m Red Green Blue
-9000.0 56 2 123
-8000.0 0 0 89
-7000.0 0 94 187
-5000.0 60 157 255
0.0 215 255 255           # Lightcyian1. At what value should it go??
2000.0 255 255 255     # White, must go to 0! 
4000.0 192 192 192     # Keep the same value or change it for a lower one (e.g. 2000)?
6000.0 128 128 128
7000.0 83 83 83
8000.0 51 51 51
10000.0 52 31 31
Esteban82 commented 1 year ago

Here I made another maps from differentes CPTS

Without cyan:

moon_relief_cpt4

With cyan at -1000 moon_relief_cpt5

With cyan at -500 moon_relief_cpt6

PaulWessel commented 1 year ago

I have no strong opinions on this so suggest you and @willschlitzer can decide what you prefer, then go with that.

Esteban82 commented 1 year ago

I wonder if @joa-quim has something to say.

Esteban82 commented 1 year ago

I will use the second CPT. Below a copy it.

Is the header ok? Line 2 is too long but is where the "cpt" was posted. I think to use this link instead (https://pubs.usgs.gov/sim/3316/) but it has no information of the colors.

# Default CPT for @moon_relief.
# Original table of colors post it in https://astrogeology.usgs.gov/search/map/Moon/LMMP/LOLA-derived/Lunar_LRO_LOLA_ClrShade_Global_64ppd_BlueSteelOriginal
# Colors modified and converted to GMT format by Federico Esteban, March 15 2023.
#
# COLOR_MODEL = RGB
-9200   56/2/123    -8000   0/0/89
-8000   0/0/89      -7000   0/94/187
-7000   0/94/187    -5000   60/157/255
-5000   60/157/255  -1000   215/255/255
-1000   215/255/255 0       255/255/255
0       255/255/255 4000    192/192/192
4000    192/192/192 6000    128/128/128
6000    128/128/128 7000    83/83/83
7000    83/83/83    8000    51/51/51
8000    51/51/51    11000   52/31/31
B   56/2/123
F   52/31/31
N   white
joa-quim commented 1 year ago

Sorry, had no time to look to this. My preferred would be the first (no cyan) but no strong opinion either.

No problem with that second long line. It's a comment line.

Esteban82 commented 1 year ago

How can I test the moon_relief.cpt from the test chache server (/export/gmtserver/gmt/test/cache)? I upload the cpt file to the directory but it didin't work.

I supossed that I have to update the gmt_data_hash.txt. I try something but it didn't work.

The error that I got:

grdimage [ERROR]: Libcurl Error: HTTP response code said error
grdimage [ERROR]: Probably means @moon_relief does not exist on the remote server
grdimage [ERROR]: Unable to obtain remote file @moon_relief
PaulWessel commented 1 year ago

Not sure if cache testing works that way. Just add it to the regular cache area since we are going to do that anyway.

Esteban82 commented 1 year ago

Now it is working.

Esteban82 commented 1 year ago

Just add it to the regular cache area since we are going to do that anyway.

Just to know.

In order to add data in the cache, is it only necessary to add to the server? Or is there something else that need to be done (like updating the cache file)?

PaulWessel commented 1 year ago

Just add it to your working copy of the repo, just like you do when you add a file to the gmt repo, then make a PR to add the file, someone approves, and within 1 hour (I hink) the gmtserver will check and detect there have been changes, it will do a git pull and the new file will be in the cloud. So give it 1 hour or so after approval/merge for it to show.

PaulWessel commented 1 year ago

Hi @willschlitzer, could you please ssh into the gmtserver and run chmod -R g+w on the moon directory under the test server, i.e.

chmod -R g+w /export/gmtserver/gmt/test/server/moon

Without write-permission for the group the rest of us cannot do much there. We are inching closer to the releases.

Esteban82 commented 8 months ago

It was already implemented.