NCTiles.BinData
— TypeBinData
Data structure containing a string or an array of strings (NetCDF file names) as well as metadata needed to read a file.
NCTiles.BinData
— MethodBinData(fnames::Union{Array{String},String},precision::Type,iosize::Tuple)
Construct a BinData struct for files that contain one field.
NCTiles.NCData
— TypeNCData
Data structure containing a string or an array of strings (file names) of NetCDF files as well as information needed to read a file.
NCTiles.NCT
— TypeNCT
Data structure containing information needed to write a NetCDF file.
NCTiles.NCvar
— TypeNCvar
Data structure containing information needed to write a variable to NetCDF files.
Instead of loading the data into memory, one can provide a list of input file names (see Bindata
).
NCTiles.TileData
— TypeTileData{T}
Data structure containing either a MeshArray
struct or BinData
struct (see vals
), MeshArray
structs describing the tile layout (tileinfo
), and other information for reading/writing tile data.
NCTiles.TileData
— MethodTileData(vals,tilesize::Tuple)
Construct a TileData struct. First generate the tileinfo, precision, and numtiles attributes.
Base.getindex
— Methodgetindex(d::BinData,i::Integer)
Return a new BinData object with the ith file, this being time index i.
Base.getindex
— Methodgetindex(d::NCData,i)
Retrieve the ith time step from the NetCDF file.
Base.getindex
— Methodgetindex(v::NCvar,i::Integer)
Retrive an NCvar at time step i.
Currently only works when values is a BinData, NCdata, or array of time steps.
Base.write
— Methodwrite(myflds::Dict,savename::String;README="",globalattribs=Dict())
Creates NetCDF file and writes myflds and all their dimensions to the file.
Base.write
— Methodwrite(myfld::NCvar,savename::String;README="",globalattribs=Dict())
Creates NetCDF file and writes myfld and all its dimensions to the file.
NCTiles.addData
— MethodaddData(v::Union{NCDatasets.CFVariable,NetCDF.NcVar},var::NCvar)
Fill variable with data in netcdf file using either NCDatasets.jl
or NetCDF.jl
NCTiles.addDim
— MethodaddDim(ds::NCDatasets.Dataset,dimvar::NCvar) # NCDatasets
Add a dimension to a NCDatasets.Dataset
NCTiles.addDim
— MethodaddDim(dimvar::NCvar)
Add a dimension to a NetCDF file using NetCDF.jl
NCTiles.addDimData
— MethodaddDimData(v::Union{NCDatasets.CFVariable,NetCDF.NcVar,Array},var::NCvar)
Add dimension data to predefined dimensions in a NetCDF file.
NCTiles.addVar
— MethodaddVar(ds::NCDatasets.Dataset,field::NCvar)
Add a variable to a NetCDF file using NCDatasets.jl
NCTiles.addVar
— MethodaddVar(field::NCvar,dimlist::Array{NetCDF.NcDim})
Add a variable with dimensions dimlist to a NetCDF file using NetCDF.jl
NCTiles.addVar
— MethodaddVar(field::NCvar})
Add a variable and its dimensions to a NetCDF file using NetCDF.jl
NCTiles.checkdims
— Methodcheckdims(v0::Array,var::NCvar)
Helper function: Checks that the size of the data about to be written to the file matches the provided dimensions.
NCTiles.createfile
— Functioncreatefile(filename, field::Union{NCvar,Dict{String,NCvar}}, README;
fillval=NaN, missval=NaN, itile=1, ntile=1)
Create NetCDF file and add variable + dimension definitions using either NCDatasets.jl
or NetCDF.jl
NCTiles.ensure_testcases_installed
— Methodensure_testcases_installed()
Download nctiles-testcases
Artifact and decompress files if needed.
NCTiles.findidx
— Methodfindidx(A,val)
Helper function for getting the indices for tiles. A is a gcmfaces struct, val is a numeric value to get the indices of. Returns a Dict of the indices for each face. Not currently exported. Maybe move to MeshArrays?
NCTiles.findtimedim
— Methodfindtimedim(v::Array)
Helper function: finds which dimension is a time dimension, if any. Can be Array of NCvars or NCDatasets.CFVariables.
NCTiles.getdims
— Methodgetdims(myflds::Dict)
Helper function: retrieves unique dimensions in dictionary of fields.
NCTiles.getnsteps
— Methodgetnsteps(d)
Helper function: Determines number of time steps in data d. Input d can be BinData, NCData, TileData, or an Array.
NCTiles.gettile
— Methodgettile(fldvals,tileinfo,tilesize,tilenum::Int)
Helper function for retrieving a tile from a gcmfaces struct as a numeric Array. Not currently exported.
NCTiles.gettiles
— Methodgettiles(fldvals,tilenum::Int)
Helper function for retrieving a tile from a gcmfaces struct as a numeric Array along with associated latitude and longitude. Not currently exported.
NCTiles.hastiledata
— Methodhastiledata(myfld::NCvar)
Helper function: returns whether given field or dict of fields has any tiled data.
NCTiles.hastimedim
— Methodhastimedim::Array)
Helper function: determines whether an array of dimensions has a time dimension. Can be Array of NCvars or NCDatasets.CFVariables.
NCTiles.hastimedim
— Methodhastimedim(v::NCvar)
Helper function: determines whether a variable has a time dimension.
NCTiles.istimedim
— Methodistimedim(d::Union{NCvar,NCDatasets.CFVariable})
Helper function: determines whether d is a time dimension.
NCTiles.pkg_version
— Methodpkg_version(name::String)
Get the version number (in current environment) for a package name
NCTiles.readbin
— Functionreadbin(flddata::BinData,tidx=1)
Read in a binary file as an array as specified by BinData
NCTiles.readbin
— Functionreadbin(fname::String,prec::Type,iosize::Tuple,fldidx=1)
Read in a binary file to an Array.
NCTiles.readdata
— Functionreaddata(flddata,tidx=1)
Generic wrapper function to read data from a file regardless of file/data type.
NCTiles.readncdata
— Functionreadncdata(var::NCData,i::Union{Colon,Integer}=:)
Read netcdf file as specified in NCData
argument. Optional argument i
can be used to read a specific records / times.
NCTiles.readncfile
— Functionreadncfile(fname,backend::Module=NCDatasets)
Read in a NetCDF file and return variables/dimensions as NCvar
structs, and file attributes as Dict
. Large variables/dimensions are not loaded into memory. This can use either NCDatasets.jl
or NetCDF.jl
NCTiles.replacevalues
— Methodreplacevalues(vals,ncvar::NCvar)
Helper function: Replaces the "values" attribute of an ncvar without changing anything else. Used to apply land mask.
NCTiles.replacevalues
— Methodreplacevalues(vals,td::TileData)
Helper function: Replaces the "values" attribute of a TilData struct without changing anything else. Used to apply land mask.
NCTiles.writetiles
— Functionwritetiles(v,var,tilenum,timeidx=1)
Helper function for writing a tile to a NetCDF file.