Re: Increase longitude extent for Hovmoeller plot

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue, 11 Jul 2006 08:05:31 -0600 (MDT)

Hi Dave,

Whenever you have coordinate arrays attached to your data, NCL goes
into an "irregular" mode. This means that it assumes you have
irregularly spaced values in your coordinate arrays (even if your
values are indeed regularly-spaced). Thus, it will not let you
automatically extend your axes in order to include white space,
because it doesn't want to try to extrapolate values from an array
that it thinks is irregular.

It sounds like you have already figured out what you need to do, and
that is to create a second, larger array, and then construct the new
longitude array yourself, with two extra values added. However,
this is not needed if your longitude array is indeed regularly spaced.

We recently had a similar question like this, so please see my answer

In particular, see the discussion that is part of "2)", which will apply
if your longitude axis is regularly spaced.

Otherwise, see the discussion that is part of "3)".

Good luck,


On Mon, 10 Jul 2006, Dave Allured wrote:

> Adam, thanks for the response.
> My dat array is dimensioned only for data present. {:lon1} and {lon2:} are
> not within the range of the longitude coordinate array, therefore I get
> subscripting errors with your method as shown. For this to work, it seems
> that I would have to create a second, larger data array, then somehow
> construct a "longer" longitude array, *then* copy the subarray with the
> actual data.
> In fact I have already started doing this. Since I'm trying to make the code
> general purpose, this is messy. Is there a more direct way to tell
> gsn_csm_hov to widen the range of displayed longitudes?
> --Dave
> Adam Phillips wrote:
>> Hi Dave,
>> Try this:
>> dat(:,{:lon1}) = dat@_FillValue
>> dat(:,{lon2:}) = dat@_FillValue
>> plot = gsn_csm_hov (wks, dat(:, {lon1-10:lon2+10}), res)
>> If that doesn't work or if I am misunderstanding your question let me
>> know...
>> Adam
>> Dave Allured wrote:
>>> Hello. I am using gsm_csm_hov to make Hovmoeller diagrams. When I want
>>> to plot only a portion of the longitude range in the data, I simply use
>>> coordinate subscripting, and the subset is correctly plotted in the full
>>> width of the diagram:
>>> plot = gsn_csm_hov (wks, dat(:, {lon1:lon2}), res)
>>> However, I would like to to the opposite, in a sense. I want the
>>> longitude range of my diagram to be *greater* than the available data, so
>>> that there are blank "all missing" areas to the right and left of the
>>> range of data. The purpose is matching scales between plots of diverse
>>> data sets.
>>> What is the best way to do this? Resources mpMinLonF and mpMaxLonF do not
>>> seem to be available for gsn_csm_hov.
>>> Thank you for any advice.
>>> --Dave A.
>>> CIRES Climate Diagnostics Center
>>> NOAA Earth System Research Laboratory, Physical Sciences Division
>>> _______________________________________________
>>> ncl-talk mailing list
> _______________________________________________
> ncl-talk mailing list
ncl-talk mailing list
Received on Tue Jul 11 2006 - 08:05:31 MDT

This archive was generated by hypermail 2.2.0 : Tue Jul 11 2006 - 08:13:14 MDT