Skip to content

Commit 970e2b2

Browse files
authored
Merge pull request #70 from jbisits/removeRasterHistograms
Remove `RasterHistogram` module as it now has its own package
2 parents 2abf4f6 + 0a6388a commit 970e2b2

19 files changed

+287
-1145
lines changed

Project.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "OceanRasterConversions"
22
uuid = "07ff2621-03e0-4bfb-9812-e5d28c6dbff8"
33
authors = ["Josef I. Bisits <[email protected]>"]
4-
version = "0.4.0"
4+
version = "0.5.0"
55

66
[deps]
77
DimensionalData = "0703355e-b756-11e9-17c0-8b28908087d0"
@@ -12,7 +12,6 @@ MakieCore = "20f20a25-4f0e-4fdf-b5d1-57303727442b"
1212
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
1313
Rasters = "a3a2b9e3-a471-40c9-b274-f788e487c689"
1414
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
15-
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1615
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
1716

1817
[compat]
@@ -23,7 +22,6 @@ MakieCore = "0.6"
2322
NCDatasets = "0.12"
2423
Rasters = "0.6, 0.7, 0.8"
2524
RecipesBase = "1.3"
26-
Reexport = "1"
2725
StatsBase = "0.33, 0.34"
2826
julia = "1.6"
2927

README.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66
[![codecov](https://codecov.io/gh/jbisits/OceanRasterConversions.jl/branch/main/graph/badge.svg?token=XEAWB8IHFV)](https://codecov.io/gh/jbisits/OceanRasterConversions.jl)
77

88
[Rasters.jl](https://rafaqz.github.io/Rasters.jl/dev/) provides excellent methods for reading, analysing and plotting for geospatial data.
9-
This package contains modules that are useful for analysing oceanic data (either model output or gridded observations) and is designed to be used in conjunction with Rasters.jl.
10-
The modules are:
11-
12-
- [`OceanVariableConversions`](https://jbisits.github.io/OceanRasterConversions.jl/dev/modules/OceanVariableConversions/), conversion and computation (using [TEOS-10](https://www.teos-10.org/pubs/gsw/html/gsw_front_page.html)) of ocean variables that are `Raster` data structures; and
13-
- [`RasterHistograms`](https://jbisits.github.io/OceanRasterConversions.jl/dev/modules/RasterHistograms/), empirical distribution fitting for `Raster` data structures aiming to provide functionality similar to python's [xhistogram](https://xhistogram.readthedocs.io/en/latest/index.html) for [xarray](https://docs.xarray.dev/en/stable/) in Julia.
9+
[`OceanVariableConversions`](https://jbisits.github.io/OceanRasterConversions.jl/stable), provides conversion and computation (using [TEOS-10](https://www.teos-10.org/pubs/gsw/html/gsw_front_page.html)) of ocean variables that are `Raster` data structures.
1410

1511
## Using the package
1612

@@ -30,10 +26,3 @@ julia> using Rasters, OceanRasterConversions
3026
```
3127

3228
into the repl.
33-
The modules can also be loaded individually, to avoid loading in unnecessary funcitons into the workspace, by
34-
35-
```julia
36-
julia> using OceanRasterConversions.RasterHistograms
37-
```
38-
39-
and similarly for `OceanRasterConversions.OceanVariableConversions`.

docs/make.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ end
1111

1212
example_pages = [
1313
"Converting ocean variables" => "literated/ocean_variable_conversion.md",
14-
"Histograms from `Raster`s" => "literated/raster_histograms.md"
1514
]
1615
module_pages = [
1716
"OceanVariableConversions" => "modules/OceanVariableConversions.md",
18-
"RasterHistograms" => "modules/RasterHistograms.md"
1917
]
2018
library_pages = [
2119
"Function index" => "library/function_index.md"

docs/src/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
[Rasters.jl](https://rafaqz.github.io/Rasters.jl/dev/) provides excellent methods for reading, analysing and plotting for geospatial data.
44
This package contains modules that are useful for analysing oceanic data (either model output or gridded observations) and is designed to be used in conjunction with Rasters.jl.
5-
The modules are:
65

7-
- [`OceanVariableConversions`](@ref ocean_conv_vars_module), conversion and computation (using [TEOS-10](https://www.teos-10.org/pubs/gsw/html/gsw_front_page.html)) of ocean variables that are `Raster` data structures; and
8-
- [`RasterHistograms`](@ref raster_hist_module), empirical distribution fitting for `Raster` data structures aiming to provide functionality similar to python's [xhistogram](https://xhistogram.readthedocs.io/en/latest/index.html) for [xarray](https://docs.xarray.dev/en/stable/) in Julia.
6+
OceanRasterConversions.jl converts and computes ocean varaibles that are saved as `Raster` data structures using [GibbsSeaWater.jl](https://github.com/TEOS-10/GibbsSeaWater.jl).
7+
Typically, the salt and temperature variables from ocean models or observational data are practical salinity and potential temperature so conversions must be to the [TEOS-10](https://www.teos-10.org/pubs/gsw/html/gsw_front_page.html) standard variables of absolute salinity and conservative temperature to accurately calculate further variables like seawater density.
8+
Further conversions and other water mass transformation procedures will be added in the future.
99

1010
If there are any bugs and/or feature request please raise an [issue](https://github.com/jbisits/OceanRasterConversions.jl/issues) on the GitHub page.
1111

docs/src/library/function_index.md

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,15 @@
1-
# Function index
1+
# [Function index](@id ovc_func_index)
22

3-
## [OceanVariableConversions](@id ovc_func_index)
4-
5-
### OceanVariableConversions exported functions
6-
7-
```@autodocs
8-
Modules = [OceanVariableConversions]
9-
Private = false
10-
```
11-
12-
### OceanVariableConversions private functions
13-
14-
```@autodocs
15-
Modules = [OceanVariableConversions]
16-
Public = false
17-
```
18-
19-
## [RasterHistograms](@id rh_func_index)
20-
21-
### RasterHistograms exported functions
3+
## OceanRasterConversions exported functions
224

235
```@autodocs
24-
Modules = [RasterHistograms]
6+
Modules = [OceanRasterConversions]
257
Private = false
268
```
279

28-
### RasterHistograms private functions
10+
## OceanRasterConversions private functions
2911

3012
```@autodocs
31-
Modules = [RasterHistograms]
13+
Modules = [OceanRasterConversions]
3214
Public = false
3315
```

docs/src/modules/OceanVariableConversions.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
# [OceanVarbiableConversion](@id ocean_conv_vars_module)
1+
# [Converting Ocean Variables](@id ocean_conv_vars_module)
22

3-
## Overview
3+
## Package workings
44

5-
This module converts and computes ocean varaibles that are saved as `Raster` data structures using [GibbsSeaWater.jl](https://github.com/TEOS-10/GibbsSeaWater.jl).
6-
Typically, the salt and temperature variables from ocean models or observational data are practical salinity and potential temperature so conversions must be to the [TEOS-10](https://www.teos-10.org/pubs/gsw/html/gsw_front_page.html) standard variables of absolute salinity and conservative temperature to accurately calculate further variables like seawater density.
7-
8-
Further conversions and other water mass transformation procedures will be added in the future.
9-
10-
## Module workings
11-
12-
This module will convert the variables practical salinity and potential temperature into absolute salinity and conservative temperature.
5+
This package will convert the variables practical salinity and potential temperature into absolute salinity and conservative temperature.
136
In doing so a pressure variable is needed, so this is created and returned in the `RasterStack`.
147
A density variable (either in-situ or potential referenced to a user input) is computed and added to the `RasterStack`.
158
See the example for how the module can be used.

docs/src/modules/RasterHistograms.md

Lines changed: 0 additions & 85 deletions
This file was deleted.

examples/ocean_variable_conversion.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# # [Converting the practical salinity and potential temperature from ECCOv4r4 model output.](@id converting_variables_example)
22
# First, add the required dependencies
33
using Rasters, NCDatasets, Plots, Downloads
4-
using OceanRasterConversions.OceanVariableConversions
4+
using OceanRasterConversions
55
# and download model output from [ECCOv4r4](https://ecco-group.org/products-ECCO-V4r4.htm).
66
# This data is the daily average 0.5 degree salinity and temperature model output. To reproduce
77
# this example, an Earthdata acount is needed to download the data.

examples/raster_histograms.jl

Lines changed: 0 additions & 93 deletions
This file was deleted.

src/OceanRasterConversions.jl

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1+
"""
2+
Module to convert variables depth, practical salinity and potential temperature to the
3+
TEOS-10 standard variables pressure, absolute salinity and conservative temperature
4+
(respectively) from a `Raster`, `RasterStack` or `RasterSeries`. A few chosen seawater
5+
variables can then be computed from these state variables.
6+
"""
17
module OceanRasterConversions
28

3-
using Reexport
9+
using Rasters, GibbsSeaWater, DocStringExtensions
10+
11+
export
12+
convert_ocean_vars,
13+
depth_to_pressure, Sₚ_to_Sₐ, θ_to_Θ,
14+
get_ρ, get_σₚ, get_α, get_β
415

5-
include("oceanvariableconversions.jl")
6-
include("oceanvariabledistributions.jl")
716

8-
@reexport using OceanRasterConversions.OceanVariableConversions
9-
@reexport using OceanRasterConversions.RasterHistograms
17+
include("oceanvariableconversions.jl")
18+
include("z_to_p.jl")
19+
include("sp_to_sa.jl")
20+
include("theta_to_Theta.jl")
21+
include("seawaterdensity.jl")
22+
include("alphaandbeta.jl")
1023

1124
end #module

0 commit comments

Comments
 (0)