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

readwrite_withgdal.sh 986 B

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
22
23
24
25
26
27
28
29
30
31
  1. #!/usr/bin/env bash
  2. #
  3. GDAL=$(gmt grdconvert 2>&1 | grep -c gd)
  4. if [ $GDAL -eq 0 ]; then exit; fi
  5. ps=readwrite_withgdal.ps
  6. # RGB image. The +b0,1,2 also tests the bands request option
  7. gmt grdimage @needle.jpg+b0,1,2 -JX7c/0 -P -Y20c -K > $ps
  8. # Same image as above but as idexed
  9. gmt grdimage @needle.png -JX7c/0 -X7.5c -O -K >> $ps
  10. # Projected
  11. gmt grdimage @needle.jpg -Rd -JW10c -Bxg30 -Byg15 -X-5.0c -Y-7c -O -K >> $ps
  12. # Illuminated
  13. gmt grdmath -R-15/15/-15/15 -I0.2 X Y HYPOT DUP 2 MUL PI MUL 8 DIV COS EXCH NEG 10 DIV EXP MUL = somb.nc
  14. gmt grdgradient somb.nc -A225 -Gillum.nc -Nt0.75
  15. gmt grdimage @needle.jpg -Iillum.nc -JM8c -Y-10c -X-2c -O -K >> $ps
  16. # A gray image (one band, no color map)
  17. gmt grdimage @vader.jpg -JX4c/0 -X9c -Y5c -K -O >> $ps
  18. # Create a .png from a dummy grid and import it
  19. gmt grdmath -R-5/5/-5/5 -I1 X Y MUL = lixo.grd
  20. gmt makecpt -T-25/25/1 > lixo.cpt
  21. gmt grdimage lixo.grd -Alixo.png=PNG -JX4c -Clixo.cpt
  22. gmt grdimage lixo.png -JX4c -Y-5c -O >> $ps
Tip!

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

Comments

Loading...