Experimental features
Multi-file support
Multiple files can also be aggregated over a given dimensions (or the record dimension). In this example, 3 sea surface temperature fields from the 1992-01-01 to 1992-01-03 are aggregated using the OpenDAP service from PODAAC.
using NCDatasets, Printf, Dates
function url(dt)
doy = @sprintf("%03d",Dates.dayofyear(dt))
y = @sprintf("%04d",Dates.year(dt))
yyyymmdd = Dates.format(dt,"yyyymmdd")
return "https://podaac-opendap.jpl.nasa.gov:443/opendap/allData/ghrsst/data/GDS2/L4/GLOB/CMC/CMC0.2deg/v2/$y/$doy/$(yyyymmdd)120000-CMC-L4_GHRSST-SSTfnd-CMC0.2deg-GLOB-v02.0-fv02.0.nc"
end
ds = NCDataset(url.(DateTime(1992,1,1):Dates.Day(1):DateTime(1992,1,3)),aggdim = "time");
SST2 = ds["analysed_sst"][:,:,:];
close(ds)If there is a network or server issue, you will see an error message like NetCDF: I/O failure.
Experimental functions
NCDatasets.ancillaryvariables — Functionncvar = NCDatasets.ancillaryvariables(ncv::NCDatasets.CFVariable,modifier)Return the first ancillary variables from the NetCDF variable ncv with the standard name modifier modifier. It can be used for example to access related variable like status flags.
Base.filter — Functiondata = NCDatasets.filter(ncv, indices...; accepted_status_flags = nothing)Load and filter observations by replacing all variables without an acepted status flag to missing. It is used the attribute ancillary_variables to identify the status flag.
# da["data"] is 2D matrix
good_data = NCDatasets.filter(ds["data"],:,:, accepted_status_flags = ["good_data","probably_good_data"])