Your dataset doesn’t have X/Y/Z/Time variables or any know conversions to X/Y/Z/Ti.
They are DEPUV
and YEARLY1.
:
julia> myvar = Raster(inf; name=varname)
105×41 Raster{Union{Missing, Float64},2} MYVAR with dimensions:
Dim{:DEPUV} Sampled{Float64} Float64[2.5, 7.5, …, 7050.0, 7350.0] ForwardOrdered Explicit Intervals,
Dim{:YEARLY1} Sampled{DateTime} DateTime[1976-07-02T00:00:00, …, 2016-07-02T00:00:00] ForwardOrdered Explicit Intervals
with missingval: missing
1976-07-02T00:00:00 1977-07-02T12:00:00 … 2015-07-02T12:00:00 2016-07-02T00:00:00
2.5 -67460.1 -78469.4 -50027.3 -34528.7
7.5 -67093.5 -77321.2 -49179.8 -34331.5
12.5 -65447.0 -74756.2 -47710.6 -32555.5
It does show this right in the REPL
You can just use the names as keywods in view
or getindex
/[]
Also IntervalSets.jl is supported now, and ..
is more terse than Between
:
julia> view(myvar, DEPUV=100..140, YEARLY1=DateTime(1976)..DateTime(1990))
7×14 Raster{Union{Missing, Float64},2} MYVAR with dimensions:
Dim{:DEPUV} Sampled{Float64} Float64[102.5057795, 107.5404245, …, 128.82229999999998, 134.6500475] ForwardOrdered Explicit Intervals,
Dim{:YEARLY1} Sampled{DateTime} DateTime[1976-07-02T00:00:00, …, 1989-07-02T12:00:00] ForwardOrdered Explicit Intervals
with missingval: missing
1976-07-02T00:00:00 1977-07-02T12:00:00 … 1988-07-02T00:00:00 1989-07-02T12:00:00
102.506 -37600.1 -36850.3 -34487.4 -40982.9
107.54 -36761.9 -35619.4 -33620.3 -40405.4
112.644 -35316.8 -33781.6 -32292.0 -39717.7
117.863 -34392.3 -32700.4 -31898.4 -39591.6
123.241 -32614.1 -30894.6 … -31187.4 -38469.7
128.822 -30479.4 -28800.1 -29699.8 -37037.9
134.65 -28381.0 -26555.7 -27803.2 -34247.8
You can also write this like:
view(myvar, Dim{:DEPUV}(100..140), Dim{:YEARLY1}(DateTime(1976)..DateTime(1990)))
For plotting, you can put years on the x axis by making yearly a time dimension:
myvar = set(myvar, :YEARLY1 => Ti)
plot(myvar)
To be clear, Rasters is not at all limited to using X/Y/Z/Ti dimension names. They just make a lot of things easier when they are detectable. But you can index with any names. Just read what it says the dimension is in the REPL, or change it with set
.