Skip to content

Commit

Permalink
Move precipitation to artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
Sbozzolo committed May 28, 2024
1 parent f9bb7aa commit 72fccfa
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 27 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ TempestRemap_jll = "8573a8c5-1df0-515e-a024-abad257ee284"
Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"

[compat]
CUDA = "5"
ClimaComms = "0.5.6"
ClimaCore = "0.14"
ClimaCoreTempestRemap = "0.3"
CUDA = "5"
ClimaUtilities = "0.1"
Dates = "1"
DocStringExtensions = "0.8, 0.9"
JLD2 = "0.4"
Expand Down
3 changes: 0 additions & 3 deletions artifacts/Artifacts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ git-tree-sha1 = "0c6039bfcc39f6c6cb20fb331a71f6a381d93f24"
[land_mask]
git-tree-sha1 = "e41bc8c44124f867b64a9d70f1599515ae27f38a"

[pr_obs_data]
git-tree-sha1 = "7486bf32e9352493f69364aead26f01eaf90d2af"

[sic]
git-tree-sha1 = "139d23f6de29900917d79b41a87a8ee6483c72d0"

Expand Down
12 changes: 0 additions & 12 deletions artifacts/artifact_funcs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,6 @@ function mask_dataset_path()
return AW.get_data_folder(mask_dataset)
end

function pr_obs_data_path()
pr_obs_data = AW.ArtifactWrapper(
@__DIR__,
"pr_obs_data",
AW.ArtifactFile[AW.ArtifactFile(
url = "https://caltech.box.com/shared/static/k1or5d0d9xdvyfiytl1os7z341monkzn.nc",
filename = "gpcp.precip.mon.mean.197901-202305.nc",
),],
)
return AW.get_data_folder(pr_obs_data)
end

"""
artifact_data(datapath_full, filename)
Expand Down
1 change: 0 additions & 1 deletion artifacts/download_artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ function trigger_download()
@info "sic dataset path: `$(sic_dataset_path())`"
@info "co2 dataset path: `$(co2_dataset_path())`"
@info "mask dataset path: `$(mask_dataset_path())`"
@info "pr obs data path: `$(pr_obs_data_path())`"
return nothing
end
trigger_download()
11 changes: 7 additions & 4 deletions experiments/ClimaEarth/Artifacts.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
[land_mask]
git-tree-sha1 = "e41bc8c44124f867b64a9d70f1599515ae27f38a"

[pr_obs_data]
git-tree-sha1 = "7486bf32e9352493f69364aead26f01eaf90d2af"

[sic]
git-tree-sha1 = "139d23f6de29900917d79b41a87a8ee6483c72d0"

Expand All @@ -19,3 +15,10 @@ git-tree-sha1 = "aa2d5178a656e9ce7a37698d978d8ed92aa46d99"
[[cmip_model_rmse.download]]
sha256 = "b019d40510cebc678899a74d2cf14e33aa60452805478b2bf7176b891012aa97"
url = "https://caltech.box.com/shared/static/lmzvnjkxctlb0fanieeqxll0vdrbei9e.gz"

[precipitation_obs]
git-tree-sha1 = "7486bf32e9352493f69364aead26f01eaf90d2af"

[[precipitation_obs.download]]
sha256 = "463ebc1886c4e0be9656656da699f2cbb87d7c2568d5e81277c0c8a415dc8143"
url = "https://caltech.box.com/shared/static/j63uak557kw7tlzb3dgwifoaeczekzm4.gz"
2 changes: 2 additions & 0 deletions experiments/ClimaEarth/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ClimaCoupler = "4ade58fe-a8da-486c-bd89-46df092ec0c7"
ClimaLand = "08f4d4ce-cf43-44bb-ad95-9d2d5f413532"
ClimaParams = "5c42b081-d73a-476f-9059-fd94b934656c"
ClimaTimeSteppers = "595c0a79-7f3d-439a-bc5a-b232dc3bde79"
ClimaUtilities = "b3f4f4ca-9299-4f7f-bd9b-81e1242a7513"
CloudMicrophysics = "6a9e3e04-43cd-43ba-94b9-e8782df3c71b"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
CommonDataModel = "1fbeeb36-5f17-413c-809b-666fb144f157"
Expand Down Expand Up @@ -61,6 +62,7 @@ ClimaCorePlots = "0.2"
ClimaLand = "0.12"
ClimaParams = "0.10"
ClimaTimeSteppers = "0.7"
ClimaUtilities = "0.1"
Colors = "0.12"
Dierckx = "0.5"
ForwardDiff = "0.10"
Expand Down
4 changes: 2 additions & 2 deletions experiments/ClimaEarth/user_io/leaderboard/Leaderboard.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Leaderboard

import ClimaComms
import ClimaAnalysis
import Dates
import NCDatasets
Expand All @@ -9,11 +10,10 @@ import GeoMakie
import ClimaCoupler
import Statistics: mean
import Artifacts
import ClimaUtilities: @clima_artifact

include(joinpath(pkgdir(ClimaCoupler), "artifacts", "artifact_funcs.jl"))
include("data_sources.jl")
include("utils.jl")
include("compare_with_obs.jl")


end
2 changes: 1 addition & 1 deletion experiments/ClimaEarth/user_io/leaderboard/cmip_rmse.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Statistics: median

pr_file_path = joinpath(artifact"cmip_model_rmse", "pr_rmse_amippr_amip.csv")
pr_file_path = joinpath(@clima_artifact("cmip_model_rmse"), "pr_rmse_amip_pr_amip_5yr")

open(pr_file_path, "r") do io
# Skip the header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ function Base.values(r::RMSEs)
return val_or_rmse.([r.ANN, r.DJF, r.JJA, r.MAM, r.SON])
end

OBS_DS["pr"] =
ObsDataSource(; path = joinpath(pr_obs_data_path(), "gpcp.precip.mon.mean.197901-202305.nc"), var_name = "precip")
OBS_DS["pr"] = ObsDataSource(;
path = joinpath(@clima_artifact("precipitation_obs"), "gpcp.precip.mon.mean.197901-202305.nc"),
var_name = "precip",
)

SIM_DS_KWARGS["pr"] = (; preprocess_data_fn = preprocess_pr_fn, new_units = "mm / day")

Expand Down
2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ClimaCoupler = "4ade58fe-a8da-486c-bd89-46df092ec0c7"
ClimaLand = "08f4d4ce-cf43-44bb-ad95-9d2d5f413532"
ClimaParams = "5c42b081-d73a-476f-9059-fd94b934656c"
ClimaTimeSteppers = "595c0a79-7f3d-439a-bc5a-b232dc3bde79"
ClimaUtilities = "b3f4f4ca-9299-4f7f-bd9b-81e1242a7513"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
GeoMakie = "db073c08-6b98-4ee5-b6a4-5efafb3259c6"
Expand Down Expand Up @@ -43,6 +44,7 @@ ArtifactWrappers = "0.2"
ClimaAtmos = "0.24"
ClimaLand = "0.12"
ClimaParams = "0.10"
ClimaUtilities = "0.1"
Dates = "1"
Downloads = "1"
IntervalSets = "0.5, 0.6, 0.7"
Expand Down
6 changes: 6 additions & 0 deletions test/experiment_tests/Artifacts.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[precipitation_obs]
git-tree-sha1 = "7486bf32e9352493f69364aead26f01eaf90d2af"

[[precipitation_obs.download]]
sha256 = "463ebc1886c4e0be9656656da699f2cbb87d7c2568d5e81277c0c8a415dc8143"
url = "https://caltech.box.com/shared/static/j63uak557kw7tlzb3dgwifoaeczekzm4.gz"
3 changes: 2 additions & 1 deletion test/experiment_tests/leaderboard.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Test: @test, @testset, @test_throws
import ClimaComms
import ClimaCoupler
import ClimaAnalysis
import Dates
Expand Down Expand Up @@ -67,7 +68,7 @@ end
@test Leaderboard.data_at_date(sim_datasource, Dates.DateTime(1979, 1, 2)) == preprocess_fn(pr.data[1, :, :])

obs_datasource = Leaderboard.ObsDataSource(;
path = joinpath(pr_obs_data_path(), "gpcp.precip.mon.mean.197901-202305.nc"),
path = joinpath(@clima_artifact("precipitation_obs"), "gpcp.precip.mon.mean.197901-202305.nc"),
var_name = "precip",
preprocess_data_fn = preprocess_fn,
)
Expand Down

0 comments on commit 72fccfa

Please sign in to comment.