LodaFile netcdf no attribute 'subset'

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
CNETO
Posts: 7
Joined: Wed Jun 04, 2014 4:48 pm

LodaFile netcdf no attribute 'subset'

Post by CNETO »

Hello,

I have some satallite date in netcdf files and i could not load them in McIDAS-V through script. obs: I'm Using McIDAS-V 1.5 beta1
When i tryed:

Code: Select all

file_toopen = /home/cneto/Downloads/201407020000.nc
params = dict(
    filename = file_toopen,
    field = 'Band1 GDAL Band Number',
    coordinateSystem = LATLON,
    latLonBounds=(15,-75,-58,-24),
)
sat = loadFile(**params)


I get the following error :

Traceback (most recent call last):
File "<string>", line 33, in <module>
File "<string>", line 2867, in loadFile
AttributeError: 'NoneType' object has no attribute 'subset'


I can load and display the file manually with no problema

I'm missing something? How can i open the file?
the file is aattached
Attachments
201407020000.nc
(1.82 MiB) Downloaded 319 times
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: LodaFile netcdf no attribute 'subset'

Post by bobc »

Hi CNETO -

It looks like the only problem in your script is that the field keyword is specified incorrectly. field= is supposed to be the field's shortname. In this case, it should simply be:

Code: Select all

field='Band1'.


A command you might be interested in is loadFileListFieldsInFile(/fileDir/file). For example:

Code: Select all

loadFileListFieldsInFile('/Users/rcarp/data/netcdf/201407020000.nc')

... this prints out:

Code: Select all

Band1 ; GDAL Band Number 1

... here, Band1 is the shortname, and GDAL Band Number 1 is the longname.

Just as a note, we're aware that the error message you saw doesn't specifically point towards an invalid entry for field=. loadFile is still a work in progress, and better error handling is something that will be addressed.

Thanks -
Bob Carp
McIDAS Help Desk
Post Reply