{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Imports" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pyaurorax\n", "import os\n", "import pprint\n", "import pandas as pd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Get all data sources" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
identifierprogramplatforminstrument_typesource_typedisplay_name
038arasearasefootprintheoArase
1175auroramaxyellowknifeDSLRgroundAuroraMAX
239clustercluster1footprintheoCluster-1
4265dmspdmsp06footprintleoDMSP-06
7286dmspdmsp07footprintleoDMSP-07
.....................
104101trexlucky lakeRGB ASIgroundTREx RGB LUCK
105102trexpinawaRGB ASIgroundTREx RGB PINA
10094trexrabbit lakenear-infrared ASIgroundTREx NIR RABB
10397trexrabbit lakespectrographgroundTREx Spectrograph RABB
107104trexrabbit lakeRGB ASIgroundTREx RGB RABB
\n", "

108 rows × 6 columns

\n", "
" ], "text/plain": [ " identifier program platform instrument_type source_type \\\n", "0 38 arase arase footprint heo \n", "1 175 auroramax yellowknife DSLR ground \n", "2 39 cluster cluster1 footprint heo \n", "4 265 dmsp dmsp06 footprint leo \n", "7 286 dmsp dmsp07 footprint leo \n", ".. ... ... ... ... ... \n", "104 101 trex lucky lake RGB ASI ground \n", "105 102 trex pinawa RGB ASI ground \n", "100 94 trex rabbit lake near-infrared ASI ground \n", "103 97 trex rabbit lake spectrograph ground \n", "107 104 trex rabbit lake RGB ASI ground \n", "\n", " display_name \n", "0 Arase \n", "1 AuroraMAX \n", "2 Cluster-1 \n", "4 DMSP-06 \n", "7 DMSP-07 \n", ".. ... \n", "104 TREx RGB LUCK \n", "105 TREx RGB PINA \n", "100 TREx NIR RABB \n", "103 TREx Spectrograph RABB \n", "107 TREx RGB RABB \n", "\n", "[108 rows x 6 columns]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# get data sources\n", "sources = pyaurorax.sources.list(order=\"program\")\n", "\n", "# show as a pandas dataframe\n", "sources_dict = [source.__dict__ for source in sources]\n", "df = pd.DataFrame(sources_dict, \n", " columns=[\n", " \"identifier\", \n", " \"program\", \n", " \"platform\", \n", " \"instrument_type\", \n", " \"source_type\", \n", " \"display_name\"\n", " ])\n", "df.sort_values([\"program\", \"platform\"])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Get all THEMIS ASI data sources" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
identifierprogramplatforminstrument_typesource_typedisplay_name
044themis-asiathabascapanchromatic ASIgroundTHEMIS-ASI ATHA
1862themis-asichibougamaupanchromatic ASIgroundTHEMIS-ASI CHBG
1256themis-asiekatipanchromatic ASIgroundTHEMIS-ASI EKAT
145themis-asifort simpsonpanchromatic ASIgroundTHEMIS-ASI FSIM
1155themis-asifort smithpanchromatic ASIgroundTHEMIS-ASI FSMI
1357themis-asifort yukonpanchromatic ASIgroundTHEMIS-ASI FYKN
1964themis-asigakonapanchromatic ASIgroundTHEMIS-ASI GAKO
246themis-asigillampanchromatic ASIgroundTHEMIS-ASI GILL
2166themis-asigoose baypanchromatic ASIgroundTHEMIS-ASI GBAY
347themis-asiinuvikpanchromatic ASIgroundTHEMIS-ASI INUV
448themis-asikapuskasingpanchromatic ASIgroundTHEMIS-ASI KAPU
2065themis-asikianapanchromatic ASIgroundTHEMIS-ASI KIAN
549themis-asikuujjuaqpanchromatic ASIgroundTHEMIS-ASI KUUJ
1458themis-asimcgrathpanchromatic ASIgroundTHEMIS-ASI MCGR
2271themis-asinarsarsuaqpanchromatic ASIgroundTHEMIS-ASI NRSQ
650themis-asipinawapanchromatic ASIgroundTHEMIS-ASI PINA
1559themis-asiprince georgepanchromatic ASIgroundTHEMIS-ASI PGEO
751themis-asirankin inletpanchromatic ASIgroundTHEMIS-ASI RANK
852themis-asisanikiluaqpanchromatic ASIgroundTHEMIS-ASI SNKQ
1660themis-asisnap lakepanchromatic ASIgroundTHEMIS-ASI SNAP
953themis-asitaloyoakpanchromatic ASIgroundTHEMIS-ASI TALO
1054themis-asithe paspanchromatic ASIgroundTHEMIS-ASI TPAS
1761themis-asiwhitehorsepanchromatic ASIgroundTHEMIS-ASI WHIT
2373themis-asiyellowknifepanchromatic ASIgroundTHEMIS-ASI YKNF
\n", "
" ], "text/plain": [ " identifier program platform instrument_type source_type \\\n", "0 44 themis-asi athabasca panchromatic ASI ground \n", "18 62 themis-asi chibougamau panchromatic ASI ground \n", "12 56 themis-asi ekati panchromatic ASI ground \n", "1 45 themis-asi fort simpson panchromatic ASI ground \n", "11 55 themis-asi fort smith panchromatic ASI ground \n", "13 57 themis-asi fort yukon panchromatic ASI ground \n", "19 64 themis-asi gakona panchromatic ASI ground \n", "2 46 themis-asi gillam panchromatic ASI ground \n", "21 66 themis-asi goose bay panchromatic ASI ground \n", "3 47 themis-asi inuvik panchromatic ASI ground \n", "4 48 themis-asi kapuskasing panchromatic ASI ground \n", "20 65 themis-asi kiana panchromatic ASI ground \n", "5 49 themis-asi kuujjuaq panchromatic ASI ground \n", "14 58 themis-asi mcgrath panchromatic ASI ground \n", "22 71 themis-asi narsarsuaq panchromatic ASI ground \n", "6 50 themis-asi pinawa panchromatic ASI ground \n", "15 59 themis-asi prince george panchromatic ASI ground \n", "7 51 themis-asi rankin inlet panchromatic ASI ground \n", "8 52 themis-asi sanikiluaq panchromatic ASI ground \n", "16 60 themis-asi snap lake panchromatic ASI ground \n", "9 53 themis-asi taloyoak panchromatic ASI ground \n", "10 54 themis-asi the pas panchromatic ASI ground \n", "17 61 themis-asi whitehorse panchromatic ASI ground \n", "23 73 themis-asi yellowknife panchromatic ASI ground \n", "\n", " display_name \n", "0 THEMIS-ASI ATHA \n", "18 THEMIS-ASI CHBG \n", "12 THEMIS-ASI EKAT \n", "1 THEMIS-ASI FSIM \n", "11 THEMIS-ASI FSMI \n", "13 THEMIS-ASI FYKN \n", "19 THEMIS-ASI GAKO \n", "2 THEMIS-ASI GILL \n", "21 THEMIS-ASI GBAY \n", "3 THEMIS-ASI INUV \n", "4 THEMIS-ASI KAPU \n", "20 THEMIS-ASI KIAN \n", "5 THEMIS-ASI KUUJ \n", "14 THEMIS-ASI MCGR \n", "22 THEMIS-ASI NRSQ \n", "6 THEMIS-ASI PINA \n", "15 THEMIS-ASI PGEO \n", "7 THEMIS-ASI RANK \n", "8 THEMIS-ASI SNKQ \n", "16 THEMIS-ASI SNAP \n", "9 THEMIS-ASI TALO \n", "10 THEMIS-ASI TPAS \n", "17 THEMIS-ASI WHIT \n", "23 THEMIS-ASI YKNF " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# get data sources\n", "sources = pyaurorax.sources.list(program=\"themis-asi\")\n", "\n", "# show as a pandas dataframe\n", "sources_dict = [source.__dict__ for source in sources]\n", "df = pd.DataFrame(sources_dict, \n", " columns=[\n", " \"identifier\", \n", " \"program\", \n", " \"platform\", \n", " \"instrument_type\", \n", " \"source_type\", \n", " \"display_name\"\n", " ])\n", "df.sort_values([\"program\", \"platform\"])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Get all RGB instrument types" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
identifierprogramplatforminstrument_typesource_typedisplay_name
085rainbowathabascaRGB ASIgroundRainbow ATHA
186rainbowfort simpsonRGB ASIgroundRainbow FSIM
388rainbowfort smithRGB ASIgroundRainbow FSMI
287rainbowgillamRGB ASIgroundRainbow GILL
798rainbowpinawaRGB ASIgroundRainbow PINA
489rainbowrabbit lakeRGB ASIgroundRainbow RABB
899rainbowresolute bayRGB ASIgroundRainbow RESU
590rainbowsaskatoonRGB ASIgroundRainbow SASK
9100rainbowyellowknifeRGB ASIgroundRainbow YKNF
696trexfort smithRGB ASIgroundTREx RGB FSMI
12103trexgillamRGB ASIgroundTREx RGB GILL
10101trexlucky lakeRGB ASIgroundTREx RGB LUCK
11102trexpinawaRGB ASIgroundTREx RGB PINA
13104trexrabbit lakeRGB ASIgroundTREx RGB RABB
\n", "
" ], "text/plain": [ " identifier program platform instrument_type source_type \\\n", "0 85 rainbow athabasca RGB ASI ground \n", "1 86 rainbow fort simpson RGB ASI ground \n", "3 88 rainbow fort smith RGB ASI ground \n", "2 87 rainbow gillam RGB ASI ground \n", "7 98 rainbow pinawa RGB ASI ground \n", "4 89 rainbow rabbit lake RGB ASI ground \n", "8 99 rainbow resolute bay RGB ASI ground \n", "5 90 rainbow saskatoon RGB ASI ground \n", "9 100 rainbow yellowknife RGB ASI ground \n", "6 96 trex fort smith RGB ASI ground \n", "12 103 trex gillam RGB ASI ground \n", "10 101 trex lucky lake RGB ASI ground \n", "11 102 trex pinawa RGB ASI ground \n", "13 104 trex rabbit lake RGB ASI ground \n", "\n", " display_name \n", "0 Rainbow ATHA \n", "1 Rainbow FSIM \n", "3 Rainbow FSMI \n", "2 Rainbow GILL \n", "7 Rainbow PINA \n", "4 Rainbow RABB \n", "8 Rainbow RESU \n", "5 Rainbow SASK \n", "9 Rainbow YKNF \n", "6 TREx RGB FSMI \n", "12 TREx RGB GILL \n", "10 TREx RGB LUCK \n", "11 TREx RGB PINA \n", "13 TREx RGB RABB " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# get data sources\n", "sources = pyaurorax.sources.list(instrument_type=\"RGB ASI\")\n", "\n", "# show as a pandas dataframe\n", "sources_dict = [source.__dict__ for source in sources]\n", "df = pd.DataFrame(sources_dict, \n", " columns=[\n", " \"identifier\", \n", " \"program\", \n", " \"platform\", \n", " \"instrument_type\", \n", " \"source_type\", \n", " \"display_name\"\n", " ])\n", "df.sort_values([\"program\", \"platform\"])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Get all Swarm data sources" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
identifierprogramplatforminstrument_typesource_typedisplay_name
03swarmswarmafootprintleoSwarm A
129swarmswarmbfootprintleoSwarm B
230swarmswarmcfootprintleoSwarm C
\n", "
" ], "text/plain": [ " identifier program platform instrument_type source_type display_name\n", "0 3 swarm swarma footprint leo Swarm A\n", "1 29 swarm swarmb footprint leo Swarm B\n", "2 30 swarm swarmc footprint leo Swarm C" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# get data sources\n", "sources = pyaurorax.sources.list(program=\"swarm\")\n", "\n", "# show as a pandas dataframe\n", "sources_dict = [source.__dict__ for source in sources]\n", "df = pd.DataFrame(sources_dict, \n", " columns=[\n", " \"identifier\", \n", " \"program\", \n", " \"platform\", \n", " \"instrument_type\", \n", " \"source_type\", \n", " \"display_name\"\n", " ])\n", "df.sort_values([\"program\", \"platform\", \"instrument_type\"])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Get all low-earth orbit data sources (LEO)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
identifierprogramplatforminstrument_typesource_typedisplay_name
8265dmspdmsp06footprintleoDMSP-06
11286dmspdmsp07footprintleoDMSP-07
6255dmspdmsp08footprintleoDMSP-08
7264dmspdmsp09footprintleoDMSP-09
12287dmspdmsp10footprintleoDMSP-10
13288dmspdmsp11footprintleoDMSP-11
9284dmspdmsp12footprintleoDMSP-12
10285dmspdmsp13footprintleoDMSP-13
14289dmspdmsp14footprintleoDMSP-14
15290dmspdmsp15footprintleoDMSP-15
16291dmspdmsp16footprintleoDMSP-16
17292dmspdmsp17footprintleoDMSP-17
463dmspdmsp18footprintleoDMSP-18
18293dmspdmsp19footprintleoDMSP-19
332epopepopfootprintleoePOP
19326noaanoaa10footprintleoNOAA-10
20327noaanoaa12footprintleoNOAA-12
21328noaanoaa14footprintleoNOAA-14
22329noaanoaa15footprintleoNOAA-15
23330noaanoaa16footprintleoNOAA-16
24331noaanoaa17footprintleoNOAA-17
25332noaanoaa18footprintleoNOAA-18
26333noaanoaa19footprintleoNOAA-19
27334noaanoaa20footprintleoNOAA-20
5106sampexsampexfootprintleoSAMPEX
03swarmswarmafootprintleoSwarm A
129swarmswarmbfootprintleoSwarm B
230swarmswarmcfootprintleoSwarm C
\n", "
" ], "text/plain": [ " identifier program platform instrument_type source_type display_name\n", "8 265 dmsp dmsp06 footprint leo DMSP-06\n", "11 286 dmsp dmsp07 footprint leo DMSP-07\n", "6 255 dmsp dmsp08 footprint leo DMSP-08\n", "7 264 dmsp dmsp09 footprint leo DMSP-09\n", "12 287 dmsp dmsp10 footprint leo DMSP-10\n", "13 288 dmsp dmsp11 footprint leo DMSP-11\n", "9 284 dmsp dmsp12 footprint leo DMSP-12\n", "10 285 dmsp dmsp13 footprint leo DMSP-13\n", "14 289 dmsp dmsp14 footprint leo DMSP-14\n", "15 290 dmsp dmsp15 footprint leo DMSP-15\n", "16 291 dmsp dmsp16 footprint leo DMSP-16\n", "17 292 dmsp dmsp17 footprint leo DMSP-17\n", "4 63 dmsp dmsp18 footprint leo DMSP-18\n", "18 293 dmsp dmsp19 footprint leo DMSP-19\n", "3 32 epop epop footprint leo ePOP\n", "19 326 noaa noaa10 footprint leo NOAA-10\n", "20 327 noaa noaa12 footprint leo NOAA-12\n", "21 328 noaa noaa14 footprint leo NOAA-14\n", "22 329 noaa noaa15 footprint leo NOAA-15\n", "23 330 noaa noaa16 footprint leo NOAA-16\n", "24 331 noaa noaa17 footprint leo NOAA-17\n", "25 332 noaa noaa18 footprint leo NOAA-18\n", "26 333 noaa noaa19 footprint leo NOAA-19\n", "27 334 noaa noaa20 footprint leo NOAA-20\n", "5 106 sampex sampex footprint leo SAMPEX\n", "0 3 swarm swarma footprint leo Swarm A\n", "1 29 swarm swarmb footprint leo Swarm B\n", "2 30 swarm swarmc footprint leo Swarm C" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# source type options are \"leo\", \"heo\", \"ground\", \"lunar\", or \"event_list\"\n", "sources = pyaurorax.sources.list(source_type=pyaurorax.SOURCE_TYPE_LEO)\n", "\n", "# show as a pandas dataframe\n", "sources_dict = [source.__dict__ for source in sources]\n", "df = pd.DataFrame(sources_dict, \n", " columns=[\n", " \"identifier\", \n", " \"program\", \n", " \"platform\", \n", " \"instrument_type\", \n", " \"source_type\", \n", " \"display_name\"\n", " ])\n", "df.sort_values([\"program\", \"platform\"])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Determine the identifier for a data source" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Identifier: 3\n" ] } ], "source": [ "data_sources = pyaurorax.sources.list(program=\"swarm\",\n", " platform=\"swarma\",\n", " instrument_type=\"footprint\")\n", "identifier = data_sources[0].identifier\n", "print(\"Identifier: %d\" % (identifier))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Get data source using identifier" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "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=[])\n" ] } ], "source": [ "# get data source\n", "data_source = pyaurorax.sources.get_using_identifier(3)\n", "pprint.pprint(data_source)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Get data source information with different levels of information\n", "\n", "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." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "DataSource(identifier=3)\n" ] } ], "source": [ "# as little information as possible\n", "data_sources = pyaurorax.sources.list(program=\"swarm\",\n", " platform=\"swarma\",\n", " instrument_type=\"footprint\",\n", " format=pyaurorax.FORMAT_IDENTIFIER_ONLY)\n", "print(data_sources[0])" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "DataSource(identifier=3, program='swarm', platform='swarma', instrument_type='footprint', source_type='leo', display_name='Swarm A')\n" ] } ], "source": [ "# default information\n", "data_source = pyaurorax.sources.get_using_identifier(3, format=pyaurorax.FORMAT_BASIC_INFO)\n", "print(data_source)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "DataSource(identifier=3, program='swarm', platform='swarma', instrument_type='footprint', source_type='leo', display_name='Swarm A', metadata={})\n" ] } ], "source": [ "# basic info, but with metadata\n", "data_source = pyaurorax.sources.get_using_identifier(3, format=pyaurorax.FORMAT_BASIC_INFO_WITH_METADATA)\n", "print(data_source)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "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=[])\n" ] } ], "source": [ "# all information\n", "data_source = pyaurorax.sources.get_using_identifier(3, format=pyaurorax.FORMAT_FULL_RECORD)\n", "print(data_source)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Get statistics for a data source" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "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=[])\n" ] } ], "source": [ "# set parameters and get identifier\n", "program = \"themis\"\n", "platform = \"themise\"\n", "instrument_type = \"footprint\"\n", "data_sources = pyaurorax.sources.list(program=program,\n", " platform=platform,\n", " instrument_type=instrument_type)\n", "print(data_sources[0])" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "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)\n", "\n", "{'data_product_count': 0,\n", " 'data_source': DataSource(identifier=3),\n", " 'earliest_data_product_loaded': None,\n", " 'earliest_ephemeris_loaded': datetime.datetime(2013, 11, 26, 0, 0),\n", " 'ephemeris_count': 4229280,\n", " 'latest_data_product_loaded': None,\n", " 'latest_ephemeris_loaded': datetime.datetime(2021, 12, 10, 23, 59)}\n" ] } ], "source": [ "# get stats\n", "stats = pyaurorax.sources.get_stats(identifier, format=pyaurorax.FORMAT_IDENTIFIER_ONLY)\n", "print(stats)\n", "print()\n", "pprint.pprint(stats.__dict__)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.12" } }, "nbformat": 4, "nbformat_minor": 4 }