Re: Interpolating sounding data to a height grid

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu May 29 2014 - 14:31:04 MDT

Brian,

Thanks for providing a script. When I ran it, I got some warnings that are worth paying attention to:

warning:linint1_n: xi and xo must be monotonically increasing
warning:linint1_n: xi and xo must be monotonically increasing
warning:linint1_n: xi and xo must be monotonically increasing
warning:linint1_n: xi and xo must be monotonically increasing
warning:["CoordArrays.c":591]:No Valid values in Array, unable to compute Min or Max
warning:["CoordArrays.c":591]:No Valid values in Array, unable to compute Min or Max
warning:["CoordArrays.c":591]:No Valid values in Array, unable to compute Min or Max

If you see warnings like this, especially from a function that is not producing the correct results, it’s important to look at the data being input to the function.

I added this lines before the linint1_n_Wrap call:

print(h1)

and got this result:

Variable: h1
Type: float
Total Size: 1000 bytes
            250 values
Number of Dimensions: 2
Dimensions and sizes: [recNum | 1] x [sigTLevel | 250]
Coordinates:
Number Of Attributes: 5
  long_name : Geopotential - Significant level wrt T
  units : meters
  valid_range : ( -250, 60000 )
  missing_value : 99999
  _FillValue : 99999
(0,0) 606
(0,1) 1044
(0,2) 1380
(0,3) 2314
(0,4) 2346
(0,5) 2378
(0,6) 3072
(0,7) 4916
(0,8) 5139
. . .
(0,29) 32447
(0,30) 33140
(0,31) 9.96921e+36
(0,32) 9.96921e+36
(0,33) 9.96921e+36
(0,34) 9.96921e+36
(0,35) 9.96921e+36
. . .
(0,244) 9.96921e+36
(0,245) 9.96921e+36
(0,246) 9.96921e+36
(0,247) 9.96921e+36
(0,248) 9.96921e+36
(0,249) 9.96921e+36

You have two problems here. One is that your “h1” array is not monotonic after index 30, because all the values appear to be missing from index 31 to index 249.

The second problem is that your “_FillValue” attribute claims the missing values are equal to 99999, but from the print of the values, it looks like it should be 9.96921e+36 (the default missing value for a float).

Doing this will fix the missing value problem for h1:

h1@_FillValue = default_fillvalue(typeof(h1))
h1@missing_value = default_fillvalue(typeof(h1)) ; not necessary, but a good idea

But, you can’t call linint1_n* with missing values in the coordinate arrays.

Since all of your arrays appear to be missing after index 30, I modified your script to only do the linterpolation on the non-missing part of the arrays. See attached.

—Mary

On May 27, 2014, at 3:50 PM, brianjs @iastate.edu <brianjs@iastate.edu> wrote:

> Good Afternoon,
>
> I have a small (and possibly simple) question to ask. I am attempting to develop vertical profiles of potential temperature, total wind speed magnitude, and atmospheric water vapor content for the 100-3000 meter layer, at 100 meter intervals from sounding data available in netcdf format). I attempted to interpolate it to the given levels I want with the linint1_n_Wrap command, but all I get are missing values. I am not sure why this happens, as plugging in model or other forms of gridded data/output work just fine with this same routine. I am guessing the sounding data is not organized the way it appears to be? Has anyone had this issue before? I appreciate any input as to why the data goes missing.
>
> I have attached my code and one of the input sounding data files. Thank you in advance!
>
> Brian Squitieri
> Graduate Research Assistant
> Iowa State University
> <raob_soundings0523_12Z.cdf><test_sounding.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 May 29 14:31:18 2014

This archive was generated by hypermail 2.1.8 : Tue Jun 03 2014 - 11:40:09 MDT