Re: draw order for contour maps and polylines

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Apr 05 2011 - 08:34:34 MDT

Hi John,

If I have all the layering concepts correct, this is what needs to happen:

 - Draw the contour-filled SSTs
 - Draw the filled map, thus covering the SSTs that are over land (but not over water)
 - Draw the vectors
 - Draw the US outlines

I think you're right about what happens when you set mpFillDrawOrder to "Draw": this causes the contour fill to be afterwards (it may be in the "PostDraw" phase), and the contour filled missing areas cover up the land areas.

Maybe you just additionally need to set "sstRes@cnFillDrawOrder" to "PreDraw". Can you give this a try:

sstRes@cnFillDrawOrder = "PreDraw"
sstRes@mpFillDrawOrder = "Draw"
Make sure you also keep "tfPolyDrawOrder" set to "PostDraw". I'm afraid this resource may not be working as expected, however. I think if mpFillDrawOrder is "PostDraw" then this trumps tfPolyDrawOrder being set to "PostDraw". Dave would have to verify this.

--Mary

On Apr 5, 2011, at 5:24 AM, John Kerfoot wrote:

> As a follow up to a post I sent yesterday (read speed for ascii vs .nc), I'm creating a contour map (gsn_csm_contour_map) of 25hr composited AVHRR sea-surface temperatures with the ocean surface current field (vectors) overlaid. I'm using the high-resolution map database GSHHS. I'd like to add US state boundary lines to the map, but can't do it natively in NCL while using the high-res map database; however I have found a shape file that contains this information.
>
> The script I'm using is here and will display the image in an x11 window.
>
> I have set the mpFillDrawOrder resource to "PostDraw" so that the land overlays the SST contour map as in this example:
>
> http://marine.rutgers.edu/~kerfoot/pub/overlays/maracoos-overlay_20110404T180000_25hroverlay_100dpi.png
>
> I then tried to draw the state boundaries as polylines without changing any resource settings. Here's what I got::
>
> http://marine.rutgers.edu/~kerfoot/pub/overlays/maracoos-overlay_20110404T180000_25hroverlay_states_100dpi.png
>
> which looks like the same thing. When I draw this in an x11 window, I can see the state lines being drawn, but the land is then drawn over them, which I think is because I have mpFillDrawOrder set to "PostDraw". So I changed mpFillDrawOrder to Draw (the default) and got this result:
>
> http://marine.rutgers.edu/~kerfoot/pub/overlays/maracoos-overlay_20110404T180000_25hroverlay_100dpi_draw.png
>
> which is masking out the land once it has been plotted with the contour map. I presume this is because cnMissingValFillColor defaults to Background(0) which, in my case, is white.
>
> I then set cnMissingValFillPattern to -1 (Hollow fill) which, from the documentation says:
>
> cnMissingValFillPattern
>
> This resource sets the HLU index of the fill pattern used to fill missing value areas. If cnMissingValFillPattern has the value HollowFill (-1), there will be no fill of the missing value area, regardless of the setting of cnMissingValFillPattern. Note that the resource cnFillOn must be set to True in order for cnMissingValFillPattern to take effect.
> Default: HollowFill
>
> and I set cnMissingValFillColor = -1 (Transparent) which, from the documentation says:
> cnMissingValFillColor
>
> This resource sets the color to use for filling in missing value areas. If cnMissingValFillColor has the value Transparent (-1), there will be no fill of the missing value area, regardless of the setting of cnMissingValFillPattern. Note that the resource cnFillOn must be set to True, and cnMissingValFillPattern to 0 ("SolidFill") or higher (pattern fill) in order for cnMissingValFillColor to take effect.
> You can use a color index value (integer) or a named color (string).
>
> Default: Background (0)
>
>
> but got the same result:
> http://marine.rutgers.edu/~kerfoot/pub/overlays/maracoos-overlay_20110404T180000_25hroverlay_100dpi_nofill.png
>
> I did specify tfPolyDrawOrder to "PostDraw" (the default) in the hopes this would fix the issue, but no luck.
>
> So I'm at a loss as to how to do the following:
> 1. Plot a contour map of SST values
> 2. Lay a land map, created from the high-resolution mapping database (GSHHS)
> 3. Plot the state boundaries on top of everything
>
> Any suggestions?
>
> I'm reading the state boundaries lat/lon file from a local directory, but would be happy to push it to anyone who wants it.
>
> Thanks,
> John
>
>
>
> _______________________________________________
> 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 Apr 5 08:34:44 2011

This archive was generated by hypermail 2.1.8 : Tue Apr 05 2011 - 09:01:21 MDT