Skip to content

Commit

Permalink
Merge pull request #46 from euroargodev/extended_workflow
Browse files Browse the repository at this point in the history
Extended workflow
  • Loading branch information
gaelforget committed Nov 18, 2023
2 parents 67acaf0 + 8596dce commit dcc6056
Show file tree
Hide file tree
Showing 21 changed files with 3,800 additions and 208 deletions.
11 changes: 7 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ArgoData"
uuid = "9eb831cf-c491-48dc-bed4-6aca718df73c"
authors = ["gaelforget <[email protected]>"]
version = "0.1.15"
version = "0.1.16"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand All @@ -11,8 +11,9 @@ Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
FTPClient = "01fcc997-4f28-56b8-8a06-30002c134abb"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
MITgcmTools = "62725fbc-3a66-4df3-9000-e33e85b3a198"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
MeshArrays = "cb8c808f-1acf-59a3-9d2b-6e38d009f683"
MITgcmTools = "62725fbc-3a66-4df3-9000-e33e85b3a198"
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
OceanStateEstimation = "891f6deb-a4f5-4bc5-a2e3-1e8f649cdd2c"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Expand All @@ -27,10 +28,12 @@ DataFrames = "0.20, 0.21, 0.22, 1"
FTPClient = "1"
Glob = "1"
Interpolations = "0.13, 0.14"
JLD2 = "0.4"
MITgcmTools = "0.2"
MeshArrays = "0.2"
NCDatasets = "0.10, 0.11, 0.12"
MeshArrays = "0.2, 0.3"
NCDatasets = "0.10, 0.11, 0.12, 0.13"
OceanStateEstimation = "0.3"
OrderedCollections = "1"
Statistics = "1"
YAML = "0.4"
julia = "1.7"
6 changes: 3 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ makedocs(;
format=Documenter.HTML(),
pages=[
"Home" => "index.md",
"Modules" => "modules.md",
"Reference" => "functions.md",
"Examples" => "examples.md",
"Reference" => "Functionalities.md",
],
repo="https://github.com/euroargodev/ArgoData.jl/blob/{commit}{path}#L{line}",
sitename="ArgoData.jl",
authors="gaelforget <[email protected]>",
assets=String[],
warnonly = [:cross_references,:missing_docs],
)

#create csv list of floats
Expand Down
53 changes: 53 additions & 0 deletions docs/src/Functionalities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@


Content of this section:

- Data Structures
- Modules (1): GDAC, MITprof, GriddedFields
- Modules (2): MITprofAnalysis, MITprofStat

## Data Structures

```@docs
ProfileNative
ProfileStandard
MITprofStandard
```

## Module: GDAC

```@autodocs
Modules = [GDAC]
Order = [:type,:function]
```

## Module: MITprof

```@autodocs
Modules = [MITprof]
Order = [:type,:function]
```

## Module: GriddedFields

```@autodocs
Modules = [GriddedFields]
Order = [:type,:function]
```


## Module: MITprofAnalysis

```@autodocs
Modules = [MITprofAnalysis]
Order = [:type,:function]
```

## Module: MITprofStat

```@autodocs
Modules = [MITprofStat]
Order = [:type,:function]
```


26 changes: 13 additions & 13 deletions docs/src/modules.md β†’ docs/src/examples.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

## Workflows
The `One Argo Float` notebook demonstrates various functionalities of the `ArgoData.jl` package, which are further documented below.

### Direct Download
πŸ‘‰ [One Argo Float](https://juliaocean.github.io/OceanRobots.jl/dev/examples/Float_Argo.html) πŸ‘ˆ [(code)](https://raw.githubusercontent.com/juliaocean/OceanRobots.jl/master/examples/Float_Argo.jl)

## Download From Argo Data Center

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

Expand All @@ -15,30 +17,30 @@ Dataset(input_file)

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).

### `MITprof` Format
## Argo on Standard Depth Levels

πŸ‘‰ [Notebook 1](https://juliaocean.github.io/OceanRobots.jl/dev/Float_Argo.html) πŸ‘ˆ [(code)](https://raw.githubusercontent.com/juliaocean/OceanRobots.jl/master/examples/Float_Argo.jl)
### The `MITprof` Format

πŸ‘‰ [Notebook 2](../ArgoToMITprof.html) πŸ‘ˆ [(code)](https://raw.githubusercontent.com/euroargodev/ArgoData.jl/master/examples/ArgoToMITprof.jl)
πŸ‘‰ [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).

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

```
gridded_fields=GriddedFields.load()
output_file=MITprof.format(gridded_fields,input_file)
```

**`MITprofStandard` Data Structure**
### 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.

```
mp=MITprofStandard(output_file)
```

### `MITprof` Sample Files
### 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.

Expand All @@ -49,10 +51,8 @@ url0="https://dataverse.harvard.edu/api/access/datafile/"
run(`wget --content-disposition $(url0)$(tmp[1,:ID])`)
```

### `argopy` Python API

πŸ‘‰ [Notebook](http://gaelforget.net/notebooks/Argo_argopy.html) πŸ‘ˆ [(code)](https://raw.githubusercontent.com/euroargodev/ArgoData.jl/master/examples/Argo_argopy.jl)
## `argopy` Python API

[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).
[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).

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).
πŸ‘‰ [Notebook](http://gaelforget.net/notebooks/Argo_argopy.html) πŸ‘ˆ [(code)](https://raw.githubusercontent.com/euroargodev/ArgoData.jl/master/examples/Argo_argopy.jl)
17 changes: 0 additions & 17 deletions docs/src/functions.md

This file was deleted.

16 changes: 10 additions & 6 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# ArgoData.jl

Analysis and Processing of
Tools to access, visualize, process, and analyze of
[Argo](https://argopy.readthedocs.io/en/latest/what_is_argo.html#what-is-argo) ocean data sets.

## Contents
### Contents

- `GDAC` module to access and retrieve files from Argo server
- `MITprof` format of [Forget, et al 2015](http://dx.doi.org/10.5194/gmd-8-3071-2015) for [standard depth data](https://doi.org/10.7910/DVN/EE3C40)
- `MITprof_plots` module (in `examples/`) for `MITprof`
- `AnalysisMethods` for cost functions and geospatial statistics
- `Notebooks`
- `MITprof` module for the format of [Forget, et al 2015](http://dx.doi.org/10.5194/gmd-8-3071-2015)
- `MITprofPlots` module (in `examples/`) for `MITprof`
- `MITprofAnalysis` module for model-data comparison
- `MITprofAnalysis` module for tabular data access
- `MITprofStat` module geospatial statistics

### Notebooks

- [ArgoData](https://juliaocean.github.io/OceanRobots.jl/dev/examples/Float_Argo.html) πŸš€ interactive vizualisation
- [MITprof](https://euroargodev.github.io/ArgoData.jl/dev/ArgoToMITprof.html) πŸš€ simplified format
- [argopy](http://gaelforget.net/notebooks/Argo_argopy.html) πŸš€ python API via Julia
Expand Down
14 changes: 7 additions & 7 deletions examples/ArgoToMITprof_step2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ prof_std.Sweight[1:5]
# +
#4. spatio-temporal interpolation

fac,rec=ArgoTools.monthly_climatology_factors(prof.date[1])
(fac0,fac1,rec0,rec1)=ArgoTools.monthly_climatology_factors(prof.date[1])
# -

prof_T1=[GriddedFields.Interpolate(gridded_fields.T[rec[1]][:,k],πŸ“š.f,πŸ“š.i,πŸ“š.j,πŸ“š.w)[1] for k=1:50]
prof_T2=[GriddedFields.Interpolate(gridded_fields.T[rec[2]][:,k],πŸ“š.f,πŸ“š.i,πŸ“š.j,πŸ“š.w)[1] for k=1:50];
prof_T0=[GriddedFields.Interpolate(gridded_fields.T[rec0][:,k],πŸ“š.f,πŸ“š.i,πŸ“š.j,πŸ“š.w)[1] for k=1:50]
prof_T1=[GriddedFields.Interpolate(gridded_fields.T[rec1][:,k],πŸ“š.f,πŸ“š.i,πŸ“š.j,πŸ“š.w)[1] for k=1:50];

prof_std.Testim.=ArgoTools.interp_z(-gridded_fields.Ξ“.RC,fac[1]*prof_T1+fac[2]*prof_T2,z_std)
prof_std.Testim.=ArgoTools.interp_z(-gridded_fields.Ξ“.RC,fac0*prof_T0+fac1*prof_T1,z_std)
prof_std.Testim[1:5]

if do_plot
Expand All @@ -107,11 +107,11 @@ end
# +
#4. spatio-temporal interpolation

prof_S1=[GriddedFields.Interpolate(gridded_fields.S[rec[1]][:,k],πŸ“š.f,πŸ“š.i,πŸ“š.j,πŸ“š.w)[1] for k=1:50]
prof_S2=[GriddedFields.Interpolate(gridded_fields.S[rec[2]][:,k],πŸ“š.f,πŸ“š.i,πŸ“š.j,πŸ“š.w)[1] for k=1:50];
prof_S0=[GriddedFields.Interpolate(gridded_fields.S[rec0][:,k],πŸ“š.f,πŸ“š.i,πŸ“š.j,πŸ“š.w)[1] for k=1:50]
prof_S1=[GriddedFields.Interpolate(gridded_fields.S[rec1][:,k],πŸ“š.f,πŸ“š.i,πŸ“š.j,πŸ“š.w)[1] for k=1:50];
# -

prof_std.Sestim.=ArgoTools.interp_z(-gridded_fields.Ξ“.RC,fac[1]*prof_S1+fac[2]*prof_S2,z_std)
prof_std.Sestim.=ArgoTools.interp_z(-gridded_fields.Ξ“.RC,fac0*prof_S0+fac1*prof_S1,z_std)
prof_std.Sestim[1:5]

ArgoTools.prof_test_set2!(prof_std,meta);
Expand Down
Loading

0 comments on commit dcc6056

Please sign in to comment.