Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
public:lta_tricks [2020-07-21 13:53] – Updated link for Python stager API releases Thomas Jürges | public:lta_tricks [2023-07-17 08:51] (current) – Robbie Luijben | ||
---|---|---|---|
Line 160: | Line 160: | ||
Observation | Observation | ||
from awlofar.toolbox.LtaStager import LtaStager, LtaStagerError | from awlofar.toolbox.LtaStager import LtaStager, LtaStagerError | ||
+ | |||
</ | </ | ||
Line 266: | Line 267: | ||
for project in (project1, project2) : | for project in (project1, project2) : | ||
stager.stage_uris(uris[project]) | stager.stage_uris(uris[project]) | ||
+ | |||
</ | </ | ||
Line 331: | Line 333: | ||
print(len(query)) | print(len(query)) | ||
# 1800 | # 1800 | ||
+ | |||
</ | </ | ||
Line 366: | Line 369: | ||
for product in query_products : | for product in query_products : | ||
print(" | print(" | ||
+ | |||
</ | </ | ||
Line 371: | Line 375: | ||
===== Python Module for Staging ===== | ===== Python Module for Staging ===== | ||
- | The python interaction with the LTA catalog can be complemented with the use of a specific module developed to give users more control over their staging requests. The module is made available **[[https:// | + | The python interaction with the LTA catalog can be complemented with the use of a specific module developed to give users more control over their staging requests. |
- | **Alternatively to the .awe/Environment.cfg described above, user credentials can also be provided via a file ~/.stagingrc | + | Current released version 2.0 ([[http://git.astron.nl/astron-sdc/ |
- | < | + | |
- | | + | |
- | | + | |
- | </code> | + | ==== Version 2.0 usage notes ==== |
+ | |||
+ | The module is made available [[http:// | ||
+ | |||
+ | __Notes: | ||
+ | |||
+ | * You need an access token to the stageit api. Please refer to the user guide linked above to sign up and login to stageit. After logging in, a token can be obtained in one of two ways: | ||
+ | * Visit [[https:// | ||
+ | * From anywhere in the application, | ||
+ | * The token is valid indefinitely. Requesting a token multiple times will yield the same token. | ||
+ | * Make sure the token is available in your ~/ | ||
+ | * api_token=YOUR_TOKEN_HERE | ||
+ | * remove the old username and password from the '' | ||
+ | * The script is Python2 compatible, there is a Dockerfile available for Python2 testing in '' | ||
+ | * The requests library is a required dependency. If you care about Python2 compatability, | ||
+ | |||
+ | Also note that some functions are not supported in the new LTA stager. The states that a request can be in have been simplified. As such, there is no need for these functions anymore. Upon use, they will display an error stating that the function is deprecated. Please look at the '' | ||
+ | |||
+ | ==== Functionality ==== | ||
For a description of what the user can do, we list here the functions that are available. | For a description of what the user can do, we list here the functions that are available. | ||
Line 398: | Line 419: | ||
Below is an example of how to use this: | Below is an example of how to use this: | ||
- | + | < | |
- | < | + | > python |
Python 2.7.10 (default, Oct 23 2015, 19:19:21) | Python 2.7.10 (default, Oct 23 2015, 19:19:21) | ||
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin | [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin | ||
Line 408: | Line 429: | ||
+ 12227 | + 12227 | ||
- | - File count -> 100 | + | - File count |
- Files done -> 40 | - Files done -> 40 | ||
- Flagged abort -> false | - Flagged abort -> false |