Skip to content

Commit

Permalink
Merge pull request #48 from euroargodev/v0p1p16a
Browse files Browse the repository at this point in the history
V0p1p16a
  • Loading branch information
gaelforget authored Nov 19, 2023
2 parents dcc6056 + 7dcb126 commit 94dc243
Show file tree
Hide file tree
Showing 5 changed files with 735 additions and 342 deletions.
5 changes: 3 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ FTPClient = "01fcc997-4f28-56b8-8a06-30002c134abb"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
MeshArrays = "cb8c808f-1acf-59a3-9d2b-6e38d009f683"
MITgcmTools = "62725fbc-3a66-4df3-9000-e33e85b3a198"
MeshArrays = "cb8c808f-1acf-59a3-9d2b-6e38d009f683"
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
OceanStateEstimation = "891f6deb-a4f5-4bc5-a2e3-1e8f649cdd2c"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Expand All @@ -25,12 +25,13 @@ YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
[compat]
CSV = "0.6, 0.7, 0.8, 0.9, 0.10"
DataFrames = "0.20, 0.21, 0.22, 1"
Downloads = "1"
FTPClient = "1"
Glob = "1"
Interpolations = "0.13, 0.14"
JLD2 = "0.4"
MITgcmTools = "0.2"
MeshArrays = "0.2, 0.3"
MITgcmTools = "0.2"
NCDatasets = "0.10, 0.11, 0.12, 0.13"
OceanStateEstimation = "0.3"
OrderedCollections = "1"
Expand Down
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[deps]
Dataverse = "9c0b9be8-e31e-490f-90fe-77697562404d"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
PlutoSliderServer = "2fc8631c-6f24-4c5b-bca7-cbb509c42db4"
56 changes: 42 additions & 14 deletions docs/src/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,80 @@ The `One Argo Float` notebook demonstrates various functionalities of the `ArgoD

Downloading and accessing an Argo file (`wmo=13857` from `folder="aoml"`) is done like this.

```
```@example main
using ArgoData
input_file=GDAC.download_file("aoml",13857)
```

You can then simply access the file content using [NCDatasets.jl](https://github.com/Alexander-Barth/NCDatasets.jl#readme).

```@example main
using NCDatasets
Dataset(input_file)
ds=Dataset(input_file)
keys(ds)
```

A list of all `folder,wmo` pairs can be obtained using `files_list=GDAC.files_list()`. And a method to download files in bulk & parallel is presented in [examples/Argo\_distributed\_download.jl](https://github.com/euroargodev/ArgoData.jl/blob/master/examples/Argo_distributed_download.jl).

## Argo on Standard Depth Levels

### The `MITprof` Format
A more complete version of the workflow presented below is in this notebook:

👉 [from Argo to MITprof](../ArgoToMITprof.html) 👈 [(code)](https://raw.githubusercontent.com/euroargodev/ArgoData.jl/master/examples/ArgoToMITprof.jl)

The MITprof format is a simple to use version of Argo where profiles have been converted to potential temperature and interpolated to [standard depth levels](https://juliaocean.github.io/OceanRobots.jl/dev/Float_Argo.html).
### The `MITprof` Format

Turning an Argo file (`input_file`) into an MITprof file (`output_file`) proceeds as follows.
The MITprof format is a simple to use version of Argo where profiles have been converted to potential temperature and interpolated to [standard depth levels](https://juliaocean.github.io/OceanRobots.jl/dev/examples/Float_Argo.html).

```
Turning an Argo file (`input_file`) into an MITprof file (`output_file`) proceeds as follows.

1. gridded fields are retrieved. These climatologies enable quality control of the data and scientific applications in step 2.
2. read the Argo file and process it. The observed profiles are interpolated to standard depth levels, converted to potential temperature, quality controled, and appended climatological profiles.

!!! note
For more detail on the use of climatologies, representation error estimation, and model-data `cost functions`, see Forget et al 2015, Forget 2011, Forget and Wunsch 2007.

```@example main
output_file=input_file[1:end-7]*"MITprof.nc" # hide
isfile(output_file) ? mv(output_file,tempname()) : nothing # hide
gridded_fields=GriddedFields.load()
output_file=MITprof.format(gridded_fields,input_file)
ds2=Dataset(output_file)
keys(ds2)
```

### Associated Data Structure

The generated file can be accessed normally as a NetCDF file (e.g., `Dataset(output_file)`) or using the convenient `MITprofStandard` data structure.

```
```@example main
mp=MITprofStandard(output_file)
```

### Sample `MITprof` Files

The original collection of MITprof files from [Forget, et al 2015](http://dx.doi.org/10.5194/gmd-8-3071-2015) is archived [here](https://doi.org/10.7910/DVN/EE3C40). These files can be retrieved as follows.
The full set of MITprof profiles processed in 2023 from the [Argo](https://argo.ucsd.edu/) data base is available in [this Dataverse](https://doi.org/10.7910/DVN/7HLV09). This dataset can be explored and retrieved using [Dataverse.jl](https://github.com/gdcc/Dataverse.jl#readme).

```@example
using Dataverse
doi="https://doi.org/10.7910/DVN/7HLV09"
lst=Dataverse.file_list(doi)
Dataverse.file_download(lst,lst.filename[2],tempdir())
```
using CSV, DataFrames
tmp = CSV.File("examples/dataverse_files.csv") |> DataFrame
url0="https://dataverse.harvard.edu/api/access/datafile/"
run(`wget --content-disposition $(url0)$(tmp[1,:ID])`)

Another example is the original collection of MITprof files from [Forget, et al 2015](http://dx.doi.org/10.5194/gmd-8-3071-2015) is archived in [this Dataverse](https://doi.org/10.7910/DVN/EE3C40). This contains an earlier versio of Argo along with complementary datasets.

```@example
using Dataverse
doi="https://doi.org/10.7910/DVN/EE3C40"
lst=Dataverse.file_list(doi)
```

## `argopy` Python API
## Argo via Python API

The python library called [argopy](https://img.shields.io/readthedocs/argopy?logo=readthedocs) provides more ways to access, manipulate, and visualize [Argo data](https://argopy.readthedocs.io/en/latest/what_is_argo.html#what-is-argo). The notebook below demonstrates how you can :

[argopy](https://img.shields.io/readthedocs/argopy?logo=readthedocs) is a python library to access, manipulate, and visualize [Argo data](https://argopy.readthedocs.io/en/latest/what_is_argo.html#what-is-argo). The notebook demonstrate how to (1) install `argopy` into `Julia` via [Conda.jl](https://github.com/JuliaPy/Conda.jl) and (2) use `argopy` via [PyCall.jl](https://github.com/JuliaPy/PyCall.jl).
1. install `argopy` into `Julia` via [Conda.jl](https://github.com/JuliaPy/Conda.jl)
2. use `argopy` from Julia via [PyCall.jl](https://github.com/JuliaPy/PyCall.jl)

👉 [Notebook](http://gaelforget.net/notebooks/Argo_argopy.html) 👈 [(code)](https://raw.githubusercontent.com/euroargodev/ArgoData.jl/master/examples/Argo_argopy.jl)
Loading

0 comments on commit 94dc243

Please sign in to comment.