Station Explorer Assistant

Chat history cleared. Start a new conversation!

Convey information to me. I am especially interested in understanding tidal datum information. Teach me about the tidal datums, especially about how they relate to coastal impacts and how to convert data between different reference datums. Jump into an example by loading the tidal datums for the selected station and plotting them as both relative to Station Zero and MHHW datums. Show your equations, code, and plots. Ask me what I would like to explore next.

Tidal datums are standard elevations defined by a certain phase of the tide. They are used as reference points for measuring local water levels and are crucial for understanding coastal impacts, such as flooding risks and navigation safety. Here are some common tidal datums:

  1. Mean Lower Low Water (MLLW): The average of the lower low water height of each tidal day observed over the National Tidal Datum Epoch (NTDE).

  2. Mean Higher High Water (MHHW): The average of the higher high water height of each tidal day observed over the NTDE.

  3. Mean Sea Level (MSL): The average height of the sea's surface, taken over all stages of the tide and over a long period.

  4. Station Zero Datum: A local reference point used by tide gauges, often specific to a particular station.

Coastal Impacts

  • Flooding: High tides, especially when combined with storm surges, can lead to coastal flooding. Understanding the relationship between current water levels and tidal datums like MHHW can help predict flooding events.
  • Navigation: Tidal datums are used to ensure safe navigation by providing reference points for water depth measurements.

Converting Between Datums

To convert water levels from one datum to another, you add or subtract the difference between the datums. For example, to convert a water level from MLLW to MHHW, you would use the equation:

$$ \text{Water Level}{\text{MHHW}} = \text{Water Level}{\text{MLLW}} + (\text{MHHW} - \text{MLLW}) $$

Example: Loading and Plotting Tidal Datums for Station 261

Let's load the tidal datums for station 261 and plot them relative to both the Station Zero and MHHW datums.

Steps:

  1. Load the tidal datum data for station 261.
  2. Parse the datum values from the HTML table.
  3. Plot the datums relative to Station Zero and MHHW.

Let's start by loading and parsing the tidal datum data.

import requests
from bs4 import BeautifulSoup

# Define the URL for the tidal datum data
station_id = '261'
unit = 'm'
url = f'https://uhslc.soest.hawaii.edu/stations/TIDES_DATUMS/fd/LST/fd{station_id}/datumTable_{station_id}_{unit}.html'

# Fetch the HTML content
response = requests.get(url)

# Parse the HTML content
soup = BeautifulSoup(response.content, 'html.parser')

# Extract datum information from the table
table = soup.find('table')
datum_info = []

# Iterate over the rows in the table
for row in table.find_all('tr')[2:]:  # Skip the first two rows (header and possibly non-standard row)
    columns = row.find_all('td')
    if len(columns) == 3:  # Ensure there are exactly 3 columns
        datum_name = columns[0].text.strip()
        datum_value = float(columns[1].text.strip())
        datum_description = columns[2].text.strip()
        datum_info.append((datum_name, datum_value, datum_description))

# Display the extracted datum information
datum_info

It seems there was an issue with converting one of the datum values to a float. This might be due to unexpected data in the table, such as a date or other non-numeric value. Let's inspect the table data more closely to identify the issue. I'll print out the raw data from the table to see what's causing the problem.

# Print the raw data from the table to identify the issue
raw_data = []
for row in table.find_all('tr'):
    columns = [col.text.strip() for col in row.find_all('td')]
    raw_data.append(columns)

raw_data

The issue was caused by the presence of non-numeric data in the table, such as dates and status information. Now that we have identified the relevant datum values, let's extract only the numeric datum values for plotting.

Here are the relevant tidal datums extracted from the table:

  • MHHW (Mean Higher-High Water): 2.593 m
  • MHW (Mean High Water): 2.482 m
  • MTL (Mean Tide Level): 1.697 m
  • MSL (Mean Sea Level): 1.733 m
  • MLW (Mean Low Water): 0.911 m
  • MLLW (Mean Lower-Low Water): 0.853 m
  • STND (Station Datum): 0.000 m

Let's proceed to plot these datums relative to both the Station Zero and MHHW datums.

import matplotlib.pyplot as plt

# Extract the relevant datum values
mhhw = 2.593
mhw = 2.482
mtl = 1.697
msl = 1.733
mlw = 0.911
mllw = 0.853
stnd = 0.000

# Datum names and values
datum_names = ['MHHW', 'MHW', 'MTL', 'MSL', 'MLW', 'MLLW', 'STND']
datum_values_station_zero = [mhhw, mhw, mtl, msl, mlw, mllw, stnd]
datum_values_mhhw = [value - mhhw for value in datum_values_station_zero]

# Plotting
plt.figure(figsize=(10, 6))

# Plot relative to Station Zero
plt.subplot(1, 2, 1)
plt.barh(datum_names, datum_values_station_zero, color='skyblue')
plt.title('Datums Relative to Station Zero')
plt.xlabel('Meters')
plt.grid(True, linestyle='--', alpha=0.6)

# Plot relative to MHHW
plt.subplot(1, 2, 2)
plt.barh(datum_names, datum_values_mhhw, color='lightcoral')
plt.title('Datums Relative to MHHW')
plt.xlabel('Meters')
plt.grid(True, linestyle='--', alpha=0.6)

plt.tight_layout()
plt.show()
Image

The plots show the tidal datums for Station 261:

  1. Left Plot (Relative to Station Zero):

    • Displays the datums in meters above the Station Zero datum.
    • MHHW is the highest, followed by MHW, MTL, MSL, MLW, and MLLW.
  2. Right Plot (Relative to MHHW):

    • Displays the datums in meters relative to the MHHW datum.
    • This shows how other datums compare to the highest tide level.

These visualizations help understand how different tidal datums relate to each other and can be used to assess potential coastal impacts, such as flooding risks.

Next Steps

Would you like to explore more about tidal datums, or is there another aspect of sea level data you're interested in?

Flip the axes around so that the plots are easier to interpret.
# Re-plot with flipped axes for easier interpretation
plt.figure(figsize=(10, 6))

# Plot relative to Station Zero
plt.subplot(1, 2, 1)
plt.bar(datum_names, datum_values_station_zero, color='skyblue')
plt.title('Datums Relative to Station Zero')
plt.ylabel('Meters')
plt.xticks(rotation=45)
plt.grid(True, linestyle='--', alpha=0.6)

# Plot relative to MHHW
plt.subplot(1, 2, 2)
plt.bar(datum_names, datum_values_mhhw, color='lightcoral')
plt.title('Datums Relative to MHHW')
plt.ylabel('Meters')
plt.xticks(rotation=45)
plt.grid(True, linestyle='--', alpha=0.6)

plt.tight_layout()
plt.show()
Image

The updated plots now have the axes flipped for easier interpretation:

  1. Left Plot (Relative to Station Zero):

    • Shows the height of each datum above the Station Zero datum.
    • MHHW is the highest, indicating the average of the higher high tides.
  2. Right Plot (Relative to MHHW):

    • Shows how other datums compare to MHHW.
    • Negative values indicate how much lower each datum is compared to MHHW.

These plots provide a clear visual representation of the tidal datums, helping to assess potential coastal impacts.

What would you like to explore next?

SEA can make mistakes. Check important results. Click for more information.