-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Suggestion] easier creation of time axis #208
Comments
This already works: tax = DateTime(1990, 1, 1):Dates.Day(1):DateTime(2020,1,1)
NCDataset("newfile.nc", "c") do ds
defVar(ds,"time",tax,("time",))
end Essentially you give the data to
|
[Edit: a typo has been fixed.] Wow, that's nice! Very very nice! The tutorial gives the impression that you need to define a dimension ( But, So, basically you do away with xax = 0:2:358 # longitudes
tax = DateTime(1990, 1, 1):Dates.Day(1):DateTime(2020,1,1)
myvar = get_var()
NCDataset("newfile.nc", "c") do ds
defVar(ds,"time",tax,("time",))
defVar(ds,"lon",xax,("lon",))
ds["lon"].attrib["units"] = "degrees_east"
defVar(ds,"myvar", myvar, ("lon", "time"))
end |
Yes, this is correct. Note that you can also define the attributes with defVar (see the examples): |
With this, |
Currently, it's a bit tedious to create a time axis for a new dataset. It would be nice if you could do something like
Here, I expect that the NCDataset library would automatically choose an underlying data type (likely Float64) and an appropriate time origin and other standard and helpful attributes.
The text was updated successfully, but these errors were encountered: