-
Notifications
You must be signed in to change notification settings - Fork 35
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
Julia states my habitat file is empty #366
Comments
In case it helps, here are my raster files (for nodes + habitat map) and .ini file |
Your habitat file is not empty, but does contain zeros. At least according to how Circuitscape is reading it: x = Circuitscape.read_raster("resraster_new.tif", Float64)
count(iszero, x) returns
We don't support rasters like that currently because that would result in a conductance matrix with |
It still isn't working after changing all zeros in the raster to a different value. Wetransfer file: https://we.tl/t-Nr0wCHbGZh
|
Looks like you set your julia> f = Circuitscape.ArchGDAL.read("wetransfer_untitled-transfer_2022-10-21_2337\\newraster\\nozeroraster.tif")
GDAL Dataset (Driver: GTiff/GeoTIFF)
File(s):
wetransfer_untitled-transfer_2022-10-21_2337\newraster\nozeroraster.tif
wetransfer_untitled-transfer_2022-10-21_2337\newraster\nozeroraster.tif.ovr
wetransfer_untitled-transfer_2022-10-21_2337\newraster\nozeroraster.tif.aux.xml
Dataset (width x height): 7007 x 3878 (pixels)
Number of raster bands: 1
[GA_ReadOnly] Band 1 (Gray): 7007 x 3878 (Float32)
julia> band = Circuitscape.ArchGDAL.getband(f, 1)
[GA_ReadOnly] Band 1 (Gray): 7007 x 3878 (Float32)
blocksize: 128×128, nodata: nothing, units: 1.0px + 0.0
overviews: (0) 3504x1939 (1) 1752x970 (2) 876x485
(3) 438x243 In the previous file you set it to something like julia> f2 = Circuitscape.ArchGDAL.read("resraster_new.tif")
GDAL Dataset (Driver: GTiff/GeoTIFF)
File(s):
resraster_new.tif
Dataset (width x height): 7007 x 3878 (pixels)
Number of raster bands: 1
[GA_ReadOnly] Band 1 (Gray): 7007 x 3878 (Float32)
julia> band2 = Circuitscape.ArchGDAL.getband(f2, 1)
[GA_ReadOnly] Band 1 (Gray): 7007 x 3878 (Float32)
blocksize: 128×128, nodata: 3.3999999521443642e38, units: 1.0px + 0.0
overviews: |
Hi Ranjan,
I don't really understand how this would work conceptually,
if I set NA raster values to a non-zero value, would my NAs (which I don't
want to calculate connectivity for) not by definition take a resistance
value (the number I assign to it?).
So e.g. I assign 5 to NAs, then my NAs get resistance value 5, which I
don't want?
Merijn
Op zo 23 okt. 2022 om 13:06 schreef Ranjan Anantharaman <
***@***.***>:
… Looks like you set your nodata value to nothing? Could you set it to
something like -9999? The
julia> f = Circuitscape.ArchGDAL.read("wetransfer_untitled-transfer_2022-10-21_2337\\newraster\\nozeroraster.tif")
GDAL Dataset (Driver: GTiff/GeoTIFF)
File(s):
wetransfer_untitled-transfer_2022-10-21_2337\newraster\nozeroraster.tif
wetransfer_untitled-transfer_2022-10-21_2337\newraster\nozeroraster.tif.ovr
wetransfer_untitled-transfer_2022-10-21_2337\newraster\nozeroraster.tif.aux.xml
Dataset (width x height): 7007 x 3878 (pixels)
Number of raster bands: 1
[GA_ReadOnly] Band 1 (Gray): 7007 x 3878 (Float32)
julia> band = Circuitscape.ArchGDAL.getband(f, 1)
[GA_ReadOnly] Band 1 (Gray): 7007 x 3878 (Float32)
blocksize: 128×128, nodata: nothing, units: 1.0px + 0.0
overviews: (0) 3504x1939 (1) 1752x970 (2) 876x485
(3) 438x243
In the previous file you set it to something like
julia> f2 = Circuitscape.ArchGDAL.read("resraster_new.tif")
GDAL Dataset (Driver: GTiff/GeoTIFF)
File(s):
resraster_new.tif
Dataset (width x height): 7007 x 3878 (pixels)
Number of raster bands: 1
[GA_ReadOnly] Band 1 (Gray): 7007 x 3878 (Float32)
julia> band2 = Circuitscape.ArchGDAL.getband(f2, 1)
[GA_ReadOnly] Band 1 (Gray): 7007 x 3878 (Float32)
blocksize: 128×128, nodata: 3.3999999521443642e38, units: 1.0px + 0.0
overviews:
—
Reply to this email directly, view it on GitHub
<#366 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHJWMNUELL24NMXILWR543WEVWC5ANCNFSM6AAAAAAQQTCBME>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Additionally, my study area is a certain shape, but a raster of course is
always a standard shape, so everything outside the study area are NA
values. These would then also be assigned a certain value and as such
included in the connectivity model?
Op zo 23 okt. 2022 om 21:10 schreef Merijn van den Bosch <
***@***.***>:
… Hi Ranjan,
I don't really understand how this would work conceptually,
if I set NA raster values to a non-zero value, would my NAs (which I don't
want to calculate connectivity for) not by definition take a resistance
value (the number I assign to it?).
So e.g. I assign 5 to NAs, then my NAs get resistance value 5, which I
don't want?
Merijn
Op zo 23 okt. 2022 om 13:06 schreef Ranjan Anantharaman <
***@***.***>:
> Looks like you set your nodata value to nothing? Could you set it to
> something like -9999? The
>
> julia> f = Circuitscape.ArchGDAL.read("wetransfer_untitled-transfer_2022-10-21_2337\\newraster\\nozeroraster.tif")
>
> GDAL Dataset (Driver: GTiff/GeoTIFF)
> File(s):
>
> wetransfer_untitled-transfer_2022-10-21_2337\newraster\nozeroraster.tif
>
> wetransfer_untitled-transfer_2022-10-21_2337\newraster\nozeroraster.tif.ovr
>
> wetransfer_untitled-transfer_2022-10-21_2337\newraster\nozeroraster.tif.aux.xml
>
>
>
> Dataset (width x height): 7007 x 3878 (pixels)
>
> Number of raster bands: 1
>
> [GA_ReadOnly] Band 1 (Gray): 7007 x 3878 (Float32)
>
>
>
>
>
> julia> band = Circuitscape.ArchGDAL.getband(f, 1)
>
> [GA_ReadOnly] Band 1 (Gray): 7007 x 3878 (Float32)
>
> blocksize: 128×128, nodata: nothing, units: 1.0px + 0.0
>
> overviews: (0) 3504x1939 (1) 1752x970 (2) 876x485
>
> (3) 438x243
>
> In the previous file you set it to something like
>
> julia> f2 = Circuitscape.ArchGDAL.read("resraster_new.tif")
>
> GDAL Dataset (Driver: GTiff/GeoTIFF)
> File(s):
>
> resraster_new.tif
>
>
>
> Dataset (width x height): 7007 x 3878 (pixels)
>
> Number of raster bands: 1
>
> [GA_ReadOnly] Band 1 (Gray): 7007 x 3878 (Float32)
>
>
>
> julia> band2 = Circuitscape.ArchGDAL.getband(f2, 1)
>
> [GA_ReadOnly] Band 1 (Gray): 7007 x 3878 (Float32)
>
> blocksize: 128×128, nodata: 3.3999999521443642e38, units: 1.0px + 0.0
>
> overviews:
>
> —
> Reply to this email directly, view it on GitHub
> <#366 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ASHJWMNUELL24NMXILWR543WEVWC5ANCNFSM6AAAAAAQQTCBME>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Closing this due to inactivity, and a subsequent email chain. Please reopen if this is a problem with the latest versions, which have many updates. |
See below my error, I will also attach the content of my .ini file. My resistance raster is 23MB (and thus not empty)
[Circuitscape Mode]
data_type = raster
scenario = pairwise
[Version]
version = 5.11.2
[Habitat raster or graph]
habitat_file = D:\Merijn\Desktop\circuitch2\resraster_new.tif
habitat_map_is_resistances = true
[Connection Scheme for raster habitat data]
connect_four_neighbors_only = false
connect_using_avg_resistances = false
[Short circuit regions (aka polygons)]
use_polygons = false
polygon_file = False
[Options for advanced mode]
ground_file_is_resistances = true
source_file = (Browse for a current source file)
remove_src_or_gnd = keepall
ground_file = (Browse for a ground point file)
use_unit_currents = false
use_direct_grounds = false
[Mask file]
use_mask = false
mask_file = None
[Options for one-to-all and all-to-one modes]
use_variable_source_strengths = false
variable_source_file = None
[Options for pairwise and one-to-all and all-to-one modes]
included_pairs_file = (Browse for a file with pairs to include or exclude)
use_included_pairs = false
point_file = D:\Merijn\Desktop\circuitch2\new_nodes.tif
[Calculation options]
solver = cg+amg
parallelize = true
max_parallel = 3
[Output options]
write_cum_cur_map_only = true
log_transform_maps = false
output_file = D:\Merijn\Desktop\circuitch2\settings
write_max_cur_maps = false
write_volt_maps = false
set_null_currents_to_nodata = false
set_null_voltages_to_nodata = false
compress_grids = false
write_cur_maps = true
julia> compute("D:\Merijn\Desktop\circuitch2\newest.ini")
I need to do double backslash to avoid an error: syntax:invalid escape sequence
[ Info: 2022-09-19 20:59:00 : Precision used: Double
[ Info: 2022-09-19 20:59:01 : Starting up Circuitscape to use 3 processes in parallel
[ Info: 2022-09-19 20:59:17 : Reading maps
ERROR: "Error: zero resistance values are not currently supported for habitat maps. Use a short-circuit region file instead."
Stacktrace:
[1] read_cellmap(habitat_file::String, is_res::Bool, #unused#::Type{Float64})
@ Circuitscape C:\Users\merij.julia\packages\Circuitscape\XpftG\src\io.jl:89
[2] load_raster_data(T::Type, V::Type, cfg::Dict{String, String})
@ Circuitscape C:\Users\merij.julia\packages\Circuitscape\XpftG\src\io.jl:429
[3] raster_pairwise(T::Type, V::Type, cfg::Dict{String, String})
@ Circuitscape C:\Users\merij.julia\packages\Circuitscape\XpftG\src\raster\pairwise.jl:18
[4] _compute(T::Type, V::Type, cfg::Dict{String, String})
@ Circuitscape C:\Users\merij.julia\packages\Circuitscape\XpftG\src\run.jl:43
[5] macro expansion
@ .\timing.jl:287 [inlined]
[6] compute(path::String)
@ Circuitscape C:\Users\merij.julia\packages\Circuitscape\XpftG\src\run.jl:31
[7] top-level scope
@ REPL[4]:1
The text was updated successfully, but these errors were encountered: