draw order for contour maps and polylines

From: John Kerfoot <johnkerfoot_at_nyahnyahspammersnyahnyah>
Date: Tue Apr 05 2011 - 05:24:31 MDT

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<http://marine.rutgers.edu/%7Ekerfoot/pub/overlays/plotRuAvhrrCodarOverlay.ncl>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<http://www.ncl.ucar.edu/Document/Graphics/fill_patterns.shtml>used
to fill missing value areas. If
*cnMissingValFillPattern*<http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnMissingValFillPattern>has
the value
HollowFill (-1), there will be no fill of the missing value area, regardless
of the setting of
*cnMissingValFillPattern*<http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnMissingValFillPattern>.
Note that the resource
*cnFillOn*<http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnFillOn>must
be set to True in order for
*cnMissingValFillPattern*<http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#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*<http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnMissingValFillColor>has
the value
Transparent (-1), there will be no fill of the missing value area,
regardless of the setting of
*cnMissingValFillPattern*<http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnMissingValFillPattern>.
Note that the resource
*cnFillOn*<http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnFillOn>must
be set to True, and
*cnMissingValFillPattern*<http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnMissingValFillPattern>to
0 ("SolidFill") or higher (pattern fill) in order for
*cnMissingValFillColor*<http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnMissingValFillColor>to
take effect.

You can use a color
index<http://www.ncl.ucar.edu/Document/glossary.shtml#ColorIndex>value
(integer) or a named
color <http://www.ncl.ucar.edu/Document/glossary.shtml> (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
Received on Tue Apr 5 05:24:42 2011

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