Skip to content

Commit

Permalink
Merge pull request #142 from gaelforget/rename_pkg
Browse files Browse the repository at this point in the history
Rename pkg
  • Loading branch information
gaelforget authored Nov 10, 2024
2 parents 411bb54 + 9863e74 commit 9165f89
Show file tree
Hide file tree
Showing 22 changed files with 118 additions and 118 deletions.
12 changes: 6 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "IndividualDisplacements"
uuid = "b92f0c32-5b7e-11e9-1d7b-238b2da8b0e6"
name = "Drifters"
uuid = "bd752fb7-3f37-44cb-a8fb-f461137b623f"
authors = ["gaelforget <[email protected]>"]
version = "0.5.4"
version = "0.6.0"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand All @@ -22,9 +22,9 @@ Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
MITgcm = "dce5fa8e-68ce-4431-a242-9469c69627a0"

[extensions]
IndividualDisplacementsClimatologyExt = ["Climatology"]
IndividualDisplacementsMakieExt = ["Makie"]
IndividualDisplacementsMITgcmExt = ["MITgcm"]
DriftersClimatologyExt = ["Climatology"]
DriftersMakieExt = ["Makie"]
DriftersMITgcmExt = ["MITgcm"]

[compat]
CSV = "0.10"
Expand Down
12 changes: 6 additions & 6 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Documenter, Literate, PlutoSliderServer, IndividualDisplacements
using Documenter, Literate, PlutoSliderServer, Drifters
using Climatology

#download data dependencies if needed
IndividualDisplacements.datadeps.getdata("flt_example")
Drifters.datadeps.getdata("flt_example")
Climatology.get_ecco_velocity_if_needed();
Climatology.get_occa_velocity_if_needed();
Climatology.get_ecco_variable_if_needed("THETA")
Expand Down Expand Up @@ -35,8 +35,8 @@ ismd(f) = splitext(f)[2] == ".md"
pages(folder) = [joinpath(folder, f) for f in readdir(joinpath(src, folder)) if ismd(f)]

makedocs(;
sitename = "IndividualDisplacements.jl",
repo = Remotes.GitHub("JuliaClimate", "IndividualDisplacements.jl"),
sitename = "Drifters.jl",
repo = Remotes.GitHub("JuliaClimate", "Drifters.jl"),
authors="JuliaClimate <[email protected]>",
format = Documenter.HTML(),
pages = [
Expand All @@ -46,7 +46,7 @@ makedocs(;
"Tool Box" => "API.md"],
doctest = false,
warnonly = [:cross_references,:missing_docs],
modules = [IndividualDisplacements]
modules = [Drifters]
)

pth_in = joinpath(@__DIR__, "..","examples")
Expand All @@ -66,5 +66,5 @@ end
# See "Hosting Documentation" and deploydocs() in the Documenter manual
# for more information.
deploydocs(
repo = "github.com/JuliaClimate/IndividualDisplacements.jl.git",
repo = "github.com/JuliaClimate/Drifters.jl.git",
)
16 changes: 8 additions & 8 deletions docs/src/examples.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

## Examples

The four examples outlined below form a tutorial of sorts that complements the [User Guide](@ref). They hopefully provide a useful jumping off point in order to configure `IndividualDisplacements.jl` for new problems.
The four examples outlined below form a tutorial of sorts that complements the [User Guide](@ref). They hopefully provide a useful jumping off point in order to configure `Drifters.jl` for new problems.

Output generated by `IndividualDisplacements.jl` is in [DataFrames.jl](https://juliadata.github.io/DataFrames.jl/latest/) tabular format which comes with powerful and convenient analysis methods. They can readily be plotted in space and time using, e.g. , [Plots.jl](https://docs.juliaplots.org/stable/) or [Makie.jl](https://makie.juliaplots.org/stable/).
Output generated by `Drifters.jl` is in [DataFrames.jl](https://juliadata.github.io/DataFrames.jl/latest/) tabular format which comes with powerful and convenient analysis methods. They can readily be plotted in space and time using, e.g. , [Plots.jl](https://docs.juliaplots.org/stable/) or [Makie.jl](https://makie.juliaplots.org/stable/).

To rerun an example yourself, the recommended method is to copy the corresponding `notebook (code)` link, paste it into the [Pluto.jl](https://github.com/fonsp/Pluto.jl/wiki/🔎-Basic-Commands-in-Pluto) prompt, and click `open`.

## Simple Two-Dimensional Flow

[notebook (html)](random_flow_field.html)[notebook (code)](https://github.com/JuliaClimate/IndividualDisplacements.jl/blob/master/examples/basics/random_flow_field.jl)
[notebook (html)](random_flow_field.html)[notebook (code)](https://github.com/JuliaClimate/Drifters.jl/blob/master/examples/basics/random_flow_field.jl)

Simulate an ensemble of displacements (and trajectories) in a simple 2D configuration.

Expand All @@ -21,7 +21,7 @@ Exercises include the non-periodic domain case, statistics made easy via `DataFr

## Simple Three-Dimensional Flow

[notebook (html)](solid_body_rotation.html)[notebook (code)](https://github.com/JuliaClimate/IndividualDisplacements.jl/blob/master/examples/basics/solid_body_rotation.jl)
[notebook (html)](solid_body_rotation.html)[notebook (code)](https://github.com/JuliaClimate/Drifters.jl/blob/master/examples/basics/solid_body_rotation.jl)

Set up a three-dimensional flow field `u,v,w`, initialize a single particle at position `📌`, and wrap everything up within an `Individuals` data structure `I`.

Expand All @@ -31,26 +31,26 @@ The flow field consists of [rigid body rotation](https://en.wikipedia.org/wiki/R

## Global Ocean Circulation

[notebook (html)](global_ocean_circulation.html)[notebook (code)](https://github.com/JuliaClimate/IndividualDisplacements.jl/blob/master/examples/worldwide/global_ocean_circulation.jl)
[notebook (html)](global_ocean_circulation.html)[notebook (code)](https://github.com/JuliaClimate/Drifters.jl/blob/master/examples/worldwide/global_ocean_circulation.jl)

A simulation of floating particles over the Global Ocean which illustrates (1) using time variable velocity fields, (2) global connections, (3) particle re-seeding, and (4) output statistics.

The flow field is based on a data-constrained ocean model solution. The problem is configured in a way to mimic, albeit very crudely, the near-surface tranport of plastics or planktons.

## Three Dimensional Pathways

[notebook (html)](three_dimensional_ocean.html)[notebook (code)](https://github.com/JuliaClimate/IndividualDisplacements.jl/blob/master/examples/worldwide/three_dimensional_ocean.jl)
[notebook (html)](three_dimensional_ocean.html)[notebook (code)](https://github.com/JuliaClimate/Drifters.jl/blob/master/examples/worldwide/three_dimensional_ocean.jl)

A simulation of particles that follow the three-dimensional ocean circulation. This example illustrates (1) the 3D case in a relatistic configuration, (2) tracking the advent or origin of a water patch, and (3) multifacted visualizations in 3D.

The flow field is based on a data-constrained, realistic, ocean model. The problem configuration mimics, albeit very approximately, ocean tracers / coumpounds transported by water masses.

## Additional Examples

- Interactivity : [notebook (html)](interactive_UI.html)[notebook (code)](https://github.com/JuliaClimate/IndividualDisplacements.jl/blob/master/examples/worldwide/interactive_UI.jl)
- Interactivity : [notebook (html)](interactive_UI.html)[notebook (code)](https://github.com/JuliaClimate/Drifters.jl/blob/master/examples/worldwide/interactive_UI.jl)
- Atmosphere : [notebook (html)](https://gaelforget.github.io/MITgcm.jl/dev/examples/HS94_particles.html)[notebook (code)](https://raw.githubusercontent.com/gaelforget/MITgcm.jl/master/examples/HS94_particles.jl)
- MITgcm : [Particle cloud](../particle_cloud/index.html), [Detailed look](../detailed_look/index.html)
- Plotting : [Plots.jl](https://github.com/JuliaClimate/IndividualDisplacements.jl/blob/master/examples/more/recipes_plots.jl), [Makie.jl](https://github.com/JuliaClimate/IndividualDisplacements.jl/blob/master/examples/more/recipes_makie.jl), [PyPlot.jl](https://github.com/JuliaClimate/IndividualDisplacements.jl/blob/master/examples/more/recipes_pyplot.jl)
- Plotting : [Plots.jl](https://github.com/JuliaClimate/Drifters.jl/blob/master/examples/more/recipes_plots.jl), [Makie.jl](https://github.com/JuliaClimate/Drifters.jl/blob/master/examples/more/recipes_makie.jl), [PyPlot.jl](https://github.com/JuliaClimate/Drifters.jl/blob/master/examples/more/recipes_pyplot.jl)

## Animations

Expand Down
6 changes: 3 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# IndividualDisplacements.jl
# Drifters.jl

[IndividualDisplacements.jl](https://github.com/JuliaClimate/IndividualDisplacements.jl) computes elementary point displacements over gridded domains. Inter-operability with global climate model output (on [Arakawa](https://en.wikipedia.org/wiki/Arakawa_grids) `C-grids` in general) that can be represented via [MeshArrays.jl](https://github.com/JuliaClimate/MeshArrays.jl) (see [these docs](https://juliaclimate.github.io/MeshArrays.jl/dev/)) is a central goal of [IndividualDisplacements.jl](https://github.com/JuliaClimate/IndividualDisplacements.jl).
[Drifters.jl](https://github.com/JuliaClimate/Drifters.jl) computes elementary point displacements over gridded domains. Inter-operability with global climate model output (on [Arakawa](https://en.wikipedia.org/wiki/Arakawa_grids) `C-grids` in general) that can be represented via [MeshArrays.jl](https://github.com/JuliaClimate/MeshArrays.jl) (see [these docs](https://juliaclimate.github.io/MeshArrays.jl/dev/)) is a central goal of [Drifters.jl](https://github.com/JuliaClimate/Drifters.jl).

The initial example suite relies on gridded ocean transports estimated in [OCCA](https://doi.org/10.7910/DVN/RNXA2A) ([Forget 2010](http://dx.doi.org/10.1175/2009JPO4043.1)), [ECCOv4](https://eccov4.readthedocs.io/en/latest/) ([Forget et al. 2015](https://doi.org/10.5194/gmd-8-3071-2015)), and [CBIOMES](https://cbiomes.readthedocs.io/en/latest/) ([Forget, 2018](http://doi.org/10.5281/zenodo.1343303)). For the Atmosphere, an additional example based on an idealized model simulation is provided in [MITgcm.jl](https://gaelforget.github.io/MITgcm.jl/dev/).

Typical applications include the simulation and analysis of materials moving through atmospheric flows (e.g. dust or chemicals) or oceanic flows (e.g. plastics or planktons). An illustration of the type of observations that [IndividualDisplacements.jl](https://github.com/JuliaClimate/IndividualDisplacements.jl) can simulate is provided below. These data collected by [Ocean Drifting Buoy](https://doi.org/10.1002/2016JC011716) can be accessed via [OceanRobots.jl](https://gaelforget.github.io/OceanRobots.jl/dev/).
Typical applications include the simulation and analysis of materials moving through atmospheric flows (e.g. dust or chemicals) or oceanic flows (e.g. plastics or planktons). An illustration of the type of observations that [Drifters.jl](https://github.com/JuliaClimate/Drifters.jl) can simulate is provided below. These data collected by [Ocean Drifting Buoy](https://doi.org/10.1002/2016JC011716) can be accessed via [OceanRobots.jl](https://gaelforget.github.io/OceanRobots.jl/dev/).

[![Global Drifter Program data](https://user-images.githubusercontent.com/20276764/90924860-41799580-e3be-11ea-96bd-9a5784d00ecc.png)](https://youtu.be/82HPnYBtoVo)

4 changes: 2 additions & 2 deletions docs/src/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A central goal of this package is to support scientific analysis of model simula

As a starting point, the package supports all types of gridded model output (on Arakawa C-grids) from the [MIT General Circulation Model](https://mitgcm.readthedocs.io/en/latest/?badge=latest) via the [MeshArrays.jl](https://github.com/JuliaClimate/MeshArrays.jl) package ([docs found here](https://juliaclimate.github.io/MeshArrays.jl/dev/)).

By convention, `IndividualDisplacements.jl` expects input flow fields to be provided in a uniform fashion (see [`FlowFields`](@ref)) summarized below:
By convention, `Drifters.jl` expects input flow fields to be provided in a uniform fashion (see [`FlowFields`](@ref)) summarized below:

1. normalized to grid index units (i.e. in 1/s rather than m/s units)
1. positive towards increasing indices
Expand All @@ -31,7 +31,7 @@ For an overview of the examples, please refer to the **example guide**. The rest
The `Individuals` struct contains a `FlowFields` struct (incl. e.g. arrays), initial positions for the individuals, and the other elements (e.g. functions) involved in `∫!(I,T)` as documented hereafter.

```@autodocs
Modules = [IndividualDisplacements]
Modules = [Drifters]
Order = [:type]
```

Expand Down
12 changes: 6 additions & 6 deletions examples/more/detailed_look.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# A more detailed look at spatial interpolation, integration through time, and I/O.
# For additional documentation e.g. see
# [1](https://JuliaClimate.github.io/IndividualDisplacements.jl/dev/),
# [1](https://JuliaClimate.github.io/Drifters.jl/dev/),
# [2](https://JuliaClimate.github.io/MeshArrays.jl/dev/),
# [3](https://docs.juliadiffeq.org/latest/solvers/ode_solve.html),
# [4](https://en.wikipedia.org/wiki/Displacement_(vector)).
Expand All @@ -21,18 +21,18 @@

# ## 1. Import Software

using IndividualDisplacements, MITgcm
import IndividualDisplacements.OrdinaryDiffEq as OrdinaryDiffEq
import IndividualDisplacements.DataFrames as DataFrames
p=dirname(pathof(IndividualDisplacements))
using Drifters, MITgcm
import Drifters.OrdinaryDiffEq as OrdinaryDiffEq
import Drifters.DataFrames as DataFrames
p=dirname(pathof(Drifters))
include(joinpath(p,"../examples/more/example123.jl"))
#md include(joinpath(p,"../examples/more/recipes_plots.jl"))

# ## 2. Read Trajectory Output
#
# from `MITgcm/pkg/flt`

flt_example_path = IndividualDisplacements.datadeps.getdata("flt_example")
flt_example_path = Drifters.datadeps.getdata("flt_example")
prec=Float32
df=read_flt(flt_example_path*"/",prec);

Expand Down
14 changes: 7 additions & 7 deletions examples/more/example123.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using IndividualDisplacements, MeshArrays, MITgcm, Statistics
import IndividualDisplacements.OrdinaryDiffEq as OrdinaryDiffEq
using Drifters, MeshArrays, MITgcm, Statistics
import Drifters.OrdinaryDiffEq as OrdinaryDiffEq

"""
read_mds(filRoot::String,x::MeshArray)
Expand Down Expand Up @@ -39,13 +39,13 @@ earlier, rather than computing trajectories as in the other examples.
```
df=example1()
p=dirname(pathof(IndividualDisplacements))
p=dirname(pathof(Drifters))
include(joinpath(p,"../examples/recipes_pyplot.jl"))
PyPlot.figure(); PlotMapProj(df,300); gcf()
```
"""
function example1()
p=dirname(pathof(IndividualDisplacements))
p=dirname(pathof(Drifters))
dirIn=joinpath(p,"../examples/run_offflt/")
prec=Float32
df=read_flt(dirIn,prec)
Expand All @@ -60,7 +60,7 @@ extended and modified configuration of the standard MITgcm test case.
```
(𝐼,df,ref)=example2();
p=dirname(pathof(IndividualDisplacements))
p=dirname(pathof(Drifters))
include(joinpath(p,"../examples/recipes_plots.jl"))
PlotBasic(df,300,100000.0)
Expand Down Expand Up @@ -92,7 +92,7 @@ example2_xy()
Read MITgcm/pkg/flt output
"""
function example2_xy(𝑃)
flt_example_path = IndividualDisplacements.datadeps.getdata("flt_example")
flt_example_path = Drifters.datadeps.getdata("flt_example")
prec=Float32
df=read_flt(flt_example_path*"/",prec)
#
Expand Down Expand Up @@ -123,7 +123,7 @@ function example2_setup()

###### 1) Get gridded variables via MeshArrays.jl

flt_example_path = IndividualDisplacements.datadeps.getdata("flt_example")
flt_example_path = Drifters.datadeps.getdata("flt_example")
γ=gcmgrid(flt_example_path*"/","PeriodicChannel",1,[(80,42)], [80 42], Float32, read, write)
nr=8

Expand Down
6 changes: 3 additions & 3 deletions examples/more/example_CyclicArray.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

using IndividualDisplacements
import IndividualDisplacements.CyclicArrays as CyclicArrays
import IndividualDisplacements.OrdinaryDiffEq as OrdinaryDiffEq
using Drifters
import Drifters.CyclicArrays as CyclicArrays
import Drifters.OrdinaryDiffEq as OrdinaryDiffEq

function cyclicarray_example()
𝑃=cyclicarray_setup()
Expand Down
14 changes: 7 additions & 7 deletions examples/more/particle_cloud.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
# Using the same setup as `detailed_look.jl` or `example2()`, here we simulate
# a point cloud getting advected by the flow field.
# For additional documentation e.g. see :
# [1](https://JuliaClimate.github.io/IndividualDisplacements.jl/dev/),
# [1](https://JuliaClimate.github.io/Drifters.jl/dev/),
# [2](https://JuliaClimate.github.io/MeshArrays.jl/dev/),
# [3](https://docs.juliadiffeq.org/latest/solvers/ode_solve.html),
# [4](https://en.wikipedia.org/wiki/Displacement_(vector))

# ## 1. Import Software

using IndividualDisplacements, Statistics
using Drifters, Statistics

import IndividualDisplacements.OrdinaryDiffEq: solve, Tsit5
import IndividualDisplacements.DataFrames: DataFrame
import Drifters.OrdinaryDiffEq: solve, Tsit5
import Drifters.DataFrames: DataFrame

p=dirname(pathof(IndividualDisplacements))
p=dirname(pathof(Drifters))
include(joinpath(p,"../examples/more/example123.jl"));
#md include(joinpath(p,"../examples/more/recipes_plots.jl"))

Expand All @@ -31,7 +31,7 @@ x=vec([x-0.5 for x in ii1, y in ii2])
y=vec([y-0.5 for x in ii1, y in ii2])
xy = permutedims([[x[i];y[i];1.0] for i in eachindex(x)])

solv(prob) = IndividualDisplacements.ensemble_solver(prob,solver=Tsit5(),reltol=1e-6,abstol=1e-6)
solv(prob) = Drifters.ensemble_solver(prob,solver=Tsit5(),reltol=1e-6,abstol=1e-6)
tr = DataFrame(ID=Int[], x=Float64[], y=Float64[], t=Float64[])

#𝐼 = Individuals{Float64,2}(📌=xy[:,:], 🔴=tr, 🆔=collect(1:size(xy,2)),
Expand All @@ -54,6 +54,6 @@ I=(position=xy,record=deepcopy(tr),velocity=dxdt!,

# Compare with trajectory output from `MITgcm`

#flt_example_path = IndividualDisplacements.datadeps.getdata("flt_example")
#flt_example_path = Drifters.datadeps.getdata("flt_example")
#df=read_flt(flt_example_path*"/",Float32)
#ref=plot_paths(df,size(xy,2),100000.0)
8 changes: 4 additions & 4 deletions examples/more/recipes_makie.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

using Makie, MeshArrays, ColorSchemes, Statistics
import IndividualDisplacements.DataFrames: DataFrame, groupby
import Drifters.DataFrames: DataFrame, groupby

"""
plot(𝐼::Individuals)
Expand All @@ -25,7 +25,7 @@ end
Plot random subset of size nn trajectories.
"""
function plot_paths(df::DataFrame,nn::Integer,dMax::Float64=0.)
IDs = IndividualDisplacements.randperm(maximum(df.ID))
IDs = Drifters.randperm(maximum(df.ID))
COs=[:gray76 :gold :limegreen :black]

#scene=Scene(limits=FRect(0, 0, 40, 40),show_axis = false)
Expand Down Expand Up @@ -57,8 +57,8 @@ MakieScatterMovie(scene,df,tt,fil::String)
Animate positions, according to time vector tt, and save movie to mp4 file.
```
using IndividualDisplacements
p=dirname(pathof(IndividualDisplacements))
using Drifters
p=dirname(pathof(Drifters))
include(joinpath(p,"../examples/more/recipes_Makie.jl"))
module ex3
fil="../examples/worldwide/three_dimensional_ocean.jl"
Expand Down
4 changes: 2 additions & 2 deletions examples/more/recipes_plots.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Plots
import IndividualDisplacements.DataFrames: DataFrame, groupby
import Drifters.DataFrames: DataFrame, groupby

"""
plot(𝐼::Individuals)
Expand All @@ -24,7 +24,7 @@ end
Plot random subset of size nn trajectories / paths.
"""
function plot_paths(df::DataFrame,nn::Integer,dMax::Float64=0.)
IDs = IndividualDisplacements.randperm(maximum(df.ID))
IDs = Drifters.randperm(maximum(df.ID))
COs=["w" "y" "g" "k"]

plt=plot(leg=false)
Expand Down
4 changes: 2 additions & 2 deletions examples/more/recipes_pyplot.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

using PyPlot, PyCall
import IndividualDisplacements.DataFrames: DataFrame, groupby
import Drifters.DataFrames: DataFrame, groupby

"""
PlotMapProj(df::DataFrame,nn::Integer)
Expand All @@ -19,7 +19,7 @@ function PlotMapProj(df::DataFrame,nn::Integer)
ax.stock_img()

# Draw trajectories
IDs = IndividualDisplacements.randperm(maximum(df.ID))
IDs = Drifters.randperm(maximum(df.ID))
COs=["w" "y" "g" "k"]

#for global ocean case:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module IndividualDisplacementsClimatologyExt
module DriftersClimatologyExt

using Climatology, IndividualDisplacements
import IndividualDisplacements: data_path
using Climatology, Drifters
import Drifters: data_path


function data_path(name::Symbol)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

module IndividualDisplacementsMITgcmExt
module DriftersMITgcmExt

using MITgcm, IndividualDisplacements
import IndividualDisplacements: read_data_ECCO, NetCDF
using MITgcm, Drifters
import Drifters: read_data_ECCO, NetCDF

function read_data_ECCO(m0,v0,path,grid,k)
MITgcm.read_nctiles(joinpath(path,v0),v0,grid,I=(:,:,k,m0))
Expand Down
Loading

0 comments on commit 9165f89

Please sign in to comment.