eo-tides 0.0.20__py3-none-any.whl → 0.0.22__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
eo_tides/stats.py CHANGED
@@ -1,15 +1,320 @@
1
- def tide_stats(a):
1
+ # Used to postpone evaluation of type annotations
2
+ from __future__ import annotations
3
+
4
+ import os
5
+ from typing import TYPE_CHECKING
6
+
7
+ import matplotlib.pyplot as plt
8
+ import numpy as np
9
+ import odc.geo.xr
10
+ import pandas as pd
11
+ from scipy import stats
12
+
13
+ # Only import if running type checking
14
+ if TYPE_CHECKING:
15
+ import xarray as xr
16
+
17
+ from .eo import tag_tides
18
+ from .model import model_tides
19
+
20
+
21
+ def tide_stats(
22
+ ds: xr.Dataset,
23
+ model: str = "EOT20",
24
+ directory: str | os.PathLike | None = None,
25
+ tidepost_lat: float | None = None,
26
+ tidepost_lon: float | None = None,
27
+ plain_english: bool = True,
28
+ plot: bool = True,
29
+ plot_col: str | None = None,
30
+ modelled_freq: str = "2h",
31
+ linear_reg: bool = False,
32
+ min_max_q: tuple = (0.0, 1.0),
33
+ round_stats: int = 3,
34
+ **model_tides_kwargs,
35
+ ) -> pd.Series:
2
36
  """
3
- Test function.
37
+ Takes a multi-dimensional dataset and generate statistics
38
+ about the data's astronomical and satellite-observed tide
39
+ conditions.
40
+
41
+ By comparing the subset of tides observed by satellites
42
+ against the full astronomical tidal range, we can evaluate
43
+ whether the tides observed by satellites are biased
44
+ (e.g. fail to observe either the highest or lowest tides).
45
+
46
+ For more information about the tidal statistics computed by this
47
+ function, refer to Figure 8 in Bishop-Taylor et al. 2018:
48
+ <https://www.sciencedirect.com/science/article/pii/S0272771418308783#fig8>
4
49
 
5
50
  Parameters
6
51
  ----------
7
- a : int
8
- Test
52
+ ds : xarray.Dataset
53
+ A multi-dimensional dataset (e.g. "x", "y", "time") to
54
+ use to calculate tide statistics. This dataset must contain
55
+ a "time" dimension.
56
+ model : string, optional
57
+ The tide model to use to model tides. Defaults to "EOT20";
58
+ for a full list of available/supported models, run
59
+ `eo_tides.model.list_models`.
60
+ directory : string, optional
61
+ The directory containing tide model data files. If no path is
62
+ provided, this will default to the environment variable
63
+ `EO_TIDES_TIDE_MODELS` if set, or raise an error if not.
64
+ Tide modelling files should be stored in sub-folders for each
65
+ model that match the structure required by `pyTMD`
66
+ (<https://geoscienceaustralia.github.io/eo-tides/setup/>).
67
+ tidepost_lat, tidepost_lon : float or int, optional
68
+ Optional coordinates used to model tides. The default is None,
69
+ which uses the centroid of the dataset as the tide modelling
70
+ location.
71
+ plain_english : bool, optional
72
+ An optional boolean indicating whether to print a plain english
73
+ version of the tidal statistics to the screen. Defaults to True.
74
+ plot : bool, optional
75
+ An optional boolean indicating whether to plot how satellite-
76
+ observed tide heights compare against the full tidal range.
77
+ Defaults to True.
78
+ plot_col : str, optional
79
+ Optional name of a coordinate, dimension or variable in the array
80
+ that will be used to plot observations with unique symbols.
81
+ Defaults to None, which will plot all observations as circles.
82
+ modelled_freq : str, optional
83
+ An optional string giving the frequency at which to model tides
84
+ when computing the full modelled tidal range. Defaults to '2h',
85
+ which computes a tide height for every two hours across the
86
+ temporal extent of `ds`.
87
+ linear_reg: bool, optional
88
+ Whether to return linear regression statistics that assess
89
+ whether satellite-observed tides show any decreasing or
90
+ increasing trends over time. This may indicate whether your
91
+ satellite data may produce misleading trends based on uneven
92
+ sampling of the local tide regime.
93
+ min_max_q : tuple, optional
94
+ Quantiles used to calculate max and min observed and modelled
95
+ astronomical tides. By default `(0.0, 1.0)` which is equivalent
96
+ to minimum and maximum; to use a softer threshold that is more
97
+ robust to outliers, use e.g. `(0.1, 0.9)`.
98
+ round_stats : int, optional
99
+ The number of decimal places used to round the output statistics.
100
+ Defaults to 3.
101
+ **model_tides_kwargs :
102
+ Optional parameters passed to the `eo_tides.model.model_tides`
103
+ function. Important parameters include `cutoff` (used to
104
+ extrapolate modelled tides away from the coast; defaults to
105
+ `np.inf`), `crop` (whether to crop tide model constituent files
106
+ on-the-fly to improve performance) etc.
9
107
 
10
108
  Returns
11
109
  -------
12
- Test
110
+ A `pandas.Series` containing the following statistics:
111
+
112
+ - `tidepost_lat`: latitude used for modelling tide heights
113
+ - `tidepost_lon`: longitude used for modelling tide heights
114
+ - `observed_min_m`: minimum tide height observed by the satellite
115
+ - `all_min_m`: minimum tide height from all available tides
116
+ - `observed_max_m`: maximum tide height observed by the satellite
117
+ - `all_max_m`: maximum tide height from all available tides
118
+ - `observed_range_m`: tidal range observed by the satellite
119
+ - `all_range_m`: full astronomical tidal range based on all available tides
120
+ - `spread_m`: proportion of the full astronomical tidal range observed by the satellite (see Bishop-Taylor et al. 2018)
121
+ - `low_tide_offset`: proportion of the lowest tides never observed by the satellite (see Bishop-Taylor et al. 2018)
122
+ - `high_tide_offset`: proportion of the highest tides never observed by the satellite (see Bishop-Taylor et al. 2018)
123
+
124
+ If `linear_reg = True`, the output will also contain:
125
+
126
+ - `observed_slope`: slope of any relationship between observed tide heights and time
127
+ - `observed_pval`: significance/p-value of any relationship between observed tide heights and time
13
128
 
14
129
  """
15
- return a
130
+ # Verify that only one tide model is provided
131
+ if isinstance(model, list):
132
+ raise Exception("Only single tide models are supported by `tide_stats`.")
133
+
134
+ # If custom tide modelling locations are not provided, use the
135
+ # dataset centroid
136
+ if not tidepost_lat or not tidepost_lon:
137
+ tidepost_lon, tidepost_lat = ds.odc.geobox.geographic_extent.centroid.coords[0]
138
+
139
+ # Model tides for each observation in the supplied xarray object
140
+ ds_tides = tag_tides(
141
+ ds,
142
+ model=model,
143
+ directory=directory,
144
+ tidepost_lat=tidepost_lat, # type: ignore
145
+ tidepost_lon=tidepost_lon, # type: ignore
146
+ return_tideposts=True,
147
+ **model_tides_kwargs,
148
+ )
149
+ ds_tides = ds_tides.sortby("time")
150
+
151
+ # Drop spatial ref for nicer plotting
152
+ ds_tides = ds_tides.drop_vars("spatial_ref")
153
+
154
+ # Generate range of times covering entire period of satellite record
155
+ all_timerange = pd.date_range(
156
+ start=ds_tides.time.min().item(),
157
+ end=ds_tides.time.max().item(),
158
+ freq=modelled_freq,
159
+ )
160
+
161
+ # Model tides for each timestep
162
+ all_tides_df = model_tides(
163
+ x=tidepost_lon, # type: ignore
164
+ y=tidepost_lat, # type: ignore
165
+ time=all_timerange,
166
+ model=model,
167
+ directory=directory,
168
+ crs="EPSG:4326",
169
+ **model_tides_kwargs,
170
+ )
171
+
172
+ # Get coarse statistics on all and observed tidal ranges
173
+ obs_mean = ds_tides.tide_height.mean().item()
174
+ all_mean = all_tides_df.tide_height.mean()
175
+ obs_min, obs_max = ds_tides.tide_height.quantile(min_max_q).values
176
+ all_min, all_max = all_tides_df.tide_height.quantile(min_max_q).values
177
+
178
+ # Calculate tidal range
179
+ obs_range = obs_max - obs_min
180
+ all_range = all_max - all_min
181
+
182
+ # Calculate Bishop-Taylor et al. 2018 tidal metrics
183
+ spread = obs_range / all_range
184
+ low_tide_offset_m = abs(all_min - obs_min)
185
+ high_tide_offset_m = abs(all_max - obs_max)
186
+ low_tide_offset = low_tide_offset_m / all_range
187
+ high_tide_offset = high_tide_offset_m / all_range
188
+
189
+ # Plain text descriptors
190
+ mean_diff = "higher" if obs_mean > all_mean else "lower"
191
+ mean_diff_icon = "⬆️" if obs_mean > all_mean else "⬇️"
192
+ spread_icon = "🟢" if spread >= 0.9 else "🟡" if 0.7 < spread <= 0.9 else "🔴"
193
+ low_tide_icon = "🟢" if low_tide_offset <= 0.1 else "🟡" if 0.1 <= low_tide_offset < 0.2 else "🔴"
194
+ high_tide_icon = "🟢" if high_tide_offset <= 0.1 else "🟡" if 0.1 <= high_tide_offset < 0.2 else "🔴"
195
+
196
+ # Extract x (time in decimal years) and y (distance) values
197
+ all_times = all_tides_df.index.get_level_values("time")
198
+ all_x = all_times.year + ((all_times.dayofyear - 1) / 365) + ((all_times.hour) / 24)
199
+ time_period = all_x.max() - all_x.min()
200
+
201
+ # Extract x (time in decimal years) and y (distance) values
202
+ obs_x = ds_tides.time.dt.year + ((ds_tides.time.dt.dayofyear - 1) / 365) + ((ds_tides.time.dt.hour) / 24)
203
+ obs_y = ds_tides.tide_height.values.astype(np.float32)
204
+
205
+ # Compute linear regression
206
+ obs_linreg = stats.linregress(x=obs_x, y=obs_y)
207
+
208
+ # return obs_linreg
209
+
210
+ if plain_english:
211
+ print(f"\n\n🌊 Modelled astronomical tide range: {all_range:.2f} metres.")
212
+ print(f"🛰️ Observed tide range: {obs_range:.2f} metres.\n")
213
+ print(f" {spread_icon} {spread:.0%} of the modelled astronomical tide range was observed at this location.")
214
+ print(
215
+ f" {high_tide_icon} The highest {high_tide_offset:.0%} ({high_tide_offset_m:.2f} metres) of the tide range was never observed."
216
+ )
217
+ print(
218
+ f" {low_tide_icon} The lowest {low_tide_offset:.0%} ({low_tide_offset_m:.2f} metres) of the tide range was never observed.\n"
219
+ )
220
+ print(f"🌊 Mean modelled astronomical tide height: {all_mean:.2f} metres.")
221
+ print(f"🛰️ Mean observed tide height: {obs_mean:.2f} metres.\n")
222
+ print(
223
+ f" {mean_diff_icon} The mean observed tide height was {obs_mean - all_mean:.2f} metres {mean_diff} than the mean modelled astronomical tide height."
224
+ )
225
+
226
+ if linear_reg:
227
+ if obs_linreg.pvalue > 0.01:
228
+ print(" ➖ Observed tides showed no significant trends over time.")
229
+ else:
230
+ obs_slope_desc = "decreasing" if obs_linreg.slope < 0 else "increasing"
231
+ print(
232
+ f" ⚠️ Observed tides showed a significant {obs_slope_desc} trend over time (p={obs_linreg.pvalue:.3f}, {obs_linreg.slope:.2f} metres per year)"
233
+ )
234
+
235
+ if plot:
236
+ # Create plot and add all time and observed tide data
237
+ fig, ax = plt.subplots(figsize=(10, 6))
238
+ all_tides_df.reset_index(["x", "y"]).tide_height.plot(ax=ax, alpha=0.4, label="Modelled tides")
239
+
240
+ # Look through custom column values if provided
241
+ if plot_col is not None:
242
+ # Create a list of marker styles
243
+ markers = ["o", "^", "s", "D", "v", "<", ">", "p", "*", "h", "H", "+", "x", "d", "|", "_"]
244
+ for i, value in enumerate(np.unique(ds_tides[plot_col])):
245
+ ds_tides.where(ds_tides[plot_col] == value, drop=True).tide_height.plot.line(
246
+ ax=ax,
247
+ linewidth=0.0,
248
+ color="black",
249
+ marker=markers[i % len(markers)],
250
+ markersize=4,
251
+ label=value,
252
+ )
253
+ # Otherwise, plot all data at once
254
+ else:
255
+ ds_tides.tide_height.plot.line(
256
+ ax=ax, marker="o", linewidth=0.0, color="black", markersize=3.5, label="Satellite observations"
257
+ )
258
+
259
+ ax.legend(loc="upper center", bbox_to_anchor=(0.5, 1.04), ncol=20, borderaxespad=0, frameon=False)
260
+
261
+ ax.plot(
262
+ ds_tides.time.isel(time=[0, -1]),
263
+ obs_linreg.intercept + obs_linreg.slope * obs_x[[0, -1]],
264
+ "r",
265
+ label="fitted line",
266
+ )
267
+
268
+ # Add horizontal lines for spread/offsets
269
+ ax.axhline(obs_min, color="black", linestyle=":", linewidth=1)
270
+ ax.axhline(obs_max, color="black", linestyle=":", linewidth=1)
271
+ ax.axhline(all_min, color="black", linestyle=":", linewidth=1)
272
+ ax.axhline(all_max, color="black", linestyle=":", linewidth=1)
273
+
274
+ # Add text annotations for spread/offsets
275
+ ax.annotate(
276
+ f" High tide\n offset ({high_tide_offset:.0%})",
277
+ xy=(all_timerange.max(), np.mean([all_max, obs_max])),
278
+ va="center",
279
+ )
280
+ ax.annotate(
281
+ f" Spread\n ({spread:.0%})",
282
+ xy=(all_timerange.max(), np.mean([obs_min, obs_max])),
283
+ va="center",
284
+ )
285
+ ax.annotate(
286
+ f" Low tide\n offset ({low_tide_offset:.0%})",
287
+ xy=(all_timerange.max(), np.mean([all_min, obs_min])),
288
+ )
289
+
290
+ # Remove top right axes and add labels
291
+ ax.spines["right"].set_visible(False)
292
+ ax.spines["top"].set_visible(False)
293
+ ax.set_ylabel("Tide height (m)")
294
+ ax.set_xlabel("")
295
+ ax.margins(x=0.015)
296
+
297
+ # Export pandas.Series containing tidal stats
298
+ output_stats = {
299
+ "tidepost_lat": tidepost_lat,
300
+ "tidepost_lon": tidepost_lon,
301
+ "observed_mean_m": obs_mean,
302
+ "all_mean_m": all_mean,
303
+ "observed_min_m": obs_min,
304
+ "all_min_m": all_min,
305
+ "observed_max_m": obs_max,
306
+ "all_max_m": all_max,
307
+ "observed_range_m": obs_range,
308
+ "all_range_m": all_range,
309
+ "spread": spread,
310
+ "low_tide_offset": low_tide_offset,
311
+ "high_tide_offset": high_tide_offset,
312
+ }
313
+
314
+ if linear_reg:
315
+ output_stats.update({
316
+ "observed_slope": obs_linreg.slope,
317
+ "observed_pval": obs_linreg.pvalue,
318
+ })
319
+
320
+ return pd.Series(output_stats).round(round_stats)
eo_tides/validation.py CHANGED
@@ -75,7 +75,7 @@ def eval_metrics(x, y, round=3, all_regress=False):
75
75
  return pd.Series(stats_dict).round(round)
76
76
 
77
77
 
78
- def round_date_strings(date, round_type="end"):
78
+ def _round_date_strings(date, round_type="end"):
79
79
  """
80
80
  Round a date string up or down to the start or end of a given time
81
81
  period.
@@ -286,8 +286,8 @@ def load_gauge_gesla(
286
286
  if time is None:
287
287
  time = ["1800", str(datetime.datetime.now().year)]
288
288
  time = [time] if not isinstance(time, (list, tuple)) else time
289
- start_time = round_date_strings(time[0], round_type="start")
290
- end_time = round_date_strings(time[-1], round_type="end")
289
+ start_time = _round_date_strings(time[0], round_type="start")
290
+ end_time = _round_date_strings(time[-1], round_type="end")
291
291
 
292
292
  # Identify paths to load and nodata values for each site
293
293
  metadata_df["file_name"] = data_path + metadata_df["file_name"]
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2024 Geoscience Australia
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.