{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Imports" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "import pyaurorax\n", "import datetime\n", "import pprint\n", "\n", "aurorax = pyaurorax.PyAuroraX()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Get availability for ephemeris data" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Start Date: 2019-01-01\n", "End Date: 2019-01-10\n", "Program: swarm\n", "Platform: swarma\n", "Instrument Type: footprint\n" ] } ], "source": [ "# set parameters\n", "start_date = datetime.datetime(2019, 1, 1)\n", "end_date = datetime.date(2019, 1, 10)\n", "program = \"swarm\"\n", "platform = \"swarma\"\n", "instrument_type = \"footprint\"\n", "print(\"%-18s%s\" % (\"Start Date:\", start_date.strftime(\"%Y-%m-%d\")))\n", "print(\"%-18s%s\" % (\"End Date:\", end_date.strftime(\"%Y-%m-%d\")))\n", "print(\"%-18s%s\" % (\"Program:\", program))\n", "print(\"%-18s%s\" % (\"Platform:\", platform))\n", "print(\"%-18s%s\" % (\"Instrument Type:\", instrument_type))" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[AvailabilityResult(data_source=DataSource(identifier=3, program='swarm', platform='swarma', instrument_type='footprint', source_type='leo', display_name='Swarm A', metadata=None, owner=None, maintainers=None, ephemeris_metadata_schema=None, data_product_metadata_schema=None, stats=None, format='basic_info'), available_data_products=None, available_ephemeris={'2019-01-01': 1440, '2019-01-02': 1440, '2019-01-03': 1440, '2019-01-04': 1440, '2019-01-05': 1440, '2019-01-06': 1440, '2019-01-07': 1440, '2019-01-08': 1440, '2019-01-09': 1440, '2019-01-10': 1440})]\n" ] } ], "source": [ "# get availability\n", "availability = aurorax.search.availability.ephemeris(start_date,\n", " end_date,\n", " program=program,\n", " platform=platform,\n", " instrument_type=instrument_type,\n", " format=pyaurorax.search.FORMAT_BASIC_INFO)\n", "print(availability)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'available_data_products': None,\n", " 'available_ephemeris': {'2019-01-01': 1440,\n", " '2019-01-02': 1440,\n", " '2019-01-03': 1440,\n", " '2019-01-04': 1440,\n", " '2019-01-05': 1440,\n", " '2019-01-06': 1440,\n", " '2019-01-07': 1440,\n", " '2019-01-08': 1440,\n", " '2019-01-09': 1440,\n", " '2019-01-10': 1440},\n", " 'data_source': DataSource(identifier=3, program='swarm', platform='swarma', instrument_type='footprint', source_type='leo', display_name='Swarm A', metadata=None, owner=None, maintainers=None, ephemeris_metadata_schema=None, data_product_metadata_schema=None, stats=None, format='basic_info')}\n" ] } ], "source": [ "pprint.pprint(availability[0].__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.9.19" } }, "nbformat": 4, "nbformat_minor": 4 }