|
| 1 | +import plots.annual_hs_boxplot as hs |
| 2 | +import plots.compendium as comp |
| 3 | +import plots.sst_climatology as sst |
| 4 | + |
| 5 | +from matplotlib.pyplot import Figure |
| 6 | + |
| 7 | + |
| 8 | +def make_annual_hs_boxplot(stn: str, year: int) -> Figure: |
| 9 | + """ |
| 10 | + Create a boxplot of annual significant wave heights for a station. |
| 11 | +
|
| 12 | + Args: |
| 13 | + stn (str): A 5-char station identifier, e.g. '100p1'. |
| 14 | + year (int): The year to plot. |
| 15 | +
|
| 16 | + Returns: |
| 17 | + fig (Figure): A matplotlib.pyplot.Figure object for the created plot. |
| 18 | + """ |
| 19 | + |
| 20 | + return hs.make_plot(stn, year) |
| 21 | + |
| 22 | + |
| 23 | +def make_compendium_plot( |
| 24 | + stns: str, start: str, end: str, params: str, x_inch: int |
| 25 | +) -> Figure: |
| 26 | + """CDIP's classic compendium plot for multiple stations and parameters. |
| 27 | +
|
| 28 | + Args: |
| 29 | + stns (str): A comma-delimited list of 5-char station identifiers, e.g. '100p1,201p1'. |
| 30 | + start (str): Start time of data series formatted as 'yyyymm[ddHHMMss]' where 'ddHHMMss' are optional components. |
| 31 | + end (str): End time of data series ('yyyymm[ddHHMMss]') If 'None' is provided, defaults to the current date and time. |
| 32 | + params (str): A comma-delimited string of parameter names, e.g. 'waveHs,waveTp'. |
| 33 | +
|
| 34 | + Returns: |
| 35 | + fig (Figure): A matplotlib.pyplot.Figure object for the created plot. |
| 36 | +
|
| 37 | + """ |
| 38 | + |
| 39 | + return comp.make_plot(stns, start, end, params, x_inch) |
| 40 | + |
| 41 | + |
| 42 | +def make_sst_climatology_plot( |
| 43 | + stn: str, x_inch: int = None, y_inch: int = None |
| 44 | +) -> Figure: |
| 45 | + """ |
| 46 | + Create a plot of yearly climatology of sea surface temperature at a station for all years of available data. |
| 47 | +
|
| 48 | + Args: |
| 49 | + stn (str): A 5-char station identifier, e.g. '100p1'. |
| 50 | +
|
| 51 | + Returns: |
| 52 | + fig (Figure): A matplotlib.pyplot.Figure object for the created plot. |
| 53 | + """ |
| 54 | + |
| 55 | + return sst.make_plot(stn, x_inch, y_inch) |
0 commit comments