-
Notifications
You must be signed in to change notification settings - Fork 36
Description
I am trying to make an unlimited dimension but Julia sets the dimension to zero.
ds = Dataset("test10.nc","c")
# Define the dimension "lon" and "lat" with the size unlimited and 110 resp.
defDim(ds,"lon",Inf)
defDim(ds,"lat",110)
# Define a global attribute
ds.attrib["title"] = "this is a test file"
# Define the variables temperature
v = defVar(ds,"temperature",Float32,("lon","lat"))
# Generate some example data
data = [Float32(i+j) for i = 1:100, j = 1:110]
# write a single column
v[:,1] = data[:,1]
# write a the complete data set
v[:,:] = data
# write attributes
v.attrib["units"] = "degree Celsius"
v.attrib["comments"] = "this is a string attribute with Unicode Ω ∈ ∑ ∫ f(x) dx"But I get the following error message,
NCDatasets.NetCDFError(-1, "wrong size of variable 'temperature' (size (0, 110)) in file 'test10.nc' for an array of size (100, 110)")
Stacktrace:
[1] nc_put_var(::Int32, ::Int32, ::Array{Float32,2}) at C:\Users\Andre.julia\packages\NCDatasets\aYSmE\src\netcdf_c.jl:631
[2] setindex!(::NCDatasets.Variable{Float32,2}, ::Array{Float32,2}, ::Colon, ::Colon) at C:\Users\Andre.julia\packages\NCDatasets\aYSmE\src\NCDatasets.jl:988
[3] setindex!(::NCDatasets.CFVariable{Union{Missing, DateTime, AbstractCFDateTime, Number},2,NCDatasets.Variable{Float32,2},NCDatasets.Attributes}, ::Array{Float32,2}, ::Colon, ::Colon) at C:\Users\Andre.julia\packages\NCDatasets\aYSmE\src\NCDatasets.jl:1364
[4] top-level scope at In[7]:18
versioninfo()Gives following output
Julia Version 1.0.3
Commit 099e826241 (2018-12-18 01:34 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
Pkg.installed()["NCDatasets"]Gives following output
v"0.9.0"
Pkg.test("NCDatasets")Gives following output
Testing NCDatasets
Status C:\Users\AppData\Local\Temp\jl_4DE1.tmp\Manifest.toml
[9e28174c] BinDeps v0.8.10
[34da2185] Compat v2.1.0
[8f4d0f93] Conda v1.2.0
[a9693cdc] CondaBinDeps v0.1.0
[864edb3b] DataStructures v0.15.0
[682c06a0] JSON v0.20.0
[e1d29d7a] Missings v0.4.0
[85f8d34a] NCDatasets v0.9.0
[bac558e1] OrderedCollections v1.1.0
[30578b45] URIParser v0.4.0
[81def892] VersionParsing v1.1.3
[2a0f44e3] Base64 [@stdlib/Base64]
[ade2ca70] Dates [@stdlib/Dates]
[8bb1440f] DelimitedFiles [@stdlib/DelimitedFiles]
[8ba89e20] Distributed [@stdlib/Distributed]
[b77e0a4c] InteractiveUtils [@stdlib/InteractiveUtils]
[76f85450] LibGit2 [@stdlib/LibGit2]
[8f399da3] Libdl [@stdlib/Libdl]
[37e2e46d] LinearAlgebra [@stdlib/LinearAlgebra]
[56ddb016] Logging [@stdlib/Logging]
[d6f4376e] Markdown [@stdlib/Markdown]
[a63ad114] Mmap [@stdlib/Mmap]
[44cfe95a] Pkg [@stdlib/Pkg]
[de0858da] Printf [@stdlib/Printf]
[3fa0cd96] REPL [@stdlib/REPL]
[9a3f8284] Random [@stdlib/Random]
[ea8e919c] SHA [@stdlib/SHA]
[9e88b42a] Serialization [@stdlib/Serialization]
[1a1011a3] SharedArrays [@stdlib/SharedArrays]
[6462fe0b] Sockets [@stdlib/Sockets]
[2f01184e] SparseArrays [@stdlib/SparseArrays]
[10745b16] Statistics [@stdlib/Statistics]
[8dfed614] Test [@stdlib/Test]
[cf7118a7] UUIDs [@stdlib/UUIDs]
[4ec0a83e] Unicode [@stdlib/Unicode]
NetCDF library: C:\Users\Andre.julia\conda\3\Library\bin\netcdf.DLL
NetCDF version: 4.6.1 of Dec 20 2018 17:54:58 $
Test Summary: | Pass Total
NCDatasets | 561 561
Test Summary: | Pass Total
NetCDF4 groups | 8 8
Test Summary: | Pass Total
Variable-length arrays | 22 22
Test Summary: | Pass Total
Time and calendars | 874618 874618
Test Summary: | Pass Total
Multi-file datasets | 36 36
Test Summary: | Pass Total
Deferred datasets | 13 13
Testing NCDatasets tests passed