Skip to content

Motu is a high efficient and robust Web Server which fills the gap between heterogeneous data providers to end users. Motu handles, extracts and transforms oceanographic huge volumes of data without performance collapse. This client enables to extract and download data through a python command line.

License

metocean/motu-client-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Motu Client Python Project

@author Project manager rdedianous@cls.fr
@author Product owner tjolibois@cls.fr
@author Scrum master, software architect smarty@cls.fr
@author Quality assurance, continuous integration manager bpirrotta@cls.fr

How to read this file? Use a markdown reader: plugins chrome exists (Once installed in Chrome, open URL chrome://extensions/, and check "Markdown Preview"/Authorise access to file URL.), or for firefox (anchor tags do not work) and also plugin for notepadd++.

Be careful: Markdown format has issue while rendering underscore "_" character which can lead to bad variable name or path.

#Summary

#Overview Motu client "motu-client-python" is a python script used to connect to Motu HTTP server.
This program can be integrated into a processing chain in order to automate the downloading of products via the Motu.

#Build
From the root folder runs the Maven command:

mvn clean install -Dmaven.test.skip=true
[...]
[INFO] BUILD SUCCESS
[...]

This creates two archives in the target folder:

  • motu-client-python-$version-$buildTimestamp-src.tar.gz: Archive containing all the source code
  • motu-client-python-$version-$buildTimestamp-bin.tar.gz: Archive ready to be installed

#Installation You must use python version 2.7.X or later.
This program is not compatible with Python 3.X versions.

Deploy the archive in the directory of your choice.

tar xvzf motu-client-python-$version-$buildTimestamp-bin.tar.gz

Create a configuration file to inform the user and password to use to connect to the CAS server.

#Configuration
The program parameters are contained in an ini file. This file is located in the following directory:

  • on Unix platforms: $HOME/motu-client/motu-client-python.ini
  • on Windows platforms: %USERPROFILE%\motu-client/motu-client-python.ini

The expected structure of file is:

[Main]  
user=john  
pwd=secret  
log_level=10  
proxy_server=proxy.domain.net:8080  
proxy_user=john  
proxy_pwd=secret  
motu=http://motu-ip-server:port/motu-web/Motu
product_id=dataset-psy2v3-pgs-med-myocean-bestestimate  
date_min=2010-11-08 12:00:00  
date_max=2010-11-10  
latitude_min=-75.0  
latitude_max=30.0  
longitude_min=20.0  
longitude_max=120.0  
depth_min=  
depth_max=  
variable=  
out_dir=./out_dir  
out_name=test.nc  
block_size=65535  
socket_timeout=  

#Usage
Starts the motu python client.

./motu-client.py  -h  
motu-client.py [options]

Options:

  • --version show program's version number and exit
  • -h, --help show this help message and exit
  • -q, --quiet prevent any output in stdout
  • --verbose print information in stdout
  • --noisy print more information (traces) in stdout
  • -u USER, --user=USER the user name (string)
  • -p PWD, --pwd=PWD the user password (string)
  • --auth-mode=AUTH_MODE the authentication mode: [default: cas]
    • none for no authentication
    • basic for basic authentication
    • cas for Central Authentication Service
  • --proxy-server=PROXY_SERVER the proxy server (url)
  • --proxy-user=PROXY_USER the proxy user (string)
  • --proxy-pwd=PROXY_PWD the proxy password (string)
  • -m MOTU, --motu=MOTU the motu server to use (url)
  • -s SERVICE_ID, --service-id=SERVICE_ID The service identifier (string)
  • -d PRODUCT_ID, --product-id=PRODUCT_ID The product (data set) to download (string)
  • -t DATE_MIN, --date-min=DATE_MIN The min date with optional hour resolution (string following format YYYY-MM-DD [HH:MM:SS])
  • -T DATE_MAX, --date-max=DATE_MAX The max date with optional hour resolution (string following format YYYY-MM-DD [HH:MM:SS ])
  • -y LATITUDE_MIN, --latitude-min=LATITUDE_MIN The min latitude (float in the interval [-90 ; 90 ])
  • -Y LATITUDE_MAX, --latitude-max=LATITUDE_MAX The max latitude (float in the interval [-90 ; 90 ])
  • -x LONGITUDE_MIN, --longitude-min=LONGITUDE_MIN The min longitude (float in the interval [-180 ; 180 ])
  • -X LONGITUDE_MAX, --longitude-max=LONGITUDE_MAX The max longitude (float in the interval [-180 ; 180 ])
  • -z DEPTH_MIN, --depth-min=DEPTH_MIN The min depth (float in the interval [0 ; 2e31 ] or string 'Surface')
  • -Z DEPTH_MAX, --depth-max=DEPTH_MAX The max depth (float in the interval [0 ; 2e31 ] or string 'Surface')
  • -v VARIABLE, --variable=VARIABLE The variable (list of strings)
  • -S, --sync-mode Sets the download mode to synchronous (not recommended)
  • -D, --describe-product It allows to have all updated information on a dataset. Output is in XML format
  • -o OUT_DIR, --out-dir=OUT_DIR The output dir (string)
  • -f OUT_NAME, --out-name=OUT_NAME The output file name (string)
  • --block-size=BLOCK_SIZE The block used to download file (integer expressing bytes)
  • --socket-timeout=SOCKET_TIMEOUT Set a timeout on blocking socket operations (float expressing seconds)
  • --user-agent=USER_AGENT Set the identification string (user-agent) for HTTP requests. By default this value is 'Python-urllib/x.x' (where x.x is the version of the python interpreter)

#Licence This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

About

Motu is a high efficient and robust Web Server which fills the gap between heterogeneous data providers to end users. Motu handles, extracts and transforms oceanographic huge volumes of data without performance collapse. This client enables to extract and download data through a python command line.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 81.1%
  • HTML 8.8%
  • Roff 8.1%
  • XSLT 2.0%