.checkignore .codeclimate.yml .codecov.yml .gitattributes .mailmap .prospector.yaml .stickler.yml AUTHORS.txt LICENSE README coverage.xml environment.yml ci/Minimum ci/Prerelease ci/doc_requirements.txt ci/extra_requirements.txt ci/gen_versions_json.py ci/linting_requirements.txt ci/requirements.txt ci/test_requirements.txt docs/CONTRIBUTING.md docs/Makefile docs/citing.rst docs/conf.py docs/developerguide.rst docs/index.rst docs/installguide.rst docs/make.bat docs/requirements.txt examples/Basic_Usage.py examples/README.txt examples/Radar_Server_Level_3.py siphon/__init__.py siphon/_tools.py siphon/_version.py siphon/catalog.py siphon/http_util.py siphon/metadata.py siphon/ncss.py siphon/ncss_dataset.py siphon/radarserver.py siphon/testing.py siphon.egg-info/PKG-INFO siphon.egg-info/SOURCES.txt siphon.egg-info/dependency_links.txt siphon.egg-info/requires.txt siphon.egg-info/top_level.txt talks/AMS-2016_Siphon_Poster_Final.pdf docs/_static/siphon_150x150.png docs/_static/siphon_150x150_white_bg.png docs/_static/tds-logo.png docs/_static/theme_override.css docs/_templates/breadcrumbs.html docs/_templates/footer.html docs/api/catalog.rst docs/api/http_util.rst docs/api/index.rst docs/api/metadata.rst docs/api/ncss.rst docs/api/ncssdataset.rst docs/api/radarserver.rst docs/api/simplewebservice.rst examples/acis/Basic_Overview.py examples/acis/Mapping_Example.py examples/acis/readme.txt examples/ncss/NCSS_Cartopy_Example.py examples/ncss/NCSS_Example.py examples/ncss/NCSS_Timeseries_Examples.py examples/ncss/README.txt examples/ndbc/README.txt examples/ndbc/buoy_met_request.py examples/ndbc/buoy_type_request.py examples/ndbc/latest_request.py examples/upperair/IGRA2_Request.py examples/upperair/README.txt examples/upperair/Wyoming_Request.py siphon/__pycache__/__init__.cpython-38.pyc siphon/__pycache__/_tools.cpython-38.pyc siphon/__pycache__/_version.cpython-38.pyc siphon/__pycache__/catalog.cpython-38.pyc siphon/__pycache__/http_util.cpython-38.pyc siphon/__pycache__/metadata.cpython-38.pyc siphon/__pycache__/ncss.cpython-38.pyc siphon/__pycache__/ncss_dataset.cpython-38.pyc siphon/__pycache__/radarserver.cpython-38.pyc siphon/__pycache__/testing.cpython-38.pyc siphon/cdmr/__init__.py siphon/cdmr/cdmremote.py siphon/cdmr/cdmremotefeature.py siphon/cdmr/cdmrfeature_pb2.py siphon/cdmr/coveragedataset.py siphon/cdmr/dataset.py siphon/cdmr/ncStream_pb2.py siphon/cdmr/ncstream.py siphon/cdmr/resources.md siphon/cdmr/xarray_support.py siphon/simplewebservice/__init__.py siphon/simplewebservice/acis.py siphon/simplewebservice/iastate.py siphon/simplewebservice/igra2.py siphon/simplewebservice/ndbc.py siphon/simplewebservice/wyoming.py siphon/tests/test_acis.py siphon/tests/test_catalog.py siphon/tests/test_catalog_access.py siphon/tests/test_http_util.py siphon/tests/test_iastate.py siphon/tests/test_igra2.py siphon/tests/test_metadata.py siphon/tests/test_ncss.py siphon/tests/test_ncss_dataset.py siphon/tests/test_ndbc.py siphon/tests/test_radarsever.py siphon/tests/test_wyoming.py siphon/cdmr/__pycache__/__init__.cpython-38.pyc siphon/cdmr/__pycache__/cdmremote.cpython-38.pyc siphon/cdmr/__pycache__/cdmremotefeature.cpython-38.pyc siphon/cdmr/__pycache__/cdmrfeature_pb2.cpython-38.pyc siphon/cdmr/__pycache__/coveragedataset.cpython-38.pyc siphon/cdmr/__pycache__/dataset.cpython-38.pyc siphon/cdmr/__pycache__/ncStream_pb2.cpython-38.pyc siphon/cdmr/__pycache__/ncstream.cpython-38.pyc siphon/cdmr/__pycache__/xarray_support.cpython-38.pyc siphon/cdmr/tests/test_cdmremote.py siphon/cdmr/tests/test_cdmremotefeature.py siphon/cdmr/tests/test_coveragedataset.py siphon/cdmr/tests/test_dataset.py siphon/cdmr/tests/test_ncstream.py siphon/cdmr/tests/test_xarray.py siphon/simplewebservice/__pycache__/__init__.cpython-38.pyc siphon/simplewebservice/__pycache__/acis.cpython-38.pyc siphon/simplewebservice/__pycache__/iastate.cpython-38.pyc siphon/simplewebservice/__pycache__/igra2.cpython-38.pyc siphon/simplewebservice/__pycache__/ndbc.cpython-38.pyc siphon/simplewebservice/__pycache__/wyoming.cpython-38.pyc siphon/tests/__pycache__/test_acis.cpython-38-pytest-6.2.3.pyc siphon/tests/__pycache__/test_catalog.cpython-38-pytest-6.2.3.pyc siphon/tests/__pycache__/test_catalog_access.cpython-38-pytest-6.2.3.pyc siphon/tests/__pycache__/test_http_util.cpython-38-pytest-6.2.3.pyc siphon/tests/__pycache__/test_iastate.cpython-38-pytest-6.2.3.pyc siphon/tests/__pycache__/test_igra2.cpython-38-pytest-6.2.3.pyc siphon/tests/__pycache__/test_metadata.cpython-38-pytest-6.2.3.pyc siphon/tests/__pycache__/test_ncss.cpython-38-pytest-6.2.3.pyc siphon/tests/__pycache__/test_ncss_dataset.cpython-38-pytest-6.2.3.pyc siphon/tests/__pycache__/test_ndbc.cpython-38-pytest-6.2.3.pyc siphon/tests/__pycache__/test_radarsever.cpython-38-pytest-6.2.3.pyc siphon/tests/__pycache__/test_wyoming.cpython-38-pytest-6.2.3.pyc siphon/tests/fixtures/GFS_Global_0p5_Grid_Dataset_xml siphon/tests/fixtures/GFS_TDS5 siphon/tests/fixtures/Surface_Synoptic_Station_Dataset_xml siphon/tests/fixtures/acis_general siphon/tests/fixtures/acis_griddata siphon/tests/fixtures/acis_multistndata siphon/tests/fixtures/acis_request siphon/tests/fixtures/acis_stndata siphon/tests/fixtures/cat_access_elements siphon/tests/fixtures/cat_non_standard_context_path siphon/tests/fixtures/cat_only_http siphon/tests/fixtures/cat_to_cdmr siphon/tests/fixtures/cat_to_open siphon/tests/fixtures/cat_to_opendap siphon/tests/fixtures/cat_to_subset siphon/tests/fixtures/follow_cat siphon/tests/fixtures/fronts_cat_open siphon/tests/fixtures/gfs-error-no-header siphon/tests/fixtures/gfs-metadata-map siphon/tests/fixtures/gfs-metadata-map-bad siphon/tests/fixtures/html_then_xml_catalog siphon/tests/fixtures/iastate_all_data_all_levels siphon/tests/fixtures/iastate_all_data_single_pressure siphon/tests/fixtures/iastate_high_alt_sounding siphon/tests/fixtures/iastate_no_data siphon/tests/fixtures/iastate_no_future_data siphon/tests/fixtures/iastate_no_future_data_with_pressure siphon/tests/fixtures/iastate_sounding siphon/tests/fixtures/iastate_sounding_with_nans siphon/tests/fixtures/igra2_derived siphon/tests/fixtures/igra2_nodata siphon/tests/fixtures/igra2_sounding siphon/tests/fixtures/latest_rap_catalog siphon/tests/fixtures/latest_resolver_on_latest_dataset siphon/tests/fixtures/ncei_cat_to_subset siphon/tests/fixtures/ncei_embedded_metadata siphon/tests/fixtures/ncss_gfs_csv_point siphon/tests/fixtures/ncss_gfs_netcdf4_point siphon/tests/fixtures/ncss_gfs_netcdf_point siphon/tests/fixtures/ncss_gfs_vertical_level siphon/tests/fixtures/ncss_gfs_xml_point siphon/tests/fixtures/ncss_test_metadata siphon/tests/fixtures/ndbc_buoy_data_types siphon/tests/fixtures/ndbc_latest siphon/tests/fixtures/ndbc_realtime_cwind siphon/tests/fixtures/ndbc_realtime_dart siphon/tests/fixtures/ndbc_realtime_drift siphon/tests/fixtures/ndbc_realtime_ocean siphon/tests/fixtures/ndbc_realtime_rain siphon/tests/fixtures/ndbc_realtime_spec siphon/tests/fixtures/ndbc_realtime_srad siphon/tests/fixtures/ndbc_realtime_supl siphon/tests/fixtures/ndbc_realtime_txt siphon/tests/fixtures/nhc_database siphon/tests/fixtures/nhc_no_data siphon/tests/fixtures/nhc_storm_archive siphon/tests/fixtures/nhc_storm_current_year siphon/tests/fixtures/point_dataset_cat siphon/tests/fixtures/point_feature_dataset_xml siphon/tests/fixtures/radar_dataset_cat siphon/tests/fixtures/radarserver_ds_denied siphon/tests/fixtures/radarserver_toplevel_denied siphon/tests/fixtures/rsmas_ramadda siphon/tests/fixtures/rsmas_ramadda_datasets siphon/tests/fixtures/spc_hail_after_2011_archive siphon/tests/fixtures/spc_hail_archive siphon/tests/fixtures/spc_hail_future siphon/tests/fixtures/spc_torn_after_2011_archive siphon/tests/fixtures/spc_torn_archive siphon/tests/fixtures/spc_torn_future siphon/tests/fixtures/spc_wind_after_2011_archive siphon/tests/fixtures/spc_wind_archive siphon/tests/fixtures/spc_wind_future siphon/tests/fixtures/tds50_catalogref_follow siphon/tests/fixtures/thredds-test-default-5-0 siphon/tests/fixtures/thredds-test-latest-gfs-0p5 siphon/tests/fixtures/thredds-test-toplevel-catalog siphon/tests/fixtures/thredds_radarserver_level2_single siphon/tests/fixtures/thredds_radarserver_level3_bad siphon/tests/fixtures/thredds_radarserver_level3_catalog siphon/tests/fixtures/thredds_radarserver_level3_good siphon/tests/fixtures/thredds_radarserver_level3_metadata siphon/tests/fixtures/thredds_radarserver_metadata siphon/tests/fixtures/thredds_radarserver_toplevel siphon/tests/fixtures/top_level_20km_rap_catalog siphon/tests/fixtures/top_level_cat siphon/tests/fixtures/top_thredds_catalog siphon/tests/fixtures/wyoming_high_alt_sounding siphon/tests/fixtures/wyoming_no_data siphon/tests/fixtures/wyoming_sounding siphon/tests/fixtures/wyoming_sounding_no_station siphon/cdmr/tests/__pycache__/test_cdmremote.cpython-38-pytest-6.2.3.pyc siphon/cdmr/tests/__pycache__/test_cdmremotefeature.cpython-38-pytest-6.2.3.pyc siphon/cdmr/tests/__pycache__/test_coveragedataset.cpython-38-pytest-6.2.3.pyc siphon/cdmr/tests/__pycache__/test_dataset.cpython-38-pytest-6.2.3.pyc siphon/cdmr/tests/__pycache__/test_ncstream.cpython-38-pytest-6.2.3.pyc siphon/cdmr/tests/__pycache__/test_xarray.cpython-38-pytest-6.2.3.pyc siphon/cdmr/tests/fixtures/cdmr_capabilities siphon/cdmr/tests/fixtures/cdmr_cdl siphon/cdmr/tests/fixtures/cdmr_enable_compression siphon/cdmr/tests/fixtures/cdmr_ncml siphon/cdmr/tests/fixtures/cdmrf_coords siphon/cdmr/tests/fixtures/cdmrf_data siphon/cdmr/tests/fixtures/cdmrf_feature_type siphon/cdmr/tests/fixtures/cdmrf_header siphon/cdmr/tests/fixtures/hrrr_cdmremotefeature siphon/cdmr/tests/fixtures/latest_rap_catalog siphon/cdmr/tests/fixtures/latest_rap_ncstream_header siphon/cdmr/tests/fixtures/nc4_chararray siphon/cdmr/tests/fixtures/nc4_compound_ref siphon/cdmr/tests/fixtures/nc4_compound_ref_deflate siphon/cdmr/tests/fixtures/nc4_enum siphon/cdmr/tests/fixtures/nc4_groups siphon/cdmr/tests/fixtures/nc4_nested_structure_scalar siphon/cdmr/tests/fixtures/nc4_opaque siphon/cdmr/tests/fixtures/nc4_strings siphon/cdmr/tests/fixtures/nc4_unsigned siphon/cdmr/tests/fixtures/nc4_vlen siphon/cdmr/tests/fixtures/rap_compressed siphon/cdmr/tests/fixtures/rap_ncstream_all_indices siphon/cdmr/tests/fixtures/rap_ncstream_decimation siphon/cdmr/tests/fixtures/rap_ncstream_ellipsis_middle siphon/cdmr/tests/fixtures/rap_ncstream_first_index siphon/cdmr/tests/fixtures/rap_ncstream_header siphon/cdmr/tests/fixtures/rap_ncstream_last_index siphon/cdmr/tests/fixtures/rap_ncstream_negative_index siphon/cdmr/tests/fixtures/rap_ncstream_negative_slice siphon/cdmr/tests/fixtures/rap_ncstream_slice_beyond_end siphon/cdmr/tests/fixtures/rap_ncstream_slice_to_end siphon/cdmr/tests/fixtures/rap_ncstream_slices siphon/cdmr/tests/fixtures/tds5_basic siphon/cdmr/tests/fixtures/tds5_compound_ref siphon/cdmr/tests/fixtures/tds5_empty_att siphon/cdmr/tests/fixtures/tds5_nested_structure_scalar siphon/cdmr/tests/fixtures/tds5_opaque siphon/cdmr/tests/fixtures/tds5_strings siphon/cdmr/tests/fixtures/tds5_unsigned siphon/cdmr/tests/fixtures/tds5_vlen siphon/cdmr/tests/fixtures/tds5_vlen_slicing <<<<<< network # path=coverage.xml /Users/runner/work/siphon/siphon <<<<<< EOF # path=siphon/cdmr/coveragedataset.py # Copyright (c) 2016 Siphon Contributors. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Provide access to a TDS Coverage Dataset.""" from collections import OrderedDict import logging import warnings from .cdmremotefeature import CDMRemoteFeature from .dataset import AttributeContainer logging.basicConfig(level=logging.WARNING) log = logging.getLogger(__name__) def reindent_lines(new_leader, source): """Re-indent string lines.""" return new_leader + ('\n' + new_leader).join(source.split('\n')) class CoverageDataset(AttributeContainer): """Wrap dataset access using CDMRemoteFeature and Coverages. This is still experimental. """ def __init__(self, url): """Initialize CoverageDataset from a url pointing to CDMRemoteFeature endpoint.""" super(CoverageDataset, self).__init__() warnings.warn('CoverageDataset is in early development, unsupported, and API may ' 'change at any time.') self.cdmrf = CDMRemoteFeature(url) self.name = 'Unnamed' self.lon_lat_domain = None self.proj_domain = None self.date_range = None self.type = None self.axes = OrderedDict() self.coord_systems = OrderedDict() self.grids = OrderedDict() self.transforms = OrderedDict() self._read_header() def _read_header(self): """Get the needed header information to initialize dataset.""" self._header = self.cdmrf.fetch_header() self.load_from_stream(self._header) def load_from_stream(self, header): """Populate the CoverageDataset from the protobuf information.""" self._unpack_attrs(header.atts) self.name = header.name self.lon_lat_domain = header.latlonRect self.proj_domain = header.projRect self.date_range = header.dateRange self.type = header.coverageType for sys in header.coordSys: self.coord_systems[sys.name] = sys for trans in header.coordTransforms: self.transforms[trans.name] = trans for ax in header.coordAxes: self.axes[ax.name] = ax for cov in header.grids: self.grids[cov.name] = cov def __str__(self): """Create a string representation of CoverageDataset.""" print_groups = [] if self.name: print_groups.append(self.name + ' (' + str(self.type) + ')') print_groups.append('Lon/Lat Domain: {0}'.format(self.lon_lat_domain)) print_groups.append('Projected Domain: {0}'.format(self.proj_domain)) print_groups.append('Date Range: {0}'.format(self.date_range)) indent = ' ' * 4 if self.axes: print_groups.append('Axes:') for ax in self.axes.values(): print_groups.append(reindent_lines(indent, str(ax))) if self.coord_systems: print_groups.append('Coordinate Systems:') for sys in self.coord_systems.values(): print_groups.append(reindent_lines(indent, str(sys))) if self.transforms: print_groups.append('Coordinate Transforms:') for trans in self.transforms.values(): print_groups.append(reindent_lines(indent, str(trans))) if self.grids: print_groups.append('Grids:') for grid in self.grids.values(): print_groups.append(reindent_lines(indent, str(grid))) if self.ncattrs(): print_groups.append('Attributes:') for att in self.ncattrs(): print_groups.append('{0}{1}: {2}'.format(indent, att, getattr(self, att))) return '\n'.join(print_groups) <<<<<< EOF # path=siphon/cdmr/__pycache__/coveragedataset.cpython-38.pyc U 1X@a��@sldZddlmZddlZddlZddlmZddlmZej ej d�e� e �Z dd �ZGd d �d e�ZdS) z)Provide access to a TDS Coverage Dataset.�)� OrderedDictN�)�CDMRemoteFeature)�AttributeContainer)�levelcCs|d|�|�d��S)zRe-indent string lines.� )�join�split)Z new_leader�source�r �?/Users/runner/work/siphon/siphon/siphon/cdmr/coveragedataset.py�reindent_linessr cs8eZdZdZ�fdd�Zdd�Zdd�Zdd �Z�ZS) �CoverageDatasetz_Wrap dataset access using CDMRemoteFeature and Coverages. This is still experimental. csltt|���t�d�t|�|_d|_d|_d|_ d|_ d|_ t �|_ t �|_t �|_t �|_|��dS)zLInitialize CoverageDataset from a url pointing to CDMRemoteFeature endpoint.zUCoverageDataset is in early development, unsupported, and API may change at any time.ZUnnamedN)�superr�__init__�warnings�warnr�cdmrf�name�lon_lat_domain� proj_domain� date_range�typer�axes� coord_systems�grids� transforms� _read_header)�self�url�� __class__r r rs  zCoverageDataset.__init__cCs|j��|_|�|j�dS)z8Get the needed header information to initialize dataset.N)r� fetch_header�_header�load_from_stream)rr r r r-s zCoverageDataset._read_headercCs�|�|j�|j|_|j|_|j|_|j|_|j |_ |j D]}||j |j<q:|j D]}||j|j<qR|jD]}||j|j<qj|jD]}||j|j<q�dS)z;Populate the CoverageDataset from the protobuf information.N)� _unpack_attrs�attsr� latlonRectr�projRectr� dateRanger� coverageTyper�coordSysr�coordTransformsr� coordAxesrr)r�header�sys�trans�ax�covr r r r$2s     z CoverageDataset.load_from_streamc Cs~g}|jr(|�|jdt|j�d�|�d�|j��|�d�|j��|�d�|j��d}|jr�|�d�|j� �D]}|�t |t|���q||j r�|�d�|j � �D]}|�t |t|���q�|j r�|�d �|j � �D]}|�t |t|���q�|j �r6|�d �|j � �D]}|�t |t|����q|���rt|�d �|��D] }|�d �||t||����qRd �|�S)z2Create a string representation of CoverageDataset.z (�)zLon/Lat Domain: {0}zProjected Domain: {0}zDate Range: {0}z zAxes:zCoordinate Systems:zCoordinate Transforms:zGrids:z Attributes:z {0}{1}: {2}r)r�append�strr�formatrrrr�valuesr rrr�ncattrs�getattrr)r� print_groups�indentr1r/r0�grid�attr r r �__str__Gs8       zCoverageDataset.__str__) �__name__� __module__� __qualname__�__doc__rrr$r>� __classcell__r r r r rs  r)rB� collectionsr�loggingr�cdmremotefeaturer�datasetr� basicConfig�WARNING� getLoggerr?�logr rr r r r �s    <<<<<< EOF # path=siphon/cdmr/tests/test_coveragedataset.py # Copyright (c) 2016 Siphon Contributors. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Test Coverage Dataset.""" import pytest from siphon.cdmr.coveragedataset import CoverageDataset from siphon.testing import get_recorder recorder = get_recorder(__file__) @pytest.mark.filterwarnings('ignore: CoverageDataset') @recorder.use_cassette('hrrr_cdmremotefeature') def test_simple_cdmremotefeature(): """Smoke test for CDMRemoteFeature.""" cd = CoverageDataset('http://localhost:8080/thredds/cdmrfeature/grid/' 'test/HRRR_CONUS_2p5km_20160309_1600.grib2') 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.""" cd = CoverageDataset('http://localhost:8080/thredds/cdmrfeature/grid/' 'test/HRRR_CONUS_2p5km_20160309_1600.grib2') assert str(cd) <<<<<< EOF # path=siphon/cdmr/tests/__pycache__/test_coveragedataset.cpython-38-pytest-6.2.3.pyc U 1X@a �@s�dZddlZddlmmZddlZddlm Z ddl m Z e e �Z ej�d�e �d�dd���Zej�d�e �d�d d ���ZdS) zTest Coverage Dataset.�N)�CoverageDataset)� get_recorderzignore: CoverageDatasetZhrrr_cdmremotefeaturecCs\td�}|j}|sTddt��ks*t�|�r4t�|�ndt�|�d�}tt�|���d}dS)z Smoke test for CDMRemoteFeature.�Xhttp://localhost:8080/thredds/cdmrfeature/grid/test/HRRR_CONUS_2p5km_20160309_1600.grib2z)assert %(py2)s {%(py2)s = %(py0)s.grids }�cd)�py0Zpy2N) r�grids� @py_builtins�locals� @pytest_ar�_should_repr_global_name� _saferepr�AssertionError�_format_explanation)r� @py_assert1Z @py_format3�r�J/Users/runner/work/siphon/siphon/siphon/cdmr/tests/test_coveragedataset.py�test_simple_cdmremotefeatures 4rcCs�td�}t|�}|sxddt��ks,t�t�r6t�t�nddt��ksNt�|�rXt�|�ndt�|�d�}tt�|���d}dS)z1Smoke test for converting CoverageDataset to str.rz,assert %(py3)s {%(py3)s = %(py0)s(%(py1)s) }�strr)rZpy1�py3N) rrrr r r r r r)r� @py_assert2� @py_format4rrr� test_simple_cdmremotefeature_strs Vr)�__doc__�builtinsr�_pytest.assertion.rewrite� assertion�rewriter �pytestZsiphon.cdmr.coveragedatasetr�siphon.testingr�__file__�recorder�mark�filterwarnings� use_cassetterrrrrr�s     <<<<<< EOF