psnoop to initialize and close a graphic

Added by Christophe 4 months ago

Hi.
I am still new GMT user, and quite frequently make mistake with pssomething -O -K options and > and >> when I try to debug my scripts. So I was looking for a no operation command. The idea is be able to write things like this :

psnoop -K >graphic.ps # "open" file
psbasemap -O -K >>graphic.ps ...
pscoast -O -K >>graphic.ps ...
pssomething -O -K >>graphic.ps ...
psnoop -O >> graphics # "close" file

This way, I can comment any real command or even change order without having to think of >/>> and -O -K.

So far, I use this simple bash function as psnoop.

psnoop() {
  pstext -R1/10/1/10 -JX10 "$@" <<<''
}

It works, but, is it a good idea ? Is there a better psnoop command ?

Could there be a psnoop command one day in the next release ?

Christophe.


Replies (4)

RE: psnoop to initialize and close a graphic - Added by Federico 4 months ago

Yes, use psxy -T ( http://gmt.soest.hawaii.edu/doc/5.4.3/psxy.html#t )

Open graphic
gmt psxy -R1/10/1/10 -JX10 -K -T > graphic.ps

Close graphic
gmt psxy -R -J -O -T >> graphic.ps

RE: psnoop to initialize and close a graphic - Added by Andreas 4 months ago

GMT6 comes with a new modern mode where you dont have to think about -K -O > and >>! I think.

RE: psnoop to initialize and close a graphic - Added by Paul 4 months ago

Correct. The -O, -K, -P and explicit handling of the PostScript file (> and >> stuff) are banned. Available via subversion but not officially released.

RE: psnoop to initialize and close a graphic - Added by Christophe 3 months ago

Thank you for all the responses.

I'll sure be using GMT 6 when it is out. meanwhile, I'll use psxy -T. it looks less weird than pstext <<<''. hopefully people will stop asking "What is this thing doing ?"

Christophe.

(1-4/4)