home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

1 row where user = 110075398 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date), closed_at (date)

type 1

  • issue 1

state 1

  • closed 1

repo 1

  • xarray 1
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
1519732161 I_kwDOAMm_X85alUXB 7419 Not able to save variable read from h5 file sombrero2003 110075398 closed 0     1 2023-01-04T23:31:29Z 2023-01-05T00:18:02Z 2023-01-05T00:18:02Z NONE      

What happened?

Hello, I am not sure that this is a bug but I really don't understand the error message.

I am reading the following file using xarray as f=xr.open_dataset('VNP22C2.A2020001.001.2022041163237.h5',group='HDFEOS/GRIDS/Cycle 1/Data Fields')

However I don't seem to be able to save f to netcdf ``` f[['Date_Mid_Greenup_Phase_1']].to_netcdf('test.nc')

numpy.core._exceptions._UFuncNoLoopError: ufunc 'add' did not contain a loop with signature matching types (dtype('float32'), dtype('<U23')) -> None ```

As far as I can tell there is nothing special with Date_Mid_Greenup_Phase_1 f['Date_Mid_Greenup_Phase_1'] <xarray.DataArray 'Date_Mid_Greenup_Phase_1' (phony_dim_0: 3600, phony_dim_1: 7200)> [25920000 values with dtype=float32] Dimensions without coordinates: phony_dim_0, phony_dim_1 Attributes: units: day of year valid_range: [ 1 32766] long_name: Date at a mid-greenup phase

What did you expect to happen?

Save variable from hdf file to netcdf

Minimal Complete Verifiable Example

Python import xarray as xr f=xr.open_dataset('VNP22C2.A2020001.001.2022041163237.h5',group='HDFEOS/GRIDS/Cycle 1/Data Fields') f[['Date_Mid_Greenup_Phase_1']].to_netcdf('test.nc')

MVCE confirmation

  • [x] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • [ ] Complete example — the example is self-contained, including all data and the text of any traceback.
  • [ ] Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • [ ] New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output

No response

Anything else we need to know?

No response

Environment

commit: None python: 3.9.15 (main, Nov 24 2022, 08:28:41) [Clang 14.0.6 ] python-bits: 64 OS: Darwin OS-release: 21.6.0 machine: arm64 processor: arm byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.12.1 libnetcdf: 4.8.1 xarray: 2022.11.0 pandas: 1.5.2 numpy: 1.23.5 scipy: 1.9.3 netCDF4: 1.5.7 pydap: None h5netcdf: 1.1.0 h5py: 3.7.0 Nio: None zarr: None cftime: 1.5.1.1 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.5 dask: None distributed: None matplotlib: 3.6.2 cartopy: None seaborn: None numbagg: None fsspec: None cupy: None pint: None sparse: None flox: None numpy_groupies: None setuptools: 65.5.0 pip: 22.3.1 conda: 22.11.1 pytest: None IPython: None sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7419/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 21.802ms · About: xarray-datasette