[ncl-install] ctrans -d xwd produces bad output

Mary Haley haley at ucar.edu
Fri Sep 21 09:06:46 MDT 2012


On Sep 18, 2012, at 1:20 PM, Steven G Decker wrote:

> 
>>> 
>>> I now have an executable that works.  (Running idt or ctrans -d X11
>>> on the output gives me what I expect.)
>>> 
>>> However, ctrans -d xwd on the output produces incorrect results.
>>> I've attached a screenshot showing the difference between ctrans -d
>>> X11 and ctrans -d xwd.
>> 
>> 
>> Sorry nobody responded to this. Was xwd output working in V6.0.0 or
>> older?
>> 
> 
> It did work with an older version (can't remember which).
> 
>> Admittedly, none of us are experts in "ctrans", since it is an old
>> tool that we mostly keep around for viewing NCGM files. We are trying
>> to get people to move away from the NCGM format, because the new
>> color model won't work with NCGMS, and NCGM is an internal format to
>> NCAR that is not supported by other open source tools.
>> 
>> We recommend that people instead send their output to a PS, PDF or
>> PNG file, and then use tools like "convert" from ImageMagick to
>> convert to other formats. I believe "convert" supports xwd.  Can I
>> ask why you need xwd files?
> 
> The xwd file was actually an intermediate step to generating a GIF image.  There was no particular reason for the xwd approach other than that's what my previous setup used.  My Fortran code was generating ncgm files, but I see that I can successfully generate a PDF by modifying the third argument to gopwk.  Generating a PNG failed:
> GKS ERROR NUMBER -218 ISSUED FROM SUBROUTINE GCLRWK:
> --X driver error: invalid index into GKS workstation identifiers
> (I used 9 for the third argument based on some documentation I found.)
> 
> I'll stick to the PDF output, which I can convert to PNG or GIF, but I am wondering if anything involving gopwk is considered archaic and that there is some other more modern approach to generating these files from Fortran.

Hi Steve,

GOPWK is not considered archaic, so using this is fine. However, we just recommend that you use PS or PDF as your output, as you can then convert this to other formats using "convert".

You should be able to use convert to create a GIF file, and, hopefully, it will even look better than the ctrans route did:

    convert -geometry 1000x1000 -density 300 -trim file.ps file.gif


The "-density 300" will improve the look of your fonts. Sometimes I have to bump this up higher, like to 500. The higher you go, the bigger the file and the slower the command takes.

The "-trim" option will trim out all white space around the edges. I find this useful if I'm importing images into PowerPoint or Keynote.

The "-geometry" option allows you to make the image bigger or smaller. You may need to play with the -density option if you change -geometry.

Good luck!

--Mary

> 
> Cheers,
> Steve
> 
>> 
>> --Mary
>> 
>>> 
>>> Can you tell me why my xwd file is not being generated correctly?
>>> 
>>> Thanks, Steve
>>> 
>>> 
>>> 
>>> 



More information about the ncl-install mailing list