psxyz -So (3-D columns)

Added by Jonathan 4 months ago


I am trying to create a map with bathy/topo in the background and tsunami runup heights displayed as columns (psxyz -So option), with the height of the column scaled to the runup height in meters. I am running GMT5 in Cygwin, but I don't think the issue is related to that. I am trying to plot the columns on a map created with grdimage, so I want to plot 3D-appearing columns on a 2D map (see attached example image). First, I wanted to clarify that I am understanding the terminology in the man page correctly. The "z" value (3rd column) in the input file should be the column height, correct? And the "base" refers to the ground surface elevation (in my case) on which the base of the column will sit, correct?

I have tried using a four column file with lon, lat, runup height (in meters), base elevation (meters, sampled from bathy map using grdtrack), e.g. 153.685 -9.295 8.10 9.484

gmt psxyz 2007.04.01_SolomonIslands_runC1.xyhb $R -JM10i -Jz0.1c -So.1i+b -W0.1p,black,solid -Gred -O -K -fg >> $ (Adding +b tells it to look in the last column for "base" elevation, correct?)

I also have tested it with a three column file (lon, lat, runup height (meters)), e.g. 153.685 -9.295 8.10, using the default base value of 0, but no luck either.

gmt psxyz 2007.04.01_SolomonIslands_runC1.xyhb $R -JM10i -Jz0.1c -So.1i -W0.1p,black,solid -Gred -O -K -fg >> $

I've also experimented with different z-scaling and different column widths but I have not had any success in plotting any part of the column, either the base or the column itself. At this point, I'm not sure whether the issue is with my file format or command syntax (or something else?). Any advice would be much appreciated, I can provide more info or data files as needed if it helps to diagnose the issue, but I'm hoping that it is a simple syntax or format fix. Thanks in advance!

- Jonathan Sleeper

2007_SI_runups_overview.jpg - Example image showing desired column appearance (223 KB)

Replies (8)

RE: psxyz -So (3-D columns) - Added by Paul 4 months ago

Hi Jonathan-

If you are plotting on a flat image (grdimage) then your base is 0 (i.e. +b0 which is the default) but if you are plotting on an undulating surface (grdview) then you must add the elevation at each point to your bar z-value and provide the elevation as the last column. See attached example script for a simple simulation of the two cases. Magnifier - Demo script (833 Bytes)

3dbars.pdf - Demo plot (63.4 KB)

RE: psxyz -So (3-D columns) - Added by Jonathan 4 months ago

Thanks Paul! I've gotten the columns to plot, however I am looking for a flat map with only the columns in a perspective view, as shown in the example image I attached previously. I'm beginning to think that may not be possible to do in GMT. I can make the map flat and the columns 3-D by using - p180/90 for the grdimage step and - p145/60 for the psxyz step. But of course then the bases of the columns are plotted in perspective and are not at the appropriate lat/lon locations on the map. So before I spend more time testing things, I just wanted to know whether what I'm trying to do is even possible in GMT. Is there some way to get the columns to be in perspective view, but still have their bases tied to the appropriate lat/lon position on the flat map?
- Jonathan

RE: psxyz -So (3-D columns) - Added by Paul 4 months ago

No, I don't think so. You cannot have both a projected view and a non-projected view at the same time. But it is possible you can fake it with some trial and error and shifting the overlay with -X -Y.

RE: psxyz -So (3-D columns) - Added by Joaquim 4 months ago

Jonathan, is this for AGU? I will have a poster about finding the best Okada solution from inversion of tsunami heights of the 6-Feb-2013 Solomon Islands. So you may be Poster neighbors.

RE: psxyz -So (3-D columns) - Added by Jonathan 4 months ago

Paul, that's what I figured, thanks. I think even if I can get really close by faking it, it'll still be somewhat off no matter what. I will just make a version using vertical bars on a flat map, and then I'll make one with a 3-D grdview map and columns to see which the client likes best.

Joaquim, this is a contract project that I got for a Hawai'i state agency that also works with the NOAA Pacific Tsunami Warning Center. I don't have the money or new research to present at AGU unfortunately, but that does sound interesting. The Solomon Islands tsunami that they are particularly interested in is the April 2007 event, but I know they also want a script that can make plots for any event in their database.

- Jonathan

RE: psxyz -So (3-D columns) - Added by Jonathan 4 months ago

Sorry to bug you again, but I am having trouble with the -i option. I'm trying to plot the runup heights as vectors (-Sv) in psxy, which seems to be the best alternative to columns. I have everything plotted correctly, the vectors are in the right location, the right colors, and the right lengths, but I need to use a scaling factor so that they are sized appropriately for the map. As far as I can tell, the syntax should be extremely simple, but for some reason it ignores the scaling factor.

gmt psxy $run $R -JM$W -Sv2p -i4+s0.5 -O >> $

$run is my 4-column runup heights file (lon,lat,direction(=90),runup height) As I understand it, that code should multiply the 4th column of my data file (the runup heights) by a scaling factor of 0.5, am I missing something? Thanks in advance.

- Jonathan

RE: psxyz -So (3-D columns) - Added by Paul 4 months ago

You need to list any other input columns you wish to use. The -i first and foremost selects which columns to read, with optional scaling/offsets for some of them.

RE: psxyz -So (3-D columns) - Added by Jonathan 4 months ago

Thanks, I should have been able to decipher that much from the man page. In case someone else reading this makes the same dumb mistake, I got it working using -i0,1,2,3+s0.5