Skip to Content.

mget-help - RE: [mget-help] Parameter Error for GHRSSTLevel4CreateArcGISRasters

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


From: Andrew Gilbert <>
To: Jason Roberts <>
Cc: "" <>, "Rich Wawrzonek" <>
Subject: RE: [mget-help] Parameter Error for GHRSSTLevel4CreateArcGISRasters
Date: Wed, 27 Aug 2014 16:19:06 +0000
Accept-language: en-US
Deferred-delivery: Wed, 27 Aug 2014 16:18:00 +0000

Jason,

 

Thanks for that information. I’ll stick with the # sign at the end now that I know it’s reasonable for it to be there.

 

As for digging up the COM library example, right now I have the Python code working, so I’ll stick with that. If I run into any issues, though, I might contact you later.

 

Thanks for your help!

 

Andrew

 

From: Jason Roberts [mailto:]
Sent: Thursday, August 21, 2014 11:15 AM
To: Andrew Gilbert
Cc: ; Rich Wawrzonek
Subject: Re: [mget-help] Parameter Error for GHRSSTLevel4CreateArcGISRasters

 

Andrew,

I am on vacation with only my phone at the moment, so I can only offer limited help. I'd need to examine the code to know for sure, but suspect the need for an extra # results from a quirk in how ArcGIS requires geoprocessing tools be parameterized. Because the tool "updates" the output directory (by storing rasters in it) the tool is required to declare a final "derived" parameter that is not listed in the documentation. This is an output parameter (like a return value from a function) and the tool simply sets it to the value of the output directory parameter. But even though it is really just an output parameter, ArcGIS still passes a value in for it. By passing # you are doing the same thing that ArcGIS does, so that is the correct thing to do.

Those Python scripts in that directory are really only there for ArcGIS use, which is why they are quirky like that. But I see no technical reason why calling them yourself as you are doing will not work.

It is theoretically possible to call many MGET "tools" from C# directly through a COM library that MGET installs. I think I have a bare bones example of this on the old website. I can dig it up for you next week when I return, if you want. I haven't tested it in a while though.

Finally, I should say that at this time, we do not really have the resources to offer a solid, stable, documented API to program against. While it is possible to use MGET from a variety of programming environments, and I'm happy to answer questions about it, we can only really say that the API is experimental, and do not suggest that it is fit for important purposes.

I hope this helps,
Jason

On Aug 20, 2014 7:18 PM, Andrew Gilbert <> wrote:

Hi there. I’m trying to run the GHRSSTLevel4CreateArcGISRasters tool through a command line like so:

 

cmd.exe /C ""C:\Program Files\GeoEco\ArcGISToolbox\Scripts\GHRSSTLevel4CreateArcGISRasters.py" JPL_OUROCEAN-L4UHfnd-GLOB-G1SST analysed_sst C:\SST Add %%Y;sst%%Y%%j.img # # "-179 68 -130 72" 8/19/2014 8/19/2014 60 300 # true false true false false"

 

I get this error:

ERROR ValueError: Invalid parameters. This tool expected to receive 19 parameters but it received 18. Please review the documentation for this tool to determine the correct parameters. If you are invoking this script from outside of ArcGIS, use a single # character to indicate that a parameter has no value.

 

According to the documentation I found here, the tool only takes 18 parameters:

http://code.nicholas.duke.edu/projects/mget/export/980/MGET/Trunk/PythonPackage/dist/TracOnlineDocumentation/Documentation/ArcGISReference/GHRSSTLevel4.CreateArcGISRasters.html?format=raw

 

I have found that adding a # symbol at the end seems to make the tool succeed with the correct name, extent, and date:

 

cmd.exe /C ""C:\Program Files\GeoEco\ArcGISToolbox\Scripts\GHRSSTLevel4CreateArcGISRasters.py" JPL_OUROCEAN-L4UHfnd-GLOB-G1SST analysed_sst C:\SST Add %%Y;sst%%Y%%j.img # # "-179 68 -130 72" 8/19/2014 8/19/2014 60 300 # true false true false false #"

 

I’m not sure that’s the right solution, though. Can you offer any insight on the error? Ultimately I’m running the tool from a C# application--is there a cleaner way to be running the tool? Thanks!

 

Andrew Gilbert

< date >
< thread >
Archives powered by MHonArc.
Top of Page