From 0cbe93726e6556edd8b7aa1a472a9885a9a97a4c Mon Sep 17 00:00:00 2001 From: "Gregory L. Wagner" Date: Wed, 1 Nov 2023 09:56:29 -0600 Subject: [PATCH 1/2] Minor docs improvements Just a little extra formatting plus cross-reference to docs for `cfvariable`. (Found while looking for docs on `DateTimeNoLeap`.) --- src/cfvariable.jl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/cfvariable.jl b/src/cfvariable.jl index 8de925a4..300052d1 100644 --- a/src/cfvariable.jl +++ b/src/cfvariable.jl @@ -243,7 +243,7 @@ end export cfvariable """ - v = getindex(ds::NCDataset,varname::AbstractString) + v = getindex(ds::NCDataset, varname::AbstractString) Return the NetCDF variable `varname` in the dataset `ds` as a `NCDataset.CFVariable`. The following CF convention are honored when the @@ -254,10 +254,10 @@ variable is indexed: `DateTime` object. Note that `DateTimeAllLeap`, `DateTimeNoLeap` and `DateTime360Day` cannot be converted to the proleptic gregorian calendar used in julia and are returned as such. If a calendar is defined but not among the -ones specified in the CF convention, then the data in the NetCDF file is not -converted into a date structure. + ones specified in the CF convention, then the data in the NetCDF file is not + converted into a date structure. -A call `getindex(ds,varname)` is usually written as `ds[varname]`. +A call `getindex(ds, varname)` is usually written as `ds[varname]`. If variable represents a cell boundary, the attributes `calendar` and `units` of the related NetCDF variables are used, if they are not specified. For example: @@ -276,14 +276,12 @@ variables: In this case, the variable `time_bnds` uses the units and calendar of `time` because both variables are related thought the bounds attribute following the CF conventions. -See also cfvariable +See also [`cfvariable(ds, varname)`](@ref). """ function Base.getindex(ds::AbstractNCDataset,varname::SymbolOrString) return cfvariable(ds, varname) end - - """ dimnames(v::CFVariable) From d85ef7c8063d48cbaf505f2ed010d6f5b6105a54 Mon Sep 17 00:00:00 2001 From: "Gregory L. Wagner" Date: Wed, 1 Nov 2023 10:03:41 -0600 Subject: [PATCH 2/2] Update cfvariable.jl --- src/cfvariable.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cfvariable.jl b/src/cfvariable.jl index 300052d1..bec17471 100644 --- a/src/cfvariable.jl +++ b/src/cfvariable.jl @@ -251,9 +251,10 @@ variable is indexed: * `_FillValue` or `missing_value` (which can be a list) will be returned as `missing`. `NCDatasets` does not use implicitely the default NetCDF fill values when reading data. * `scale_factor` and `add_offset` are applied (output = `scale_factor` * `data_in_file` + `add_offset`) * time variables (recognized by the units attribute and possibly the calendar attribute) are returned usually as - `DateTime` object. Note that `DateTimeAllLeap`, `DateTimeNoLeap` and - `DateTime360Day` cannot be converted to the proleptic gregorian calendar used in - julia and are returned as such. If a calendar is defined but not among the + `DateTime` object. Note that `CFTime.DateTimeAllLeap`, `CFTime.DateTimeNoLeap` and + `CF.TimeDateTime360Day` cannot be converted to the proleptic gregorian calendar used in + julia and are returned as such. (See [`CFTime.jl`](https://github.com/JuliaGeo/CFTime.jl) + for more information about those date types.) If a calendar is defined but not among the ones specified in the CF convention, then the data in the NetCDF file is not converted into a date structure.