Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
glaroc committed Oct 5, 2023
2 parents 4c20c22 + b934052 commit 1427b3c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ services:
runner-julia:
container_name: biab-runner-julia
image: geobon/bon-in-a-box:runner-julia
# build:
#build:
# context: ./runners
# dockerfile: julia-dockerfile
command: sh # Avoids launching julia session that will not be used.
Expand Down
20 changes: 10 additions & 10 deletions pipelines/SDM/BRT_julia_viewer.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@
"id": "33",
"type": "output",
"position": {
"x": 2396.121814241836,
"y": 98.93945151650797
"x": 2379.6499938964844,
"y": 122
},
"data": {
"label": "Output"
Expand Down Expand Up @@ -353,11 +353,11 @@
}
},
{
"id": "39",
"id": "38",
"type": "output",
"position": {
"x": 2687.4770663161003,
"y": 233.61776005508665
"x": 1504.2802457138919,
"y": 294.44054742414664
},
"data": {
"label": "Output"
Expand Down Expand Up @@ -604,11 +604,11 @@
"id": "reactflow__edge-30-37"
},
{
"source": "21",
"sourceHandle": "n_clean",
"target": "39",
"source": "1",
"sourceHandle": "total_records",
"target": "38",
"targetHandle": null,
"id": "reactflow__edge-21n_clean-39"
"id": "reactflow__edge-1total_records-38"
}
],
"inputs": {
Expand Down Expand Up @@ -718,7 +718,7 @@
"identifier": "https://orcid.org/0000-0002-6506-6487"
},
{
"name": "Thimothée Poisot",
"name": "Timothée Poisot",
"identifier": "https://orcid.org/0000-0002-0735-5184"
}
],
Expand Down
3 changes: 3 additions & 0 deletions runners/julia-dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ FROM julia:1.9.3
# Pre-compiling Julia dependencies
RUN julia -e 'pwd(); using Pkg; Pkg.add.(["SpeciesDistributionToolkit", "JSON", "CSV", "DataFrames", "StatsBase", "EvoTrees", "MultivariateStats" ]); Pkg.instantiate();'

#COPY Project.toml /root/Project.toml
#COPY instantiate.jl /root/instantiate.jl
#RUN julia --project=. /root/instantiate.jl
RUN date +"%Y-%m-%d %R" > /version.txt
1 change: 0 additions & 1 deletion scripts/SDM/julia_sdms/fitBRT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ function main()

pseudoabsences = CSV.read(pseudoabs_path, DataFrame, delim="\t")
pseudoabs_layer = create_occurrence_layer(similar(predictors[1]), pseudoabsences)
#pseudoabs_layer = create_occurrence_layer(similar(predictors[1]), pseudoabs_df)

X, y, p_and_a_coords = get_features_and_labels(occurrence_layer, pseudoabs_layer, predictors)

Expand Down
12 changes: 8 additions & 4 deletions scripts/SDM/julia_sdms/fitBRT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,21 @@ inputs:
label: predictors
description: layer names (predictors) as a list
type: image/tiff;application=geotiff[]
example: ["/output/data/loadFromStac/ea82148a2926d97acf85cea61a110194/bio1_242b2b01561981-01-01.tif","/output/data/loadFromStac/ea82148a2926d97acf85cea61a110194/bio2_243a4e7f541981-01-01.tif"]
example:
[
"/output/data/loadFromStac/ea82148a2926d97acf85cea61a110194/bio1_242b2b01561981-01-01.tif",
"/output/data/loadFromStac/ea82148a2926d97acf85cea61a110194/bio2_243a4e7f541981-01-01.tif",
]
outputs:
sdm:
label: sdm
description: map of predicted occurrence probability
type: image/tiff;application=geotiff
sdm_uncertainty:
label: sdm uncertainty
description: map of relative uncertainty
label: sdm_uncertainty
description: map of relative uncertainty
type: image/tiff;application=geotiff
fit_stats:
label: fit_stats
description: JSON of model fit stats and threshold
description: JSON of model fit stats and threshold
type: text/json
3 changes: 2 additions & 1 deletion scripts/SDM/julia_sdms/pcaLayers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ function make_pca_layers(layers, land_idx)
end

function write_outputs(runtime_dir, layers)

predictor_paths = []

for (i,l) in enumerate(layers)
outpath = joinpath(runtime_dir, "predictor$i.tif")
push!(predictor_paths, outpath)
SpeciesDistributionToolkit.save(outpath, l)
SpeciesDistributionToolkit._write_geotiff(outpath, l; compress="COG")
end

output_json_path = joinpath(runtime_dir, "output.json")
Expand Down

0 comments on commit 1427b3c

Please sign in to comment.