Re: (no subject)

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Jul 27 2010 - 22:41:50 MDT

All,

(Adam, thanks for answering this).

I've been trying to put together an example that shows how to use
ImageMagick's "convert"
to overlay NCL-generated contours on an existing JPEG image and get
transparency if desired.
I hope to make it available soon.

You can do this without needing the special transparency version of
NCL (although the transparent
version will make this process easier).

As an example (without transparency), see the animation of the
computer model study done
on the Gulf Oil spill. The contours and labelbar were created with NCL:

http://www2.ucar.edu/news/ocean-currents-likely-to-carry-oil-spill-to-atlantic-coast

The contours were overlaid on a JPEG file using "convert".

We did a version of this animation with transparency and another one
where we
overlaid it on a Google Earth map. Here's the G.E. version:

http://www2.ucar.edu/news/oil-spill-animations-multimedia-gallery#googleearth0005

We got the transparency simply by generating the same contours with a
grayscale
color map, and overlaying these in addition to the color contours.

Here's what a sample script might look like to do the non-transparent
overlay.
Note that your JPEG image must be in the same map projection as what
you overlay
the contours on, or your two images won't line up correctly.

# Convert PS file to jpeg and trim white space.
convert -density 800 -trim -geometry 1386x1386 contours.ps contours.jpg

# Resize NCL image to size of existing JPEG file.
convert -resize 1386x1054 contours.jpg contours_resize.jpg

# Overlay on top of the world map and convert to png
convert satellite_image.jpg contours_resize.jpg -composite
final_image.png

Here's how it might look for transparency. The grayscale values will
basically
represent how intense you want a color to be once you overlay it on
another
color.

# Convert color and grayscale PS files to jpeg and trim white space.
convert -density 800 -trim -geometry 1386x1386 color.ps color.jpg
convert -density 800 -trim -geometry 1386x1386 gray.ps gray.jpg

# Resize square images to size of existing JPEG file.
convert -resize 1386x1054 color.jpg color_resize.jpg
convert -resize 1386x1054 gray.jpg gray_resize.jpg

# Composite color and grayscale images into a PNG.
composite -compose CopyOpacity gray_resize.jpg color_resize.jpg
contours.png

# Overlay the above transparent image on top of the world map.
convert satellite_image.jpg contours.png -composite final_image.png

--Mary

On Jul 27, 2010, at 12:59 PM, Adam Phillips wrote:

> You can draw maps that combine color-filled topography with color
> filled
> geopotential heights, but where the two color fills overlap only one
> will be visible.
>
> Geopotential heights is typically a smooth enough field that you can
> draw them using contours only, and these can be easily overlaid on a
> color-filled topography field.
> See the overlay applications page here for examples on how to
> overlay a
> contour field on a color-filled field:
> http://www.ncl.ucar.edu/Applications/overlay.shtml
>
> There are numerous other examples on the NCL applications page that
> deal
> with color-filling and the like: http://www.ncl.ucar.edu/Applications/
>
> Within the next 6 months (or so) NCL will likely be able to draw
> transparent colors, which would allow for two color-filled contour
> fields occupying the same space to be visible. This of course doesn't
> help you right now though...
> Good luck,
> Adam
>
>
> On 07/27/2010 01:27 AM, lumos.leee wrote:
>> Hello, I’m a student of Peking University and I’m about to use ncl to
>> draw some contour maps in atmospheric research.
>>
>> I was just wondering if ncl can draw maps combined with topography
>> and
>> geopotential height.
>>
>> For example, I’d like to draw the topography of north America which
>> includes the high elevation of Rocky mountains and flat plain and the
>> Five Lakes in different colors. And I also like to draw the
>> geopotential
>> height filled with color on the topography. Since one figure in
>> matlab
>> can only use one colormap, I have no idea to use what command to draw
>> such kind of maps. Can you tell me some way to go through it?
>>
>> Thank you.
>>
>> NCL version 5.2.1
>>
>> --
>> Cheng Li
>> Dept. Atmospheric Sciences
>> Peking Univ.
>> Beijing 100871
>> P. R. China
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
> __________________________________________________
> Adam Phillips
> asphilli@ucar.edu
> National Center for Atmospheric Research tel: (303) 497-1726
> Climate and Global Dynamics Division fax: (303) 497-1333
> P.O. Box 3000
> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jul 27 22:41:57 2010

This archive was generated by hypermail 2.1.8 : Wed Jul 28 2010 - 10:42:06 MDT