Skip to content
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

Add a directory option to download data in ECCORestoring #306

Merged
merged 28 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
94669d4
fix jra55 and bathymetry
simone-silvestri Sep 17, 2024
a202674
add correct dirs
simone-silvestri Sep 17, 2024
3321f2e
fix jra55 tests
simone-silvestri Sep 17, 2024
a6ecdca
dowload directory also for ecco
simone-silvestri Sep 17, 2024
5ab2157
make and delete ECCO directory
simone-silvestri Sep 17, 2024
d3cc3c3
correct
simone-silvestri Sep 17, 2024
ac244e3
try downloading in init
simone-silvestri Sep 18, 2024
61f6703
call it "path" instead of dir
simone-silvestri Sep 18, 2024
1fce1de
remove data directories
simone-silvestri Sep 18, 2024
3bb7369
docstring
simone-silvestri Sep 18, 2024
e6cac0f
removed filename
simone-silvestri Sep 18, 2024
dd77c95
fix another bug
simone-silvestri Sep 19, 2024
c4d7b9b
Merge remote-tracking branch 'origin/main' into ss/fix-directories
simone-silvestri Sep 20, 2024
00cc01d
remove filename
simone-silvestri Sep 20, 2024
a139b8a
fix tests
simone-silvestri Sep 24, 2024
80113e3
change directory
simone-silvestri Oct 7, 2024
13505c0
Merge branch 'main' into ss/fix-directories
simone-silvestri Oct 8, 2024
9baa1f6
bugfix
simone-silvestri Oct 8, 2024
bf7fde0
Merge branch 'ss/fix-directories' of github.com:CliMA/ClimaOcean.jl i…
simone-silvestri Oct 8, 2024
63ea456
initialize cuda runtime
simone-silvestri Oct 9, 2024
9e73b4c
Update ECCO_restoring.jl
simone-silvestri Dec 19, 2024
8a2f237
correct show method
simone-silvestri Dec 19, 2024
b34a593
Merge branch 'ss/data-dir' of github.com:CliMA/ClimaOcean.jl into ss/…
simone-silvestri Dec 19, 2024
395a2d5
dir instead of data_dir
simone-silvestri Dec 21, 2024
631d6e7
Merge branch 'main' into ss/data-dir
navidcy Dec 22, 2024
31fec4c
Update ECCO_restoring.jl
simone-silvestri Dec 22, 2024
6a47ee3
Merge branch 'main' into ss/data-dir
simone-silvestri Dec 22, 2024
8052736
Merge branch 'main' into ss/data-dir
navidcy Dec 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions mwe.jl

This file was deleted.

1 change: 0 additions & 1 deletion src/DataWrangling/ECCO/ECCO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ using Adapt
using Scratch

download_ECCO_cache::String = ""

function __init__()
global download_ECCO_cache = @get_scratch!("ECCO")
end
Expand Down
9 changes: 7 additions & 2 deletions src/DataWrangling/ECCO/ECCO_restoring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ end
ECCOFieldTimeSeries(variable_name::Symbol, version=ECCO4Monthly(); kw...) =
ECCOFieldTimeSeries(ECCOMetadata(variable_name, all_ECCO_dates(version), version); kw...)

# Variable names for restoreable data
# Variable names for restorable data
struct Temperature end
struct Salinity end
struct UVelocity end
Expand Down Expand Up @@ -244,6 +244,7 @@ end
time_indexing = Cyclical(),
mask = 1,
rate = 1,
dir = download_ECCO_cache,
inpainting = NearestNeighborInpainting(Inf),
cache_inpainted_data = true)

Expand Down Expand Up @@ -296,6 +297,9 @@ Keyword Arguments

- `rate`: The restoring rate, i.e., the inverse of the restoring timescale (in s⁻¹).

- `dir`: The directory where the native ECCO data is located. If the data does not exist it will
be automatically downloaded. Default: `download_ECCO_cache`.

- `inpainting`: inpainting algorithm, see [`inpaint_mask!`](@ref). Default: `NearestNeighborInpainting(Inf)`.

- `cache_inpainted_data`: If `true`, the data is cached to disk after inpainting for later retrieving.
Expand All @@ -305,9 +309,10 @@ function ECCORestoring(variable_name::Symbol,
arch_or_grid = CPU();
version = ECCO4Monthly(),
dates = all_ECCO_dates(version),
dir = download_ECCO_cache,
kw...)

metadata = ECCOMetadata(variable_name, dates, version)
metadata = ECCOMetadata(variable_name, dates, version, dir)
return ECCORestoring(metadata, arch_or_grid; kw...)
end

Expand Down
Loading