home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 62242132

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
62242132 MDU6SXNzdWU2MjI0MjEzMg== 374 Set coordinate resolution in ds.to_netcdf 167164 closed 0     4 2015-03-17T00:10:22Z 2015-03-17T03:01:57Z 2015-03-17T02:09:15Z NONE      

I am trying to mutate some netcdf data, so that I can feed it to a Fortran model, but the ds.to_netcdf function results in a file with different time units (minutes instead of seconds).

Original file:

$ ncdump -h ~/path/to/met_forcings.nc netcdf met_forcings { dimensions: x = 1 ; y = 1 ; time = UNLIMITED ; // (70128 currently) z = 1 ; variables: ... double time(time) ; time:units = "seconds since 2002-01-01 00:30:00" ;

New file:

$ ncdump -h ../projects/synthetic_forcings/data/tumba_site_mean_2_year.nc netcdf tumba_site_mean_2_year { dimensions: time = 35088 ; y = 1 ; x = 1 ; z = 1 ; variables: ... float time(time) ; time:calendar = "proleptic_gregorian" ; time:units = "minutes since 2000-01-01 00:30:00" ;

The model is expecting second units, so all of the time-based calculations are amusingly out of whack. In my case, the Fortran model is probably to blame, because it's time reading function should be more robust. However, it would be generally useful to be able to specify the time units when saving to netcdf. I can't see a way of doing that currently.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/374/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

  • 0 rows from issues_id in issues_labels
  • 4 rows from issue in issue_comments
Powered by Datasette · Queries took 82.574ms · About: xarray-datasette