Skip to content

Commit 186a4ab

Browse files
author
R Bailey
committed
Patching with new version since it now works with heliosat v.0.4.0.
1 parent ea69a66 commit 186a4ab

2 files changed

Lines changed: 23 additions & 11 deletions

File tree

predstorm/data.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -896,8 +896,9 @@ def shift_wind_to_L1(self):
896896
expansion at different radii.
897897
898898
Exponents taken from Kivelson and Russell, Introduction to Space Physics (Ch. 4.3.2).
899-
Density, btot, bt, bn, bx and bz are scaled according to 1/r**2.
900-
bt and by are scaled according to 1/r.
899+
Magnetic field components are scaled according to values in
900+
Hanneson et al. (2020) JGR Space Physics paper.
901+
https://doi.org/10.1029/2019JA027139
901902
902903
Parameters
903904
==========
@@ -911,16 +912,27 @@ def shift_wind_to_L1(self):
911912
dttime = [num2date(t).replace(tzinfo=None) for t in self['time']]
912913
L1Pos = get_l1_position(dttime, units=self.pos.h['Units'], refframe=self.pos.h['ReferenceFrame'])
913914

914-
shift_vars_2 = ['density', 'btot', 'bt', 'bn', 'bx', 'bz'] # behave according to inverse-square law
915-
shift_vars = [v for v in shift_vars_2 if v in self.vars]
915+
if 'density' in self.vars:
916+
self['density'] = self['density'] * (self.pos['r']/L1Pos['r'])**(-2)
917+
918+
if 'btot' in self.vars:
919+
self['btot'] = self['btot'] * (self.pos['r']/L1Pos['r'])**(-1.49)
920+
921+
shift_vars_r = ['br', 'bx'] # radial component
922+
shift_vars = [v for v in shift_vars_r if v in self.vars] # behave according to 1/r
916923
for var in shift_vars:
917-
self[var] = self[var] * (self.pos['r']/L1Pos['r'])**(-2.)
924+
self[var] = self[var] * (self.pos['r']/L1Pos['r'])**(-1.94)
918925

919-
shift_vars_1 = ['bt', 'by']
920-
shift_vars = [v for v in shift_vars_1 if v in self.vars] # behave according to 1/r
926+
shift_vars_t = ['bt', 'by'] # tangential component
927+
shift_vars = [v for v in shift_vars_t if v in self.vars] # behave according to 1/r
928+
for var in shift_vars:
929+
self[var] = self[var] * (self.pos['r']/L1Pos['r'])**(-1.26)
930+
931+
shift_vars_n = ['bn', 'bz'] # normal component
932+
shift_vars = [v for v in shift_vars_n if v in self.vars] # behave according to 1/r
921933
for var in shift_vars:
922-
self[var] = self[var] * (self.pos['r']/L1Pos['r'])**(-1.)
923-
logger.info("shift_wind_to_L1: Extrapolated B and density values to L1 distance")
934+
self[var] = self[var] * (self.pos['r']/L1Pos['r'])**(-1.34)
935+
logger.info("shift_wind_to_L1: Scaled B and density values to L1 distance")
924936

925937
return self
926938

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
setuptools.setup(
99
name = "predstorm",
10-
version = "0.1",
10+
version = "0.1.1",
1111
author = "Helio4Cast Group, Graz Austria",
1212
author_email = "[email protected]",
1313
description = "Python3 package and scripts for space weather prediction research.",
1414
long_description = long_description,
1515
long_description_content_type = "text/markdown",
1616
url = "https://github.com/helioforecast/Predstorm",
17-
download_url = "https://github.com/helioforecast/Predstorm/archive/v_01.tar.gz",
17+
download_url = "https://github.com/helioforecast/Predstorm/archive/v_011.tar.gz",
1818
packages = setuptools.find_packages(),
1919
install_requires=[
2020
"numpy",

0 commit comments

Comments
 (0)