Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Barth committed Nov 17, 2023
1 parent 3e108fd commit 0f72756
Showing 1 changed file with 1 addition and 42 deletions.
43 changes: 1 addition & 42 deletions src/cfvariable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mixed Julian/Gregorian calendar.
## Keyword arguments
* `fillvalue`: A value filled in the NetCDF file to indicate missing data.
It will be stored in the _FillValue attribute.
It will be stored in the _FillValue attribute. `NCDatasets` does not use implicitely the default NetCDF fill values when reading data.
* `chunksizes`: Vector integers setting the chunk size. The total size of a chunk must be less than 4 GiB.
* `deflatelevel`: Compression level: 0 (default) means no compression and 9 means maximum compression. Each chunk will be compressed individually.
* `shuffle`: If true, the shuffle filter is activated which can improve the compression ratio.
Expand Down Expand Up @@ -242,47 +242,6 @@ end

export cfvariable

"""
v = getindex(ds::NCDataset, varname::AbstractString)
Return the NetCDF variable `varname` in the dataset `ds` as a
`CFVariable`. The following CF convention are honored when the
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 `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.
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:
```
dimensions:
time = UNLIMITED; // (5 currently)
nv = 2;
variables:
double time(time);
time:long_name = "time";
time:units = "hours since 1998-04-019 06:00:00";
time:bounds = "time_bnds";
double time_bnds(time,nv);
```
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(ds, varname)`](@ref).
"""
function Base.getindex(ds::AbstractNCDataset,varname::SymbolOrString)
return cfvariable(ds, varname)
end

"""
dimsize(v::CFVariable)
Get the size of a `CFVariable` as a named tuple of dimension → length.
Expand Down

0 comments on commit 0f72756

Please sign in to comment.