|
| 1 | +# maregrams |
| 2 | + |
| 3 | +``` |
| 4 | +D = maregrams(list::Bool=false, code="", name="", days::Real=2, starttime::String="", printurl=false) |
| 5 | +or |
| 6 | +
|
| 7 | +D = maregrams(lon::Real, lat::Real; days=2, starttime::String="") |
| 8 | +``` |
| 9 | + |
| 10 | +*keywords: GMT, Julia, Plate Kinematics* |
| 11 | + |
| 12 | +Download maregrams data from [www.ioc-sealevelmonitoring.org](http://www.ioc-sealevelmonitoring.org). |
| 13 | + |
| 14 | +The default is to download the last 2 days, but length and duration is configurable by input options. |
| 15 | +Since the use of this function requires knowing the station code or name, we provide also the possibility |
| 16 | +to use coordinates to find the nearest station. The file with stations data locations and names is stored in |
| 17 | +the `TESTSDIR/assets/maregs_online.csv` file, which can be accessed using `d = GMT.read_maregrams()` and its |
| 18 | +contents are returned in the `d` dictionary. Note that not all stations sites are always on and running, so |
| 19 | +errors when requesting data from some stations are, unfortunately, not so uncommon. |
| 20 | + |
| 21 | +Our reference stations data is a bit old (needs update) and we can find more stations online listed at the |
| 22 | +[www.ioc-sealevelmonitoring.org](http://www.ioc-sealevelmonitoring.org) site. If user provides a station code |
| 23 | +that we don't know about, but is a valid one, we still return the data for that station. Example: |
| 24 | +`D = maregrams(code="tdoj")` |
| 25 | + |
| 26 | +### Args |
| 27 | +- `lon, lat`: (Second form) Coordinates of a point that is used to find the closest station to that point. |
| 28 | + This is an alternative way of selecting a station instead of using `code` or `name` that require knowing them. |
| 29 | + |
| 30 | +### Kwargs |
| 31 | +- `list::Bool`: If true, returns a GMTdataset with the list all available stations and their codes and coords. |
| 32 | + |
| 33 | +- `code`: Station code (See the output of `list`) |
| 34 | + |
| 35 | +- `name`: In alternative to `code` give the station name (See the output of `list`) |
| 36 | + |
| 37 | +- `days`: Number of days to be downloaded. It can be a decimal number. |
| 38 | + |
| 39 | +- `starttime`: Start time in ISO8601 format (_e.g._ `"2019-01-01T00:00:00"`, or just the date `"2019-01-01"`). |
| 40 | + |
| 41 | +- `printurl`: If true, prints the station's URL. Useful for getting more info about the sation and its data. |
| 42 | + |
| 43 | +### Returns |
| 44 | +- `D`: \myreflink{GMTdataset} with the maregrams data. |
| 45 | + |
| 46 | +### Example |
| 47 | + |
| 48 | +Get the time series for 4 days starting at February 1 2025 for the station with code "lgos" (Lagos, Portugal) |
| 49 | + |
| 50 | +\begin{examplefig}{} |
| 51 | +```julia |
| 52 | +using GMT |
| 53 | + |
| 54 | +D = maregrams(code="lgos", days=4, starttime="2025-02-01"); |
| 55 | +viz(D, title="Tide Gauge at Lagos (Portugal)") |
| 56 | +``` |
| 57 | +\end{examplefig} |
0 commit comments