Skip to content

'numpy.datetime64' object has no attribute 'year' writing from grib2 source #130

Open
@rsignell-usgs

Description

@rsignell-usgs

I have a consolidated JSON with a "best time series" dataset that reads from a collection of HRRR grib2 files on S3.

The data access and visualization of data in the notebook looks fine, but when I attempt to save a subset (to either zarr or netcdf) I get an error from xarray:

AttributeError: 'numpy.datetime64' object has no attribute 'year'

I'm raising this issue here because I run a nearly identical workflow with NetCDF files, where we also have datetime64 objects for time in xarray, and don't get this problem. Hence I'm thinking it must have something to do with the reading from grib2 files?

This notebook should be reproducible (and doesn't require AWS credentials):
https://nbviewer.org/gist/rsignell-usgs/7d0a76a5f9fbf5781e9e97b66bd72882

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions