17 |
17 |
18 Please note that this is not part of the "official" SCC tools. |
18 Please note that this is not part of the "official" SCC tools. |
19 |
19 |
20 Any suggestions for improvements and new features are more than welcome. |
20 Any suggestions for improvements and new features are more than welcome. |
21 |
21 |
22 |
|
23 Installation |
22 Installation |
24 ------------ |
23 ------------ |
25 |
24 |
26 The easiest way to install this module is from the python package index using pip:: |
25 The easiest way to install this module is from the python package index using pip:: |
27 |
26 |
28 pip install hg+https://bitbucket.org/iannis_b/scc-access#egg=scc-access |
27 pip install hg+https://repositories.imaa.cnr.it/public/scc_access#egg=scc-access |
29 |
28 |
30 or, if you don't have mercurial on your system:: |
29 or, if you don't have mercurial on your system:: |
31 |
30 |
32 pip install https://bitbucket.org/iannis_b/scc-access/get/tip.zip |
31 pip install https://repositories.imaa.cnr.it/public/scc_access/archive/tip.zip |
33 |
32 |
34 You can also use the script by cloning this mercurial repository. |
33 You can also use the script by cloning this mercurial repository. |
35 |
34 |
36 |
|
37 Settings |
35 Settings |
38 -------- |
36 -------- |
39 You will need to change some user-defined settings in a settings.yaml file. You |
37 The required user-defined settings need to be specified in a .yaml file. |
40 can copy the settings_sample.yaml file to settings.py and follow the instructions |
|
41 there. You can copy the resulting file to your home directory as `.scc_access.yaml`. |
|
42 This is the default location, `scc_access` will search there if no other location was |
|
43 specified. |
|
44 |
38 |
45 Specifically, you will need to: |
39 The following parameters should be specified:: |
46 |
40 |
47 1. Change the `basic_credentials` and `website_credentials` to your credentials. |
41 basic_credentials: ['username', 'password'] # The HTTP user name and password that is needed to access the SCC site. |
48 2. Change the `output_dir` to the location were the results will be stored. |
42 website_credentials: ['username', 'password'] # The user name and password that is needed to log in to the SCC site. |
|
43 output_dir: /path/to/files/scc_output/ # The directory to download the files |
|
44 base_url: https://scc.imaa.cnr.it/ # SCC base URL. Normally you shouldn't need to change that. |
49 |
45 |
50 Please not that it's not a good idea to store your stations management credentials in the settings |
46 |
51 file. The standard user has "Station Management" privileges and if the credentials |
47 The repository includes a `settings_sample.yaml` file that you can use as a starting point. Rename the file, e.g. to |
|
48 `settings.yaml` and input the required parameters. If you don't want to specify the file path every time |
|
49 your run the `scc_access` script, you can name the file `.scc_access.yaml` and place it in your home directory. |
|
50 |
|
51 Please note that it's not a good idea to store your stations management credentials in the settings |
|
52 file. The standard user has "Station Management" privileges and, if the credentials |
52 are stolen, someone could change/delete the stations settings from the SCC database. |
53 are stolen, someone could change/delete the stations settings from the SCC database. |
53 For this, it is better to use a used account with minimum access settings, that |
54 For this, it is better to use a user account with minimum access settings, i.e. that |
54 can only upload files and measurements. |
55 can only upload files and measurements. |
55 |
56 |
56 |
57 |
57 Usage |
58 Usage |
58 ----- |
59 ----- |
59 |
60 |
60 You can upload a file specifying the username and the system id:: |
61 You can upload a file specifying the username and the system id:: |
61 |
62 |
62 scc_access upload-file 20110101po01.nc 125 |
63 scc_access upload-file 20110101po01.nc 125 |
63 |
64 |
64 If you want to wait for the processing to finish and download the resulting files |
65 If you want to wait for the processing to finish and download the resulting files |
65 you need to define the `process-file` command :: |
66 you can use add the `-p` or `--process` flag:: |
66 |
67 |
67 scc_access process-file 20110101po01.nc 125 |
68 scc_access upload-file 20110101po01.nc 125 -p |
|
69 |
|
70 The two command above assume that you have placed your setting file in the default location. You can specify a |
|
71 custom location using the -c flag:: |
|
72 |
|
73 scc_access -c ./path/to/settings.yaml upload-file 20110101po01.nc 125 |
|
74 |
|
75 By default, the SCC will reject an uploaded file, if the specified measurement id already exists on the server. You |
|
76 can instruct the script to delete any existing measurement before uploading using the `--force_upload` flag:: |
|
77 |
|
78 scc_access upload-file 20110101po01.nc 125 -p --force_upload |
68 |
79 |
69 If you want to delete an existing measurement id from the database use the `delete` |
80 If you want to delete an existing measurement id from the database use the `delete` |
70 command and the measurement id:: |
81 command and the measurement id:: |
71 |
82 |
72 scc_access delete 20110101po01 |
83 scc_access delete 20110101po01 |
73 |
84 |
74 You can list available measurements with the `list` command:: |
85 You can list available measurements with the `list` command:: |
75 |
86 |
76 scc_access list |
87 scc_access list |
77 |
88 |
|
89 .. note:: |
|
90 The `list` command needs to be updated. Cross-check the results before using them. |
|
91 |
78 For more information on the syntax type:: |
92 For more information on the syntax type:: |
79 |
93 |
80 scc_access -h |
94 scc_access -h |
|
95 |
|
96 This will produce the following help text:: |
|
97 |
|
98 usage: scc_access [-h] [-d] [-s] [-c CONFIG] |
|
99 {delete,rerun-all,rerun-elpp,upload-file,list,download} ... |
|
100 |
|
101 positional arguments: |
|
102 {delete,rerun-all,rerun-elpp,upload-file,list,download} |
|
103 delete Deletes a measurement. |
|
104 rerun-all Rerun all processing steps for the provided |
|
105 measurement IDs. |
|
106 rerun-elpp Rerun low-resolution processing steps for the provided |
|
107 measurement ID. |
|
108 upload-file Submit a file and, optionally, download the output |
|
109 products. |
|
110 list List measurements registered on the SCC. |
|
111 download Download selected measurements. |
|
112 |
|
113 optional arguments: |
|
114 -h, --help show this help message and exit |
|
115 -d, --debug Print debugging information. |
|
116 -s, --silent Show only warning and error messages. |
|
117 -c CONFIG, --config CONFIG |
|
118 Path to the config file. |
|
119 |
|
120 You can find out more information about each command e.g. like this:: |
|
121 |
|
122 scc_access upload-file -h |
|
123 |
|
124 In this case, the help text will give more details about the `upload-file` command:: |
|
125 |
|
126 usage: scc_access upload-file [-h] [-p] [--force_upload] |
|
127 [--radiosounding RADIOSOUNDING] |
|
128 [--overlap OVERLAP] [--lidarratio LIDARRATIO] |
|
129 filename system |
|
130 |
|
131 positional arguments: |
|
132 filename Measurement file name or path. |
|
133 system Processing system id. |
|
134 |
|
135 optional arguments: |
|
136 -h, --help show this help message and exit |
|
137 -p, --process Wait for the processing results. |
|
138 --force_upload If measurement ID exists on SCC, delete before |
|
139 uploading. |
|
140 --radiosounding RADIOSOUNDING |
|
141 Radiosounding file name or path |
|
142 --overlap OVERLAP Overlap file name or path |
|
143 --lidarratio LIDARRATIO |
|
144 Lidar ratio file name or path |