import pyaurorax
import os
import pprint
import pandas as pd
# get data sources
sources = pyaurorax.sources.list(order="program")
# show as a pandas dataframe
sources_dict = [source.__dict__ for source in sources]
df = pd.DataFrame(sources_dict,
columns=[
"identifier",
"program",
"platform",
"instrument_type",
"source_type",
"display_name"
])
df.sort_values(["program", "platform"])
identifier | program | platform | instrument_type | source_type | display_name | |
---|---|---|---|---|---|---|
0 | 38 | arase | arase | footprint | heo | Arase |
1 | 175 | auroramax | yellowknife | DSLR | ground | AuroraMAX |
2 | 39 | cluster | cluster1 | footprint | heo | Cluster-1 |
4 | 265 | dmsp | dmsp06 | footprint | leo | DMSP-06 |
7 | 286 | dmsp | dmsp07 | footprint | leo | DMSP-07 |
... | ... | ... | ... | ... | ... | ... |
104 | 101 | trex | lucky lake | RGB ASI | ground | TREx RGB LUCK |
105 | 102 | trex | pinawa | RGB ASI | ground | TREx RGB PINA |
100 | 94 | trex | rabbit lake | near-infrared ASI | ground | TREx NIR RABB |
103 | 97 | trex | rabbit lake | spectrograph | ground | TREx Spectrograph RABB |
107 | 104 | trex | rabbit lake | RGB ASI | ground | TREx RGB RABB |
108 rows × 6 columns
# get data sources
sources = pyaurorax.sources.list(program="themis-asi")
# show as a pandas dataframe
sources_dict = [source.__dict__ for source in sources]
df = pd.DataFrame(sources_dict,
columns=[
"identifier",
"program",
"platform",
"instrument_type",
"source_type",
"display_name"
])
df.sort_values(["program", "platform"])
identifier | program | platform | instrument_type | source_type | display_name | |
---|---|---|---|---|---|---|
0 | 44 | themis-asi | athabasca | panchromatic ASI | ground | THEMIS-ASI ATHA |
18 | 62 | themis-asi | chibougamau | panchromatic ASI | ground | THEMIS-ASI CHBG |
12 | 56 | themis-asi | ekati | panchromatic ASI | ground | THEMIS-ASI EKAT |
1 | 45 | themis-asi | fort simpson | panchromatic ASI | ground | THEMIS-ASI FSIM |
11 | 55 | themis-asi | fort smith | panchromatic ASI | ground | THEMIS-ASI FSMI |
13 | 57 | themis-asi | fort yukon | panchromatic ASI | ground | THEMIS-ASI FYKN |
19 | 64 | themis-asi | gakona | panchromatic ASI | ground | THEMIS-ASI GAKO |
2 | 46 | themis-asi | gillam | panchromatic ASI | ground | THEMIS-ASI GILL |
21 | 66 | themis-asi | goose bay | panchromatic ASI | ground | THEMIS-ASI GBAY |
3 | 47 | themis-asi | inuvik | panchromatic ASI | ground | THEMIS-ASI INUV |
4 | 48 | themis-asi | kapuskasing | panchromatic ASI | ground | THEMIS-ASI KAPU |
20 | 65 | themis-asi | kiana | panchromatic ASI | ground | THEMIS-ASI KIAN |
5 | 49 | themis-asi | kuujjuaq | panchromatic ASI | ground | THEMIS-ASI KUUJ |
14 | 58 | themis-asi | mcgrath | panchromatic ASI | ground | THEMIS-ASI MCGR |
22 | 71 | themis-asi | narsarsuaq | panchromatic ASI | ground | THEMIS-ASI NRSQ |
6 | 50 | themis-asi | pinawa | panchromatic ASI | ground | THEMIS-ASI PINA |
15 | 59 | themis-asi | prince george | panchromatic ASI | ground | THEMIS-ASI PGEO |
7 | 51 | themis-asi | rankin inlet | panchromatic ASI | ground | THEMIS-ASI RANK |
8 | 52 | themis-asi | sanikiluaq | panchromatic ASI | ground | THEMIS-ASI SNKQ |
16 | 60 | themis-asi | snap lake | panchromatic ASI | ground | THEMIS-ASI SNAP |
9 | 53 | themis-asi | taloyoak | panchromatic ASI | ground | THEMIS-ASI TALO |
10 | 54 | themis-asi | the pas | panchromatic ASI | ground | THEMIS-ASI TPAS |
17 | 61 | themis-asi | whitehorse | panchromatic ASI | ground | THEMIS-ASI WHIT |
23 | 73 | themis-asi | yellowknife | panchromatic ASI | ground | THEMIS-ASI YKNF |
# get data sources
sources = pyaurorax.sources.list(instrument_type="RGB ASI")
# show as a pandas dataframe
sources_dict = [source.__dict__ for source in sources]
df = pd.DataFrame(sources_dict,
columns=[
"identifier",
"program",
"platform",
"instrument_type",
"source_type",
"display_name"
])
df.sort_values(["program", "platform"])
identifier | program | platform | instrument_type | source_type | display_name | |
---|---|---|---|---|---|---|
0 | 85 | rainbow | athabasca | RGB ASI | ground | Rainbow ATHA |
1 | 86 | rainbow | fort simpson | RGB ASI | ground | Rainbow FSIM |
3 | 88 | rainbow | fort smith | RGB ASI | ground | Rainbow FSMI |
2 | 87 | rainbow | gillam | RGB ASI | ground | Rainbow GILL |
7 | 98 | rainbow | pinawa | RGB ASI | ground | Rainbow PINA |
4 | 89 | rainbow | rabbit lake | RGB ASI | ground | Rainbow RABB |
8 | 99 | rainbow | resolute bay | RGB ASI | ground | Rainbow RESU |
5 | 90 | rainbow | saskatoon | RGB ASI | ground | Rainbow SASK |
9 | 100 | rainbow | yellowknife | RGB ASI | ground | Rainbow YKNF |
6 | 96 | trex | fort smith | RGB ASI | ground | TREx RGB FSMI |
12 | 103 | trex | gillam | RGB ASI | ground | TREx RGB GILL |
10 | 101 | trex | lucky lake | RGB ASI | ground | TREx RGB LUCK |
11 | 102 | trex | pinawa | RGB ASI | ground | TREx RGB PINA |
13 | 104 | trex | rabbit lake | RGB ASI | ground | TREx RGB RABB |
# get data sources
sources = pyaurorax.sources.list(program="swarm")
# show as a pandas dataframe
sources_dict = [source.__dict__ for source in sources]
df = pd.DataFrame(sources_dict,
columns=[
"identifier",
"program",
"platform",
"instrument_type",
"source_type",
"display_name"
])
df.sort_values(["program", "platform", "instrument_type"])
identifier | program | platform | instrument_type | source_type | display_name | |
---|---|---|---|---|---|---|
0 | 3 | swarm | swarma | footprint | leo | Swarm A |
1 | 29 | swarm | swarmb | footprint | leo | Swarm B |
2 | 30 | swarm | swarmc | footprint | leo | Swarm C |
# source type options are "leo", "heo", "ground", "lunar", or "event_list"
sources = pyaurorax.sources.list(source_type=pyaurorax.SOURCE_TYPE_LEO)
# show as a pandas dataframe
sources_dict = [source.__dict__ for source in sources]
df = pd.DataFrame(sources_dict,
columns=[
"identifier",
"program",
"platform",
"instrument_type",
"source_type",
"display_name"
])
df.sort_values(["program", "platform"])
identifier | program | platform | instrument_type | source_type | display_name | |
---|---|---|---|---|---|---|
8 | 265 | dmsp | dmsp06 | footprint | leo | DMSP-06 |
11 | 286 | dmsp | dmsp07 | footprint | leo | DMSP-07 |
6 | 255 | dmsp | dmsp08 | footprint | leo | DMSP-08 |
7 | 264 | dmsp | dmsp09 | footprint | leo | DMSP-09 |
12 | 287 | dmsp | dmsp10 | footprint | leo | DMSP-10 |
13 | 288 | dmsp | dmsp11 | footprint | leo | DMSP-11 |
9 | 284 | dmsp | dmsp12 | footprint | leo | DMSP-12 |
10 | 285 | dmsp | dmsp13 | footprint | leo | DMSP-13 |
14 | 289 | dmsp | dmsp14 | footprint | leo | DMSP-14 |
15 | 290 | dmsp | dmsp15 | footprint | leo | DMSP-15 |
16 | 291 | dmsp | dmsp16 | footprint | leo | DMSP-16 |
17 | 292 | dmsp | dmsp17 | footprint | leo | DMSP-17 |
4 | 63 | dmsp | dmsp18 | footprint | leo | DMSP-18 |
18 | 293 | dmsp | dmsp19 | footprint | leo | DMSP-19 |
3 | 32 | epop | epop | footprint | leo | ePOP |
19 | 326 | noaa | noaa10 | footprint | leo | NOAA-10 |
20 | 327 | noaa | noaa12 | footprint | leo | NOAA-12 |
21 | 328 | noaa | noaa14 | footprint | leo | NOAA-14 |
22 | 329 | noaa | noaa15 | footprint | leo | NOAA-15 |
23 | 330 | noaa | noaa16 | footprint | leo | NOAA-16 |
24 | 331 | noaa | noaa17 | footprint | leo | NOAA-17 |
25 | 332 | noaa | noaa18 | footprint | leo | NOAA-18 |
26 | 333 | noaa | noaa19 | footprint | leo | NOAA-19 |
27 | 334 | noaa | noaa20 | footprint | leo | NOAA-20 |
5 | 106 | sampex | sampex | footprint | leo | SAMPEX |
0 | 3 | swarm | swarma | footprint | leo | Swarm A |
1 | 29 | swarm | swarmb | footprint | leo | Swarm B |
2 | 30 | swarm | swarmc | footprint | leo | Swarm C |
data_sources = pyaurorax.sources.list(program="swarm",
platform="swarma",
instrument_type="footprint")
identifier = data_sources[0].identifier
print("Identifier: %d" % (identifier))
Identifier: 3
# get data source
data_source = pyaurorax.sources.get_using_identifier(3)
pprint.pprint(data_source)
DataSource(identifier=3, program='swarm', platform='swarma', instrument_type='footprint', source_type='leo', display_name='Swarm A', metadata={}, owner='dchaddoc@ucalgary.ca', maintainers=[], ephemeris_metadata_schema=[{'field_name': 'nbt...}], data_product_metadata_schema=[])
You can retrieve different amounts of information about data sources. The default is pyaurorax.FORMAT_BASIC_INFO
which provides some basic information, there are also format types for smaller or larger amounts of information.
# as little information as possible
data_sources = pyaurorax.sources.list(program="swarm",
platform="swarma",
instrument_type="footprint",
format=pyaurorax.FORMAT_IDENTIFIER_ONLY)
print(data_sources[0])
DataSource(identifier=3)
# default information
data_source = pyaurorax.sources.get_using_identifier(3, format=pyaurorax.FORMAT_BASIC_INFO)
print(data_source)
DataSource(identifier=3, program='swarm', platform='swarma', instrument_type='footprint', source_type='leo', display_name='Swarm A')
# basic info, but with metadata
data_source = pyaurorax.sources.get_using_identifier(3, format=pyaurorax.FORMAT_BASIC_INFO_WITH_METADATA)
print(data_source)
DataSource(identifier=3, program='swarm', platform='swarma', instrument_type='footprint', source_type='leo', display_name='Swarm A', metadata={})
# all information
data_source = pyaurorax.sources.get_using_identifier(3, format=pyaurorax.FORMAT_FULL_RECORD)
print(data_source)
DataSource(identifier=3, program='swarm', platform='swarma', instrument_type='footprint', source_type='leo', display_name='Swarm A', metadata={}, owner='dchaddoc@ucalgary.ca', maintainers=[], ephemeris_metadata_schema=[{'field_name': 'nbt...}], data_product_metadata_schema=[])
# set parameters and get identifier
program = "themis"
platform = "themise"
instrument_type = "footprint"
data_sources = pyaurorax.sources.list(program=program,
platform=platform,
instrument_type=instrument_type)
print(data_sources[0])
DataSource(identifier=37, program='themis', platform='themise', instrument_type='footprint', source_type='heo', display_name='THEMIS-E', metadata={}, owner='dchaddoc@ucalgary.ca', maintainers=[], ephemeris_metadata_schema=[{'field_name': 'nbt...}], data_product_metadata_schema=[])
# get stats
stats = pyaurorax.sources.get_stats(identifier, format=pyaurorax.FORMAT_IDENTIFIER_ONLY)
print(stats)
print()
pprint.pprint(stats.__dict__)
DataSourceStatistics(data_source=DataSource(identifier=3), earliest_ephemeris_loaded=datetime.datetime(2013, 11, 26, 0, 0), latest_ephemeris_loaded=datetime.datetime(2021, 12, 10, 23, 59), ephemeris_count=4229280, earliest_data_product_loaded=None, latest_data_product_loaded=None, data_product_count=0) {'data_product_count': 0, 'data_source': DataSource(identifier=3), 'earliest_data_product_loaded': None, 'earliest_ephemeris_loaded': datetime.datetime(2013, 11, 26, 0, 0), 'ephemeris_count': 4229280, 'latest_data_product_loaded': None, 'latest_ephemeris_loaded': datetime.datetime(2021, 12, 10, 23, 59)}