Skip to content

Commit 2ffc3b8

Browse files
committed
Improved access for different labels, one function only so far
1 parent 70a2fa5 commit 2ffc3b8

1 file changed

Lines changed: 33 additions & 9 deletions

File tree

pysatMagVect/_core.py

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -996,13 +996,21 @@ def add_mag_drifts(inst):
996996
return
997997

998998

999-
def add_footpoint_and_equatorial_drifts(inst):
999+
def add_footpoint_and_equatorial_drifts(inst, equ_mer_scalar='equ_mer_drifts_scalar',
1000+
equ_zonal_scalar='equ_zon_drifts_scalar',
1001+
north_mer_scalar='north_footpoint_mer_drifts_scalar',
1002+
north_zon_scalar='north_footpoint_zon_drifts_scalar',
1003+
south_mer_scalar='south_footpoint_mer_drifts_scalar',
1004+
south_zon_scalar='south_footpoint_zon_drifts_scalar',
1005+
mer_drift='iv_mer',
1006+
zon_drift='iv_zon'):
10001007
"""Translates geomagnetic ion velocities to those at footpoints and magnetic equator.
10011008
10021009
Note
10031010
----
10041011
Presumes scalar values for mapping ion velocities are already in the inst, labeled
1005-
by north_footpoint_zon_drift, north_footpoint_mer_drift, equ_mer_drift, equ_zon_drift.
1012+
by north_footpoint_zon_drifts_scalar, north_footpoint_mer_drifts_scalar,
1013+
equ_mer_drifts_scalar, equ_zon_drifts_scalar.
10061014
10071015
Also presumes that ion motions in the geomagnetic system are present and labeled
10081016
as 'iv_mer' and 'iv_zon' for meridional and zonal ion motions.
@@ -1013,7 +1021,23 @@ def add_footpoint_and_equatorial_drifts(inst):
10131021
Parameters
10141022
----------
10151023
inst : pysat.Instrument
1016-
1024+
equ_mer_scalar : string
1025+
Label used to identify equatorial scalar for meridional ion drift
1026+
equ_zon_scalar : string
1027+
Label used to identify equatorial scalar for zonal ion drift
1028+
north_mer_scalar : string
1029+
Label used to identify northern footpoint scalar for meridional ion drift
1030+
north_zon_scalar : string
1031+
Label used to identify northern footpoint scalar for zonal ion drift
1032+
south_mer_scalar : string
1033+
Label used to identify northern footpoint scalar for meridional ion drift
1034+
south_zon_scalar : string
1035+
Label used to identify southern footpoint scalar for zonal ion drift
1036+
mer_drift : string
1037+
Label used to identify meridional ion drifts within inst
1038+
zon_drift : string
1039+
Label used to identify zonal ion drifts within inst
1040+
10171041
Returns
10181042
-------
10191043
None
@@ -1024,14 +1048,14 @@ def add_footpoint_and_equatorial_drifts(inst):
10241048
10251049
"""
10261050

1027-
inst['equ_mer_drift'] = inst['equ_mer_drifts_scalar']*inst['iv_mer']
1028-
inst['equ_zon_drift'] = inst['equ_zon_drifts_scalar']*inst['iv_zon']
1051+
inst['equ_mer_drift'] = inst[equ_mer_scalar]*inst[mer_drift]
1052+
inst['equ_zon_drift'] = inst[equ_zonal_scalar]*inst[zon_drift]
10291053

1030-
inst['south_footpoint_mer_drift'] = inst['south_footpoint_mer_drifts_scalar']*inst['iv_mer']
1031-
inst['south_footpoint_zon_drift'] = inst['south_footpoint_zon_drifts_scalar']*inst['iv_zon']
1054+
inst['south_footpoint_mer_drift'] = inst[south_mer_scalar]*inst[mer_drift]
1055+
inst['south_footpoint_zon_drift'] = inst[south_zon_scalar]*inst[zon_drift]
10321056

1033-
inst['north_footpoint_mer_drift'] = inst['north_footpoint_mer_drifts_scalar']*inst['iv_mer']
1034-
inst['north_footpoint_zon_drift'] = inst['north_footpoint_zon_drifts_scalar']*inst['iv_zon']
1057+
inst['north_footpoint_mer_drift'] = inst[north_mer_scalar]*inst[mer_drift]
1058+
inst['north_footpoint_zon_drift'] = inst[north_zon_scalar]*inst[zon_drift]
10351059

10361060
inst['equ_mer_drift'] = {
10371061
'units':'m/s',

0 commit comments

Comments
 (0)