Skip to content

Commit

Permalink
updateRamIndices: workaround for https on some systems
Browse files Browse the repository at this point in the history
- Use SSLContext to avoid bad certification check on RHEL
- Update RamIndices.txt
  • Loading branch information
drsteve committed Sep 20, 2024
1 parent 49eb7fd commit 42a1acc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Scripts/updateRamIndices.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import ftplib
import io
import re
import ssl
from urllib import request
import numpy as np

Expand Down Expand Up @@ -51,7 +52,8 @@ def floatkp(kpstring):
# download updated F10.7 from http://spaceweather.gc.ca/solar_flux_data/daily_flux_values/fluxtable.txt
# only has data from 2004-10-28 (prior data are in different files)
f107url = 'http://spaceweather.gc.ca/solar_flux_data/daily_flux_values/fluxtable.txt'
conts = request.urlopen(f107url).read().decode()
gcontext = ssl.SSLContext() # Some systems have certification issues for https - workaround
conts = request.urlopen(f107url, context=gcontext).read().decode()

# get first line of data (needs regex as no linebreaks & odd spacing
# then split up, read dates, interpolate to requested JDs
Expand Down
31 changes: 31 additions & 0 deletions input/RamIndices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24318,3 +24318,34 @@ YYYYMMDD Kp_x8 f10.7
20240729 2.0 1.7 1.0 1.7 1.3 1.3 1.7 1.7 222.3
20240730 4.0 5.3 4.0 3.7 3.0 3.3 1.3 2.0 227.9
20240731 1.3 1.0 1.3 1.0 2.7 4.0 4.7 3.7 240.0
20240801 5.3 4.3 3.3 2.3 3.0 2.3 2.3 2.0 243.2
20240802 2.3 2.7 1.7 1.0 1.7 1.7 1.3 2.7 257.2
20240803 1.7 2.3 1.0 2.0 2.0 2.3 2.0 2.7 244.4
20240804 2.7 3.7 4.3 4.0 6.7 7.0 4.3 4.0 246.2
20240805 2.3 2.7 3.0 2.0 2.0 1.7 1.7 1.7 251.5
20240806 1.7 1.3 1.3 0.3 0.7 1.3 1.3 1.7 267.6
20240807 1.0 1.7 1.0 2.0 2.0 1.3 1.0 2.3 288.3
20240808 2.7 1.3 1.3 1.7 1.0 1.0 1.3 1.3 307.0
20240809 2.0 1.3 0.7 1.3 2.0 1.7 1.0 1.7 313.4
20240810 1.3 2.0 0.7 0.7 2.3 2.3 1.7 1.3 309.8
20240811 2.0 2.0 4.7 4.3 5.0 4.3 3.7 4.7 290.8
20240812 6.7 7.0 7.0 6.7 8.0 7.7 5.7 6.0 276.1
20240813 4.3 2.7 1.7 1.3 1.0 0.7 3.0 4.3 268.0
20240814 3.7 3.3 2.0 1.0 1.3 1.3 1.3 3.0 260.4
20240815 1.3 0.7 0.3 0.3 1.7 1.0 1.3 2.0 240.1
20240816 2.7 2.0 2.0 2.0 2.7 1.3 0.3 0.7 233.5
20240817 1.0 0.3 1.3 1.3 3.7 6.3 5.0 5.3 232.2
20240818 2.3 2.7 2.0 3.3 3.7 2.3 2.0 2.0 233.5
20240819 0.7 1.3 0.7 1.3 3.0 3.0 3.0 2.7 241.3
20240820 3.3 1.7 1.7 1.7 2.3 2.3 1.7 1.7 246.9
20240821 3.3 1.3 1.3 1.7 2.0 2.7 1.7 1.3 242.5
20240822 3.0 2.7 2.0 2.0 2.0 2.0 1.7 2.3 238.1
20240823 1.3 1.3 2.3 1.3 2.0 0.7 1.7 1.3 242.6
20240824 1.7 1.7 2.7 2.7 1.7 3.0 1.3 1.7 229.4
20240825 2.0 2.3 2.0 1.3 0.7 0.3 0.7 1.0 233.9
20240826 1.7 1.0 0.3 1.0 1.0 1.3 0.3 0.3 236.4
20240827 0.0 0.7 2.7 1.7 2.7 3.0 2.3 3.3 230.1
20240828 5.7 4.0 5.0 2.3 2.7 2.3 1.3 2.7 214.9
20240829 2.0 1.0 0.7 1.0 1.7 1.0 1.0 1.0 208.8
20240830 1.3 0.7 3.7 3.0 4.7 4.7 4.7 4.3 213.1
20240831 4.0 4.3 4.3 1.7 3.7 4.7 4.0 3.0 227.7

0 comments on commit 42a1acc

Please sign in to comment.