Note

Notebook name: 02b__viresclient-Available-Data.ipynb (download .ipynb)
Alternative view with nbviewer - sometimes the formatting below can be messed up as it is processed by nbsphinx

Available data and models through viresclient

Authors: Ashley Smith

Abstract: Different Swarm datasets are available through each “collection” on the VirES server. Choosing a collection determines the subset of “measurement”-type products available, while “auxiliary”-type are always available. Geomagnetic “model”-type are available in connection with the MAG collections. These can be seen at https://viresclient.readthedocs.io/en/latest/available_parameters.html

[1]:
%load_ext watermark
%watermark -i -v -p viresclient,pandas,xarray,matplotlib
2020-05-21T12:02:35+00:00

CPython 3.7.6
IPython 7.11.1

viresclient 0.6.1
pandas 0.25.3
xarray 0.15.0
matplotlib 3.1.2
[2]:
from viresclient import SwarmRequest

Using viresclient to check what data & models are available

viresclient has some tools to help you find out what data and models are available. First instantiate a request object, then use it to call methods:

request.available_collections()
request.available_measurements()
request.available_auxiliaries()
request.available_models()
[3]:
request = SwarmRequest()

Data are organised into “collections” - see a list of them with references:

[4]:
request.available_collections()
General References:
 Swarm Data Handbook, https://earth.esa.int/web/guest/missions/esa-eo-missions/swarm/data-handbook
 The Swarm Satellite Constellation Application and Research Facility (SCARF) and Swarm data products, https://doi.org/10.5047/eps.2013.07.001
 Swarm Science Data Processing and Products (2013), https://link.springer.com/journal/40623/65/11/page/1
 Special issue “Swarm science results after 2 years in space (2016), https://www.springeropen.com/collections/swsr
 Earth's Magnetic Field: Understanding Geomagnetic Sources from the Earth's Interior and its Environment (2017), https://link.springer.com/journal/11214/206/1/page/1

MAG
   SW_OPER_MAGA_LR_1B
   SW_OPER_MAGB_LR_1B
   SW_OPER_MAGC_LR_1B
 https://earth.esa.int/web/guest/missions/esa-eo-missions/swarm/data-handbook/level-1b-product-definitions#MAGX_LR_1B_Product

MAG_HR
   SW_OPER_MAGA_HR_1B
   SW_OPER_MAGB_HR_1B
   SW_OPER_MAGC_HR_1B
https://earth.esa.int/web/guest/missions/esa-eo-missions/swarm/data-handbook/level-1b-product-definitions#MAGX_HR_1B_Product

EFI
   SW_OPER_EFIA_LP_1B
   SW_OPER_EFIB_LP_1B
   SW_OPER_EFIC_LP_1B
 https://earth.esa.int/web/guest/missions/esa-eo-missions/swarm/data-handbook/level-1b-product-definitions#EFIX_LP_1B_Product

IBI
   SW_OPER_IBIATMS_2F
   SW_OPER_IBIBTMS_2F
   SW_OPER_IBICTMS_2F
 https://earth.esa.int/web/guest/missions/esa-eo-missions/swarm/data-handbook/level-2-product-definitions#IBIxTMS_2F
 https://earth.esa.int/documents/10174/1514862/Swarm_L2_IBI_product_description

TEC
   SW_OPER_TECATMS_2F
   SW_OPER_TECBTMS_2F
   SW_OPER_TECCTMS_2F
 https://earth.esa.int/web/guest/missions/esa-eo-missions/swarm/data-handbook/level-2-product-definitions#TECxTMS_2F
 https://earth.esa.int/documents/10174/1514862/Swarm_Level-2_TEC_Product_Description

FAC
   SW_OPER_FACATMS_2F
   SW_OPER_FACBTMS_2F
   SW_OPER_FACCTMS_2F
   SW_OPER_FAC_TMS_2F
 https://earth.esa.int/web/guest/missions/esa-eo-missions/swarm/data-handbook/level-2-product-definitions#FAC_TMS_2F
 https://earth.esa.int/web/guest/missions/esa-eo-missions/swarm/data-handbook/level-2-product-definitions#FACxTMS_2F
 https://earth.esa.int/documents/10174/1514862/Swarm_L2_FAC_single_product_description
 https://earth.esa.int/documents/10174/1514862/Swarm-L2-FAC-Dual-Product-Description

EEF
   SW_OPER_EEFATMS_2F
   SW_OPER_EEFBTMS_2F
   SW_OPER_EEFCTMS_2F
 https://earth.esa.int/web/guest/missions/esa-eo-missions/swarm/data-handbook/level-2-product-definitions#EEFxTMS_2F
 https://earth.esa.int/documents/10174/1514862/Swarm-Level-2-EEF-Product-Description

IPD
   SW_OPER_IPDAIRR_2F
   SW_OPER_IPDBIRR_2F
   SW_OPER_IPDCIRR_2F
 https://earth.esa.int/web/guest/missions/esa-eo-missions/swarm/data-handbook/level-2-product-definitions#IPDxIPR_2F

Just the names of the collections:

[5]:
request.available_collections(details=False)
[5]:
{'MAG': ['SW_OPER_MAGA_LR_1B', 'SW_OPER_MAGB_LR_1B', 'SW_OPER_MAGC_LR_1B'],
 'MAG_HR': ['SW_OPER_MAGA_HR_1B', 'SW_OPER_MAGB_HR_1B', 'SW_OPER_MAGC_HR_1B'],
 'EFI': ['SW_OPER_EFIA_LP_1B', 'SW_OPER_EFIB_LP_1B', 'SW_OPER_EFIC_LP_1B'],
 'IBI': ['SW_OPER_IBIATMS_2F', 'SW_OPER_IBIBTMS_2F', 'SW_OPER_IBICTMS_2F'],
 'TEC': ['SW_OPER_TECATMS_2F', 'SW_OPER_TECBTMS_2F', 'SW_OPER_TECCTMS_2F'],
 'FAC': ['SW_OPER_FACATMS_2F',
  'SW_OPER_FACBTMS_2F',
  'SW_OPER_FACCTMS_2F',
  'SW_OPER_FAC_TMS_2F'],
 'EEF': ['SW_OPER_EEFATMS_2F', 'SW_OPER_EEFBTMS_2F', 'SW_OPER_EEFCTMS_2F'],
 'IPD': ['SW_OPER_IPDAIRR_2F', 'SW_OPER_IPDBIRR_2F', 'SW_OPER_IPDCIRR_2F']}

Available “measurements” within each collection type:

[6]:
request.available_measurements("MAG")
[6]:
['F',
 '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']
[7]:
request.available_measurements("EFI")
[7]:
['U_orbit',
 'Ne',
 'Ne_error',
 'Te',
 'Te_error',
 'Vs',
 'Vs_error',
 'Flags_LP',
 'Flags_Ne',
 'Flags_Te',
 'Flags_Vs']
[8]:
request.available_measurements("IBI")
[8]:
['Bubble_Index',
 'Bubble_Probability',
 'Flags_Bubble',
 'Flags_F',
 'Flags_B',
 'Flags_q']
[9]:
request.available_measurements("TEC")
[9]:
['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']
[10]:
request.available_measurements("FAC")
[10]:
['IRC',
 'IRC_Error',
 'FAC',
 'FAC_Error',
 'Flags',
 'Flags_F',
 'Flags_B',
 'Flags_q']
[11]:
request.available_measurements("EEF")
[11]:
['EEF', 'EEJ', 'RelErr', 'Flags']
[12]:
request.available_measurements("IPD")
[12]:
['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']

“auxiliaries” are available to fetch together with any collection

[13]:
request.available_auxiliaries()
[13]:
['Timestamp',
 'Latitude',
 'Longitude',
 'Radius',
 'Spacecraft',
 'OrbitDirection',
 'QDOrbitDirection',
 'SyncStatus',
 'Kp10',
 'Kp',
 'Dst',
 'F107',
 'IMF_BY_GSM',
 'IMF_BZ_GSM',
 'IMF_V',
 'F10_INDEX',
 'OrbitSource',
 'OrbitNumber',
 'AscendingNodeTime',
 'AscendingNodeLongitude',
 'QDLat',
 'QDLon',
 'QDBasis',
 'MLT',
 'SunDeclination',
 'SunHourAngle',
 'SunRightAscension',
 'SunAzimuthAngle',
 'SunZenithAngle',
 'SunLongitude',
 'SunVector',
 'DipoleAxisVector',
 'NGPLatitude',
 'NGPLongitude',
 'DipoleTiltAngle']

Several models are available (and custom ones can be supplied as .shc files)

[14]:
request.available_models()
CHAOS-Core = 'CHAOS-Core'(max_degree=20,min_degree=1)
  START: 1997-02-07T05:31:12.000003Z
  END:   2020-09-14T01:00:11.519998Z
DESCRIPTION:
CHAOS-7 Core field (SH degrees 1-20)
 http://www.spacecenter.dk/files/magnetic-models/CHAOS-7/
SOURCES:
  SW_OPER_MCO_SHA_2X_19970101T000000_20200913T235959_0702

CHAOS-MMA-Primary = 'CHAOS-MMA-Primary'(max_degree=2,min_degree=1)
  START: 2002-01-01T00:00:00Z
  END:   2020-05-20T23:30:00Z
DESCRIPTION:
CHAOS-7 Primary (external) magnetospheric field
 hhttp://www.spacecenter.dk/files/magnetic-models/CHAOS-7/
SOURCES:
  SW_OPER_MMA_CHAOS__20020101T000000_20021231T233000_0701
  SW_OPER_MMA_CHAOS__20030101T000000_20031231T233000_0701
  SW_OPER_MMA_CHAOS__20040101T000000_20041231T233000_0701
  SW_OPER_MMA_CHAOS__20050101T000000_20051231T233000_0701
  SW_OPER_MMA_CHAOS__20060101T000000_20061231T233000_0701
  SW_OPER_MMA_CHAOS__20070101T000000_20071231T233000_0701
  SW_OPER_MMA_CHAOS__20080101T000000_20081231T233000_0701
  SW_OPER_MMA_CHAOS__20090101T000000_20091231T233000_0701
  SW_OPER_MMA_CHAOS__20100101T000000_20101231T233000_0701
  SW_OPER_MMA_CHAOS__20110101T000000_20111231T233000_0701
  SW_OPER_MMA_CHAOS__20120101T000000_20121231T233000_0701
  SW_OPER_MMA_CHAOS__20130101T000000_20131231T233000_0701
  SW_OPER_MMA_CHAOS__20140101T000000_20141231T233000_0701
  SW_OPER_MMA_CHAOS__20150101T000000_20151231T233000_0701
  SW_OPER_MMA_CHAOS__20160101T000000_20161231T233000_0701
  SW_OPER_MMA_CHAOS__20170101T000000_20171231T233000_0701
  SW_OPER_MMA_CHAOS__20180101T000000_20181231T233000_0701
  SW_OPER_MMA_CHAOS__20190101T000000_20200520T233000_0701

CHAOS-MMA-Secondary = 'CHAOS-MMA-Secondary'(max_degree=2,min_degree=1)
  START: 2002-01-01T00:00:00Z
  END:   2020-05-20T23:30:00Z
DESCRIPTION:
CHAOS-7 Secondary (internal) magnetospheric field
 http://www.spacecenter.dk/files/magnetic-models/CHAOS-7/
SOURCES:
  SW_OPER_MMA_CHAOS__20020101T000000_20021231T233000_0701
  SW_OPER_MMA_CHAOS__20030101T000000_20031231T233000_0701
  SW_OPER_MMA_CHAOS__20040101T000000_20041231T233000_0701
  SW_OPER_MMA_CHAOS__20050101T000000_20051231T233000_0701
  SW_OPER_MMA_CHAOS__20060101T000000_20061231T233000_0701
  SW_OPER_MMA_CHAOS__20070101T000000_20071231T233000_0701
  SW_OPER_MMA_CHAOS__20080101T000000_20081231T233000_0701
  SW_OPER_MMA_CHAOS__20090101T000000_20091231T233000_0701
  SW_OPER_MMA_CHAOS__20100101T000000_20101231T233000_0701
  SW_OPER_MMA_CHAOS__20110101T000000_20111231T233000_0701
  SW_OPER_MMA_CHAOS__20120101T000000_20121231T233000_0701
  SW_OPER_MMA_CHAOS__20130101T000000_20131231T233000_0701
  SW_OPER_MMA_CHAOS__20140101T000000_20141231T233000_0701
  SW_OPER_MMA_CHAOS__20150101T000000_20151231T233000_0701
  SW_OPER_MMA_CHAOS__20160101T000000_20161231T233000_0701
  SW_OPER_MMA_CHAOS__20170101T000000_20171231T233000_0701
  SW_OPER_MMA_CHAOS__20180101T000000_20181231T233000_0701
  SW_OPER_MMA_CHAOS__20190101T000000_20200520T233000_0701

CHAOS-Static = 'CHAOS-Static'(max_degree=185,min_degree=21)
  START: 0001-01-01T00:00:00Z
  END:   4000-01-01T00:00:00Z
DESCRIPTION:
CHAOS-7 crust field (SH degrees 21-185)
 http://www.spacecenter.dk/files/magnetic-models/CHAOS-7/
SOURCES:
  CHAOS-7_static.shc

IGRF = IGRF(max_degree=13,min_degree=1)
  START: 1900-01-01T00:00:00Z
  END:   2025-01-01T00:00:00Z
DESCRIPTION:
 International Geomagnetic Reference Field: the 13th generation, (waiting for publication)
 https://www.ngdc.noaa.gov/IAGA/vmod/igrf.html
SOURCES:
  SW_OPER_AUX_IGR_2__19000101T000000_20241231T235959_0103

LCS-1 = 'LCS-1'(max_degree=185,min_degree=1)
  START: 0001-01-01T00:00:00Z
  END:   4000-01-01T00:00:00Z
DESCRIPTION:
The LCS-1 high-resolution lithospheric field model, derived from CHAMP and Swarm satellite observations
 http://www.spacecenter.dk/files/magnetic-models/LCS-1/
SOURCES:
  LCS-1.shc

MCO_SHA_2C = MCO_SHA_2C(max_degree=18,min_degree=1)
  START: 2013-11-24T18:34:03.360004Z
  END:   2020-04-01T04:32:00.960003Z
DESCRIPTION:
[Comprehensive Inversion]: Core field of CIY4
 A comprehensive model of Earth’s magnetic field determined from 4 years of Swarm satellite observations, https://doi.org/10.1186/s40623-018-0896-3
Validation: ftp://swarm-diss.eo.esa.int/Level2longterm/MCO/SW_OPER_MCO_VAL_2C_20131201T000000_20180101T000000_0401.ZIP
SOURCES:
  SW_OPER_MCO_SHA_2C_20131125T000000_20200401T000000_0601

MCO_SHA_2D = MCO_SHA_2D(max_degree=20,min_degree=1)
  START: 2013-11-25T12:00:00.000003Z
  END:   2018-01-01T00:00:00Z
DESCRIPTION:
[Dedicated Chain]: Core field
An algorithm for deriving core magnetic field models from the Swarm data set, https://doi.org/10.5047/eps.2013.07.005
Validation: ftp://swarm-diss.eo.esa.int/Level2longterm/MCO/SW_OPER_MCO_VAL_2D_20131126T000000_20180101T000000_0401.ZIP
SOURCES:
  SW_OPER_MCO_SHA_2D_20131126T000000_20180101T000000_0401

MF7 = MF7(max_degree=133,min_degree=16)
  START: 0001-01-01T00:00:00Z
  END:   4000-01-01T00:00:00Z
DESCRIPTION:
MF7 crustal field model, derived from CHAMP satellite observations
 http://geomag.org/models/MF7.html
SOURCES:
  MF7.shc

MIO_SHA_2C-Primary = 'MIO_SHA_2C-Primary'(max_degree=60,min_degree=1)
  START: 0001-01-01T00:00:00Z
  END:   4000-01-01T00:00:00Z
DESCRIPTION:
[Comprehensive Inversion]: Primary (external) ionospheric field of CIY4
Validation: ftp://swarm-diss.eo.esa.int/Level2longterm/MIO/SW_OPER_MIO_VAL_2C_00000000T000000_99999999T999999_0401.ZIP
SOURCES:
  SW_OPER_MIO_SHA_2C_00000000T000000_99999999T999999_0601

MIO_SHA_2C-Secondary = 'MIO_SHA_2C-Secondary'(max_degree=60,min_degree=1)
  START: 0001-01-01T00:00:00Z
  END:   4000-01-01T00:00:00Z
DESCRIPTION:
[Comprehensive Inversion]: Secondary (external/induced) ionospheric field of CIY4
SOURCES:
  SW_OPER_MIO_SHA_2C_00000000T000000_99999999T999999_0601

MIO_SHA_2D-Primary = 'MIO_SHA_2D-Primary'(max_degree=60,min_degree=1)
  START: 0001-01-01T00:00:00Z
  END:   4000-01-01T00:00:00Z
DESCRIPTION:
[Dedicated Chain]: Primary (external) ionospheric field, DIFI
 Swarm SCARF dedicated ionospheric field inversion chain, https://doi.org/10.5047/eps.2013.08.006
 First results from the Swarm Dedicated Ionospheric Field Inversion chain, https://doi.org/10.1186/s40623-016-0481-6
 http://geomag.colorado.edu/difi-3
Validation: ftp://swarm-diss.eo.esa.int/Level2longterm/MIO/SW_OPER_MIO_VAL_2D_20131201T000000_20171231T235959_0402.ZIP
SOURCES:
  SW_OPER_MIO_SHA_2D_20131201T000000_20150531T235959_0101

MIO_SHA_2D-Secondary = 'MIO_SHA_2D-Secondary'(max_degree=60,min_degree=1)
  START: 0001-01-01T00:00:00Z
  END:   4000-01-01T00:00:00Z
DESCRIPTION:
[Dedicated Chain]: Secondary (external/induced) ionospheric field, DIFI
SOURCES:
  SW_OPER_MIO_SHA_2D_20131201T000000_20150531T235959_0101

MLI_SHA_2C = MLI_SHA_2C(max_degree=120,min_degree=16)
  START: 0001-01-01T00:00:00Z
  END:   4000-01-01T00:00:00Z
DESCRIPTION:
[Comprehensive Inversion]: Lithospheric field of CIY4
Validation: ftp://swarm-diss.eo.esa.int/Level2longterm/MLI/SW_OPER_MLI_VAL_2C_00000000T000000_99999999T999999_0401.ZIP
SOURCES:
  SW_OPER_MLI_SHA_2C_00000000T000000_99999999T999999_0601

MLI_SHA_2D = MLI_SHA_2D(max_degree=133,min_degree=16)
  START: 0001-01-01T00:00:00Z
  END:   4000-01-01T00:00:00Z
DESCRIPTION:
[Dedicated Chain]: Lithospheric field
 Swarm SCARF Dedicated Lithospheric Field Inversion chain, https://doi.org/10.5047/eps.2013.07.008
 Validation: ftp://swarm-diss.eo.esa.int/Level2longterm/MLI/SW_OPER_MLI_VAL_2D_00000000T000000_99999999T999999_0401.ZIP
SOURCES:
  SW_OPER_MLI_SHA_2D_00000000T000000_99999999T999999_0501

MMA_SHA_2C-Primary = 'MMA_SHA_2C-Primary'(max_degree=2,min_degree=1)
  START: 2013-11-25T03:00:00Z
  END:   2018-12-31T21:00:00Z
DESCRIPTION:
[Comprehensive Inversion]: Primary (external) magnetospheric field of CIY4
Validation: ftp://swarm-diss.eo.esa.int/Level2longterm/MMA/SW_OPER_MMA_VAL_2C_20131201T000000_20180101T000000_0401.ZIP
SOURCES:
  SW_OPER_MMA_SHA_2C_20131125T000000_20181231T235959_0501

MMA_SHA_2C-Secondary = 'MMA_SHA_2C-Secondary'(max_degree=3,min_degree=1)
  START: 2013-11-25T03:00:00Z
  END:   2018-12-31T21:00:00Z
DESCRIPTION:
[Comprehensive Inversion]: Secondary (internal/induced) magnetospheric field of CIY4
SOURCES:
  SW_OPER_MMA_SHA_2C_20131125T000000_20181231T235959_0501

MMA_SHA_2F-Primary = 'MMA_SHA_2F-Primary'(max_degree=1,min_degree=1)
  START: 2013-11-25T11:15:00Z
  END:   2020-05-17T20:15:00Z
DESCRIPTION:
[Fast-Track Product]: Primary (external) magnetospheric field
 Rapid modelling of the large-scale magnetospheric field from Swarm satellite data, https://doi.org/10.5047/eps.2013.09.003
SOURCES:
  SW_OPER_MMA_SHA_2F_20131125T103000_20140101T000000_0108
  SW_OPER_MMA_SHA_2F_20140101T000000_20150101T000000_0108
  SW_OPER_MMA_SHA_2F_20150101T000000_20160101T000000_0108
  SW_OPER_MMA_SHA_2F_20160101T000000_20170101T000000_0108
  SW_OPER_MMA_SHA_2F_20170101T000000_20180101T000000_0108
  SW_OPER_MMA_SHA_2F_20180101T000000_20190101T000000_0108
  SW_OPER_MMA_SHA_2F_20190101T000000_20200101T000000_0108
  SW_OPER_MMA_SHA_2F_20200101T000000_20200517T210000_0108

MMA_SHA_2F-Secondary = 'MMA_SHA_2F-Secondary'(max_degree=1,min_degree=1)
  START: 2013-11-25T11:15:00Z
  END:   2020-05-17T20:15:00Z
DESCRIPTION:
[Fast-Track Product]: Secondary (internal/induced) magnetospheric field
SOURCES:
  SW_OPER_MMA_SHA_2F_20131125T103000_20140101T000000_0108
  SW_OPER_MMA_SHA_2F_20140101T000000_20150101T000000_0108
  SW_OPER_MMA_SHA_2F_20150101T000000_20160101T000000_0108
  SW_OPER_MMA_SHA_2F_20160101T000000_20170101T000000_0108
  SW_OPER_MMA_SHA_2F_20170101T000000_20180101T000000_0108
  SW_OPER_MMA_SHA_2F_20180101T000000_20190101T000000_0108
  SW_OPER_MMA_SHA_2F_20190101T000000_20200101T000000_0108
  SW_OPER_MMA_SHA_2F_20200101T000000_20200517T210000_0108

[15]:
request.available_models(details=False)
[15]:
['IGRF',
 'LCS-1',
 'MF7',
 'CHAOS-Core',
 'CHAOS-Static',
 'CHAOS-MMA-Primary',
 'CHAOS-MMA-Secondary',
 'MCO_SHA_2C',
 'MCO_SHA_2D',
 'MLI_SHA_2C',
 'MLI_SHA_2D',
 'MMA_SHA_2C-Primary',
 'MMA_SHA_2C-Secondary',
 'MMA_SHA_2F-Primary',
 'MMA_SHA_2F-Secondary',
 'MIO_SHA_2C-Primary',
 'MIO_SHA_2C-Secondary',
 'MIO_SHA_2D-Primary',
 'MIO_SHA_2D-Secondary']

The Swarm models are named with a prefix indicating the source field (e.g. MCO for “Model of the Core field) and suffix indicating the processing chain (e.g. 2D for “Level 2 product, Comprehensive Inversion chain”).

C: Comprehensive; D: Dedicated; F: Fast-track

  C D F
MCO - Core x x
MMA - Magnetosphere x
x
MIO - Ionosphere x x
MLI - Lithosphere x x

MIO and MMA are divided into Primary and Secondary parts - primary for the external (to the Earth) ionospheric / magnetospheric field source, and secondary for the internally induced part in the upper mantle.

[16]:
request.available_models("C", details=False)
[16]:
['MCO_SHA_2C',
 'MLI_SHA_2C',
 'MMA_SHA_2C-Primary',
 'MMA_SHA_2C-Secondary',
 'MIO_SHA_2C-Primary',
 'MIO_SHA_2C-Secondary']
[17]:
request.available_models("MCO", details=True)
MCO_SHA_2C = MCO_SHA_2C(max_degree=18,min_degree=1)
  START: 2013-11-24T18:34:03.360004Z
  END:   2020-04-01T04:32:00.960003Z
DESCRIPTION:
[Comprehensive Inversion]: Core field of CIY4
 A comprehensive model of Earth’s magnetic field determined from 4 years of Swarm satellite observations, https://doi.org/10.1186/s40623-018-0896-3
Validation: ftp://swarm-diss.eo.esa.int/Level2longterm/MCO/SW_OPER_MCO_VAL_2C_20131201T000000_20180101T000000_0401.ZIP
SOURCES:
  SW_OPER_MCO_SHA_2C_20131125T000000_20200401T000000_0601

MCO_SHA_2D = MCO_SHA_2D(max_degree=20,min_degree=1)
  START: 2013-11-25T12:00:00.000003Z
  END:   2018-01-01T00:00:00Z
DESCRIPTION:
[Dedicated Chain]: Core field
An algorithm for deriving core magnetic field models from the Swarm data set, https://doi.org/10.5047/eps.2013.07.005
Validation: ftp://swarm-diss.eo.esa.int/Level2longterm/MCO/SW_OPER_MCO_VAL_2D_20131126T000000_20180101T000000_0401.ZIP
SOURCES:
  SW_OPER_MCO_SHA_2D_20131126T000000_20180101T000000_0401

Manipulation of models

Models can be manipulated: combining different models, limiting spherical harmonic (SH) series summation to a smaller range of SH degree. These composed models can be provided within the models kwarg in request.set_products(), e.g.

from viresclient import SwarmRequest
request = SwarmRequest()
request.set_collection("SW_OPER_MAGA_LR_1B")
request.set_products(
    measurements=["F"],
    models=["MCO_MMA = 'MCO_SHA_2C' + 'MMA_SHA_2C-Primary' + 'MMA_SHA_2C-Secondary'"],
)

Model details can be found with request.get_model_info(models=...) which handles the same models input as set_products(). This information is returned as a dictionary.

  1. The models should be provided as a list of strings, where each string defines a particular model.
[18]:
request.get_model_info(
    models=["MCO_SHA_2D", "MCO_SHA_2C"]
)
[18]:
{'MCO_SHA_2D': {'expression': 'MCO_SHA_2D(max_degree=20,min_degree=1)',
  'validity': {'start': '2013-11-25T12:00:00.000003Z',
   'end': '2018-01-01T00:00:00Z'},
  'sources': ['SW_OPER_MCO_SHA_2D_20131126T000000_20180101T000000_0401']},
 'MCO_SHA_2C': {'expression': 'MCO_SHA_2C(max_degree=18,min_degree=1)',
  'validity': {'start': '2013-11-24T18:34:03.360004Z',
   'end': '2020-04-01T04:32:00.960003Z'},
  'sources': ['SW_OPER_MCO_SHA_2C_20131125T000000_20200401T000000_0601']}}

2.. Models can be combined to form a new model like:

"New_model = 'Model_1' + 'Model_2'"
[19]:
request.get_model_info(
    models=["MCO_MMA = 'MCO_SHA_2C' + 'MMA_SHA_2C-Primary' + 'MMA_SHA_2C-Secondary'"]
)
[19]:
{'MCO_MMA': {'expression': "MCO_SHA_2C(max_degree=18,min_degree=1) + 'MMA_SHA_2C-Primary'(max_degree=2,min_degree=1) + 'MMA_SHA_2C-Secondary'(max_degree=3,min_degree=1)",
  'validity': {'start': '2013-11-25T03:00:00Z', 'end': '2018-12-31T21:00:00Z'},
  'sources': ['SW_OPER_MCO_SHA_2C_20131125T000000_20200401T000000_0601',
   'SW_OPER_MMA_SHA_2C_20131125T000000_20181231T235959_0501']}}
  1. Limiting the SH degree range can be done with:

    Model_name(min_degree=x, max_degree=y)
    
  2. Your own .shc format model can be provided as a file, the model for which is then accessible within VirES under the name "Custom_Model". NB: in this case you will also need to provide the custom_model kwarg in request.set_products() - the model is not persistently stored on the server.

  3. New models can be defined successively in the list, using names that have been defined earlier in the list.

[20]:
# Fetch an example file to use
url = "http://www.spacecenter.dk/files/magnetic-models/LCS-1/LCS-1.shc"
file_name = "LCS-1.shc"
import urllib.request
urllib.request.urlretrieve(url, file_name);
[21]:
# Demonstrates:
#  limiting SH degree
#  providing your own model file
#  referring to defined models
request.get_model_info(
    models=[
        "MLI_SHA_2D = MLI_SHA_2D(min_degree=1, max_degree=80)",
        "LCS = Custom_Model(min_degree=1, max_degree=80)",
        "LCS-SwarmMLI = LCS - MLI_SHA_2D"
    ],
    custom_model=file_name,
)
[21]:
{'MLI_SHA_2D': {'expression': 'MLI_SHA_2D(max_degree=80,min_degree=16)',
  'validity': {'start': '0001-01-01T00:00:00Z', 'end': '4000-01-01T00:00:00Z'},
  'sources': ['SW_OPER_MLI_SHA_2D_00000000T000000_99999999T999999_0501']},
 'LCS': {'expression': 'Custom_Model(max_degree=80,min_degree=1)',
  'validity': {'start': '0001-01-01T00:00:00Z', 'end': '4000-01-01T00:00:00Z'},
  'sources': []},
 'LCS-SwarmMLI': {'expression': 'LCS(max_degree=80,min_degree=1) - MLI_SHA_2D(max_degree=80,min_degree=16)',
  'validity': {'start': '0001-01-01T00:00:00Z', 'end': '4000-01-01T00:00:00Z'},
  'sources': ['SW_OPER_MLI_SHA_2D_00000000T000000_99999999T999999_0501']}}

It is also possible to provide the models as a dictionary instead of a list.

[22]:
request.get_model_info(
    models={
        "MLI_SHA_2D": "MLI_SHA_2D(min_degree=1, max_degree=80)",
        "LCS": "Custom_Model(min_degree=1, max_degree=80)",
        "LCS-SwarmMLI": "LCS - MLI_SHA_2D"
    },
    custom_model="LCS-1.shc"
)
[22]:
{'MLI_SHA_2D': {'expression': 'MLI_SHA_2D(max_degree=80,min_degree=16)',
  'validity': {'start': '0001-01-01T00:00:00Z', 'end': '4000-01-01T00:00:00Z'},
  'sources': ['SW_OPER_MLI_SHA_2D_00000000T000000_99999999T999999_0501']},
 'LCS': {'expression': 'Custom_Model(max_degree=80,min_degree=1)',
  'validity': {'start': '0001-01-01T00:00:00Z', 'end': '4000-01-01T00:00:00Z'},
  'sources': []},
 'LCS-SwarmMLI': {'expression': 'LCS(max_degree=80,min_degree=1) - MLI_SHA_2D(max_degree=80,min_degree=16)',
  'validity': {'start': '0001-01-01T00:00:00Z', 'end': '4000-01-01T00:00:00Z'},
  'sources': ['SW_OPER_MLI_SHA_2D_00000000T000000_99999999T999999_0501']}}