-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from PoisotLab/mdc/fractal_triad
Fractal Triad
- Loading branch information
Showing
27 changed files
with
522 additions
and
491 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module SDTExt | ||
|
||
using BiodiversityObservationNetworks | ||
using SpeciesDistributionToolkit | ||
|
||
@info "Loading BONs.jl support for SimpleSDMLayers.jl ..." | ||
|
||
function stack( | ||
layers::Vector{<:SpeciesDistributionToolkit.SimpleSDMLayers.SimpleSDMLayer}, | ||
) | ||
# assert all layers are the same size if we add this function to BONs.jl | ||
mat = zeros(size(first(layers))..., length(layers)) | ||
for (l, layer) in enumerate(layers) | ||
thismin, thismax = extrema(layer) | ||
mat[:, :, l] .= broadcast( | ||
x -> isnothing(x) ? NaN : (x - thismin) / (thismax - thismin), | ||
layer.grid, | ||
) | ||
end | ||
return mat | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.