|
From: Michael R. <raw...@ya...> - 2012-09-27 14:47:01
|
----- Original Message ----- > From: Michael Rawlins <raw...@ya...> > To: Jeff Whitaker <jef...@no...>; Benjamin Root <ben...@ou...>; Matplotlib Users <mat...@li...> > Cc: > Sent: Wednesday, September 26, 2012 6:23 PM > Subject: Re: [Matplotlib-users] error reading netcdf file > > > >> ________________________________ >> From: Jeff Whitaker <jef...@no...> >> To: Benjamin Root <ben...@ou...>; Michael Rawlins > <ra...@ge...>; Matplotlib Users > <mat...@li...> >> Sent: Wednesday, September 26, 2012 5:10 PM >> Subject: Re: [Matplotlib-users] error reading netcdf file >> >> >> Michael: You can't change an attribute in a read-only dataset. It > should never have worked. >> >> -Jeff >> >> > > > Thanks Jeff and Ben. > > Below is a complete version of one such program I use. I was give the program by > a colleague and I do not know who wrote that code. My previous post showed only > as far as the missing data statement. > <snip> I've gotten my script to work by setting the missing value another way. I'm showing lines commented out as well. #data.missing_value=-9.99 #try: # mval=data.missing_value # print " using specified missing value =",mval #except: mval=-9.99 # print " faking missing value=",mval # make a masked array: using missing value(s) in mval maskdat=ma.masked_values(slice,mval) If I understand correctly, in previous versions the value of -9.99 was passed through the data.missing_value into mval. A mistake in coding that did not result in an error. I will implement the change. Tomorrow I'll check that this solution is backward compatible. Mike |