ucar.ma2 invalid range expection from loadGrid

Errors and unexpected results
Post Reply
User avatar
joleenf
Posts: 1120
Joined: Mon Jan 19, 2009 7:16 pm

ucar.ma2 invalid range expection from loadGrid

Post by joleenf »

Hi,

I am trying to view data from ftp://ftp.ssec.wisc.edu/ABI/kaba/sim-abi/doe/third_set/ using loadGrid.

I have just pulled one file from the set and placed it in a test directory.

Then, I have run the code:

Code: Select all

import os,glob
homedir=expandpath('~')
datadir=os.path.join(homedir,'test')
files=os.path.join(datadir,'OR_*.nc')

files=glob.glob(files)

gridParms = dict(
   filename=files[0],
   field='Rad'
   )

gridData=loadGrid(**gridParms)


loadGrid returns an exception ucar.ma2.InvalidRangeException: Number of ranges in section (2) must be = 0.

Am I using the loadGrid command correctly? This exception occurs in Version 1.6 beta 1 build date 2015-07-20. It also occurs in McIDAS-V 1.5 stable version.

Thanks,
Joleen
User avatar
Rick
Posts: 404
Joined: Fri Jan 16, 2009 8:20 pm

Re: ucar.ma2 invalid range expection from loadGrid

Post by Rick »

Hi Joleen,

I am able to reproduce the problem. I did run the file through a CF compliance checker and there are some errors. I did note that I can load the data through the GUI. Both the GUI and background should work identically. If you get a chance, please see if you can correct the NC compliance errors and again try to display the data using loadGrid.

I have created inquiry 2127 to evaluate the problem.

Rick
User avatar
TJS
Posts: 90
Joined: Thu Mar 05, 2009 7:31 pm

Re: ucar.ma2 invalid range expection from loadGrid

Post by TJS »

Hi,

Agreed that if the files work via the GUI, the system should allow them via background.

In theory, the DOE files can still change to be more CF complaint, but getting those changes in gets more difficult with each passing round of reviews.

Thanks,
TJS
User avatar
mhiley
Posts: 90
Joined: Mon Jan 23, 2012 10:22 pm

Re: ucar.ma2 invalid range expection from loadGrid

Post by mhiley »

Joleen,

I am aware of the issues with loadGrid and the ABI DOE files. I wrote some code a few months ago that demonstrates how to get these files loaded from a Jython script, which I attached below and is hopefully helpful. I intend to make loadGrid compatible with the ABI-DOE files using this strategy, but just haven't gotten to it yet. Hope this code is helpful for the time being (be sure to set the filename and filepath appropriately).

Mike
Attachments
abi_doe_test_code.py
(1.21 KiB) Downloaded 308 times
User avatar
joleenf
Posts: 1120
Joined: Mon Jan 19, 2009 7:16 pm

Re: ucar.ma2 invalid range expection from loadGrid

Post by joleenf »

Hi Mike,

Thanks, this does work. Is there a way to pull the data description from loadGrid and the future loadAbiDoe (grid)? (i.e., if I load the 'Rad' field, can I get the description for that field, or will I have to somehow parse that information from listGridFieldsInFile. If so, what is the best way to do this?).

Thanks,
Joleen
User avatar
joleenf
Posts: 1120
Joined: Mon Jan 19, 2009 7:16 pm

Re: ucar.ma2 invalid range expection from loadGrid

Post by joleenf »

Sorry, I think I have the answer to my question. The resulting object is a MappedGeoGridFlatField, so I will be able to type something like dataGrid=loadGrid(file,**parms) and then use description=dataGrid['info'].

Thanks,
Joleen
Post Reply