Package for interacting with EARLINET's Single Calculus Chain through the command line.
Project description
This package provides a tool for interacting with the Single Calculus Chain through the command line. Specifically, with the script you can:
Upload a file to the SCC for processing
Download the processed files and graphs
Delete an existing measurement from the SCC (with appropriate privileges)
The script provides limited feedback when a file upload fails. Before using the script, you will need to upload some files manually and be confident that your SCC file format and processing settings are correct.
Please note that this is not part of the “official” SCC tools.
In principle, the main functions are implemented in a class (SCC) that you can also import and use in your custom scripts. However, error handling has to be improved in this case. If you are interested in such use, please contact me at ioannis@inoe.ro.
Any suggestions for improvements and new features are more than welcome.
Installation
The easiest way to install this module is from the python package index using pip:
pip install scc-access
Alternatively, you can install the latest version directly from the repository:
pip install hg+https://repositories.imaa.cnr.it/public/scc_access#egg=scc-access
or, if you don’t have mercurial on your system:
pip install https://repositories.imaa.cnr.it/public/scc_access/archive/tip.zip
You can also use the script by cloning this mercurial repository.
Settings
The required user-defined settings need to be specified in a .yaml file.
The following parameters should be specified:
basic_credentials: ['username', 'password'] # The HTTP user name and password that is needed to access the SCC site. website_credentials: ['username', 'password'] # The user name and password that is needed to log in to the SCC site. output_dir: /path/to/files/scc_output/ # The directory to download the files base_url: https://scc.imaa.cnr.it/ # SCC base URL. Normally you shouldn't need to change that.
The repository includes a settings_sample.yaml file that you can use as a starting point. Rename the file, e.g. to settings.yaml and input the required parameters. If you don’t want to specify the file path every time your run the scc_access script, you can name the file .scc_access.yaml and place it in your home directory.
Please note that it’s not a good idea to store your stations management credentials in the settings file. The standard user has “Station Management” privileges and, if the credentials are stolen, someone could change/delete the stations settings from the SCC database. For this, it is better to use a user account with minimum access settings, i.e. that can only upload files and measurements.
Usage
You can upload a file specifying the username and the system id:
scc_access upload-file 20110101po01.nc 125
If you want to wait for the processing to finish and download the resulting files you can use add the -p or –process flag:
scc_access upload-file 20110101po01.nc 125 -p
The two command above assume that you have placed your setting file in the default location. You can specify a custom location using the -c flag:
scc_access -c ./path/to/settings.yaml upload-file 20110101po01.nc 125
By default, the SCC will reject an uploaded file if the specified measurement id already exists on the server. You can instruct the script to delete any existing measurement before uploading using the –force_upload flag:
scc_access upload-file 20110101po01.nc 125 -p --force_upload
When uploading a measurement you can require that the processing is delayed by a specified number of hours. This can be used to assure that your files are processed using model input data, that typically have a delay of more than 24 hours. You can specify the delay (in hours) using the –delay option:
scc_access upload-file 20110101po01.nc 125 --delay 48
If you want to delete an existing measurement id from the database use the delete command and the measurement id:
scc_access delete 20110101po01
You can list available measurements with the list command:
scc_access list
For more information on the syntax type:
scc_access -h
This will produce the following help text:
usage: scc_access [-h] [-d] [-s] [-c CONFIG] {delete,rerun-all,rerun-elpp,upload-file,list,download} ... positional arguments: {delete,rerun-all,rerun-elpp,upload-file,list,download} delete Deletes a measurement. rerun-all Rerun all processing steps for the provided measurement IDs. rerun-elpp Rerun low-resolution processing steps for the provided measurement ID. upload-file Submit a file and, optionally, download the output products. list List measurements registered on the SCC. download Download selected measurements. optional arguments: -h, --help show this help message and exit -d, --debug Print debugging information. -s, --silent Show only warning and error messages. -c CONFIG, --config CONFIG Path to the config file.
You can find out more information about each command e.g. like this:
scc_access upload-file -h
In this case, the help text will give more details about the upload-file command:
usage: scc_access upload-file [-h] [-p] [--force_upload] [--radiosounding RADIOSOUNDING] [--overlap OVERLAP] [--lidarratio LIDARRATIO] filename system positional arguments: filename Measurement file name or path. system Processing system id. optional arguments: -h, --help show this help message and exit --delay DELAY Delay processing by the specified number of hours (0 to 96). -p, --process Wait for the processing results. --force_upload If measurement ID exists on SCC, delete before uploading. --radiosounding RADIOSOUNDING Radiosounding file name or path --overlap OVERLAP Overlap file name or path --lidarratio LIDARRATIO Lidar ratio file name or path
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file scc_access-0.11.0.tar.gz
.
File metadata
- Download URL: scc_access-0.11.0.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0b63e87863d31bddc1c86ada03566db8354398bea3551c25d8b9dbda604eda8 |
|
MD5 | 176f2603481bd16f06e928699b71a373 |
|
BLAKE2b-256 | 08d3869b388bff95e2a752215a4e0c3619359c59ce30fd487b520ba22d8a948c |
File details
Details for the file scc_access-0.11.0-py3-none-any.whl
.
File metadata
- Download URL: scc_access-0.11.0-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dc90420c401c7334d934405099bdf4993d91e572366df6f0b88f3bfdffd622a |
|
MD5 | f82714099cd4a17563e6905cbd37a966 |
|
BLAKE2b-256 | 12267983efc57a83d9832d026ddd2962b3aa4bec4aeb99b42238aff3e289d4a4 |