home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 732567105

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
732567105 MDU6SXNzdWU3MzI1NjcxMDU= 4552 UFuncTypeError when reading data from HDF4 file 4762214 closed 0     5 2020-10-29T18:46:49Z 2020-11-01T09:28:18Z 2020-11-01T09:28:17Z NONE      

What happened: When trying to access numpy.ndarray in a subdataset within a HDF4 file, following error: UFuncTypeError: Cannot cast ufunc 'multiply' output from dtype('<U32') to dtype('float32') with casting rule 'same_kind'. Similar error seen when accessing using netcdf4.Dataset

What you expected to happen: Data to be available as numpy.ndarray

Minimal Complete Verifiable Example:

```python

Put your MCVE code here

import requests import os import xarray as xr

download the file

url = 'https://hls.gsfc.nasa.gov/data/v1.4/S30/2020/13/S/D/D/HLS.S30.T13SDD.2020004.v1.4.hdf' f = os.path.basename(url) r = requests.get(url, allow_redirects=True) open(f, 'wb').write(r.content)

open with xarray and try to access one of the bands of data

ds = xr.open_dataset(f) ds['B01'].values ```

Anything else we need to know?: I've tried the following with netCDF4's Dataset module

python from netCDF4 import Dataset ds = Dataset(f) ds['B01'][:]

Environment:

Output of <tt>xr.show_versions()</tt> INSTALLED VERSIONS ------------------ commit: None python: 3.6.7 |Anaconda, Inc.| (default, Dec 10 2018, 20:35:02) [MSC v.1915 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 158 Stepping 9, GenuineIntel byteorder: little LC_ALL: None LANG: None LOCALE: None.None libhdf5: 1.10.5 libnetcdf: 4.7.3 xarray: 0.14.1 pandas: 0.25.3 numpy: 1.17.3 scipy: 1.3.1 netCDF4: 1.5.3 pydap: installed h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.0.4.2 nc_time_axis: None PseudoNetCDF: None rasterio: 1.1.2 cfgrib: None iris: None bottleneck: None dask: 2.9.1 distributed: 2.9.1 matplotlib: 3.0.3 cartopy: 0.17.0 seaborn: None numbagg: None setuptools: 44.0.0.post20200106 pip: 19.3.1 conda: None pytest: 5.3.2 IPython: 7.11.1 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4552/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 0.494ms · About: xarray-datasette