-
Notifications
You must be signed in to change notification settings - Fork 2
/
add_source.py
64 lines (57 loc) · 1.83 KB
/
add_source.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import pyaurorax
import os
def main():
# read API key from environment vars
api_key = os.environ["AURORAX_API_KEY"]
pyaurorax.api.set_base_url("https://api.staging.aurorax.space")
pyaurorax.authenticate(api_key)
# set values
identifier = 400
program = "test-program"
platform = "test-platform"
instrument_type = "test-instrument"
source_type = pyaurorax.SOURCE_TYPE_GROUND
display_name = "Test Instrument"
metadata_schema_ephemeris = [
{
"field_name": "test_meta1",
"description": "testing metadata field 1",
"data_type": "string",
"allowed_values": [],
},
{
"field_name": "test_meta2",
"description": "testing metadata field 2",
"data_type": "string",
"allowed_values": [],
}
]
metadata_schema_data_products = [
{
"field_name": "test_meta1",
"description": "testing metadata field 1",
"data_type": "string",
"allowed_values": [],
},
{
"field_name": "test_meta2",
"description": "testing metadata field 2",
"data_type": "string",
"allowed_values": [],
}
]
# make request
ds = pyaurorax.sources.add(program,
platform,
instrument_type,
source_type,
display_name,
ephemeris_metadata_schema=metadata_schema_ephemeris,
data_product_metadata_schema=metadata_schema_data_products,
identifier=identifier)
# output results
print("Successfully added source\n")
print(ds)
# ----------
if (__name__ == "__main__"):
main()