Re: Re: vertical lines through maps

From: Jonathan Vigh <vigh_at_nyahnyahspammersnyahnyah>
Date: Mon, 12 Dec 2005 12:51:06 -0700

Greetings,
        Attached is a small shell script which some may find useful for doing
image conversions from ps to png (I think this should easily generalize
to gif as well). My sysadmin, Rick Taft, is the author and said it is
okay to distribute. It uses the psselect utility, ghostscript, and
convert to produce a nice, clean cropped png (I should note that it is
NOT optimized to produce a small-sized file). The script is convenient
to call from within the NCL program using the systemfunc command, or
externally. Put it someplace in your path like: /usr/bin

Usage is: ps2png <file.ps> <page_num> <resolution> [ <max_xsize>
<max_ysize> ]

I found the following produces a nice png from NCL for a map which has
been generated in landscape orientation with gsnMaximize = True.

   ps2png foo.ps 1 300 800 800
   convert -rotate 270 foo-1.png foo1.png

An example of the output can be found at:
http://euler.atmos.colostate.edu/~vigh/guidance/atlantic/store/2005/late_AAL12_05082618.png
(these are the model forecast tracks for Hurricane Katrina for the first
forecast cycle which showed a landfall near New Orleans landfall)

Jonathan Vigh

On Mon, 2005-12-12 at 08:54, Micah Sklut wrote:
> Aha, antialiasing is the culprit...
>
> I hadn't paid any attention to antialiasing until now. Removing the
> antialiasing has taken
> away the vertical lines and has made my graphs much cleaner (about
> half the file size as well).
> The text fonts I'm using are actually cleaner looking too...
>
> Using ImageMagick convert, antialiasing is applied by default, this
> can be removed using the +antialias option.
>
> Thanks for the help Jonathan.
>
> Micah
>
> On 12/11/05, Jonathan Vigh <vigh_at_atmos.colostate.edu> wrote:
> Hi Micah,
> This sounds like a problem I had last year - thin lines or
> stippling
> which shows up in gv (depending on whether antialiasing is
> turned on),
> but if you print from the postscript, everything is fine. If
> you convert
> to gif or png, the lines still show up.
>
> Mark Stevens sent a reply which explains what is going on.
> I've copied
> this here (see ncl-talk acrhives April 23-24, 2004 for the
> original
> discussion):
> =============================
> Jonathan,
>
> This is a problem I looked into before. The problem isn't in
> the
> postscript plot, it arises when viewing the postscript plot or
> converting it to another format. You can see this by using gv.
> Start gv
> with the postscript file. At the top of gv there is a menu
> button
> labeled "State". Click on the item labeled "Antialias" to turn
> it on or
> off. With the antialias turned on the problem will be there,
> with the
> antialias turned off the problem will go away. If you use gs I
> think by
> default the antialiasing is off so the problem doesn't appear,
> but there
> are options to turn it on or off.
>
> When you use "convert" the antialiasing is by default used so
> the
> problem is visible. You can turn it off with the +antialias
> option.
>
> The real problem is that when the antialiasing is turned off
> the plot
> area will be fine but the fonts will look really bad. Also
> sometimes
> this problem appears and other times it doesn't. When I run
> scripts
> sometimes I get this problem in one plot, but not in another.
>
> Mark
> ==============================
>
> So if you indeed want clean gif or png (say for web
> applications), I
> recommend using ghostscript instead of convert for the ps->png
> conversion. There are some pesky options to set to get a nice
> optimized
> gif or png, but I've been happy with it, and I think it takes
> care of
> this problem. My sysadmin wrote a nifty little script to do
> this, but I
> should probably ask him first before distributing it to the
> masses. If
> he say's okay, I'll try to remember to send it out tomorrow.
>
> Jonathan Vigh
>
>
>
> On Sun, 2005-12-11 at 10:29, Micah Sklut wrote:
> > Regarding the vertical transparent lines:
> >
> > I just discovered something interesting regarding the
> vertical lines
> > on the ps files:
> >
> > When viewing the ps file on one monitor using GGV (gnome
> ghostview
> > 1.99)
> > then vertical lines are present.
> >
> > Viewing the file on another monitor using a different
> ghostview view
> > (gv 3.5.8), the lines
> > are NOT present.
> >
> > When, converting to gif (using Image Magick- convert tool),
> the lines
> > are present regardless...
> >
> > This leads me to believe the lines are not just a result of
> the
> > convert program, but are being derived from the original
> file.
> >
> > Any thoughts on this?
> >
> > Micah
> >
> > On 12/11/05, Micah Sklut <micahs2005_at_gmail.com> wrote:
> > Hi Mary, (original email - not sent to ncl-talk
> below)
> >
> > The transparent vertical lines are appearing on my
> original
> > postscript files:
> > http://udel.edu/~micahs/nww3_na00.ps
> >
> > After recieving the previous email from Dennis, I
> thought this
> > issue might
> > be due to how I'm defining my coordinates, but no
> luck so
> > far...
> >
> > Here's the data file if you would like to run the
> script:
> > http://udel.edu/~micahs/nww3.all.grb
> >
> > Thanks.
> >
> > Micah
> >
> > Original email:
> >
> > > Hi,
> > >
> > > I am getting thin transparent vertical lines
> through my
> > maps.
> > > Is anyone aware of why this is and if it is
> avoidable?
> > >
> > > Here is an example:
> > > http://udel.edu/~micahs/nww3_na00.gif
> > >
> > > In this image there is one vertical line that goes
> through
> > the ocean
> > > along the prime
> > > meridian, and several vertical lines along the
> continents to
> > the west.
> > >
> > > code:
> > > http://udel.edu/~micahs/nww3_na.ncl
> > >
> > > Thanks.
> > >
> > > Micah
> >
> >
> > On 12/10/05, Mary Haley <haley_at_ucar.edu> wrote:
> > Micah,
> >
> > This is just to let you know that you posted
> this
> > question from your
> > micahs2005_at_gmail.com email address, but you
> are
> > subscribed under a
> > different address on ncl-talk, so the
> posting didn't
> > go through. I
> > went ahead and added this email address as a
> valid one
> > to post from.
> >
> > Meanwhile, with regard to your question, are
> these
> > vertical lines
> > appearing in your original PostScript file?
> If not,
> > then it's possible
> > that the tool you are using to convert from
> PS to GIF
> > is introducing
> > the lines.
> >
> > Can you send us the original PS file so we
> can look
> > into this?
> >
> > Thanks,
> >
> > --Mary
> >
> >
> >
> >
> >
> >
> ______________________________________________________________________
> > _______________________________________________
> > ncl-talk mailing list
> > ncl-talk_at_ucar.edu
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> --
> ---------------------------------------------------------------------
> Jonathan Vigh, Ph.D. Candidate work phone:
> 970.491.8988
> Department of Atmospheric Science
> vigh_at_atmos.colostate.edu
> Colorado State University
> http://euler.atmos.colostate.edu/~vigh/
> ---------------------------------------------------------------------
> ~

-- 
---------------------------------------------------------------------
Jonathan Vigh, Ph.D. Candidate              work phone: 970.491.8988                         
Department of Atmospheric Science           vigh_at_atmos.colostate.edu
Colorado State University    http://euler.atmos.colostate.edu/~vigh/
---------------------------------------------------------------------
~


_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Mon Dec 12 2005 - 12:51:06 MST

This archive was generated by hypermail 2.2.0 : Tue Dec 13 2005 - 09:37:24 MST