Re: missing values loaded from GRIB2

From: Jeff Whitaker <jswhit_at_nyahnyahspammersnyahnyah>
Date: Thu Feb 24 2011 - 15:29:09 MST

On 2/24/11 10:53 AM, Bryan Woods wrote:
> Hello,
>
> I am loading in HWRF data from the GRIB2 files using PyNIO. Once I
> load them into numpy arrays I am left with a halo of values near the
> boundaries that appear to be empty. When I print them or use them in
> conditional statements I get values of '--' back. I'd like to turn
> these values into zeroes at the very least.
>
> I can't find anything in the numpy documentation that addresses this
> type of missing value so I am wondering if this is something unique to
> PyNIO. Has anyone dealt with this before?
>
> Thanks,
> Bryan

Bryan: To fill in missing values in a masked array with zeros, use

data_filled = data.filled(fill_value=0) # data is your masked array

-Jeff

-- 
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : Jeffrey.S.Whitaker@noaa.gov
325 Broadway                Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg
_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Thu Feb 24 15:29:13 2011

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2011 - 10:03:36 MST