Select to view content in your preferred language

using dap2arc and multidimensional tools via python to visualize netdcf results

6988
27
Jump to solution
05-05-2015 01:15 PM
ashleytarver1
Deactivated User

HI all

Im in a bit of a pickle.  I'm graduating late, and I'm at a roadblock for my thesis.  I need to pull netcdf files into Arc to visualize some results. I've downloaded both the zipped open2arc folder an the multidimensional tool service package, but now I'm stuck. 

Although I am somewhat familiar with Arc, I have no experience with python or programming.  Which text file from the folders I downloaded need to be copy and pasted into the python window under the "geoprocessing" tab in order to make the tools available for use?

Any suggestions are appreciated!

Thanks in advance!

Ashley

0 Kudos
27 Replies
IanMurray
Honored Contributor

Thats it!!  OPeNDAP Dataset Query Form

Make sure you time, x, and y parameters for your data as well when you do the query.  They are required for the script tool.  I got the code past your crash point.

0 Kudos
ashleytarver1
Deactivated User

Really? I'm still getting the same error

0 Kudos
IanMurray
Honored Contributor

when you are doing the query, you need to have x,y and time variables checked and included in the resulting url for the tool to work.

http://opendap.renci.org:1935/thredds/dodsC/tc/isaac/39/ocpr_v19a_DesAllemands4CERA/garnet.erdc.hpc....

Thats the query I put in and it got past the key error, but since I hadn't made an output location it crashed on the time.  I had to check the windx, x,y, time variables on the OPeNDAP Query Form.

Unfortunately, I'm on my home computer now, so I can't try running again, but I did get past the error you hit.

0 Kudos
curtvprice
MVP Esteemed Contributor

The dap2tinapyt file shows a red "x"; does this mean I need to first import the toolbox via python?

It means there is a syntax error in the pyt file. If you right click the toolbox there is a "Check Syntax" menu option you can click.

There is no need to import toolboxes of any kind in 10x; they can be accessed directly from the catalog location.

0 Kudos
IanMurray
Honored Contributor

I took her response to mean she opened the toolbox in the catalog, but once she tried to put in the URL parameter, it said it was invalid, so the red x showed up next to the parameter.  The tool had no syntax errors when I tried it, I suppose she needs to be sure that the netcdf python module is installed.

curtvprice
MVP Esteemed Contributor

Ian Murray wrote:

I suppose she needs to be sure that the netcdf python module is installed.

Which can be a challenge with 10.1, as Rich has discovered. (He was involved in some of the Python discussions between the oceanography/meteorology community and Esri, fortunately.)

Fortunately the netcdf module will be included in the Python stack that will ship with 10.3.1 so tools like Richard Signell's will have netcdf pre-loaded and ready to roll.

ashleytarver1
Deactivated User

I have ArcMap 10.2. Is that the problem?

0 Kudos
curtvprice
MVP Esteemed Contributor

I don't think so. 10.1 SP 1 through 10.2.x are pretty much compatible.

Does the toolbox fail to load (which I thought was the issue) or is the URL parameter not validating (which Ian suspects)?  if the latter, all you need to do is add your URLs to the filter code as he suggests.

The netcdf issue is a sticky wicket because it involves finding a version that runs compatible with arcpy. To see if that's an issue, try "import netcdf" in your arcmap python window.

0 Kudos
ashleytarver1
Deactivated User

Forgive me, its like you're all speaking a foreign language to me. Yuk yuk

(couldn't help myself)

I think the problem is that I need to install the netcdf python module. I

have the .pyt (dap2tin) saved to my desktop, and when it shows up in my

catalog it has a red "x" next to it and when I check the syntax it reads :

'Parsing error SyntaxError: invalid syntax line'.

Thank you, when I get to my desktop tonight I will mark the helpful

comments in the hopes this may help another beginner to python like me!

-Ashley

0 Kudos
IanMurray
Honored Contributor

Okay, once you downloaded the multidimeonsional tool zip and unzip it, open the folder and there is an netCDF4-1.0.4.win32-py2.7.exe.  That is the installer for the netcdf python module.  Let it run and it will install the netcdf python module on your computer.  NetCDF module.png