Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection with extent of a single pixel fails with Chunk error #403

Open
felixcremer opened this issue Jun 6, 2024 · 0 comments
Open

Selection with extent of a single pixel fails with Chunk error #403

felixcremer opened this issue Jun 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@felixcremer
Copy link
Member

When I am trying to select with an Extent that falls fully into one pixel I get the following error.
This appeared for me while working on PyramidScheme, where the first extent might be off, when the Makie axis is not yet on the right position.

using YAXArrays, ArchGDAL
julia> c = Cube("test/data/bremen_sea_ice_conc_2022_9_9.tif")
cs = 512
cs = 512
╭───────────────────────────────╮
│ 1264×1327 YAXArray{Float32,2} │
├───────────────────────────────┴──────────────────────────────────────── dims ┐
   X Sampled{Float64} -3.95e6:6250.0:3.94375e6 ForwardOrdered Regular Points,
   Y Sampled{Float64} 4.35e6:-6250.0:-3.9375e6 ReverseOrdered Regular Points
├──────────────────────────────────────────────────────────────────────────────┴───────────────────────────────────────── metadata ┐
  Dict{String, Any} with 2 entries:
  "name"       => "Gray"
  "projection" => "PROJCS[\"WGS 84 / Antarctic Polar Stereographic\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",63781…
├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── file size ┤ 
  file size: 6.4 MB
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

julia> c[X=1..10]
cs = 512
cs = 0
ERROR: ArgumentError: Chunk sizes must be strictly positive
Stacktrace:
  [1] DiskArrays.RegularChunks(cs::Int64, offset::Int64, s::Int64)
    @ DiskArrays ~/Documents/PyramidScheme/dev/DiskArrays/src/chunks.jl:27
  [2] subsetchunks(r::DiskArrays.RegularChunks, subs::UnitRange{Int64})
    @ DiskArrays ~/Documents/PyramidScheme/dev/DiskArrays/src/chunks.jl:51
  [3] #104
    @ ./range.jl:0 [inlined]
  [4] iterate
    @ ./generator.jl:47 [inlined]
  [5] grow_to!(dest::Vector{…}, itr::Base.Generator{…})
    @ Base ./array.jl:907
  [6] collect(itr::Base.Generator{Base.Iterators.Filter{…}, DiskArrays.var"#104#107"{…}})
    @ Base ./array.jl:831
  [7] eachchunk_view(::DiskArrays.Chunked{…}, vv::SubArray{…})
    @ DiskArrays ~/Documents/PyramidScheme/dev/DiskArrays/src/subarray.jl:33
  [8] eachchunk
    @ ~/Documents/PyramidScheme/dev/DiskArrays/src/subarray.jl:25 [inlined]
  [9] rebuild
    @ ~/Documents/PyramidScheme/dev/YAXArrays/src/Cubes/Cubes.jl:200 [inlined]
 [10] rebuild
    @ ~/Documents/PyramidScheme/dev/DimensionalData/src/array/array.jl:85 [inlined]
 [11] rebuildsliced
    @ ~/Documents/PyramidScheme/dev/DimensionalData/src/array/array.jl:100 [inlined]
 [12] rebuildsliced
    @ ~/Documents/PyramidScheme/dev/DimensionalData/src/array/array.jl:99 [inlined]
 [13] view
    @ ~/Documents/PyramidScheme/dev/DimensionalData/src/array/indexing.jl:125 [inlined]
 [14] _dim_view
    @ ~/Documents/PyramidScheme/dev/DimensionalData/src/array/indexing.jl:110 [inlined]
 [15] #view#110
    @ ~/Documents/PyramidScheme/dev/DimensionalData/src/array/indexing.jl:81 [inlined]
 [16] getindex(::YAXArray{…}; kwargs::@Kwargs{})
    @ YAXArrays.Cubes ~/Documents/PyramidScheme/dev/YAXArrays/src/Cubes/Cubes.jl:487
 [17] top-level scope
    @ REPL[221]:1
Some type information was truncated. Use `show(err)` to see complete types.

bremen_sea_ice_conc_2022_9_9.zip

@lazarusA lazarusA added the bug Something isn't working label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants