pangeo-data / climpred

:earth_americas: Verification of weather and climate forecasts :earth_africa:
https://climpred.readthedocs.io
MIT License
233 stars 48 forks source link

Create CF conform nc-output #77

Closed aaronspring closed 5 years ago

aaronspring commented 5 years ago

Goes long the thinking of documentation in metadata.

I am unsure about the requirements: are you more familiar @bradyrx

What I want to do with saved skill netcdf files:

bradyrx commented 5 years ago

I have to think about this. CF conform in my mind is for raw climate model output. I'm not sure how we would implement this for things like skill.nc, since it would have the lead dimension. Does ncview require 'time in seconds since' to work? I would imagine with lat/lon and coordinates, it could plot over the lead/time dimension.

What are you looking to do with cdo with files like skill.nc? Just trying to get a sense for what needs to be done here.

aaronspring commented 5 years ago

its a more general point. basically I want to do cdo's to all files in xarray. for skill we might just implement a dummy time variable or just include it inside a cdo wrapper. Something like: maybe this should go to esmtools

def cdo_wrap(ds,operator='fldmean '):
    # add time dimension here
    # ....
    cdo.addc('0',operator+ds,returnXarray=True)
aaronspring commented 5 years ago

all cdo commands need a time dimension. if time is in integers, after a cdo command the time will be different. datetime[ns] stays the same.

my wrapper idea doesnt work because if the input= is from xr, then operator chaining doesnt work. cdo-py is already the wrapper of cdo. no more wrapping possible

aaronspring commented 5 years ago

https://stackoverflow.com/questions/54571207/how-to-stop-xarray-from-automatically-changing-time-attributes-when-writing-out

aaronspring commented 5 years ago

Didn’t see that time is required. http://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/cf-conventions.html#_abstract

Might be a cdo thing.

Close for now