McIDAS1.5beta2 - loadFile from Xml Catalog problem

Errors and unexpected results
Post Reply
User avatar
carlospsneto
Posts: 68
Joined: Thu Mar 14, 2013 1:38 pm

McIDAS1.5beta2 - loadFile from Xml Catalog problem

Post by carlospsneto »

I'm having some trouble to load a file from a xml catalog. When i run this script ( that works fine in beta1) :

Code: Select all

namefile = 'http://thredds.ucar.edu/thredds/dodsC/grib/NCEP/GFS/Global_0p5deg/GFS_Global_0p5deg_20140731_0600.grib2/GC'

params = dict(
   filename = namefile,
   field = 'Temperature_tropopause',
   latLonBounds=(15,-85,-60,-30),
)
tempTrop = loadFile(**params)
collectGarbage()


I get the following message:
ValueError: filename does not exist or is a directory: http://thredds.ucar.edu/thredds/dodsC/g ... 0.grib2/GC


If you load manually, in field selector, right click on the data, select Properties and in the Details tab you can see that the File address is the same that i use in the script.
I'm not sure what changed in beta2 that this is not working anymore.
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: McIDAS1.5beta2 - loadFile from Xml Catalog problem

Post by bobc »

Hello -

Can you please give this a try using today's beta2 nightly? We're still in the process of developing loadFile functionalities, and our testing to this point has been with local files on our machines, not realizing that this had worked with data right off a catalog. Since we didn't notice this, we put in an error check for loadFile that verified that the 'filename' keyword actually pointed at a local file, which is why accessing data from a catalog started to error.

I made our loadFile programmer aware of this, and he put in a fix to allow the filename keyword to point to a catalog. From my testing this morning, this seems to be working now.

Thanks for reporting this -
Bob Carp
McIDAS Help Desk
User avatar
carlospsneto
Posts: 68
Joined: Thu Mar 14, 2013 1:38 pm

Re: McIDAS1.5beta2 - loadFile from Xml Catalog problem

Post by carlospsneto »

Hi Bob,

Thank you for taking a look into this.
I use that script as a example, because the unidata thredds is open, but my real use of this is to load file from the local Threads of the institution that i work.
The unidata thredds worked, but my institution's local thredds didn't.
The funny thing is that in 1.5beta1 works fine.
User avatar
mhiley
Posts: 90
Joined: Mon Jan 23, 2012 10:22 pm

Re: McIDAS1.5beta2 - loadFile from Xml Catalog problem

Post by mhiley »

Hi Carlos,

Can you post the URL you are trying to use? Well, I don't need to the actual URL, just the "form" of it.

All I'm trying to do is add some simple error checking to loadFile so that it will fail gracefully if a user tries to load a non-existant local file. But thanks to your post, I realize now that we still need to let through any attempt to load remote data. For the moment I went the naive route and am just letting through anything that starts with the string "http". So... if you you can let me know the "form" of your URL I can make sure that case gets handled properly.

Sorry for the hassle, but thanks for letting us know about this... we didn't even realize loadFile works with remote data! :)

Mike
User avatar
carlospsneto
Posts: 68
Joined: Thu Mar 14, 2013 1:38 pm

Re: McIDAS1.5beta2 - loadFile from Xml Catalog problem

Post by carlospsneto »

Hello Mike.

Thank you for the effort.
Here is a example of a address of a openDaP data that i used to load with loadFile in McV1.5beta1.
dods://nfs5:8080/thredds/dodsC/eumetsat ... 08_L2_1.nc

I used this address as filename params for loadFile. Like this:

file_toopen: 'dods://nfs5:8080/thredds/dodsC/eumetsat/L2/IR_108/latest/MET_IR_108_L2_1.nc'
params = dict(
filename = file_toopen,
field = 'Band1',
coordinateSystem = LATLON,
latLonBounds=(15,-75,-58,-24),
)
dataIR = loadFile(**params)
User avatar
mhiley
Posts: 90
Joined: Mon Jan 23, 2012 10:22 pm

Re: McIDAS1.5beta2 - loadFile from Xml Catalog problem

Post by mhiley »

Hi Carlos,

We just updated the nightly build one more time. If you download and install the newest nightly, the "dods://" URL should work. Sorry again about the hassle, but thanks for working through it with us!

Let us know if you have any more trouble!
Mike
User avatar
carlospsneto
Posts: 68
Joined: Thu Mar 14, 2013 1:38 pm

Re: McIDAS1.5beta2 - loadFile from Xml Catalog problem

Post by carlospsneto »

Thank you very much Mike.
Worked well.
Post Reply