Skip to content
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- uses: pre-commit/action@v3.0.1
with:
extra_args: --hook-stage manual --all-files
Expand All @@ -36,12 +36,12 @@ jobs:
- os: ubuntu-24.04
python-version: 3.14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v4
uses: astral-sh/setup-uv@v7
- name: Install package
run: uv sync ${{ github.event_name == 'schedule' && '--upgrade' || '--frozen' }} --group test
- name: Configure token access
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
34 changes: 19 additions & 15 deletions docs/available_parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ The available measurements are segregated according to the "collection" (essenti
- ``SW_FAST_AEJxLPL_2F``
- ``SW_FAST_AEJxPBL_2F``
- ``SW_FAST_AOBxFAC_2F``
- ``SW_FAST_STRxEPF_1B``

Collections are grouped according to a type containing similar measurements (i.e. the same product from different spacecraft). The collection type can be given to :py:meth:`viresclient.SwarmRequest.available_collections` to retrieve the full collection names. These cover the Swarm data products as below (replace x with A, B, or C for Alpha, Bravo, or Charlie):

Expand All @@ -75,6 +76,7 @@ SW_OPER_FAC_TMS_2F FAC Field-aligned currents (dual-satellite
SW_OPER_EEFxTMS_2F EEF Equatorial electric field
SW_OPER_IBIxTMS_2F IBI Ionospheric bubble index
SW_OPER_MODx_SC_1B MOD_SC Spacecraft positions at 1Hz
SW_OPER_STRxEPF_1B STR_EPF Star tracker energetic particle flux
======================== ================ ==============================================================

The AEBS (auroral electrojets and boundaries) products are a bit more complicated:
Expand Down Expand Up @@ -220,21 +222,23 @@ The ``measurements``, ``models``, and ``auxiliaries`` chosen will match the cade

Choose combinations of measurements from one of the following sets, corresponding to the collection chosen above. The collection full name or collection type can be given to :py:meth:`viresclient.SwarmRequest.available_measurements` to retrieve the list of available measurements for a given collection (e.g. ``request.available_measurements("SW_OPER_MAGA_LR_1B")``)

=============== ==============================================================================================================================================================================================================================================================================================
Collection type Available measurement names
=============== ==============================================================================================================================================================================================================================================================================================
MAG ``F,dF_Sun,dF_AOCS,dF_other,F_error,B_VFM,B_NEC,dB_Sun,dB_AOCS,dB_other,B_error,q_NEC_CRF,Att_error,Flags_F,Flags_B,Flags_q,Flags_Platform,ASM_Freq_Dev``
MAG_HR ``F,B_VFM,B_NEC,dB_Sun,dB_AOCS,dB_other,B_error,q_NEC_CRF,Att_error,Flags_B,Flags_q,Flags_Platform,ASM_Freq_Dev``
EFI ``U_orbit,Ne,Ne_error,Te,Te_error,Vs,Vs_error,Flags_LP,Flags_Ne,Flags_Te,Flags_Vs``
EFI_TIE ``Latitude_GD,Longitude_GD,Height_GD,Radius_GC,Latitude_QD,MLT_QD,Tn_msis,Te_adj_LP,Ti_meas_drift,Ti_model_drift,Flag_ti_meas,Flag_ti_model``
EFI_TCTyy ``VsatC,VsatE,VsatN,Bx,By,Bz,Ehx,Ehy,Ehz,Evx,Evy,Evz,Vicrx,Vicry,Vicrz,Vixv,Vixh,Viy,Viz,Vixv_error,Vixh_error,Viy_error,Viz_error,Latitude_QD,MLT_QD,Calibration_flags,Quality_flags``
EFI_IDM ``Latitude_GD,Longitude_GD,Height_GD,Radius_GC,Latitude_QD,MLT_QD,V_sat_nec,M_i_eff,M_i_eff_err,M_i_eff_Flags,M_i_eff_tbt_model,V_i,V_i_err,V_i_Flags,V_i_raw,N_i,N_i_err,N_i_Flags,A_fp,R_p,T_e,Phi_sc``
IPD ``Ne,Te,Background_Ne,Foreground_Ne,PCP_flag,Grad_Ne_at_100km,Grad_Ne_at_50km,Grad_Ne_at_20km,Grad_Ne_at_PCP_edge,ROD,RODI10s,RODI20s,delta_Ne10s,delta_Ne20s,delta_Ne40s,Num_GPS_satellites,mVTEC,mROT,mROTI10s,mROTI20s,IBI_flag,Ionosphere_region_flag,IPIR_index,Ne_quality_flag,TEC_STD``
TEC ``GPS_Position,LEO_Position,PRN,L1,L2,P1,P2,S1,S2,Elevation_Angle,Absolute_VTEC,Absolute_STEC,Relative_STEC,Relative_STEC_RMS,DCB,DCB_Error``
FAC ``IRC,IRC_Error,FAC,FAC_Error,Flags,Flags_F,Flags_B,Flags_q``
EEF ``EEF,EEJ,RelErr,Flags``
IBI ``Bubble_Index,Bubble_Probability,Flags_Bubble,Flags_F,Flags_B,Flags_q``
=============== ==============================================================================================================================================================================================================================================================================================
================== ==============================================================================================================================================================================================================================================================================================
Collection type Available measurement names
================== ==============================================================================================================================================================================================================================================================================================
MAG ``F,dF_Sun,dF_AOCS,dF_other,F_error,B_VFM,B_NEC,dB_Sun,dB_AOCS,dB_other,B_error,q_NEC_CRF,Att_error,Flags_F,Flags_B,Flags_q,Flags_Platform,ASM_Freq_Dev``
MAG_HR ``F,B_VFM,B_NEC,dB_Sun,dB_AOCS,dB_other,B_error,q_NEC_CRF,Att_error,Flags_B,Flags_q,Flags_Platform,ASM_Freq_Dev``
EFI ``U_orbit,Ne,Ne_error,Te,Te_error,Vs,Vs_error,Flags_LP,Flags_Ne,Flags_Te,Flags_Vs``
EFI_TIE ``Latitude_GD,Longitude_GD,Height_GD,Radius_GC,Latitude_QD,MLT_QD,Tn_msis,Te_adj_LP,Ti_meas_drift,Ti_model_drift,Flag_ti_meas,Flag_ti_model``
EFI_TCTyy ``VsatC,VsatE,VsatN,Bx,By,Bz,Ehx,Ehy,Ehz,Evx,Evy,Evz,Vicrx,Vicry,Vicrz,Vixv,Vixh,Viy,Viz,Vixv_error,Vixh_error,Viy_error,Viz_error,Latitude_QD,MLT_QD,Calibration_flags,Quality_flags``
EFI_IDM ``Latitude_GD,Longitude_GD,Height_GD,Radius_GC,Latitude_QD,MLT_QD,V_sat_nec,M_i_eff,M_i_eff_err,M_i_eff_Flags,M_i_eff_tbt_model,V_i,V_i_err,V_i_Flags,V_i_raw,N_i,N_i_err,N_i_Flags,A_fp,R_p,T_e,Phi_sc``
IPD ``Ne,Te,Background_Ne,Foreground_Ne,PCP_flag,Grad_Ne_at_100km,Grad_Ne_at_50km,Grad_Ne_at_20km,Grad_Ne_at_PCP_edge,ROD,RODI10s,RODI20s,delta_Ne10s,delta_Ne20s,delta_Ne40s,Num_GPS_satellites,mVTEC,mROT,mROTI10s,mROTI20s,IBI_flag,Ionosphere_region_flag,IPIR_index,Ne_quality_flag,TEC_STD``
TEC ``GPS_Position,LEO_Position,PRN,L1,L2,P1,P2,S1,S2,Elevation_Angle,Absolute_VTEC,Absolute_STEC,Relative_STEC,Relative_STEC_RMS,DCB,DCB_Error``
FAC ``IRC,IRC_Error,FAC,FAC_Error,Flags,Flags_F,Flags_B,Flags_q``
EEF ``EEF,EEJ,RelErr,Flags``
IBI ``Bubble_Index,Bubble_Probability,Flags_Bubble,Flags_F,Flags_B,Flags_q``
STR_EPF ``EPF,EPD,T_CHU,RA,Dec,EPD_Dens_corr,EPD_T_corr,Flags_EPF``
STR_EPF:flattened ``EPF,EPD,T_CHU,RA,Dec,EPD_Dens_corr,EPD_T_corr,Flags_EPF,SensorId``
================== ==============================================================================================================================================================================================================================================================================================

AEBS products:

Expand Down
6 changes: 6 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Release notes
Change log
----------

Changes from 0.16.0 to 0.17.0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Added new `STRxEPF <https://swarmhandbook.earth.esa.int/catalogue/SW_STRXEPF_1B>`_ product
- Per-CHU variables in ``STR_EPF`` are given a shared ``CHU`` dimension (labelled 1, 2, 3) in xarray, and expanded to ``<var>_1``, ``<var>_2``, ``<var>_3`` in pandas with ``expand=True``

Changes from 0.15.2 to 0.16.0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion src/viresclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
from ._config import ClientConfig, set_token
from ._data_handling import ReturnedData, ReturnedDataFile

__version__ = "0.16.0"
__version__ = "0.17.0"
35 changes: 35 additions & 0 deletions src/viresclient/_client_swarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@
),
"ULF_MAG": ("https://swarmhandbook.earth.esa.int/catalogue/SW_ULFxMAG_2F",),
"PC1_MAG": ("https://swarmhandbook.earth.esa.int/catalogue/SW_PC1xMAG_2F",),
"STR_EPF": ("https://swarmhandbook.earth.esa.int/catalogue/SW_STRXEPF_1B",),
"STR_EPF:flattened": (
"https://swarmhandbook.earth.esa.int/catalogue/SW_STRXEPF_1B",
),
}
for mission in ("SW", "OR", "CH", "CR", "CO"):
for cadence in ("1M", "4M"):
Expand Down Expand Up @@ -725,6 +729,14 @@ class SwarmRequest(ClientRequest):
*(f"SW_OPER_PC1{spacecraft}MAG_2F:Br_event_mean" for spacecraft in "ABC"),
*(f"SW_OPER_PC1{spacecraft}MAG_2F:Ba_event_mean" for spacecraft in "ABC"),
],
"STR_EPF": [
*(f"SW_OPER_STR{spacecraft}EPF_1B" for spacecraft in "ABC"),
*(f"SW_FAST_STR{spacecraft}EPF_1B" for spacecraft in "ABC"),
],
"STR_EPF:flattened": [
*(f"SW_OPER_STR{spacecraft}EPF_1B:flattened" for spacecraft in "ABC"),
*(f"SW_FAST_STR{spacecraft}EPF_1B:flattened" for spacecraft in "ABC"),
],
}

OBS_COLLECTIONS = [
Expand Down Expand Up @@ -820,6 +832,8 @@ class SwarmRequest(ClientRequest):
"ULF_MAG:event_mean": "PT1M", # irregular sampling
"PC1_MAG:event": "PT1S", # irregular sampling
"PC1_MAG:event_mean": "PT1M", # irregular sampling
"STR_EPF": "PT1S",
"STR_EPF:flattened": "PT1S",
}

PRODUCT_VARIABLES = {
Expand Down Expand Up @@ -1531,6 +1545,27 @@ class SwarmRequest(ClientRequest):
"ROFC",
"Quality",
],
"STR_EPF": [
"EPF",
"EPD",
"T_CHU",
"RA",
"Dec",
"EPD_Dens_corr",
"EPD_T_corr",
"Flags_EPF",
],
"STR_EPF:flattened": [
"EPF",
"EPD",
"T_CHU",
"RA",
"Dec",
"EPD_Dens_corr",
"EPD_T_corr",
"Flags_EPF",
"SensorId",
],
}

AUXILIARY_VARIABLES = [
Expand Down
17 changes: 16 additions & 1 deletion src/viresclient/_data_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@
"WGS84": ["GPS_Position", "LEO_Position"],
"EEJ_QDLat": ["EEJ_meast", "EEJ_mnorth"],
"NE": ["J_NE", "J_CF_NE", "J_DF_NE", "B_NE"],
"CHU": [
"EPF",
"EPD",
"T_CHU",
"RA",
"Dec",
"EPD_Dens_corr",
"EPD_T_corr",
"Flags_EPF",
],
}
# Reverse mapping of the above
DATANAMES_TO_FRAME_NAMES = {}
Expand All @@ -72,12 +82,14 @@
"WGS84": ["X", "Y", "Z"],
"EEJ_QDLat": numpy.linspace(-20, 20, 81),
"NE": ["N", "E"],
"CHU": [1, 2, 3],
}
FRAME_DESCRIPTIONS = {
"NEC": "NEC frame - North, East, Centre (down)",
"NE": "Horizontal NE frame - North, East",
"VFM": "Vector Field Magnetometer instrument frame",
"EEJ_QDLat": "Quasi-dipole latitude profile between -20 and 20 degrees from the EEF product",
"CHU": "Star tracker Camera Head Unit (CHU) identifier",
}


Expand Down Expand Up @@ -205,10 +217,13 @@ def as_pandas_dataframe(self, expand=False):
columns.remove(self._time_variable)
# Split columns according to those to be expanded into multiple columns
if expand:
# Only expand vector variables (e.g. not the scalar per-CHU
# variables in the STR_EPF:flattened collections)
columns_to_expand = {
c
for c in columns
if c in DATANAMES_TO_FRAME_NAMES.keys() or "B_NEC" in c
if (c in DATANAMES_TO_FRAME_NAMES.keys() or "B_NEC" in c)
and self.get_variable_numdims(c) == 1
}
# Avoid conflict with 2D AOB_FAC Quality variable
# when accessing AUX_OBS Quality
Expand Down
Loading