Skip to content

Commit

Permalink
Merge pull request #149 from PALEOtoolkit/grid_missing_fix
Browse files Browse the repository at this point in the history
Bugfix for cartesian grids netcdf load/save with isotopes
  • Loading branch information
sjdaines authored Dec 22, 2024
2 parents c059bd0 + 8b43f54 commit 67b590c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Grids.jl
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,9 @@ end
"""
function cartesian_to_internal(grid::CartesianLinearGrid, griddata::AbstractArray)
size(grid.linear_index) == size(griddata) || error("grid and data size mismatch")

return griddata[grid.cartesian_index]

# recreate vector to change type back from eg Union{Missing, Float64} to Float64, where missing will have been added by internal_to_cartesian
return [griddata[i] for i in grid.cartesian_index]
end

cartesian_to_internal(grid::CartesianArrayGrid, griddata::AbstractArray) = griddata
Expand Down

0 comments on commit 67b590c

Please sign in to comment.