Closed aasdelat closed 4 months ago
I answer myself:
The key is to load the data with the option lazy=false
.
julia> ds = RasterStack(inpur_grib_file_name, lazy=false)
julia> names(ds)
(:longitude, :latitude, :msl)
julia> ds["longitude"][1]
0.0
julia> ds["longitude"][1] = 12
12
julia> ds["longitude"][1]
12.0
So the setindex
method is perhaps not necessary.
Hi!
When you use lazy=false
, the data are actually loaded into memory. That's why you're able to setindex!
on the memory Array. However, it is important to keep in mind that the GRIB file data won't be updated. As mentioned here, it is not possible to write to GRIB files with GRIBDatasets.jl (which is used behind Rasters.jl for reading GRIB files).
Hello: I am working with some grib files and experimenting with Rasters and YAXArrays. Rasters uses GRIBDatasets in order to work with grib files. If I need to convert longitudes in the range [0, 360] to the range [-180, 180], I do
So that longitude is a variable, not a coordinate (this is the structure of my data). Then, in order to change any latitude:
If I convert the Rasters dataset into a YAXSArrays dataset, I get the same error. So, I think that a setindex method is needed.