Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

imgmap.sh 1.1 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  1. #!/usr/bin/env bash
  2. # Testing various ways of extracting and plotting IMG grids
  3. ps=imgmap.ps
  4. IMG=@topo.8.4.img
  5. # Get subset of original merc grid and plot as Cartesian
  6. # This requires a spherical Mercator projection overlay
  7. gmt img2grd $IMG -R180/200/-5/5 -T1 -S1 -Gimg_m.nc -M
  8. gmt makecpt -Crainbow -T-8000/0 > t.cpt
  9. gmt grdimage img_m.nc -Jx0.25i -Ct.cpt -P -K -Xc > $ps
  10. # Overlay geographic basemap using the same scale in spherical Mercator
  11. gmt psbasemap -R -Jm0.25i -Ba -BWSne -O -K --PROJ_ELLIPSOID=sphere >> $ps
  12. # Get a geographic grid by automatically undoing the spherical Mercator
  13. # This yields a grid with an exact region that differs from given -R
  14. gmt img2grd $IMG -R180/200/-5/5 -T1 -S1 -Gimg_g1.nc
  15. # Now we can plot this geographic grid using any projection, here Mercator
  16. gmt grdimage img_g1.nc -Jm -Ct.cpt -O -K -Ba -BWSne -Y3.25i >> $ps
  17. # Get resampled geo grid with a domain exactly matching the requested -R
  18. gmt img2grd $IMG -R180/200/-5/5 -T1 -S1 -Gimg_g2.nc -E
  19. # Now we can plot this geographic grid using any projection, here Mercator
  20. gmt grdimage img_g2.nc -Jm -Ct.cpt -O -Ba -BWSne -Y3.25i >> $ps
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...