Hi Dave,
Thanks very much for sending this along. I do appreciate
it.
Daran
-- On Sep 3, 2008, at 5:52 PM, David Brown wrote: > 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 > > <Nio.py> > > 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-talkReceived on Thu Sep 04 2008 - 13:15:08 MDT
This archive was generated by hypermail 2.2.0 : Wed Oct 01 2008 - 09:47:33 MDT