Re: Masked arrays in PyNIO 1.3.0b1

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Wed, 3 Sep 2008 17:52:31 -0600

Hi Daran,

I have modified PyNIO so that both get_value and assign_value
support MaskedArrays. Attached is a new version of Nio.py.
  -dave

On Sep 2, 2008, at 8:52 PM, Daran L. Rife wrote:

> Hi Dave,
>
> Thanks very much for the info, and your willingness to
> modify the get_value() method for the final release of
> PyNIO 1.3.0.
>
> Daran
>
> --
>
>> Hi Daran,
>>
>> It seems that you are correct that PyNIO does not return masked
>> arrays when
>> data is requested through the get_value interface. This is
>> definitely an
>> oversight that will be corrected before the final release version
>> goes out.
>>
>> Note however that given your use case:
>>
>> import Nio, Ngl
>> dirc = Ngl.pynglpath("data")
>> ufile = Nio.open_file(dirc + "/cdf/Ustorm.cdf","r")
>> u = ufile.variables["u"]
>> u_data = u.get_value()
>>
>> the only line that needs to be changed to work around the problem is
>> the last one:
>>
>> u_data = u[:]
>>
>> Actually this is true unless the data variable happens to be a
>> scalar, in which case
>> it will not work.
>>
>> I think it will only require changes to Nio.py to fix this problem.
>> Assuming this is true,
>> I will post the new version to the mailing list once we have a
>> solution.
>> -dave
>

_______________________________________________
pyngl-talk mailing list
pyngl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

Received on Wed Sep 03 2008 - 17:52:31 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 01 2008 - 09:47:33 MDT