Skip to content

Add lunar DEM file to remote server #167

Closed

Description

@willschlitzer

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

Activity

  1. PaulWessel commented on Jan 3, 2023

    @PaulWessel
    Contributor

    Great. Just a heads up: I am actually trying to do some of the legwork for you and will do a PR soon to add the moon recipe. I thought I at least run in through a few resolutions before adding it.

  2. willschlitzer commented on Jan 3, 2023

    @willschlitzer
    Author

    Thanks @PaulWessel! I'll hold off any work until your PR.

  3. PaulWessel commented on Jan 4, 2023

    @PaulWessel
    Contributor

    PR safely updated and seems to work well.Unless you are on a mac with lots of RAM it would be good to see how well the process runs for you. Expect many hours.

  4. willschlitzer commented on Jan 4, 2023

    @willschlitzer
    Author

    Currently running the script and it's converting the TIFF to a netCDF. You weren't joking about the RAM requirements; currently using 24 out of 32 GB. I'm on an Ubuntu 20.04 gaming desktop with an 8th gen i7, so I'm hoping it won't take too long. I did run into an issue the first time I ran the script; it stopped downloading after 4.6 GB and I received curl: (18) transfer closed with 3917136203 bytes remaining to read, so I'm not sure if that was a connection issue or something else. I deleted the downloaded portion and it seems to have completed the download the second time around!

  5. PaulWessel commented on Jan 4, 2023

    @PaulWessel
    Contributor

    Interesting with curl doing that. Probably a glitch in the matrix somewhere as we say. If the downsampler step works well you will find the folder moon/moon_relief inside the staging folder and it will have all the grids at various resolutions. If you then run the tiler script then all the 5 min and higher resolutions will be split into tiles so there will then be directories with JP2 tiles inside that folder while the original global grids will be moved up to stain/tiled as safekeeping (we do not use those again or store them on the server).

  6. willschlitzer commented on Jan 4, 2023

    @willschlitzer
    Author

    I just received this error and the process quit. Here is what I'm seeing on my terminal:

    srv_downsampler_grid.sh: Must download original source https://planetarymaps.usgs.gov/mosaic/Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014.tif
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 8100M  100 8100M    0     0  28.7M      0  0:04:41  0:04:41 --:--:-- 28.1M
    srv_downsampler_grid.sh: Must convert original tif source to Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014.nc
    scripts/srv_downsampler_grid.sh: line 117: [: NaN: integer expression expected
    Convert Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014.nc to moon/moon_relief/moon_relief_14s_p.grd=ns+s0.5+o0
    Down-filter Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014.nc to moon/moon_relief/moon_relief_15s_g.grd=ns+s0.5+o0
    scripts/srv_downsampler_grid.sh: line 167: 21766 Killed                  gmt grdfilter -R-180/180/-90/0 ${SRC_FILE} -Fg${FILTER_WIDTH} -D${FMODE} -I${RES}${UNIT} -r${REG} -G${TMP}/s.grd --PROJ_ELLIPSOID=${DST_SPHERE}
    

    It looks like the download went fine but it ran into an issue when trying to run grdfilter. It looks like my home environment still has GMT 6.0.0, so I'm trying it with my PyGMT development environment that has GMT 6.4.0.

  7. willschlitzer commented on Jan 4, 2023

    @willschlitzer
    Author

    Same issue with GMT 6.4:

    moon/moon_relief/moon_relief_14s_p.grd exists - skipping
    Down-filter Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014.nc to moon/moon_relief/moon_relief_15s_g.grd=ns+s0.5+o0
    scripts/srv_downsampler_grid.sh: line 167: 22132 Killed                  gmt grdfilter -R-180/180/-90/0 ${SRC_FILE} -Fg${FILTER_WIDTH} -D${FMODE} -I${RES}${UNIT} -r${REG} -G${TMP}/s.grd --PROJ_ELLIPSOID=${DST_SPHERE}
    

    Any idea what the culprit may be? Here is my environment info:

    GMT library information:
      binary version: 6.4.0
      cores: 12
      grid layout: rows
      library path: /home/will/miniconda3/envs/pygmt-dev/lib/libgmt.so
      padding: 2
      plugin dir: /home/will/miniconda3/envs/pygmt-dev/lib/gmt/plugins
      share dir: /home/will/miniconda3/envs/pygmt-dev/share/gmt
      version: 6.4.0
    
  8. PaulWessel commented on Jan 4, 2023

    @PaulWessel
    Contributor

    OK, I think you will actually need to run from GMT master - I do not know how to do that within conda since I am from the olden days. But I have made GMT source changes the last 24 hours in responses to issues with the moon processing. So master is a requirement for now.

  9. joa-quim commented on Jan 4, 2023

    @joa-quim
    Member

    The problem with big files is that it's not enough to have enough RAM. There needs to exist a contiguous chunk of memory to hold the entire array. Maybe if you reboot and start from a cleanest as possible state it may make a difference ... or not.

  10. PaulWessel commented on Jan 4, 2023

    @PaulWessel
    Contributor

    True, @joa-quim but also a must to use master since I fixed some issues. They may be macOS-specific though - hard to tell. The crash is in the section where I had to run grdfilter separately on the N and S hemispheres otherwise I got strange horizontal lines that @Esteban82 reported. Doing it this way (until I can find some subtle trouble) works - at least for me - and is only done on the 30s or finer resolutions. This and other issues are most likely some subtle 64-bit counting issue but hard to debug.

  11. willschlitzer commented on Jan 4, 2023

    @willschlitzer
    Author

    Installed gmt from master (showing 6.5.0_e43114b_2023.01.04) and rebooted; still got the same result. It also used all of my RAM (32 GB) for about a minute prior to crashing.

    Down-filter Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014.nc to moon/moon_relief/moon_relief_15s_g.grd=ns+s0.5+o0
    scripts/srv_downsampler_grid.sh: line 167:  6018 Killed                  gmt grdfilter -R-180/180/-90/0 ${SRC_FILE} -Fg${FILTER_WIDTH} -D${FMODE} -I${RES}${UNIT} -r${REG} -G${TMP}/s.grd --PROJ_ELLIPSOID=${DST_SPHERE}
    

    Unfortunately, I don't have any Apple hardware to try this out with. I'm not sure what troubleshooting to try next.

  12. PaulWessel commented on Jan 4, 2023

    @PaulWessel
    Contributor

    Thanks for trying. What I guess you can try is to run the script with full verbose (bash -xv .....) so that you can see that command with all the actual arguments. Then copy paste and verify it still crashes (it should) but add -Vd so we might learn when it crashes. Then, just mess with -I and go from 15s to 30s to 01m and see if it stops crashing. I would think so as this seems to be related to trouble with 64-bit counting and not so much lack of memory since you have 32 Gb.

  13. PaulWessel commented on Jan 5, 2023

    @PaulWessel
    Contributor

    THe 14 arc second grid as 4-byte float internally is about 16 Gb, and then it is the output grid at 15s which is almost 14 Gb. So just those two allocations push 30 Gb of memory. For "fun" I am trying this comment (which does not produce the right answer hence the S and N workaround:

    gmt grdfilter moon_relief_14s_p.grd -Fg0.18 -I15s -rp -D1 -Gshit.nc=ns -V

    and activity monitor says this process is using 45.68 Gb! I am not sure what the extra 15 Gb but maybe a weight grid for something. I will have to debug to understand that 3rd blob.

  14. 63 remaining items

  15. Esteban82 commented on Mar 11, 2023

    @Esteban82
    Member

    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

  16. PaulWessel commented on Mar 11, 2023

    @PaulWessel
    Contributor

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

  17. Esteban82 commented on Mar 13, 2023

    @Esteban82
    Member

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

  18. Esteban82 commented on Mar 15, 2023

    @Esteban82
    Member

    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
    
    
  19. joa-quim commented on Mar 15, 2023

    @joa-quim
    Member

    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.

  20. added a commit that references this issue on Mar 16, 2023
  21. Esteban82 commented on Mar 19, 2023

    @Esteban82
    Member

    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
    
  22. PaulWessel commented on Mar 21, 2023

    @PaulWessel
    Contributor

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

  23. Esteban82 commented on Mar 21, 2023

    @Esteban82
    Member

    Now it is working.

  24. Esteban82 commented on Mar 22, 2023

    @Esteban82
    Member

    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)?

  25. PaulWessel commented on Mar 22, 2023

    @PaulWessel
    Contributor

    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.

  26. added a commit that references this issue on Apr 12, 2023
  27. PaulWessel commented on Jul 25, 2023

    @PaulWessel
    Contributor

    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.

  28. Esteban82 commented on Jan 9, 2024

    @Esteban82
    Member

    It was already implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions