diff --git a/siphon/catalog.py b/siphon/catalog.py index 5116ed55c..fad2388fe 100644 --- a/siphon/catalog.py +++ b/siphon/catalog.py @@ -165,16 +165,16 @@ def __init__(self, catalog_url): The URL of a THREDDS client catalog """ - # top level server url - self.catalog_url = catalog_url - self.base_tds_url = _find_base_tds_url(catalog_url) - session = create_http_session() # get catalog.xml file - resp = session.get(self.catalog_url) + resp = session.get(catalog_url) resp.raise_for_status() + # top level server url + self.catalog_url = resp.url + self.base_tds_url = _find_base_tds_url(self.catalog_url) + # If we were given an HTML link, warn about it and try to fix to xml if 'html' in resp.headers['content-type']: import warnings @@ -186,7 +186,7 @@ def __init__(self, catalog_url): resp.raise_for_status() # begin parsing the xml doc - root = ET.fromstring(resp.text) + root = ET.fromstring(resp.content) self.catalog_name = root.attrib.get('name', 'No name found') self.datasets = DatasetCollection() @@ -305,8 +305,8 @@ def __init__(self, base_url, element_node): An :class:`~xml.etree.ElementTree.Element` representing a catalogRef node """ - self.name = element_node.attrib['name'] self.title = element_node.attrib['{http://www.w3.org/1999/xlink}title'] + self.name = element_node.attrib.get('name', self.title) # Resolve relative URLs href = element_node.attrib['{http://www.w3.org/1999/xlink}href'] @@ -440,21 +440,19 @@ def make_access_urls(self, catalog_url, all_services, metadata=None): # for each SimpleService if isinstance(service, CompoundService): for subservice in service.services: - access_urls[subservice.service_type] = (server_url + - subservice.base + - self.url_path) + server_base = urljoin(server_url, subservice.base) + access_urls[subservice.service_type] = urljoin(server_base, + self.url_path) else: - access_urls[service.service_type] = (server_url + - service.base + - self.url_path) + server_base = urljoin(server_url, service.base) + access_urls[service.service_type] = urljoin(server_base, self.url_path) # process access children of dataset elements for service_type in self.access_element_info: url_path = self.access_element_info[service_type] if service_type in all_service_dict: - access_urls[service_type] = (server_url + - all_service_dict[service_type].base + - url_path) + server_base = urljoin(server_url, all_service_dict[service_type].base) + access_urls[service_type] = urljoin(server_base, url_path) self.access_urls = access_urls diff --git a/siphon/cdmr/tests/test_coveragedataset.py b/siphon/cdmr/tests/test_coveragedataset.py index 8262f9135..40cd89ddd 100644 --- a/siphon/cdmr/tests/test_coveragedataset.py +++ b/siphon/cdmr/tests/test_coveragedataset.py @@ -3,17 +3,15 @@ # SPDX-License-Identifier: MIT """Test Coverage Dataset.""" -import warnings +import pytest from siphon.cdmr.coveragedataset import CoverageDataset from siphon.testing import get_recorder recorder = get_recorder(__file__) -# Ignore warnings about CoverageDataset -warnings.simplefilter('ignore') - +@pytest.mark.filterwarnings('ignore: CoverageDataset') @recorder.use_cassette('hrrr_cdmremotefeature') def test_simple_cdmremotefeature(): """Smoke test for CDMRemoteFeature.""" @@ -22,6 +20,7 @@ def test_simple_cdmremotefeature(): assert cd.grids +@pytest.mark.filterwarnings('ignore: CoverageDataset') @recorder.use_cassette('hrrr_cdmremotefeature') def test_simple_cdmremotefeature_str(): """Smoke test for converting CoverageDataset to str.""" diff --git a/siphon/radarserver.py b/siphon/radarserver.py index 4bce94772..35616d469 100644 --- a/siphon/radarserver.py +++ b/siphon/radarserver.py @@ -85,7 +85,7 @@ def _get_metadata(self): def _get_stations(self, station_file='stations.xml'): resp = self.get_path(station_file) - self.stations = parse_station_table(ET.fromstring(resp.text)) + self.stations = parse_station_table(ET.fromstring(resp.content)) def query(self): """Return a new query for the radar server. diff --git a/siphon/simplewebservice/wyoming.py b/siphon/simplewebservice/wyoming.py index b521559b1..35d5eaad6 100644 --- a/siphon/simplewebservice/wyoming.py +++ b/siphon/simplewebservice/wyoming.py @@ -4,6 +4,7 @@ """Read upper air data from the Wyoming archives.""" from io import StringIO +import warnings from bs4 import BeautifulSoup import numpy as np @@ -11,6 +12,8 @@ from .._tools import get_wind_components from ..http_util import HTTPEndPoint +warnings.filterwarnings('ignore', 'Pandas doesn\'t allow columns to be created', UserWarning) + class WyomingUpperAir(HTTPEndPoint): """Download and parse data from the University of Wyoming's upper air archive.""" diff --git a/siphon/tests/fixtures/rsmas_ramadda b/siphon/tests/fixtures/rsmas_ramadda new file mode 100644 index 000000000..4221f88b3 --- /dev/null +++ b/siphon/tests/fixtures/rsmas_ramadda @@ -0,0 +1,40 @@ +interactions: +- request: + body: null + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + User-Agent: [Siphon (0.6.0+16.gce11082.dirty)] + method: GET + uri: http://weather.rsmas.miami.edu/repository?output=thredds.catalog + response: + body: {string: "\n \n \n \n + \ \n \n \n \n \n \n \n \n \n \n \n\n"} + headers: + Connection: [Keep-Alive] + Content-Length: ['2258'] + Content-Type: [text/xml;charset=UTF-8] + Date: ['Tue, 31 Oct 2017 21:17:47 GMT'] + Keep-Alive: ['timeout=5, max=100'] + Server: [Apache] + Set-Cookie: ['ramadda_repository_session=b95d312c-74c4-464e-81d2-1ba4be8597f0_0.468476777107967; + path=/repository; expires=Tue, 26-Oct-2021 23:59:59 GMT'] + X-Frame-Options: [SAMEORIGIN] + status: {code: 200, message: '200'} +version: 1 diff --git a/siphon/tests/fixtures/rsmas_ramadda_datasets b/siphon/tests/fixtures/rsmas_ramadda_datasets new file mode 100644 index 000000000..275406764 --- /dev/null +++ b/siphon/tests/fixtures/rsmas_ramadda_datasets @@ -0,0 +1,203 @@ +interactions: +- request: + body: null + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + User-Agent: [Siphon (0.6.0+18.g872e2b9.dirty)] + method: GET + uri: http://weather.rsmas.miami.edu/repository?output=thredds.catalog + response: + body: {string: "\n \n \n \n + \ \n \n \n \n \n \n \n \n \n \n \n\n"} + headers: + Connection: [Keep-Alive] + Content-Length: ['2258'] + Content-Type: [text/xml;charset=UTF-8] + Date: ['Tue, 31 Oct 2017 22:39:54 GMT'] + Keep-Alive: ['timeout=5, max=100'] + Server: [Apache] + Set-Cookie: ['ramadda_repository_session=01515177-fb6e-4d76-ad7e-d534916cc3ee_0.5596476352415347; + path=/repository; expires=Tue, 26-Oct-2021 23:59:59 GMT'] + X-Frame-Options: [SAMEORIGIN] + status: {code: 200, message: '200'} +- request: + body: null + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + User-Agent: [Siphon (0.6.0+18.g872e2b9.dirty)] + method: GET + uri: http://weather.rsmas.miami.edu/repository/entry/show?entryid=5c0355aa-bcc1-4b90-808f-48ecc03b7989&output=thredds.catalog + response: + body: {string: "\n \n \n \n \n \n \n \n \n + \ \n \n \n \n \n + \ \n + \ \n + \ \n + \ \n + \ \n + \ 141262\n 2014-09-26 + 02:56:17 UTC\n \n 2014-09-26 02:56:17 + UTC\n 2014-09-26 02:56:17 UTC\n \n + \ \n \n \n + \ \n + \ \n + \ \n + \ \n + \ \n + \ 472724\n 2014-09-26 + 14:54:19 UTC\n \n 2011-11-24 00:00:00 + UTC\n 2011-11-29 00:00:00 UTC\n \n + \ \n \n \n\n"} + headers: + Connection: [Keep-Alive] + Content-Length: ['4034'] + Content-Type: [text/xml;charset=UTF-8] + Date: ['Tue, 31 Oct 2017 22:39:54 GMT'] + Keep-Alive: ['timeout=5, max=100'] + Server: [Apache] + Set-Cookie: ['ramadda_repository_session=76be331f-cd5a-443c-a119-947f7d1a28be_0.1308195297232102; + path=/repository; expires=Tue, 26-Oct-2021 23:59:59 GMT'] + X-Frame-Options: [SAMEORIGIN] + status: {code: 200, message: '200'} +- request: + body: null + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + User-Agent: [Siphon (0.6.0+18.g872e2b9.dirty)] + method: GET + uri: http://weather.rsmas.miami.edu/repository/entry/show?entryid=a43c1cc4-1cf2-4365-97b9-6768b8201407&output=thredds.catalog + response: + body: {string: "\n \n \n \n \n \n\n"} + headers: + Connection: [Keep-Alive] + Content-Length: ['793'] + Content-Type: [text/xml;charset=UTF-8] + Date: ['Tue, 31 Oct 2017 22:39:54 GMT'] + Keep-Alive: ['timeout=5, max=100'] + Server: [Apache] + Set-Cookie: ['ramadda_repository_session=af5601b1-1eae-4702-b80e-63859747829d_0.8163946096633592; + path=/repository; expires=Tue, 26-Oct-2021 23:59:59 GMT'] + X-Frame-Options: [SAMEORIGIN] + status: {code: 200, message: '200'} +- request: + body: null + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + User-Agent: [Siphon (0.6.0+18.g872e2b9.dirty)] + method: GET + uri: http://weather.rsmas.miami.edu/repository/entry/show?entryid=synth%3Aa43c1cc4-1cf2-4365-97b9-6768b8201407%3AL3YyYl91c2VzRUNPQQ%3D%3D&output=thredds.catalog + response: + body: {string: "\n + \ \n \n + \ \n + \ \n + \ \n \n \n \n + \ \n + \ \n + \ \n + \ \n + \ 6302\n 2014-04-10 + 21:49:19 UTC\n \n 2014-04-10 21:49:19 + UTC\n 2014-04-10 21:49:19 UTC\n \n + \ \n \n \n + \ \n + \ \n + \ \n + \ \n \n + \ \n + \ \n + \ \n + \ \n \n \n + \ \n + \ \n + \ \n + \ \n 2921048216\n + \ 2014-04-12 21:10:27 UTC\n \n + \ 2014-04-12 21:10:27 UTC\n 2014-04-12 21:10:27 + UTC\n \n \n \n + \ \n + \ \n + \ \n + \ \n + \ \n \n + \ \n + \ \n + \ \n + \ \n \n \n + \ \n + \ \n + \ \n + \ \n 2935653172\n + \ 2014-04-12 21:11:13 UTC\n \n + \ 2014-04-12 21:11:13 UTC\n 2014-04-12 21:11:13 + UTC\n \n \n \n \n \n \n\n"} + headers: + Connection: [Keep-Alive] + Content-Length: ['5790'] + Content-Type: [text/xml;charset=UTF-8] + Date: ['Tue, 31 Oct 2017 22:39:54 GMT'] + Keep-Alive: ['timeout=5, max=100'] + Server: [Apache] + Set-Cookie: ['ramadda_repository_session=5ef56a35-e108-48f7-b4fc-b187ebc7dab7_0.5765682928071657; + path=/repository; expires=Tue, 26-Oct-2021 23:59:59 GMT'] + X-Frame-Options: [SAMEORIGIN] + status: {code: 200, message: '200'} +version: 1 diff --git a/siphon/tests/fixtures/tds50_catalogref_follow b/siphon/tests/fixtures/tds50_catalogref_follow new file mode 100644 index 000000000..f3adb6282 --- /dev/null +++ b/siphon/tests/fixtures/tds50_catalogref_follow @@ -0,0 +1,616 @@ +interactions: +- request: + body: null + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + User-Agent: [Siphon (0.6.0+19.g94704ea.dirty)] + method: GET + uri: http://thredds-test.unidata.ucar.edu/thredds/catalog.xml + response: + body: {string: ''} + headers: + Access-Control-Allow-Origin: ['*'] + Connection: [Keep-Alive] + Content-Language: [en-US] + Content-Length: ['0'] + Content-Type: [application/xml] + Date: ['Wed, 01 Nov 2017 03:51:55 GMT'] + Keep-Alive: ['timeout=5, max=100'] + Location: [/thredds/catalog/catalog.xml] + Server: [Apache/2.4.27 (Unix) OpenSSL/1.0.1e-fips mod_jk/1.2.42] + X-Frame-Options: [SAMEORIGIN] + status: {code: 302, message: '302'} +- request: + body: null + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + User-Agent: [Siphon (0.6.0+19.g94704ea.dirty)] + method: GET + uri: http://thredds-test.unidata.ucar.edu/thredds/catalog/catalog.xml + response: + body: {string: "\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n + \ \r\n \r\n + \ \r\n \r\n \r\n \r\n \r\n \r\n + \ \r\n \r\n \r\n\r\n"} + headers: + Access-Control-Allow-Origin: ['*'] + Connection: [Keep-Alive] + Content-Language: [en-US] + Content-Type: [application/xml;charset=UTF-8] + Date: ['Wed, 01 Nov 2017 03:51:55 GMT'] + Keep-Alive: ['timeout=5, max=99'] + Server: [Apache/2.4.27 (Unix) OpenSSL/1.0.1e-fips mod_jk/1.2.42] + X-Frame-Options: [SAMEORIGIN] + status: {code: 200, message: '200'} +- request: + body: null + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + User-Agent: [Siphon (0.6.0+19.g94704ea.dirty)] + method: GET + uri: http://thredds-test.unidata.ucar.edu/thredds/catalog/idd/forecastModels.xml + response: + body: {string: "\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n fullServices\r\n edu.ucar.unidata\r\n + \ GRID\r\n GRIB-2\r\n + \ \r\n Freely + available\r\n Transmitted + through Unidata Internet Data Distribution.\r\n Read by CDM Grib Collection.\r\n + \ \r\n \r\n \r\n DOC/NOAA/NWS/NCEP\r\n + \ \r\n \r\n \r\n National + Oceanic and Atmospheric Administration (NOAA)/National Weather Service (NWS)\r\n + \ National Center for Environmental Prediction (NCEP)\r\n \r\n \r\n \r\n UCAR/UNIDATA\r\n + \ \r\n \r\n \r\n University + Corporation for Atmospheric Research (UCAR)/Unidata\r\n \r\n + \ \r\n \r\n present\r\n + \ 45 days\r\n \r\n \r\n + \ \r\n \r\n NCEP Global + Ensemble Forecasting System (GEFS) Global one degree Lat/Lon grid. Model runs + are made at 0, 6, 12, 18 ... hours out to 378 hours (16 days). Horizontal + = 181 by 360 points, resolution 1 degree, Lat/Lon projection. Vertical = 2000 + to 1000 hPa mandatory pressure levels (7 levels); pressure, height above ground, + pressure_difference_layers.\r\n \r\n \r\n + \ \r\n Ensemble + members - Analysis grids only.\r\n \r\n + \ \r\n \r\n \r\n Ensemble members.\r\n \r\n + \ \r\n \r\n \r\n + \ Ensemble derived products: mean, + spread, and probabilities.\r\n \r\n \r\n + \ \r\n \r\n + \ \r\n NCEP + Global Forecast System Model, previously called AVN/MRF (Medium Range Forecast)\r\n + \ \r\n \r\n \r\n \r\n \r\n + \ NCEP GFS Model : AWIPS 230 (G) Grid. + Global Lat/Lon grid. Model runs at 0, 6, 12, and 18Z. Horizontal= 721 by 14400 + points, resolution 0.25 degree, Lat/Lon projection. Vertical= 1000 to 100 + hPa mandatory pressure levels (26 levels); surface, height above ground, pressure + layers.\r\n \r\n \r\n \r\n Analysis grids only.\r\n \r\n + \ \r\n \r\n \r\n Forecasts grids starting from the 0 hour forecast every 3 + hours out to 10 days, then 12 hour forecasts for days 10-16.\r\n + \ \r\n \r\n \r\n \r\n \r\n + \ NCEP GFS Model : AWIPS 230 (G) Grid. + Global Lat/Lon grid. Model runs at 0, 6, 12, and 18Z. Horizontal= 361 by 720 + points, resolution 0.5 degree, Lat/Lon projection. Vertical= 1000 to 100 hPa + mandatory pressure levels (10 levels); surface, height above ground, pressure + layers.\r\n \r\n \r\n \r\n Analysis grids only.\r\n \r\n + \ \r\n \r\n \r\n Forecasts grids starting from the 0 hour forecast every 3 + hours out to 10 days, then 12 hour forecasts for days 10-16.\r\n + \ \r\n \r\n \r\n \r\n \r\n + \ NCEP GFS Model : AWIPS 229 (F) Grid. + Global Lat/Lon grid. Model runs are made at 0, 6, 12, and 18Z. Horizontal + = 181 by 360 points, resolution 1 degree, Lat/Lon projection. Vertical = 1000 + to 100 hPa mandatory pressure levels (10 levels); surface, height above ground, + pressure layers.\r\n \r\n \r\n + \ \r\n Analysis + grids only.\r\n \r\n \r\n + \ \r\n + \ \r\n Forecasts + grids starting from the 0 hour forecast every 3 hours out to 192 hours (8 + days).\r\n \r\n \r\n + \ \r\n \r\n + \ \r\n NCEP + GFS Model : AWIPS 228 (A) Grid. Global Lat/Lon grid. Model runs every 12 hours + from 204 to 384 hours (8 to 16 days). Horizontal= 73 by 144 points, resolution + 2.5 degree, Lat/Lon projection. Vertical = 1000 to 100 hPa mandatory pressure + levels (10 levels); surface, height above ground, pressure layers.\r\n + \ \r\n \r\n \r\n \r\n + \ NCEP GFS Model : AWIPS 003 (A) Grid. + Global Lat/Lon grid. Model runs are made at 0, 6, 12, and 18Z, with forecasts + every 6 hours from 0 to 240 hours (0 to 10 days). Horizontal= 181 by 360 points, + resolution 1.0 degree, Lat/Lon projection. Vertical = 1000 to 70 hPa mandatory + pressure levels (12 levels); surface, height above ground, pressure layers.\r\n + \ \r\n \r\n \r\n + \ \r\n NCEP + GFS Model : Mercator Grid over most of the Pacific. longitude 110 W to 110 + E. Model runs are made at 0, 6, 12, and 18Z, with analysis and forecasts every + 6 hours out 10 days. Horizontal = 300 by 369 points, resolution 40 km, Mercator + projection. Vertical = 1000 to 100 hPa mandatory pressure levels (29 levels); + surface, height above ground, pressure layers.\r\n \r\n + \ \r\n \r\n + \ \r\n NCEP + GFS Model : Mercator Grid over most of the Pacific; longitude 110 W to 110 + E. Model runs are made at 0, 6, 12, and 18Z, with analysis and forecasts every + 3 hours out to 84 hours, and every 6 hours out to 10 days. Horizontal = 600 + by 737 points, resolution 20 km, Mercator projection. Vertical = 1000 to 100 + hPa mandatory pressure levels (29 levels); surface, height above ground, pressure + layers.\r\n \r\n \r\n + \ \r\n \r\n NCEP GFS Model : Puerto_Rico 0.5 degree Lat/Lon grid. Model + runs are made at 0, 6, 12, 18 hours out to 10 days. Horizontal = 102 by 107 + points, resolution .5 degree, Lat/Lon projection. Vertical = 1000 to 100 hPa + mandatory pressure levels (29 levels); surface, height above ground, pressure + layers.\r\n \r\n \r\n + \ \r\n \r\n NCEP GFS Model : Puerto_Rico 0.25 degree Lat/Lon grid. Model + runs are made at 0, 6, 12, and 18Z, with analysis and forecasts every 3 hours + out to 84 hours, and every 6 hours out to 10 days. Horizontal = 204 by 213 + points, resolution 0.25 degree, Lat/Lon projection. Vertical = 1000 to 100 + hPa mandatory pressure levels (29 levels); surface, height above ground, pressure + layers.\r\n \r\n \r\n + \ \r\n + \ GRIB-1\r\n \r\n + \ NCEP GFS Model : AWIPS 211 (Q) Grid. + Regional - CONUS (Lambert Conformal). Model runs are made at 0, 6, 12, and + 18Z, with analysis and forecasts every 6 hours out 10 days. Horizontal = 93 + by 65 points, resolution 81.27 km, LambertConformal projection. Vertical = + 1000 to 100 hPa pressure levels (29 levels); surface, height above ground, + pressure layers.\r\n \r\n \r\n + \ \r\n + \ GRIB-1\r\n \r\n + \ NCEP GFS Model : AWIPS 215 (Q) Grid. + Regional - CONUS (Lambert Conformal). Model runs are made at 0, 6, 12, and + 18Z, with analysis and forecasts every 3 hours out to 84 hours, and every + 6 hours out to 10 days. Horizontal = 372 by 260 points, resolution 20 km, + LambertConformal projection. Vertical = 1000 to 100 hPa pressure levels (29 + levels); surface, height above ground, pressure layers.\r\n + \ \r\n \r\n \r\n + \ GRIB-2\r\n \r\n + \ NCEP GFS Model : AWIPS 213 (H) Grid. + National - CONUS - Double Resolution (polar stereographic). Model runs are + made at 0, 6, 12, and 18Z, with analysis and forecasts every 6 hours out 4 + days. Horizontal = 129 by 85 points, resolution 95.25 km, Polar Stereographic + projection. Vertical = 1000 to 100 hPa mandatory pressure levels (10 levels); + surface, height above ground, pressure layers.\r\n \r\n + \ \r\n \r\n + \ GRIB-2\r\n \r\n + \ NCEP GFS Model : AWIPS 217 (H) Grid. + National - Alaska - Double Resolution (polar stereographic). Model runs are + made at 0, 6, 12, and 18Z, with analysis and forecasts every 3 hours out to + 84 hours, and every 6 hours out to 10 days. Horizontal = 520 by 340 points, + resolution 20 km, Polar Stereographic projection. Vertical = 1000 to 100 hPa + pressure levels (29 levels); surface, height above ground, pressure layers.\r\n + \ \r\n \r\n \r\n \r\n \r\n + \ fullServices\r\n edu.ucar.unidata\r\n + \ GRID\r\n GRIB-2\r\n + \ \r\n \r\n \r\n \r\n \r\n \r\n \r\n NCEP High + Resolution Rapid Refresh\r\n \r\n NCEP + HRRR Model : AWIPS 184 (C) Grid. 2.5 km NDFD grid over CONUS (Lambert Conformal). + Model runs are made hourly. Horizontal = 2145 by 1377 points, resolution 2.5 + km, Lambert Conformal projection. Vertical = 1000 to 500 hPa mandatory pressure + levels (5 levels); surface, height above ground, pressure layers.\r\n + \ \r\n \r\n GRIB-2\r\n + \ \r\n This + collection contains analysis grids only.\r\n \r\n + \ \r\n \r\n + \ GRIB-2\r\n \r\n + \ Forecasts grids every hour out + 15 hours.\r\n \r\n \r\n + \ \r\n \r\n \r\n \r\n NCEP Nonhydrostatic Mesoscale Model (NMM) and Gridpoint Statistical + Interpolation (GSI) analysis, running in the Weather Research and Forecasting + (WRF) infrastructure.\r\n \r\n \r\n \r\n \r\n \r\n NCEP North + American Model: AWIPS 242 (S) Grid over Alaska. Model runs are made at 0, + 6, 12, 18Z with analysis and forecasts every 3 hours out to 84 hours (3.5 + days). Horizontal = 553 by 425 points, resolution 11.25 km, Polar Stereographic + projection. Vertical = 1000 to 100 hPa pressure levels.\r\n + \ \r\n \r\n \r\n \r\n + \ GRIB-1\r\n NCEP + North American Model : AWIPS 216 (V) grid over Alaska. Model runs are made + at 0 and 12Z, with analysis and forecasts every 3 hours out to 60 hours. Horizontal + = 139 by 107 points, resolution 45.0 km, Polar Stereographic projection. Vertical + = 1000 to 50 hPa pressure levels.\r\n \r\n + \ \r\n \r\n \r\n NCEP North American Model : AWIPS 216 (V) grid over Alaska. + Model runs are made at 00Z, 06Z, 12Z, and 18Z with analysis and forecasts + every 3 hours out to 84 hours (3.5 days). Horizontal = 139 by 107 points, + resolution 45.0 km, Polar Stereographic projection. Vertical = 1000 to 50 + hPa pressure levels.\r\n \r\n \r\n + \ \r\n + \ \r\n GRIB-1\r\n + \ NCEP North American Model : AWIPS + 207 (N) Regional - Alaska. Model runs are made at 0 and 12Z, with analysis + and forecasts every 6 hours out to 60 hours. Horizontal = 49 by 35 points, + resolution 95.25 km, Stereographic projection. Vertical = 1000 to 100 hPa + pressure levels.\r\n \r\n \r\n + \ \r\n \r\n NCEP North American Model : AWIPS 218 (B) grid over the continental + United States. Model runs are made at 06Z, 12Z, 18Z and 00Z, with analysis + and forecasts every 3 hours out to 84 hours (3.5 days). Horizontal = 614 by + 428 points, resolution 12.19 km, LambertConformal projection. Vertical = 1000 + to 100 hPa pressure levels (29).\r\n \r\n + \ \r\n \r\n \r\n NCEP North American Model : AWIPS 218 (B) grid over the continental + United States. Model runs are made at 06Z, 12Z, 18Z and 00Z, with analysis + and forecasts every hour, out to 36 hours, and then every three hours out + to 84 hours (3.5 days). Horizontal = 614 by 428 points, resolution 12.19 km, + LambertConformal projection. Vertical = small number of mandatory pressure + levels, lots of surface fields.\r\n \r\n + \ \r\n \r\n + \ \r\n GRIB-1\r\n + \ Model runs are made at 00Z, and + 12Z with analysis and forecasts every 3 hours out to 60 hours; and at 06Z, + and 18Z with analysis and forecasts every 3 hours out to 48 hours. Vertical + = surface, height above ground, and 1000 to 30 hPa pressure levels.\r\n + \ \r\n \r\n \r\n + \ \r\n NCEP + North American Model : AWIPS 212 (R) Regional - CONUS - Double Resolution. + Horizontal = 185 by 129 points, resolution 40.63 km; LambertConformal projection. + Vertical = surface, 1000 to 50 hPa pressure levels, layers, and depth. Model + runs are made at 00Z, 06Z, 12Z, and 18Z and have analysis and forecasts every + 3 hours out to 84 hours.\r\n \r\n \r\n + \ \r\n + \ \r\n GRIB-1\r\n + \ NCEP North American Model : AWIPS + 211 (Q) Regional - CONUS (Lambert Conformal). Model runs are made at 12Z and + 00Z, with analysis and forecasts every 6 hours out to 60 hours. Horizontal + = 93 by 65 points, resolution 81.27 km, LambertConformal projection. Vertical + = 1000 to 100 hPa pressure levels.\r\n \r\n + \ \r\n \r\n + \ \r\n NCEP + North American Model : AWIPS 105 Grid. Model runs are made at 0, 6, 12, and + 18Z, with analysis and forecasts every 3 hours out to 84 hours. Horizontal + = 147 by 110 points, resolution 90.75 km, Polar Stereographic projection. + Vertical = 1000 to 50 hPa pressure levels.\r\n \r\n + \ \r\n \r\n + \ \r\n The + FWIS runs are high resolution innermost nests of the new NAM that are placeable + within either the 4 km CONUS or 6 km Alaska nests that run each cycle at 00z, + 06z, 12z and 18z, with forecasts to 36 hours. If it is placed inside the CONUS, + then it runs with a 1.33 km horizontal spacing using a 375x375x60 grid. If + it is placed inside Alaska, then it runs with a 1.5 km horizontal spacing + using a 333x333x60 grid. FWIS runs on a rotated lat-long grid and uses a B-grid + stagger of variables. The vertical coordinate and resolution are identical + to NAM and its nests \u2013 i.e. sigma-pressure hybrid with a top at 2 mb. + For FWIS inside CONUS, all output fields are mapped to a 1.27 km Lambert conic + conformal grid whose size varies to encompass as completely as possible the + FWIS computational domain. For FWIS inside Alaska, all output fields are mapped + to a 1.48825 km polar-stereographic grid whose size varies to encompass as + completely as possible the FWIS computational domain.\r\n + \ \r\n \r\n + \ \r\n \r\n \r\n \r\n NCEP Rapid Refresh (RR / RAP)) Model: frequently updated + short-range weather forecasts. Replaced the Rapid Update Cycle (RUC/RUC2) + on 05 May 2012 12Z. Model runs are made hourly, with analysis and hourly forecasts + out to 3 hours; on the 0, 3, 6, 9, 12, 15, 18, and 21Z runs, the hourly forecasts + go out to 12 hours\r\n \r\n \r\n + \ \r\n \r\n Horizontal = 337 by 451 points, resolution 13.55 km, LambertConformal + projection.\r\n \r\n \r\n + \ \r\n \r\n Horizontal = 301 by 225 points, resolution 20.31 km, Lambert + Conformal projection.\r\n \r\n \r\n + \ \r\n \r\n GRIB-2\r\n + \ Horizontal = 151 by 113 points, + resolution 40.63 km, LambertConformal projection.\r\n \r\n + \ \r\n \r\n \r\n \r\n NCEP Short Range Ensemble Forecast (SREF)\r\n + \ \r\n \r\n \r\n \r\n + \ NCEP Short Range Ensemble Forecast + (SREF) 40km derived products: mean, spread, and probability, over CONUS with + 185 by 129 points, resolution 40 km. Models are run daily at 3,9,15,and 21Z. + Forecasts every 3 hours from 3 to 87 hours.\r\n \r\n + \ \r\n \r\n + \ \r\n NCEP + Short Range Ensemble Forecast (SREF) 40km derived products: bias-corrected + mean, spread, and probability, over CONUS with 185 by 129 points, resolution + 40 km. Models are run daily at 3,9,15,and 21Z. Forecasts every 3 hours from + 3 to 87 hours.\r\n \r\n \r\n + \ \r\n \r\n + \ NCEP SREF Alaska 45km derived products:mean, + spread, and probability.\r\n \r\n \r\n + \ \r\n + \ \r\n NCEP + SREF Pacific NE 0.4 degree derived products:mean, spread, and probability.\r\n + \ \r\n \r\n \r\n \r\n \r\n + \ NCEP Wave Watch III (WW3): US National + Weather Service gridded forecasts of sensible weather elements.\r\n + \ \r\n \r\n \r\n \r\n 720 by 336 + points, resolution 30 minute. Models are run daily at 0Z, 6Z, 12Z and 18Z. + Forecasts every 3 hours from 0 to 72, every 6 hours from 72 to 180 hours.\r\n + \ \r\n \r\n \r\n \r\n 401 by 187 points, resolution 10 minute. Models are run daily + at 0Z, 6Z, 12Z and 18Z. Forecasts every 3 hours from 0 to 72, every 6 hours + from 72 to 180 hours.\r\n \r\n \r\n + \ \r\n \r\n 548 by 391 points, resolution 4 minute. Models are run daily + at 0Z, 6Z, 12Z and 18Z. Forecasts every 3 hours from 0 to 72, every 6 hours + from 72 to 180 hours.\r\n \r\n \r\n + \ \r\n \r\n + \ 511 by 301 points, resolution 10 + minute. Models are run daily at 0Z, 6Z, 12Z and 18Z. Forecasts every 3 hours + from 0 to 72, every 6 hours from 72 to 180 hours.\r\n \r\n + \ \r\n \r\n \r\n + \ 301 by 331 points, resolution 10 + minute. Models are run daily at 0Z, 6Z, 12Z and 18Z. Forecasts every 3 hours + from 0 to 72, every 6 hours from 72 to 180 hours.\r\n \r\n + \ \r\n \r\n \r\n + \ 241 by 151 points, resolution 10 + minute. Models are run daily at 0Z, 6Z, 12Z and 18Z. Forecasts every 3 hours + from 0 to 72, every 6 hours from 72 to 180 hours.\r\n \r\n + \ \r\n \r\n \r\n + \ 586 by 481 points, resolution 4 + minute. Models are run daily at 0Z, 6Z, 12Z and 18Z. Forecasts every 3 hours + from 0 to 72, every 6 hours from 72 to 180 hours.\r\n \r\n + \ \r\n \r\n \r\n + \ 736 by 526 points, resolution 4 + minute. Models are run daily at 0Z, 6Z, 12Z and 18Z. Forecasts every 3 hours + from 0 to 72, every 6 hours from 72 to 180 hours.\r\n \r\n + \ \r\n \r\n \r\n \r\n \r\n fullServices\r\n + \ edu.ucar.unidata\r\n Grid\r\n + \ GRIB-1\r\n \r\n Freely + available\r\n Transmitted + through Unidata Internet Data Distribution.\r\n Read by CDM Grib Collection.\r\n + \ \r\n Fleet Numerical Meteorology + and Oceanography Center(FNMOC)\r\n \r\n \r\n \r\n University + Corporation for Atmospheric Research (UCAR)/Unidata\r\n \r\n + \ \r\n \r\n present\r\n + \ 45 days\r\n \r\n \r\n + \ \r\n + \ \r\n \r\n + \ FNMOC NAVGEM Global_0p5deg Model + : Global Lat/Lon grid. Model runs are made at 0, 6, 12, and 18Z, with analysis + and forecasts every 3 hours out 66 hours. Horizontal = 361 by 720 points, + resolution 0.5 degree, Lat/Lon projection. Vertical = 1013 to 4 hPa pressure + levels (33 levels); surface, height above ground, pressure layers.\r\n + \ \r\n \r\n \r\n \r\n \r\n + \ \r\n \r\n \r\n + \ \r\n FNMOC + WW3 Global_1p0deg Model : Global Lat/Lon grid. Model runs are made at 0, and + 12Z, with analysis and forecasts every 3 hours out 24 hours then every 6 hours + out 180 hours. Horizontal= 181 by 360 points, resolution 1 degree, Lat/Lon + projection.\r\n \r\n \r\n + \ \r\n + \ \r\n FNMOC + WW3 Europe Model : Global Lat/Lon grid. Model runs are made at 0, and 12Z, + with analysis and forecasts every 6 hours out 72 hours. Horizontal= 188 by + 301 points, resolution .2 degree, Lat/Lon projection.\r\n + \ \r\n \r\n \r\n \r\n + \ \r\n \r\n \r\n \r\n \r\n FNMOC FAROP Global_1p0deg Model : Global Lat/Lon grid. Model + runs are made at 0, 6, 12, and 18Z, with analysis and forecasts every 3 hours + out 9 hours. Horizontal= 181 by 360 points, resolution 1 degree, Lat/Lon projection.\r\n + \ \r\n \r\n \r\n \r\n + \ \r\n \r\n \r\n \r\n \r\n \r\n + \ FNMOC COAMPS Western Atlantic Model + : Global Lat/Lon grid. Model runs are made at 0 and 12Z, with analysis and + forecasts every 3 hours out 72 hours. Horizontal= 176 by 191 points, resolution + .2 degree, Lat/Lon projection.\r\n \r\n + \ \r\n \r\n + \ \r\n FNMOC + COAMPS Europe Model : Global Lat/Lon grid. Model runs are made at 0 and 12Z, + with analysis and forecasts every 6 hours out 96 hours. Horizontal= 186 by + 301 points, resolution .2 degree, Lat/Lon projection.\r\n + \ \r\n \r\n \r\n \r\n FNMOC COAMPS Equatorial America Model : Global Lat/Lon grid. + Model runs are made at 0 and 12Z, with analysis and forecasts every 3 hours + out 48 hours. Horizontal= 298 by 461 points, resolution 0.15 degree, Lat/Lon + projection.\r\n \r\n \r\n + \ \r\n \r\n FNMOC COAMPS Northeastern Pacific Model : Global Lat/Lon + grid. Model runs are made at 0 and 12Z, with analysis and forecasts every + 3 hours out 48 hours. Horizontal= 156 by 271 points, resolution .2 degree, + Lat/Lon projection.\r\n \r\n \r\n + \ \r\n \r\n + \ FNMOC COAMPS Southern California + Model : Global Lat/Lon grid. Model runs are made at 0 and 12Z, with analysis + and forecasts every 3 hours out 48 hours. Horizontal= 141 by 128 points, resolution + .15 degree, Lat/Lon projection.\r\n \r\n + \ \r\n \r\n \r\n \r\n + \ \r\n \r\n \r\n \r\n FNMOC NCODA Model : Global Lat/Lon grid. Model runs are made + at 12Z, with analysis and forecasts at 0Z. Horizontal= 721 by 1440 points, + resolution .25 degree, Lat/Lon projection.\r\n \r\n + \ \r\n \r\n \r\n\r\n"} + headers: + Access-Control-Allow-Origin: ['*'] + Connection: [Keep-Alive] + Content-Language: [en-US] + Content-Type: [application/xml;charset=UTF-8] + Date: ['Wed, 01 Nov 2017 03:51:55 GMT'] + Keep-Alive: ['timeout=5, max=100'] + Server: [Apache/2.4.27 (Unix) OpenSSL/1.0.1e-fips mod_jk/1.2.42] + X-Frame-Options: [SAMEORIGIN] + status: {code: 200, message: '200'} +version: 1 diff --git a/siphon/tests/test_catalog.py b/siphon/tests/test_catalog.py index 4e00d5137..9b5497a25 100644 --- a/siphon/tests/test_catalog.py +++ b/siphon/tests/test_catalog.py @@ -5,7 +5,6 @@ from datetime import datetime import logging -import warnings import pytest @@ -98,14 +97,12 @@ def test_simple_point_feature_collection_xml(): @recorder.use_cassette('html_then_xml_catalog') -def test_html_link(): +def test_html_link(recwarn): """Test that we fall-back when given an HTML catalog page.""" - with warnings.catch_warnings(): - warnings.simplefilter('ignore') - url = ('http://thredds-test.unidata.ucar.edu/thredds/catalog/' - 'grib/NCEP/RAP/CONUS_13km/catalog.html') - cat = TDSCatalog(url) - assert cat + url = ('http://thredds-test.unidata.ucar.edu/thredds/catalog/' + 'grib/NCEP/RAP/CONUS_13km/catalog.html') + TDSCatalog(url) + assert 'Changing' in str(recwarn.pop(UserWarning).message) @recorder.use_cassette('follow_cat') @@ -238,3 +235,34 @@ def test_simple_service_within_compound(): assert (cat.datasets[0].access_urls == {'HTTPServer': 'http://thredds-test.unidata.ucar.edu/thredds/fileServer/noaaport/' 'text/tropical/atlantic/hdob/High_density_obs_20170824.txt'}) + + +@recorder.use_cassette('rsmas_ramadda') +def test_ramadda_catalog(): + """Test parsing a catalog from RAMADDA.""" + url = 'http://weather.rsmas.miami.edu/repository?output=thredds.catalog' + cat = TDSCatalog(url) + assert len(cat.catalog_refs) == 12 + + +@recorder.use_cassette('rsmas_ramadda_datasets') +def test_ramadda_access_urls(): + """Test creating access urls from a catalog from RAMADDA.""" + url = 'http://weather.rsmas.miami.edu/repository?output=thredds.catalog' + + # Walk down a few levels to where we can get a dataset + cat = (TDSCatalog(url).catalog_refs[0].follow().catalog_refs[0].follow() + .catalog_refs[0].follow()) + + ds = cat.datasets[3] + assert ds.access_urls['opendap'] == ('http://weather.rsmas.miami.edu/repository/opendap/' + 'synth:a43c1cc4-1cf2-4365-97b9-6768b8201407:L3YyYl91c' + '2VzRUNPQS9keW5hbW9fYmFzaWNfdjJiXzIwMTFhbGwubmM=' + '/entry.das') + + +@recorder.use_cassette('tds50_catalogref_follow') +def test_tds50_catalogref_follow(): + """Test following a catalog ref url on TDS 5.""" + cat = TDSCatalog('http://thredds-test.unidata.ucar.edu/thredds/catalog.xml') + assert len(cat.catalog_refs[0].follow().catalog_refs) == 59