https://github.com/briochemc/oceanographycruises.jl
Types and interface for oceanographic cruise data (originally designed for AIBECS.jl)
https://github.com/briochemc/oceanographycruises.jl
Last synced: 3 months ago
JSON representation
Types and interface for oceanographic cruise data (originally designed for AIBECS.jl)
- Host: GitHub
- URL: https://github.com/briochemc/oceanographycruises.jl
- Owner: briochemc
- License: other
- Created: 2019-12-19T01:27:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-01T03:59:41.000Z (over 2 years ago)
- Last Synced: 2024-10-12T10:30:01.989Z (7 months ago)
- Language: Julia
- Homepage:
- Size: 38.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
- License: LICENSE.md
Awesome Lists containing this project
README
# OceanographyCruises.jl
*An interface for dealing with oceanographic cruises data*
Create a `Station`,
```julia
julia> using OceanographyCruisesjulia> st = Station(name="ALOHA", lat=22.75, lon=-158)
Station ALOHA (22.8N, 158.0W)
```a `CruiseTrack` of stations,
```julia
julia> N = 10 ;julia> stations = [Station(name=string(i), lat=i, lon=2i) for i in 1:N] ;
julia> ct = CruiseTrack(stations=stations, name="TestCruiseTrack")
Cruise TestCruiseTrack
┌─────────┬──────┬──────┬──────┐
│ Station │ Date │ Lat │ Lon │
├─────────┼──────┼──────┼──────┤
│ 1 │ │ 1.0 │ 2.0 │
│ 2 │ │ 2.0 │ 4.0 │
│ 3 │ │ 3.0 │ 6.0 │
│ 4 │ │ 4.0 │ 8.0 │
│ 5 │ │ 5.0 │ 10.0 │
│ 6 │ │ 6.0 │ 12.0 │
│ 7 │ │ 7.0 │ 14.0 │
│ 8 │ │ 8.0 │ 16.0 │
│ 9 │ │ 9.0 │ 18.0 │
│ 10 │ │ 10.0 │ 20.0 │
└─────────┴──────┴──────┴──────┘
```And make a `Transect` of `DepthProfiles` along that `CruiseTrack`
```julia
julia> depths = [10, 50, 100, 200, 300, 400, 500, 700, 1000, 2000, 3000, 5000] ;julia> idepths = [rand(Bool, length(depths)) for i in 1:N] ;
julia> profiles = [DepthProfile(station=stations[i], depths=depths[idepths[i]], values=rand(12)[idepths[i]]) for i in 1:N] ;
julia> t = Transect(tracer="PO₄", cruise=ct.name, profiles=profiles)
Transect of PO₄
Cruise TestCruiseTrack
┌─────────┬──────┬──────┬──────┐
│ Station │ Date │ Lat │ Lon │
├─────────┼──────┼──────┼──────┤
│ 1 │ │ 1.0 │ 2.0 │
│ 2 │ │ 2.0 │ 4.0 │
│ 3 │ │ 3.0 │ 6.0 │
│ 4 │ │ 4.0 │ 8.0 │
│ 5 │ │ 5.0 │ 10.0 │
│ 6 │ │ 6.0 │ 12.0 │
│ 7 │ │ 7.0 │ 14.0 │
│ 8 │ │ 8.0 │ 16.0 │
│ 9 │ │ 9.0 │ 18.0 │
│ 10 │ │ 10.0 │ 20.0 │
└─────────┴──────┴──────┴──────┘julia> t.profiles[3]
Depth profile at Station 3 (3.0N, 6.0E)
┌────────┬────────────────────┐
│ Depth │ Value │
├────────┼────────────────────┤
│ 50.0 │ 0.519255214063679 │
│ 300.0 │ 0.6289521421572468 │
│ 500.0 │ 0.8564006614918445 │
│ 5000.0 │ 0.7610393670925686 │
└────────┴────────────────────┘
```