Re: overlaying raster over other fields

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Dec 06 2010 - 08:50:46 MST

Hi Joe,

Daran has you on the right track, but I couldn't tell from your resource
settings below if you might be setting some conflicting resources that
would cause it not to work.

You shouldn't need to use "-1" in your fill colors, as long as you have
a _FillValue attribute. You can then simply set cnMissingvalFillColor
to -1 *and* cnFillMode to "CellFill".

Please see the new "mask_10" example I added:

http://www.ncl.ucar.edu/Applications/mask.shtml#ex10

--Mary

On Dec 5, 2010, at 4:55 PM, Joe Grim wrote:

> Thanks Daran,
>
> I think that points me in the right direction. However, this "transparent"
> color still ends up covering up what's below it. The missing value areas
> are no longer white in the output ps file, but instead "transparent" (as
> indicated by the light and dark gray checkerboard pattern using "display).
> Using your input plus related stuff from ncl-talk archives, I have updated
> the relevant attributes as follows:
> res@gsnDraw = False ; do not draw the plot since
> stuff will later be overlaid
> res@gsnFrame = False ; do not advance frame
> res@cnFillOn = True ; Turn on color fill
> res@cnFillMode = "CellFill" ; Do not use RasterFill, as per
> ncl documentation, transparency doesn't work with it
> res@cnLinesOn = False ; Don't use contour lines
> (only fill)
> res@cnLevelSelectionMode = "ExplicitLevels" ; explicitly set the contour
> levels
> ; make first value "missing" (-1 is the @_FillValue), then make the rest
> of the values from min to max
> res@cnLevels =
> array_append_record(-1,ispan(min_contour,max_contour,cntr_intrvl),0)
> ; use transparency as first color (-1 is transparent), then make the rest
> of the colors from 3 to 101
> res@cnFillColors = array_append_record(-1,ispan(3,101,1),0)
> res@cnMissingValFillColor = -1 ; use transparency for missing value
>
> Do you (or does anyone else) have any other suggestions?
>
> Thanks again.
>
> Joe
>
> -----Original Message-----
> From: Daran Rife [mailto:drife@ucar.edu]
> Sent: Sunday, December 05, 2010 1:42 PM
> To: Joe Grim
> Subject: Re: overlaying raster over other fields
>
> Hi Joe,
>
> The value for transparent color is -1.
>
> I believe you can simply set the cnMissingValFillColor to -1
>
> res@cnMissingValFillColor = -1
>
> See:
>
> http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnMissingValFil
> lColor
>
> If that doesn't work, try adding the -1 color to your color
> map in the zeroth position. cnMissingValFillColor always
> defaults to color 0 in your color table.
>
>
> Daran
>
>
> --
>
> Good morning!
>
>
>
> I was wondering if anyone could point me to any documentation
> explaining how
> to do something? I am currently trying to plot one field, and then
> overlay
> a raster plot. This is simple to do. However, what is not simple is
> that I
> would prefer to only plot non-missing raster data points, and be able
> to see
> what was plotted below where the raster field is missing. Currently,
> the
> missing values are plotted as white and covers over the lower-laying
> field.
> The only way I can think of accomplishing this would be to plots
> thousands
> of teeny polygons instead of the raster plot, but this would be very
> inefficient (and require a lot more coding.) Would anyone be able to
> help
> me find an easier way here?
>
>
>
> Thank you very much!
>
>
>
> Joe Grim
>
> _______________________________________________
> 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 Mon Dec 6 08:50:53 2010

This archive was generated by hypermail 2.1.8 : Mon Dec 06 2010 - 09:18:09 MST