Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDMRemote failing on a structure #311

Open
dopplershift opened this issue Sep 30, 2020 · 0 comments
Open

CDMRemote failing on a structure #311

dopplershift opened this issue Sep 30, 2020 · 0 comments

Comments

@dopplershift
Copy link
Member

This code downloading a NIDS NST product:

from siphon.catalog import TDSCatalog
from siphon.radarserver import RadarServer
from siphon.cdmr import Dataset
from datetime import datetime, timedelta
cat = TDSCatalog("http://thredds.ucar.edu/thredds/radarServer/catalog.xml")
url = cat.catalog_refs['NEXRAD Level III Radar from IDD'].href
rs = RadarServer(url)
query_latest = rs.query()
now = datetime.utcnow()
query_latest.lonlat_box(292.9375, 235.0625, 25.0625, 52.9375).time(now).variables('NST')
query_latest_cat = rs.get_catalog(query_latest)
data_available = list(query_latest_cat.datasets.values())
data_from_thredds = Dataset(data_available[0].access_urls['CdmRemote'])

data_from_thredds.variables['textStruct_code8gg'][:]

results in:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-33-5a7eeac0ffd5> in <module>
     13 data_from_thredds = Dataset(data_available[0].access_urls['CdmRemote'])
     14 
---> 15 data_from_thredds.variables['textStruct_code8gg'][:]

~/repos/siphon/siphon/cdmr/dataset.py in __getitem__(self, ind)
    207                 pass
    208             else:
--> 209                 arr.dtype = dt
    210 
    211             # Need to handle removing dimensions that have had an index

~/miniconda3/envs/py38/lib/python3.8/site-packages/numpy/core/_internal.py in _view_is_safe(oldtype, newtype)
    457 
    458     if newtype.hasobject or oldtype.hasobject:
--> 459         raise TypeError("Cannot change data-type for object array.")
    460     return
    461 

TypeError: Cannot change data-type for object array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant