Thank you very much, that's a useful trick to know.
I also understand now what I did wrong with my method. If I had used
(/ /) to keep it from copying the coordinate data, it would have
worked. e.g.,
expanded(1:4,1:8) = (/ original /)
expanded(0,:) = (/ expanded(1,:) /)
expanded(:,0) = (/ expanded(:,1) /)
expanded(5,:) = (/ expanded(4,:) /)
expanded(:,9) = (/ expanded(:,8) /)
I always forget that writing to a portion of a variable can still
change its metadata. Thanks for your help!!
Carl
On Thu, Jun 4, 2009 at 1:37 PM, David Brown <dbrown_at_ucar.edu> wrote:
> Hi Carl,
> There is a way to get "CellFill" (or non-smoothed "RasterFill") mode plots
> to
> show the full cells at the boundaries of the plots. You can provide
> coordinates as
> cell edges rather than as cell centers by specifying coordinate arrays that
> have one
> more value than the number of data points along each axis. However, it is
> slightly more
> complicated because NCL variables cannot have such arrays as part of their
> metadata. So what you need to do is eliminate the coordinate arrays attached
> to
> the variables and instead set the resources sfXArray and sfYArray directly.
>
> I am attaching a modified version of your script that achieves this in the
> first
> frame.
>
> Regarding the use of irregular axes, an irregular coordinate axis will never
> work if 2
> elements have the same value. This violates the essential condition that
> the
> values be monotonically increasing or decreasing.
> -dave
>
>
> On Jun 4, 2009, at 9:26 AM, Carl J. Schreck, III wrote:
>
>> I'm trying to plot a very sparse dataset with cnFillMode = "CellFill",
>> but I notice that it makes the cells on the edges and corners smaller
>> than the others. It looks like it cuts them off in the middle. I
>> realize it has to do that for contouring, but I was hoping CellFill
>> could get around it. Is there a workaround?
>>
>> One idea I had was to pad the data with identical points on the edges
>> that are only half a gridbox away. However, it appears that NCL has
>> issues contouring irregularly spaced grids, and gives me errors like
>> these:
>>
>> warning:_NhlCreateSplineCoordApprox: Attempt to create spline
>> approximation for X axis failed: consider adjusting trXTensionF value
>> warning:_NhlCreateSplineCoordApprox: Attempt to create spline
>> approximation for Y axis failed: consider adjusting trYTensionF value
>> warning:IrTransInitialize: error creating spline approximation for
>> trXCoordPoints; defaulting to linear
>> warning:IrTransInitialize: error creating spline approximation for
>> trYCoordPoints; defaulting to linear
>>
>> Attached is a sample script that might demonstrate the issues I'm
>> talking about. Thank you for your help!!
>>
>> Cheers,
>> Carl<grid_irreg.ncl>_______________________________________________
>> 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 Thu Jun 04 2009 - 11:48:57 MDT
This archive was generated by hypermail 2.2.0 : Mon Jun 08 2009 - 09:30:31 MDT