> Hi,
>
> I am using ncar graphics to create a gmeta file which has multi-frame,
> and I want to get a specific frame, suppose #3 frame.
>
> I know idt or ictrans can do it, but they are both interractive tools. I
> am wondering if I can use ctrans to do it because I try to write a c
> scripts file.
>
> The commond line may be like:
> ctrans -d hdf -res 400x400 -frame 3 myfile.ncgm > myfile3.hdf
>
> Thanks
>
> Peizhong
> University of Michigan
Dear Peizhong,
You can use ictrans in batch mode if you use the "-e" option. You will
also need to have your "ncarv_spool" file set up for the output
options that you want to use. According to the man page for
"ncarv_spool":
The ncarv_spool file contains definitions for spooled dev-
ices to be used by ictrans. Each definition describes a
rule used for sending a set of metafile frames to a spooled
device.
Each entry consists of a line of the form:
alias_name : translator_args : filter_chain
So, to get HDF output like you were trying to do with ctrans, you
might have an entry in your ncarv_spool file that looks like this:
HDF : -d hdf -res 400x400 : > myfile.hdf
Then, you use "ictrans" to specify which frames you want to convert
to hdf:
ictrans -e 'spooler HDF' -e '3P' myfile.ncgm
Using a capital 'P' as in '3P' tells ictrans that you want the output
to go to the specified spooler device that you have indicated with the
'spooler' command.
You can have other entries in your "ncarv_spool" including ones
that send output to a printer. For example, if you have two printers,
one black-and-white and one color, and assuming their names are
"lpbw" and "lpcolor", then the entries in your "ncarv_spool" file
might look like this:
printbw : -d ps.mono : | lpr -Plpbw
printclr : -d ps.color -simulatebg : | lpr -Plpcolor
Then, to send frames 3-5 and 7 to the color printer, your ictrans
line would look like this:
ictrans -e 'spooler printclr' -e '3-5,7P' myfile.ncgm
A note on the "ncarv_spool" file: you can put this file in the
directory $NCARG_ROOT/lib/ncarg where everybody will have access to
its entries, or you can rename it ".ncarv_spool" and put it in your
home directory where only you will have access to its entries. If you
have ncarv_spool files in both places, then their contents will be
merged together. This same file is used by "idt" for its "Print"
button setup.
Cheers,
Mary Haley
This archive was generated by hypermail 2b29 : Wed Jun 28 2000 - 09:45:37 MDT