View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

printing with :.snap

Pat Hartigan wrote on Nov 14, 2007

Hi Mike,

I suppose I should know how to do this by now but for some reason I always
seem to get stuck. I looked in the FAQs and in various manuals to no avail.
Running 2.12.2 export on Redhat Enterprise Linux 4, I use
an external, networked Lexmark T522 printer as a default. So, for example
at the unix prompt 'echo "hi" | lpr' sends the text string 'hi' to the printer, which
lives at its own IP address on port 9100.

Within IRAF, 'show printer' returns 'lpr' and in dev$graphcap I have
lpr|lp|lw :tc=g-lpr

which as I recall aliases lpr, lp, and lw to g-lpr within IRAF. Later in the graphcap
file there is a generic entry
g-lpr|UNIX generic interface to default printer device (lpr):\
:DD=lpr,tmp$sgk,!{ sgidispatch sgi2uapl $F -l$(XO) -w$(XW) \
-b$(YO) -h$(YW) -p$(PW) | lpr ; rm $F ; }&:tc=sgi_apl:

which, if I understand correctly, instructs IRAF to convert its gki code to sgi,
and then sgi to postscript to send to the default unix lpr device.

.....ok..... So within IRAF, lprint works, i.e. 'imhead file.imh | lprint' does what
it is supposed to do. But splot followed by :.snap simply hangs the system.
For what it is worth, stdplot=lp and stdgraph=xgterm. I launch IRAF from an
xgterm.

Suggestions?

Pat Hartigan

Pat Hartigan wrote on Nov 14, 2007

I don't know why the smiley-face got in the post, which was a cut and paste.
But maybe that's a good omen?

Mike Fitzpatrick wrote on Nov 14, 2007

Hi Pat,

Good to hear from you again.

First, be sure to follow ":.snap" with ":.gflush" to flush the graphics buffer right away.

If that doesn't work, try using the 'psdump' device to save the postscript to a /tmp/irafdmpXXXXX.ps file, then try printing that file manually with 'lpr' outside of IRAF. If it doesn't work let me know, you
might also try changing the first line of the file from "%!PS" to "%!PS-Adobe-2.0" since some printers require that. This can be done automatically in the graphcap and has been changed in the next release.

Cheers,
-Mike

Pat Hartigan wrote on Nov 14, 2007

Wow, fast turnaround time!
After :.sn I get 'done' in yellow at the lower left of the xgterm graphics window,
but then there is a circular blue arrow that keeps going round and round. I do
have cursor control, and when I hit 'q' and get back to the main IRAF cl> and
type gflush nothing happens.

Typing :.sn psdump after I have displayed my spectrum
does indeed make an irafdmp6628.ps file, but it is empty.

As a workaround yesterday I simply grabbed the window in xv, made it
greyscale and printed it, but that is a rather clumsy solution. I'll try the
Adobe-2.0 thing next.

ph

Pat Hartigan wrote on Nov 14, 2007

well I guess I can't very well add anything to the postscript file when it is empty...

Mike Fitzpatrick wrote on Nov 14, 2007

Hi Pat,

Try doing a "cl> !which sgidispatch" to see if you can find the command. The dispose command in the graphcap is done using a spawned shell and so if your .cshrc file doesn't define a path to the sgidispatch command it might not produce the final file. This usually means that your path is defined in your .login file instead, just add the extra directory to the .cshrc (or .bashrc) as well.

The 'sgidispatch' command is a symlink created by the install script and should point to the iraf$unix/bin.<arch>/sgidispatch.e binary. If something changed the links in your system, rerunning the install script will fix it, but in most cases it's a path problem.

Cheers,
-Mike

Pat Hartigan wrote on Nov 14, 2007

You da man! After adding in the following links (command file made with vi)
:.snap now happily prints to my printer.

Thanks!

sudo ln -s /r1/iraf/iraf/unix/bin.redhat/alloc.e /usr/local/bin/alloc
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/f2c.e /usr/local/bin/f2c
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/generic.e /usr/local/bin/generic
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/mkpkg.e /usr/local/bin/mkpkg
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/rmbin.e /usr/local/bin/rmbin
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/rmfiles.e /usr/local/bin/rmfiles
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/rpp.e /usr/local/bin/rpp
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/rtar.e /usr/local/bin/rtar
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/sgi2gif.e /usr/local/bin/sgi2gif
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/sgi2uapl.e /usr/local/bin/sgi2uapl
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/sgi2ueps.e /usr/local/bin/sgi2ueps
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/sgi2uhpgl.e /usr/local/bin/sgi2uhpgl
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/sgi2uhplj.e /usr/local/bin/sgi2uhplj
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/sgi2uimp.e /usr/local/bin/sgi2uimp
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/sgi2uptx.e /usr/local/bin/sgi2uptx
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/sgi2uqms.e /usr/local/bin/sgi2uqms
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/sgi2xbm.e /usr/local/bin/sgi2xbm
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/sgidispatch.e /usr/local/bin/sgidispatch
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/wtar.e /usr/local/bin/wtar
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/xc.e /usr/local/bin/xc
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/xpp.e /usr/local/bin/xpp
sudo ln -s /r1/iraf/iraf/unix/bin.redhat/xyacc.e /usr/local/bin/xyacc

Reba wrote on Nov 14, 2007

Thanks fitz! This topic helped me out as well.

Last post on Nov 14, 2007