-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Examples | ||
|
||
## Using EMODnet data | ||
|
||
* [Comparison of seawater temperature of several observatories using EMODnet data](temp_spain_january_2019.md). | ||
|
||
Return to [index](../index_docs.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Comparison of seawater temperature of several observatories using EMODnet data | ||
|
||
In this example, we have used data from [EMODnet Physics](https://www.emodnet-physics.eu/Portal/). We have downloaded all the data from January 2020 from the observatories of the Spanish coast that measure the temperature of the water in the first 5 meters of depth. We have discarded datasets that contain errors (for example, misspelt geolocation). We have also dropped datasets with water temperatures at various depths or with large amounts of data so that the script could be run on less powerful computers. Finally, the files that we are going to use in this example are [here](./data/emodnet-esp-2020-01.7z). | ||
|
||
```python | ||
import mooda as md | ||
import plotly.graph_objects as go | ||
import os | ||
|
||
# Make a list of file locations | ||
root = '/path/to/directory/' | ||
nc_files = [os.path.join(root, filename) | ||
for root, _, filenames in os.walk(root) | ||
for filename in filenames | ||
if '.nc' in filename] | ||
|
||
# Open the files and make a list of WaterFrames | ||
wf_list = [md.read_nc_emodnet(path) for path in nc_files] | ||
|
||
# Make an interactive map with the observatory locations | ||
fig1 = md.iplot_location(wf_list) | ||
go.Figure(fig1).show() | ||
|
||
# Make an interactive plot with the seawater temperatures of all the WaterFrames | ||
fig2 = md.iplot_timeseries(wf_list, 'TEMP') | ||
go.Figure(fig2).show() | ||
``` | ||
|
||
Output: | ||
|
||
![Observatories of the Spanish coast][spanish-observatories] | ||
|
||
![Spanish coast seawater temperatures][spanish-temp] | ||
|
||
*Note: The script makes two interactive charts. The images shown in this document have been generated by saving the interactive images in a PNG file.* | ||
|
||
Return to the [Index of examples](index_examples.md). | ||
|
||
[spanish-observatories]: ./img_examples/spanish-observatories.png | ||
|
||
[spanish-temp]: ./img_examples/spanish-temp.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters