Re: Cannot set sfElementNodes to stop contouring between unrelated nodes

From: Carmen St. Jean <cstjean_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 26 2012 - 08:41:34 MDT

Hi Dave,

Thank you so much for the quick response and the modified script. This
is exactly what I was looking for. Maybe part of the problem I was
having was that I was trying to transpose file.variables["nv"] instead
of file.variables["nv"][:], though I already cannot remember exactly
what it was that I tried. The new plot looks beautiful!

Thank you!

Carmen

On 3/24/2012 11:14 AM, David Brown wrote:
> Hi Carmen,
>
> You definitely need to set sfElementNodes to render this dataset correctly either in NCL or in PyNGL.
> I was able to transpose the dimensions of the "nv" array with no problem using the numpy transpose function.
>
> nv = file.variables["nv"][:].transpose(1,0) # has the wrong dimensions to be used to for sfElementNodes
>
> With minor modifications to your script (also attached) I produced the attached plot. Hopefully this will help.
> -dave
>
> .
>
>
>
>
>
>
> On Mar 23, 2012, at 9:31 AM, Carmen St. Jean wrote:
>
>> Hello NCL-ers,
>>
>> I'm trying to use a NetCDF file of NOAA/NOS' Northern Gulf of Mexico Operational Forecast System (NGOFS) to create a contour plot of sea surface temperature. However, the contour plot my PyNGL code produces is not showing NGOFS as I would expect it to appear. The contour is being drawn between nodes of the NGOFS triangular mesh that should not be neighbors.
>>
>> I attached a PNG image of the plot, where you can see that there are extra connections being made between nodes when you compare it to how NGOFS should look (example: http://tidesandcurrents.noaa.gov/images/ngofs_bathy.png). (Additionally, I think I am having projection issues, but that is a separate issue perhaps.)
>>
>> I saw that you can set the "sfElementNodes" resource to specify a set of triangles explicitly, so I attempted to set "sfElementNodes" to the "nv" variable of this NetCDF file. However, the dimensions of "nv" are backwards from what sfElementNodes wants. I attempted to transpose this 2D array through several methods, but it killed my program, perhaps because the array is too large to transpose.
>>
>> Without a mask in this NetCDF file, I'm not sure of any other ways to stop the contour from being drawn outside of the NGOFS domain. Does anyone have any ideas? I'm pretty new to PyNGL/NCL, so there may be something obvious I am missing. Any suggestions would be appreciated.
>>
>> Here is the file I'm using for input:
>> http://opendap.co-ops.nos.noaa.gov/netcdf/ngofs/201203/nos.ngofs.fields.nowcast.20120322.t03z.nc
>> (If this file does not work for you, it can be any nos.ngofs.fields.nowcast.* file from the CO-OPS OPeNDAP server: http://opendap.co-ops.nos.noaa.gov/index.php?dir=/netcdf/ngofs/)
>>
>> Thank you,
>>
>> Carmen St. Jean
>> <ngofs-test.png><ngofs-test.py>_______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 26 08:41:45 2012

This archive was generated by hypermail 2.1.8 : Tue Mar 27 2012 - 08:50:24 MDT