Skip to content

Commit

Permalink
update source for F10.7 which moved from FTP server to HTTPS
Browse files Browse the repository at this point in the history
Also updated RamIndices file to reflect recent changes
  • Loading branch information
drsteve committed Sep 9, 2024
1 parent 621be49 commit ebf12a4
Show file tree
Hide file tree
Showing 2 changed files with 523 additions and 8 deletions.
12 changes: 4 additions & 8 deletions 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
from urllib import request
import numpy as np


Expand Down Expand Up @@ -47,15 +48,10 @@ def floatkp(kpstring):
outJDs = [startjd + n + 0.5 for n in range(int(endjd-startjd))]
outdates = [lastdate+dt.timedelta(days=n+1) for n in range(int(endjd-startjd))]

# download updated F10.7 from ftp://ftp.geolab.nrcan.gc.ca/data/solar_flux/daily_flux_values/fluxtable.txt
# 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)
io_store = io.StringIO()
ftp = ftplib.FTP('ftp.seismo.nrcan.gc.ca')
ftp.login()
ftp.cwd('spaceweather/solar_flux/daily_flux_values')
ftp.retrlines('RETR {0}'.format('fluxtable.txt'), io_store.write)
io_store.seek(0)
conts = io_store.read()
f107url = 'http://spaceweather.gc.ca/solar_flux_data/daily_flux_values/fluxtable.txt'
conts = request.urlopen(f107url).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
Loading

0 comments on commit ebf12a4

Please sign in to comment.