-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
motuclient 1.8.4 and Python script #19
Comments
Hi, Can you try from a command line: Then from python script:
Have you the same display ? Regards |
C:\Python27\motuclient -h
|
Solved with this: `cmems_user= "lbuga" command_string = "python -m motuclient --user " + str(cmems_user) + " --pwd " + str(cmems_pass) +" --motu " + str(motu_server) + " --service-id " + str(product_id) + " --product-id " + str(dataset_id) + " --longitude-min " + str(lon_min) + " --longitude-max " + str(lon_max) + " --latitude-min " + str(lat_min) + " --latitude-max " + str(lat_max) + " --date-min " + str(date_min) + " --date-max " + str(date_max) + " --variable " + str(variable1) + " --out-dir " + str(Out_dir) + " --out-name " + str(nc_name) os.system(command_string)` |
From a python script, you can also fake a motu client:
This is a dirty workaround, but works. Would be nicer though if the api supported using a dict rather than only an optionparser result. |
Is there a solution to this? I'm still getting the same error as OP |
Hello !
After I install motuclient 1.8.4 (with pip), I try to run motuclient from a Python script:
`import datetime
import time
from datetime import timedelta
time_min = datetime.date.today().isoformat()
time_max = (datetime.date.today()+timedelta(days=3)).isoformat()
nc_name = time.strftime("%d_%m_%Y_%H_%M.nc")
os.system("C:\Python27\python.exe -m motuclient -u lbuga -p 9YxKdFEK -m http://nrt.cmems-du.eu/motu-web/Motu -s BLKSEA_ANALYSIS_FORECAST_PHYS_007_001-TDS -d sv03-bs-cmcc-tem-an-fc-h -t time_min -T time_max -x 28.5 -X 32.5 -y 42.5 -Y 46.0 -z 2.501 -Z 266.0668 -v votemper -o out_dir/NC -f nc_name %*")`
and I got this error:
motuclient is a package and cannot be directly executed
Look forward for some tips.
Cheers !
George
The text was updated successfully, but these errors were encountered: