Skip to content

Conversation

rafaqz
Copy link
Member

@rafaqz rafaqz commented Jul 7, 2025

Closes #36

Working but still needs tests

@rafaqz
Copy link
Member Author

rafaqz commented Jul 7, 2025

Edit: dont worry, its just that CF fake the examples to make them easier to read, putting dates in like that doesn't actually work with ncgen

@Alexander-Barth using the dataset in the linked issue both the time and (now "working") climatology_bounds vars end up with the wrong dates! Is this a CFTime bug or some problem with the ncgen? Its pretty much straight from the CF standards.

julia> ds = collect(NCDataset("clim.nc")["time"])
4-element Vector{DateTime}:
 1965-05-14T00:00:00
 1965-05-14T00:00:00
 1965-05-14T00:00:00
 1965-05-15T00:00:00

julia> ds = collect(NCDataset("clim.nc")["climatology_bounds"])
2×4 Matrix{DateTime}:
 1965-05-14T00:00:00  1965-05-14T00:00:00  1965-05-14T00:00:00  1965-05-14T00:00:00
 1965-06-13T00:00:00  1965-06-13T00:00:00  1965-06-13T00:00:00  1965-06-14T00:00:00

Is this something not handling "days since 1960-1-1" properly?

netcdf climatological_seasons {
dimensions:
  time=4;
  nv=2;
  lat=10; // added
  lon=10; // added
variables:
  float temperature(time,lat,lon);
    temperature:long_name="surface air temperature";
    temperature:cell_methods="time: minimum within years time: mean over years";
    temperature:units="K";
  double time(time);
    time:climatology="climatology_bounds";
    time:units="days since 1960-1-1";
  double climatology_bounds(time,nv);
data:  // time coordinates translated to datetime format
  time="1960-4-16", "1960-7-16", "1960-10-16", "1961-1-16" ;
  climatology_bounds="1960-3-1",  "1990-6-1",
                     "1960-6-1",  "1990-9-1",
                     "1960-9-1",  "1990-12-1",
                     "1960-12-1", "1991-3-1" ;    
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cliimatology bounds are not read as datetime
1 participant