{ "cells": [ { "cell_type": "markdown", "id": "327e7ab4", "metadata": {}, "source": [ "# PRISM products in VirES\n", "\n", "This notebook demonstrates access to the data the `MITx_LP_2F`, `MITxTEC_2F` and `PPIxFAC_2F` Swarm products by means of the vires client.\n", "\n", "For each VirES data collection the avaiable variables are listed. In addition, mapping the the variables of the source the products is provided [*link to product documentation TBD*].\n", "\n", "The data for the whole Swarm mission is avaiable from the production VirES server API." ] }, { "cell_type": "code", "execution_count": 1, "id": "c8be9901", "metadata": {}, "outputs": [], "source": [ "from viresclient import SwarmRequest\n", "\n", "SERVER_URL = \"https://vires.services/ows\"" ] }, { "cell_type": "markdown", "id": "b943b990", "metadata": { "tags": [] }, "source": [ "## MITx_LP_2F - Midlatitude Ionospheric Trough from Langmuir Probe\n", "\n", "### Collections\n", "\n", "| Collection | Dataset |\n", "|---|---|\n", "|`SW_OPER_MITA_LP_2F`| Swarm A MIT from LP - MIT minima |\n", "|`SW_OPER_MITA_LP_2F:ID`| Swarm A MIT from LP - MIT boundaries (\"ID\" dataset) |\n", "|`SW_OPER_MITB_LP_2F`| Swarm B MIT from LP - MIT minima |\n", "|`SW_OPER_MITB_LP_2F:ID`| Swarm B MIT from LP - MIT boundaries (\"ID\" dataset) |\n", "|`SW_OPER_MITC_LP_2F`| Swarm C MIT from LP - MIT minima |\n", "|`SW_OPER_MITC_LP_2F:ID`| Swarm C MIT from LP - MIT boundaries (\"ID\" dataset) |\n", "\n", "\n", "### Defult MIT minima dataset (`SW_OPER_MITx_LP_2F` collections)\n", "\n", "Avaiables Variables:\n", "\n", "| VirES Variable | Source Product Variable | Unit | Dimension | Description | \n", "|---|---|---|---|---|\n", "| `Counter` | `Counter` | $$-$$ | vector[2] | Swarm orbit and quarter orbit counters |\n", "| `Timestamp` | `Timestamp` | $$-$$ | scalar | UTC time of the MIT minimum |\n", "| `Latitude` | `Latitude` | $$\\text{deg}$$ | scalar | ITRF geocentric latitude of the MIT minimum |\n", "| `Longitude` | `Longitude` | $$\\text{deg}$$ | scalar | ITRF geocentric longitude of the MIT minimum |\n", "| `Radius` | `Radius` | $$\\text{m}$$ | scalar | ITRF geocentric radius of the MIT minimum |\n", "| `Latitude_QD` | `Latitude_QD` | $$\\text{deg}$$ | scalar | Quasi-dipole latitude of the MIT minimum |\n", "| `Longitude_QD` | `Longitude_QD` | $$\\text{deg}$$ | scalar | Quasi-dipole longitude of the MIT minimum |\n", "| `MLT_QD` | `MLT` | $$\\text{hour}$$ | scalar | Magnetic local time (QD) of the MIT minimum |\n", "| `L_value` | `L_value` | $$-$$ | scalar | L-value in earth radii of the MIT minimum |\n", "| `SZA` | `SZA` | $$\\text{deg}$$ | scalar | Solar zenith angle of the MIT minimum |\n", "| `Ne` | `Ne` | $$\\text{cm}^{-3}$$ | scalar | LP electron density of the MIT minimum |\n", "| `Te` | `Te` | $$\\text{K}$$ | scalar | LP electron temperature of the MIT minimum |\n", "| `Depth` | `Depth` | $$\\text{cm}^{-3}$$ | scalar | depth of the MIT |\n", "| `DR` | `DR` | $$\\text{%}$$ | scalar | relative change in density within the MIT |\n", "| `Width` | `Width` | $$\\text{deg}$$ | scalar | width of the MIT calculated from QD latitudes |\n", "| `dL` | `dL` | $$\\text{deg}$$ | scalar | width of the MIT calculated from L-values |\n", "| `PW_Gradient` | `PW_Gradient` | $$\\log{\\left(\\text{cm}^{-3}\\right)}\\,\\text{deg}^{-1}$$ | scalar | change in log electron density at the poleward wall of the MIT divided by QD latitude difference |\n", "| `EW_Gradient` | `EW_Gradient` | $$\\log{\\left(\\text{cm}^{-3}\\right)}\\,\\text{deg}^{-1}$$ | scalar | change in log electron density at the equatorward wall of the MIT divided by QD latitude difference |\n", "| `Quality` | `Quality` | $$-$$ | vector [8] | Characterises the detection quality of the MIT as a whole |\n", "\n", "\n", "The `Quality` vector flags contain integer values from -1 to 3 indicating the quality of the MIT as a whole.\n", "Positive values indicate good or acceptable observation, while -1 means a likely false observation.\n", "For all flags, a 0 value means that the information needed to derive the flag is not available.\n", "In general, greater numbers indicate higher quality. For more details, see the product documentation.\n", "\n", "\n", "### ID dataset (`SW_OPER_MITx_LP_2F:ID` collections)\n", "\n", "Avaiables Variables:\n", "\n", "| VirES Variable | Source Product Variable | Unit | Dimension | Description | \n", "|---|---|---|---|---|\n", "| `Counter` | `Counter` | $$-$$ | vector[2] | Swarm orbit and quarter orbit counters |\n", "| `Timestamp` | `Timestamp_ID` | $$-$$ | scalar | UTC time of the observation |\n", "| `Latitude` | `Latitude_ID` | $$\\text{deg}$$ | scalar | ITRF geocentric latitude |\n", "| `Longitude` | `Longitude_ID` | $$\\text{deg}$$ | scalar | ITRF geocentric longitude |\n", "| `Radius` | `Radius_ID` | $$\\text{m}$$ | scalar | ITRF geocentric radius |\n", "| `Latitude_QD` | `Latitude_QD_ID` | $$\\text{deg}$$ | scalar | Quasi-dipole latitude |\n", "| `Longitude_QD` | `Longitude_QD_ID` | $$\\text{deg}$$ | scalar | Quasi-dipole longitude |\n", "| `MLT_QD` | `MLT_ID` | $$\\text{hour}$$ | scalar | Magnetic local time (QD) |\n", "| `L_value` | `L_value_ID` | $$-$$ | scalar | L-value in earth radii |\n", "| `SZA` | `SZA_ID` | $$\\text{deg}$$ | scalar | Solar zenith angle |\n", "| `Ne` | `Ne_ID` | $$\\text{cm}^{-3}$$ | scalar | LP electron density |\n", "| `Te` | `Te_ID` | $$\\text{K}$$ | scalar | LP electron temperature |\n", "| `Position_Quality` | `Position_Quality_ID` | $$-$$ | scalar | detection quality of each single position |\n", "| `PointType` | n/a | $$-$$ | scalar | point type derived from the source `*_ID` column |\n", "\n", "`Position_Quality` describes the overall quality of the corresponding boundary/position. The possible values and their meaning are 3: highest quality; 2: fair quality;\n", "1: uncertain detection; -1: a likely false positive detection; -2: the corresponding boundary/position is not defined. For more details, see the product documentation.\n", "\n", "These are the possible `PointType` values for the MITx_LP_2F products:\n", "\n", "| Value | Hex. | Bin. | ID Column | Meaning |\n", "|---|---|---|---|---|\n", "| 0 | 0x0 | 0b0000 | 1 | LP MIT equatorward edge of the equatorward wall |\n", "| 1 | 0x1 | 0b0001 | 2 | LP MIT poleward edge of the equatorward wall |\n", "| 2 | 0x2 | 0b0010 | 3 | LP MIT equatorward edge of poleward wall |\n", "| 3 | 0x3 | 0b0011 | 4 | LP MIT poleward edge of the poleward boundary |\n", "| 4 | 0x4 | 0b0100 | 5 | LP SETE equatorward bounding position |\n", "| 5 | 0x5 | 0b0101 | 7 | LP SETE poleward bounding position |\n", "| 6 | 0x6 | 0b0110 | 6 | LP Te peak position |\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "5d709dfe", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a7ec5f51635147de9cd1ba68f6a47acc", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading: 0%| | [ Elapsed: 00:00, Remaining: ? ] (0.201MB)" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Requested variables Counter, Latitude_QD, Longitude_QD, MLT_QD, L_value, SZA, Ne, Te, Position_Quality, PointType\n", "Response: \n", "Dimensions: (Timestamp: 26, Quality_dim1: 8, Counter_dim1: 2)\n", "Coordinates:\n", " * Timestamp (Timestamp) datetime64[ns] 2016-01-02T01:55:43.196999936 .....\n", "Dimensions without coordinates: Quality_dim1, Counter_dim1\n", "Data variables: (12/22)\n", " Spacecraft (Timestamp) object 'A' 'A' 'A' 'A' 'A' ... 'A' 'A' 'A' 'A' 'A'\n", " Latitude (Timestamp) float64 62.78 64.77 63.47 ... 57.11 60.2 55.09\n", " SZA (Timestamp) float64 115.9 110.0 116.0 ... 115.7 107.9 115.5\n", " DR (Timestamp) float64 22.8 61.76 22.73 ... 22.84 22.67 42.02\n", " L_value (Timestamp) float64 4.054 6.672 4.327 ... 2.792 8.536 2.718\n", " Ne (Timestamp) float64 6.839e+03 1.713e+04 ... 1.004e+04\n", " ... ...\n", " Longitude_QD (Timestamp) float64 124.8 -85.74 103.9 ... -159.2 -13.53 154.7\n", " QDLat (Timestamp) float64 59.08 66.39 60.18 ... 51.75 69.26 51.14\n", " Counter (Timestamp, Counter_dim1) uint32 11820 2 11821 1 ... 1 11834 2\n", " Latitude_QD (Timestamp) float64 59.08 66.39 60.18 ... 51.75 69.26 51.14\n", " PW_Gradient (Timestamp) float64 0.1788 0.1281 0.2573 ... 0.1277 0.08771\n", " MLT_QD (Timestamp) float64 5.114 16.5 5.387 ... 4.955 17.43 4.926\n", "Attributes:\n", " Sources: ['SW_OPER_MITA_LP_2F_20160101T000000_20161231T235959_0103']\n", " MagneticModels: []\n", " RangeFilters: []\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "6422720ce02f4722a565d77ea3050209", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading: 0%| | [ Elapsed: 00:00, Remaining: ? ] (0.158MB)" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Requested variables Counter, Latitude_QD, Longitude_QD, MLT_QD, L_value, SZA, Ne, Te, Position_Quality, PointType\n", "Response: \n", "Dimensions: (Timestamp: 146, Counter_dim1: 2)\n", "Coordinates:\n", " * Timestamp (Timestamp) datetime64[ns] 2016-01-02T01:55:10.19699993...\n", "Dimensions without coordinates: Counter_dim1\n", "Data variables: (12/17)\n", " Spacecraft (Timestamp) object 'A' 'A' 'A' 'A' 'A' ... 'A' 'A' 'A' 'A'\n", " Latitude (Timestamp) float64 64.89 64.7 63.1 ... 54.99 47.94 46.09\n", " SZA (Timestamp) float64 116.1 116.1 115.9 ... 114.2 113.8\n", " Position_Quality (Timestamp) int8 3 3 3 3 3 3 2 -1 3 ... 3 3 3 3 -1 2 3 3 2\n", " L_value (Timestamp) float64 4.607 4.552 4.131 ... 2.707 2.055 1.93\n", " Ne (Timestamp) float64 1.368e+04 1.345e+04 ... 3.418e+04\n", " ... ...\n", " Te (Timestamp) float64 2.077e+03 2.125e+03 ... 2.01e+03\n", " Longitude_QD (Timestamp) float64 125.1 125.0 124.8 ... 154.8 154.8\n", " QDLat (Timestamp) float64 61.19 61.0 59.4 ... 51.04 43.8 41.87\n", " Counter (Timestamp, Counter_dim1) uint32 11820 2 11820 ... 11834 2\n", " Latitude_QD (Timestamp) float64 61.19 61.0 59.4 ... 51.04 43.8 41.87\n", " MLT_QD (Timestamp) float64 5.126 5.125 5.115 ... 4.964 4.973\n", "Attributes:\n", " Sources: ['SW_OPER_MITA_LP_2F_20160101T000000_20161231T235959_0103']\n", " MagneticModels: []\n", " RangeFilters: []\n" ] } ], "source": [ "request = SwarmRequest(SERVER_URL)\n", "\n", "# request the default dataset\n", "request.set_collection(\"SW_OPER_MITA_LP_2F\")\n", "request.set_products(\n", " measurements=SwarmRequest.PRODUCT_VARIABLES[\"MIT_LP\"], # request all dataset variables\n", " auxiliaries=['QDLat', 'QDLon', 'MLT'], # QD coordinates and MLT calculated by VirES \n", ")\n", "\n", "data = request.get_between(\n", " start_time=\"2016-01-02T00:00:00Z\",\n", " end_time=\"2016-01-03T00:00:00Z\",\n", " asynchronous=False,\n", ").as_xarray()\n", "\n", "print(\"Requested variables\", \", \".join(SwarmRequest.PRODUCT_VARIABLES[\"MIT_LP:ID\"]))\n", "print(\"Response:\", data)\n", "\n", "# request the ID dataset\n", "request.set_collection(\"SW_OPER_MITA_LP_2F:ID\")\n", "request.set_products(\n", " measurements=SwarmRequest.PRODUCT_VARIABLES[\"MIT_LP:ID\"], # request all dataset variables\n", " auxiliaries=['QDLat', 'QDLon', 'MLT'], # QD coordinates and MLT calculated by VirES\n", ")\n", "\n", "data = request.get_between(\n", " start_time=\"2016-01-02T00:00:00Z\",\n", " end_time=\"2016-01-03T00:00:00Z\",\n", " asynchronous=False,\n", ").as_xarray()\n", "\n", "print(\"Requested variables\", \", \".join(SwarmRequest.PRODUCT_VARIABLES[\"MIT_LP:ID\"]))\n", "print(\"Response:\", data)" ] }, { "cell_type": "markdown", "id": "367e9b47", "metadata": {}, "source": [ "## MITxTEC_2F - Midlatitude Ionospheric Trough from GPS TEC\n", "\n", "| Collection | Dataset |\n", "|---|---|\n", "|`SW_OPER_MITATEC_2F`| Swarm A MIT from GPS TEC - MIT minima |\n", "|`SW_OPER_MITATEC_2F:ID`| Swarm A MIT from GPS TEC - MIT boundaries (\"ID\" dataset) |\n", "|`SW_OPER_MITBTEC_2F`| Swarm B MIT from GPS TEC - MIT minima |\n", "|`SW_OPER_MITBTEC_2F:ID`| Swarm B MIT from GPS TEC - MIT boundaries (\"ID\" dataset) |\n", "|`SW_OPER_MITCTEC_2F`| Swarm C MIT from GPS TEC - MIT minima |\n", "|`SW_OPER_MITCTEC_2F:ID`| Swarm C MIT from GPS TEC - MIT boundaries (\"ID\" dataset) |\n", "\n", "\n", "### defult MIT minima dataset (`SW_OPER_MITxTEC_2F` collections)\n", "\n", "Avaiables Variables:\n", "\n", "| VirES Variable | Source Product Variable | Unit | Dimension | Description | \n", "|---|---|---|---|---|\n", "| `Counter` | `Counter` | $$-$$ | vector[2] | Swarm orbit and quarter orbit counters |\n", "| `Timestamp` | `Timestamp` | $$-$$ | scalar | UTC time of the MIT minimum |\n", "| `Latitude` | `Latitude` | $$\\text{deg}$$ | scalar | ITRF geocentric latitude of the MIT minimum |\n", "| `Longitude` | `Longitude` | $$\\text{deg}$$ | scalar | ITRF geocentric longitude of the MIT minimum |\n", "| `Radius` | `Radius` | $$\\text{m}$$ | scalar | ITRF geocentric radius of the MIT minimum |\n", "| `Latitude_QD` | `Latitude_QD` | $$\\text{deg}$$ | scalar | Quasi-dipole latitude of the MIT minimum |\n", "| `Longitude_QD` | `Longitude_QD` | $$\\text{deg}$$ | scalar | Quasi-dipole longitude of the MIT minimum |\n", "| `MLT_QD` | `MLT` | $$\\text{hour}$$ | scalar | Magnetic local time (QD) of the MIT minimum |\n", "| `L_value` | `L_value` | $$-$$ | scalar | L-value in earth radii of the MIT minimum |\n", "| `SZA` | `SZA` | $$\\text{deg}$$ | scalar | Solar zenith angle of the MIT minimum |\n", "| `TEC` | `TEC` | $$\\text{TECU}$$ | scalar | Total electron content at the MIT minimum |\n", "| `Depth` | `Depth` | $$\\text{TECU}$$ | scalar | depth of the MIT |\n", "| `DR` | `DR` | $$\\text{%}$$ | scalar | relative change in density within the MIT |\n", "| `Width` | `Width` | $$\\text{deg}$$ | scalar | width of the MIT calculated from QD latitudes |\n", "| `dL` | `dL` | $$\\text{deg}$$ | scalar | width of the MIT calculated from L-values |\n", "| `PW_Gradient` | `PW_Gradient` | $$\\text{TECU}\\,\\text{deg}^{-1}$$ | scalar | change in TEC at the poleward wall of the MIT divided by QD latitude difference |\n", "| `EW_Gradient` | `EW_Gradient` | $$\\text{TECU}\\,\\text{deg}^{-1}$$ | scalar | change in TEC at the equatorward wall of the MIT divided by QD latitude difference |\n", "| `Quality` | `Quality` | $$-$$ | vector [8] | Characterises the detection quality of the MIT as a whole |\n", "\n", "The `Quality` vector flags contain integer values from -1 to 3 indicating the quality of the MIT as a whole.\n", "Positive values indicate good or acceptable observation, while -1 means a likely false observation.\n", "For all flags, a 0 value means that the information needed to derive the flag is not available.\n", "In general, greater numbers indicate higher quality. For more details, see the product documentation.\n", "\n", "### ID dataset (`SW_OPER_MITxTEC_2F:ID` collections)\n", "\n", "Avaiables Variables:\n", "\n", "| VirES Variable | Source Product Variable | Unit | Dimension | Description | \n", "|---|---|---|---|---|\n", "| `Counter` | `Counter` | $$-$$ | vector[2] | Swarm orbit and quarter orbit counters |\n", "| `Timestamp` | `Timestamp_ID` | $$-$$ | scalar | UTC time of the observation |\n", "| `Latitude` | `Latitude_ID` | $$\\text{deg}$$ | scalar | ITRF geocentric latitude |\n", "| `Longitude` | `Longitude_ID` | $$\\text{deg}$$ | scalar | ITRF geocentric longitude |\n", "| `Radius` | `Radius_ID` | $$\\text{m}$$ | scalar | ITRF geocentric radius |\n", "| `Latitude_QD` | `Latitude_QD_ID` | $$\\text{deg}$$ | scalar | Quasi-dipole latitude |\n", "| `Longitude_QD` | `Longitude_QD_ID` | $$\\text{deg}$$ | scalar | Quasi-dipole longitude |\n", "| `MLT_QD` | `MLT_ID` | $$\\text{hour}$$ | scalar | Magnetic local time (QD) |\n", "| `L_value` | `L_value_ID` | $$-$$ | scalar | L-value in earth radii |\n", "| `SZA` | `SZA_ID` | $$\\text{deg}$$ | scalar | Solar zenith angle |\n", "| `TEC` | `TEC_ID` | $$\\text{TECU}$$ | scalar | Total electron content |\n", "| `Position_Quality` | `Position_Quality_ID` | $$-$$ | scalar | detection quality of each single position |\n", "| `PointType` | n/a | $$-$$ | scalar | point type derived from the source `*_ID` column |\n", "\n", "`Position_Quality` describes the overall quality of the corresponding boundary/position. The possible values and their meaning are 3: highest quality; 2: fair quality;\n", "1: uncertain detection; -1: a likely false positive detection; -2: the corresponding boundary/position is not defined. For more details, see the product documentation.\n", "\n", "These are the possible `PointType` values for the MITxTEC_2F products:\n", "\n", "| Value | Hex. | Bin. | ID Column | Meaning |\n", "|---|---|---|---|---|\n", "| 0 | 0x0 | 0b0000 | 1 | TEC MIT equatorward edge of the equatorward wall |\n", "| 1 | 0x1 | 0b0001 | 2 | TEC MIT poleward edge of the equatorward wall |\n", "| 2 | 0x2 | 0b0010 | 3 | TEC MIT equatorward edge of poleward wall |\n", "| 3 | 0x3 | 0b0011 | 4 | TEC MIT poleward edge of the poleward boundary |\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "cdc1eb6a", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "5c4adf6642a147399b0fb0dfb59fe274", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading: 0%| | [ Elapsed: 00:00, Remaining: ? ] (0.192MB)" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Requested variables Counter, Latitude_QD, Longitude_QD, MLT_QD, L_value, SZA, TEC, Position_Quality, PointType\n", "Response: \n", "Dimensions: (Timestamp: 15, Quality_dim1: 8, Counter_dim1: 2)\n", "Coordinates:\n", " * Timestamp (Timestamp) datetime64[ns] 2016-01-02T06:24:35 ... 2016-01-...\n", "Dimensions without coordinates: Quality_dim1, Counter_dim1\n", "Data variables: (12/21)\n", " Spacecraft (Timestamp) object 'A' 'A' 'A' 'A' 'A' ... 'A' 'A' 'A' 'A' 'A'\n", " Latitude (Timestamp) float64 71.06 70.22 69.19 ... 63.61 60.73 63.39\n", " SZA (Timestamp) float64 111.8 111.5 111.2 ... 116.4 108.1 116.4\n", " DR (Timestamp) float64 87.17 82.74 69.45 ... 84.17 81.56 77.3\n", " L_value (Timestamp) float64 7.023 6.087 5.634 ... 3.827 8.94 4.142\n", " Depth (Timestamp) float64 0.4311 0.5704 1.165 ... 0.7037 0.7399\n", " ... ...\n", " Longitude_QD (Timestamp) float64 -126.6 -143.7 -162.4 ... -13.46 154.4\n", " QDLat (Timestamp) float64 67.03 65.1 64.11 ... 58.07 69.76 59.4\n", " Counter (Timestamp, Counter_dim1) uint32 11823 1 11824 1 ... 1 11834 2\n", " Latitude_QD (Timestamp) float64 67.03 65.1 64.11 ... 58.07 69.76 59.4\n", " PW_Gradient (Timestamp) float64 0.09949 0.1164 0.1653 ... 0.3494 0.2213\n", " MLT_QD (Timestamp) float64 17.2 17.72 18.07 ... 4.656 17.44 4.871\n", "Attributes:\n", " Sources: ['SW_OPER_MITATEC_2F_20160101T000000_20161231T235959_0103']\n", " MagneticModels: []\n", " RangeFilters: []\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "df4851a25d9b404db1731b9c7aab7d32", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading: 0%| | [ Elapsed: 00:00, Remaining: ? ] (0.149MB)" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Requested variables Counter, Latitude_QD, Longitude_QD, MLT_QD, L_value, SZA, TEC, Position_Quality, PointType\n", "Response: \n", "Dimensions: (Timestamp: 60, Counter_dim1: 2)\n", "Coordinates:\n", " * Timestamp (Timestamp) datetime64[ns] 2016-01-02T06:21:52 ... 2016...\n", "Dimensions without coordinates: Counter_dim1\n", "Data variables: (12/16)\n", " Spacecraft (Timestamp) object 'A' 'A' 'A' 'A' 'A' ... 'A' 'A' 'A' 'A'\n", " Latitude (Timestamp) float64 60.65 63.15 77.01 ... 54.81 51.03\n", " SZA (Timestamp) float64 108.6 109.4 113.3 ... 115.3 114.7\n", " Position_Quality (Timestamp) int8 1 3 -1 -1 2 3 -1 -1 ... 3 -1 -1 -1 3 3 -1\n", " L_value (Timestamp) float64 3.368 3.895 13.32 ... 9.49 2.87 2.371\n", " MLT (Timestamp) float64 17.37 17.35 16.97 ... 4.928 4.949\n", " ... ...\n", " PointType (Timestamp) uint8 0 1 2 3 0 1 2 3 0 ... 0 0 1 2 3 3 2 1 0\n", " Longitude_QD (Timestamp) float64 -123.3 -123.8 -130.5 ... 154.7 154.8\n", " QDLat (Timestamp) float64 55.69 58.39 73.53 ... 70.16 50.86 47.0\n", " Counter (Timestamp, Counter_dim1) uint32 11823 1 11823 ... 11834 2\n", " Latitude_QD (Timestamp) float64 55.69 58.39 73.53 ... 70.16 50.86 47.0\n", " MLT_QD (Timestamp) float64 17.37 17.35 16.97 ... 4.928 4.949\n", "Attributes:\n", " Sources: ['SW_OPER_MITATEC_2F_20160101T000000_20161231T235959_0103']\n", " MagneticModels: []\n", " RangeFilters: []\n" ] } ], "source": [ "request = SwarmRequest(SERVER_URL)\n", "\n", "# request the default dataset\n", "request.set_collection(\"SW_OPER_MITATEC_2F\")\n", "request.set_products(\n", " measurements=SwarmRequest.PRODUCT_VARIABLES[\"MIT_TEC\"], # request all dataset variables\n", " auxiliaries=['QDLat', 'QDLon', 'MLT'], # QD coordinates and MLT calculated by VirES \n", ")\n", "\n", "data = request.get_between(\n", " start_time=\"2016-01-02T00:00:00Z\",\n", " end_time=\"2016-01-03T00:00:00Z\",\n", " asynchronous=False,\n", ").as_xarray()\n", "\n", "print(\"Requested variables\", \", \".join(SwarmRequest.PRODUCT_VARIABLES[\"MIT_TEC:ID\"]))\n", "print(\"Response:\", data)\n", "\n", "# request the ID dataset\n", "request.set_collection(\"SW_OPER_MITATEC_2F:ID\")\n", "request.set_products(\n", " measurements=SwarmRequest.PRODUCT_VARIABLES[\"MIT_TEC:ID\"], # request all dataset variables\n", " auxiliaries=['QDLat', 'QDLon', 'MLT'], # QD coordinates and MLT calculated by VirES \n", ")\n", "\n", "data = request.get_between(\n", " start_time=\"2016-01-02T00:00:00Z\",\n", " end_time=\"2016-01-03T00:00:00Z\",\n", " asynchronous=False,\n", ").as_xarray()\n", "\n", "print(\"Requested variables\", \", \".join(SwarmRequest.PRODUCT_VARIABLES[\"MIT_TEC:ID\"]))\n", "print(\"Response:\", data)" ] }, { "cell_type": "markdown", "id": "a9e2817c", "metadata": {}, "source": [ "## PPIxFAC_2F - Midnight Plasmapause Index\n", "\n", "| Collection | Dataset |\n", "|---|---|\n", "|`SW_OPER_PPIAFAC_2F`| Swarm A PPI and SSFAC boundaries |\n", "|`SW_OPER_PPIAFAC_2F:ID`| Swarm A edges of the SSFAC boundaries (\"ID\" dataset) |\n", "|`SW_OPER_PPIBFAC_2F`| Swarm B PPI and SSFAC boundaries |\n", "|`SW_OPER_PPIBFAC_2F:ID`| Swarm B edges of the SSFAC boundaries (\"ID\" dataset) |\n", "|`SW_OPER_PPICFAC_2F`| Swarm C PPI and SSFAC boundaries |\n", "|`SW_OPER_PPICFAC_2F:ID`| Swarm C edges of the SSFAC boundaries (\"ID\" dataset) |\n", "\n", "### defult SSFAC boundary (`SW_OPER_PPIxFAC_2F` collections)\n", "\n", "Avaiables Variables:\n", "\n", "| VirES Variable | Source Product Variable | Unit | Dimension | Description | \n", "|---|---|---|---|---|\n", "| `Counter` | `Counter` | $$-$$ | vector[2] | Swarm orbit and quarter orbit counters |\n", "| `Timestamp` | `Timestamp` | $$-$$ | scalar | UTC time of the SSFAC boundary |\n", "| `Latitude` | `Latitude` | $$\\text{deg}$$ | scalar | ITRF geocentric latitude of the SSFAC boundary |\n", "| `Longitude` | `Longitude` | $$\\text{deg}$$ | scalar | ITRF geocentric longitude of the SSFAC boundary |\n", "| `Radius` | `Radius` | $$\\text{m}$$ | scalar | ITRF geocentric radius of the SSFAC boundary |\n", "| `Latitude_QD` | `Latitude_QD` | $$\\text{deg}$$ | scalar | Quasi-dipole latitude of the SSFAC boundary |\n", "| `Longitude_QD` | `Longitude_QD` | $$\\text{deg}$$ | scalar | Quasi-dipole longitude of the SSFAC boundary |\n", "| `MLT_QD` | `MLT` | $$\\text{hour}$$ | scalar | Magnetic local time (QD) of the SSFAC boundary |\n", "| `L_value` | `L_value` | $$-$$ | scalar | L-value in earth radii of the SSFAC boundary |\n", "| `SZA` | `SZA` | $$\\text{deg}$$ | scalar | Solar zenith angle of the SSFAC boundary |\n", "| `Sigma` | `Sigma` | $$-$$ | scalar | Standard deviation of the linear fit of S at the boundary |\n", "| `PPI` | `PPI` | $$\\text{R_E}$$ | scalar | midnight plasmapause index |\n", "| `dL` | `dL` | $$\\text{deg}$$ | scalar | boundary width in Earth radii |\n", "| `Quality` | `Quality` | $$-$$ | vector [7] | Quality indicators of SSFAC boundary detection |\n", "\n", "The `Quality` vector flags contain integer values from -1 to 3 indicating the quality of the MIT as a whole.\n", "Positive values indicate good or acceptable observation, while -1 means a likely false observation.\n", "For all flags, a 0 value means that the information needed to derive the flag is not available.\n", "In general, greater numbers indicate higher quality. For more details, see the product documentation.\n", "\n", "### ID dataset (`SW_OPER_PPIxFAC_2F:ID` collections)\n", "\n", "Avaiables Variables:\n", "\n", "| VirES Variable | Source Product Variable | Unit | Dimension | Description | \n", "|---|---|---|---|---|\n", "| `Counter` | `Counter` | $$-$$ | vector[2] | Swarm orbit and quarter orbit counters |\n", "| `Timestamp` | `Timestamp_ID` | $$-$$ | scalar | UTC time of the observation |\n", "| `Latitude` | `Latitude_ID` | $$\\text{deg}$$ | scalar | ITRF geocentric latitude |\n", "| `Longitude` | `Longitude_ID` | $$\\text{deg}$$ | scalar | ITRF geocentric longitude |\n", "| `Radius` | `Radius_ID` | $$\\text{m}$$ | scalar | ITRF geocentric radius |\n", "| `Latitude_QD` | `Latitude_QD_ID` | $$\\text{deg}$$ | scalar | Quasi-dipole latitude |\n", "| `Longitude_QD` | `Longitude_QD_ID` | $$\\text{deg}$$ | scalar | Quasi-dipole longitude |\n", "| `MLT_QD` | `MLT_ID` | $$\\text{hour}$$ | scalar | Magnetic local time (QD) |\n", "| `L_value` | `L_value_ID` | $$-$$ | scalar | L-value in earth radii |\n", "| `SZA` | `SZA_ID` | $$\\text{deg}$$ | scalar | Solar zenith angle |\n", "| `Position_Quality` | `Position_Quality_ID` | $$-$$ | scalar | detection quality of each single position |\n", "| `PointType` | n/a | $$-$$ | scalar | point type derived from the source `*_ID` column |\n", "\n", "`Position_Quality` describes the overall quality of the corresponding boundary/position. The possible values and their meaning are 3: highest quality; 2: fair quality;\n", "1: uncertain detection; -1: a likely false positive detection; -2: the corresponding boundary/position is not defined. For more details, see the product documentation.\n", "\n", "These are the possible `PointType` values for the PPIxFAC_2F products:\n", "\n", "| Value | Hex. | Bin. | ID Column | Meaning |\n", "|---|---|---|---|\n", "| 0 | 0x0 | 0b0000 | 1 | equatorward edge of SSFAC boundary |\n", "| 1 | 0x1 | 0b0001 | 2 | poleward edge of SSFAC boundary |\n" ] }, { "cell_type": "code", "execution_count": 4, "id": "680383c1", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "5b5ebba6261944cf9ec6bc5e4c14d728", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading: 0%| | [ Elapsed: 00:00, Remaining: ? ] (0.158MB)" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Requested variables Counter, Latitude_QD, Longitude_QD, MLT_QD, L_value, SZA, Position_Quality, PointType\n", "Response: \n", "Dimensions: (Timestamp: 25, Quality_dim1: 7, Counter_dim1: 2)\n", "Coordinates:\n", " * Timestamp (Timestamp) datetime64[ns] 2016-01-02T00:05:50.500000 ... 2...\n", "Dimensions without coordinates: Quality_dim1, Counter_dim1\n", "Data variables: (12/17)\n", " Spacecraft (Timestamp) object 'A' 'A' 'A' 'A' 'A' ... 'A' 'A' 'A' 'A' 'A'\n", " Latitude (Timestamp) float64 54.2 69.51 37.46 ... 54.51 64.04 68.72\n", " SZA (Timestamp) float64 106.6 116.4 99.95 ... 105.9 116.5 116.7\n", " L_value (Timestamp) float64 5.059 5.873 1.929 ... 4.518 3.976 5.507\n", " MLT (Timestamp) float64 17.21 4.956 16.88 ... 18.07 4.848 4.823\n", " Quality (Timestamp, Quality_dim1) int8 3 3 -1 0 -1 1 ... -1 -1 0 1 1 3\n", " ... ...\n", " Longitude_QD (Timestamp) float64 -25.57 146.9 -53.39 ... 19.23 177.1 154.1\n", " PPI (Timestamp) float64 5.022 5.931 1.881 ... 4.526 4.04 5.571\n", " QDLat (Timestamp) float64 63.36 65.41 43.44 ... 61.67 59.61 64.55\n", " Counter (Timestamp, Counter_dim1) uint32 11819 1 11819 2 ... 2 11834 2\n", " Latitude_QD (Timestamp) float64 63.36 65.41 43.44 ... 61.67 59.61 64.55\n", " MLT_QD (Timestamp) float64 17.21 4.956 16.88 ... 18.07 4.848 4.823\n", "Attributes:\n", " Sources: ['SW_OPER_PPIAFAC_2F_20160101T000000_20161231T235959_0103']\n", " MagneticModels: []\n", " RangeFilters: []\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "273d29ec9c9043b2aae3de3a6245c845", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading: 0%| | [ Elapsed: 00:00, Remaining: ? ] (0.14MB)" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Requested variables Counter, Latitude_QD, Longitude_QD, MLT_QD, L_value, SZA, Position_Quality, PointType\n", "Response: \n", "Dimensions: (Timestamp: 50, Counter_dim1: 2)\n", "Coordinates:\n", " * Timestamp (Timestamp) datetime64[ns] 2016-01-02T00:05:07.500000 ....\n", "Dimensions without coordinates: Counter_dim1\n", "Data variables: (12/15)\n", " Spacecraft (Timestamp) object 'A' 'A' 'A' 'A' 'A' ... 'A' 'A' 'A' 'A'\n", " Latitude (Timestamp) float64 51.45 54.97 72.12 ... 72.41 67.63\n", " SZA (Timestamp) float64 105.6 106.9 116.5 ... 116.8 116.7\n", " Position_Quality (Timestamp) int8 2 2 2 2 2 2 2 2 2 2 ... 2 1 1 2 2 3 3 2 2\n", " L_value (Timestamp) float64 4.253 5.328 7.181 ... 7.279 5.113\n", " MLT (Timestamp) float64 17.2 17.21 4.941 ... 4.902 4.781 4.834\n", " ... ...\n", " PointType (Timestamp) uint8 0 1 1 0 0 1 1 0 1 ... 1 1 0 0 1 1 0 1 0\n", " Longitude_QD (Timestamp) float64 -25.52 -25.58 146.9 ... 153.7 154.2\n", " QDLat (Timestamp) float64 60.72 64.09 67.89 ... 68.05 63.51\n", " Counter (Timestamp, Counter_dim1) uint32 11819 1 11819 ... 11834 2\n", " Latitude_QD (Timestamp) float64 60.72 64.09 67.89 ... 68.05 63.51\n", " MLT_QD (Timestamp) float64 17.2 17.21 4.941 ... 4.902 4.781 4.834\n", "Attributes:\n", " Sources: ['SW_OPER_PPIAFAC_2F_20160101T000000_20161231T235959_0103']\n", " MagneticModels: []\n", " RangeFilters: []\n" ] } ], "source": [ "request = SwarmRequest(SERVER_URL)\n", "\n", "# request the default dataset\n", "request.set_collection(\"SW_OPER_PPIAFAC_2F\")\n", "request.set_products(\n", " measurements=SwarmRequest.PRODUCT_VARIABLES[\"PPI_FAC\"], # request all dataset variables\n", " auxiliaries=['QDLat', 'QDLon', 'MLT'], # QD coordinates and MLT calculated by VirES \n", ")\n", "\n", "data = request.get_between(\n", " start_time=\"2016-01-02T00:00:00Z\",\n", " end_time=\"2016-01-03T00:00:00Z\",\n", " asynchronous=False,\n", ").as_xarray()\n", "\n", "print(\"Requested variables\", \", \".join(SwarmRequest.PRODUCT_VARIABLES[\"PPI_FAC:ID\"]))\n", "print(\"Response:\", data)\n", "\n", "# request the ID dataset\n", "request.set_collection(\"SW_OPER_PPIAFAC_2F:ID\")\n", "request.set_products(\n", " measurements=SwarmRequest.PRODUCT_VARIABLES[\"PPI_FAC:ID\"], # request all dataset variables\n", " auxiliaries=['QDLat', 'QDLon', 'MLT'], # QD coordinates and MLT calculated by VirES \n", ")\n", "\n", "data = request.get_between(\n", " start_time=\"2016-01-02T00:00:00Z\",\n", " end_time=\"2016-01-03T00:00:00Z\",\n", " asynchronous=False,\n", ").as_xarray()\n", "\n", "print(\"Requested variables\", \", \".join(SwarmRequest.PRODUCT_VARIABLES[\"PPI_FAC:ID\"]))\n", "print(\"Response:\", data)" ] } ], "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.7" } }, "nbformat": 4, "nbformat_minor": 5 }