Skip to content

Commit

Permalink
Merge pull request #1271 from dpshelio/noaa
Browse files Browse the repository at this point in the history
Updated SWPC/NOAA links
  • Loading branch information
ayshih committed Jan 23, 2015
2 parents 7655136 + 13d3bc8 commit 754a015
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
19 changes: 10 additions & 9 deletions sunpy/lightcurve/sources/noaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ class NOAAIndicesLightCurve(LightCurve):
References
----------
| http://www.swpc.noaa.gov/Data/index.html#indices
| http://www.swpc.noaa.gov/ftpdir/weekly/README3
| http://www.swpc.noaa.gov/ftpdir/weekly/RecentIndices.txt
| http://www.swpc.noaa.gov/SolarCycle/
| http://legacy-www.swpc.noaa.gov/Data/index.html#indices
| ftp://ftp.swpc.noaa.gov/pub/weekly/README3
| ftp://ftp.swpc.noaa.gov/pub/weekly/RecentIndices.txt
| http://www.swpc.noaa.gov/products/solar-cycle-progression
"""

def peek(self, axes=None, type='sunspot SWO', **plot_args):
Expand Down Expand Up @@ -78,7 +78,7 @@ def peek(self, axes=None, type='sunspot SWO', **plot_args):
@classmethod
def _get_default_uri(cls):
"""Return the url to download indices"""
return "http://www.swpc.noaa.gov/ftpdir/weekly/RecentIndices.txt"
return "ftp://ftp.swpc.noaa.gov/pub/weekly/RecentIndices.txt"

@staticmethod
def _get_url_for_date_range(*args, **kwargs):
Expand Down Expand Up @@ -125,9 +125,10 @@ class NOAAPredictIndicesLightCurve(LightCurve):
References
----------
| http://www.swpc.noaa.gov/Data/index.html#indices
| http://www.swpc.noaa.gov/ftpdir/weekly/Predict.txt
| http://www.swpc.noaa.gov/SolarCycle/
| http://legacy-www.swpc.noaa.gov/Data/index.html#indices
| http://services.swpc.noaa.gov/text/predicted-sunspot-radio-flux.txt
| http://www.swpc.noaa.gov/products/solar-cycle-progression
| http://www.swpc.noaa.gov/products-and-data
"""

def peek(self, axes=None, **plot_args):
Expand All @@ -154,7 +155,7 @@ def peek(self, axes=None, **plot_args):
@classmethod
def _get_default_uri(cls):
"""Return the url to download indices"""
return "http://www.swpc.noaa.gov/ftpdir/weekly/Predict.txt"
return "http://services.swpc.noaa.gov/text/predicted-sunspot-radio-flux.txt"

@staticmethod
def _get_url_for_date_range(*args, **kwargs):
Expand Down
8 changes: 4 additions & 4 deletions sunpy/lightcurve/tests/test_noaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_isempty(self):
@pytest.mark.online
def test_url(self):
"""Test creation with url"""
url = 'http://www.swpc.noaa.gov/ftpdir/weekly/RecentIndices.txt'
url = 'ftp://ftp.swpc.noaa.gov/pub/weekly/RecentIndices.txt'
lc1 = sunpy.lightcurve.NOAAIndicesLightCurve.create(url)
assert isinstance(lc1, sunpy.lightcurve.NOAAIndicesLightCurve)

Expand All @@ -37,7 +37,7 @@ def test_goes_timerange(self):
def test_get_url(self):
"""Test the getting of url"""
g = sunpy.lightcurve.NOAAIndicesLightCurve
assert g._get_url_for_date_range(timerange_a) == 'http://www.swpc.noaa.gov/ftpdir/weekly/RecentIndices.txt'
assert g._get_url_for_date_range(timerange_a) == 'ftp://ftp.swpc.noaa.gov/pub/weekly/RecentIndices.txt'

@pytest.mark.online
def test_header(self):
Expand Down Expand Up @@ -69,14 +69,14 @@ def test_goes_timerange(self):
@pytest.mark.online
def test_url(self):
"""Test creation with url"""
url = 'http://www.swpc.noaa.gov/ftpdir/weekly/Predict.txt'
url = 'http://services.swpc.noaa.gov/text/predicted-sunspot-radio-flux.txt'
lc1 = sunpy.lightcurve.NOAAPredictIndicesLightCurve.create(url)
assert isinstance(lc1, sunpy.lightcurve.NOAAPredictIndicesLightCurve)

def test_get_url(self):
"""Test the getting of url"""
g = sunpy.lightcurve.NOAAPredictIndicesLightCurve
assert g._get_url_for_date_range(timerange_a) == 'http://www.swpc.noaa.gov/ftpdir/weekly/Predict.txt'
assert g._get_url_for_date_range(timerange_a) == 'http://services.swpc.noaa.gov/text/predicted-sunspot-radio-flux.txt'

@pytest.mark.online
def test_header(self):
Expand Down

0 comments on commit 754a015

Please sign in to comment.