Skip to content

Runtime difference between NORA3_wind_wave and individual wind/wave products #78

Description

@hiro-takashina

Noticed that using NORA3_wind_wave takes significantly more time to run compared to using NORA3_wind_sub and NORA3_wave_sub separately, even though I understand they are both using the same data.

The example below shows a short-term case, but the difference becomes even more pronounced for long-term periods.

example code

from metocean_api import ts
import time

# list of product
product_wave_only = 'NORA3_wave_sub'
product_wind_only = "NORA3_wind_sub"
product_wind_wave='NORA3_wind_wave'

# example
lon, lat = 9.1578, 63.7905  # Example coordinates
start_time, end_time = '2021-12-01', '2021-12-6'

# 'NORA3_wave_sub'
t = time.time()
df_ts_wave = ts.TimeSeries(lon=lon, lat=lat, start_time=start_time, end_time=end_time, product=product_wave_only)
df_ts_wave.import_data(save_csv=True, save_nc=False) 
print(f"wave: {time.time() - t:.2f} seconds")

# 'NORA3_wind_sub'
t = time.time()
df_ts_wind = ts.TimeSeries(lon=lon, lat=lat, start_time=start_time, end_time=end_time, product=product_wind_only)
df_ts_wind.import_data(save_csv=True, save_nc=False)
print(f"wind: {time.time() - t:.2f} seconds")

# 'NORA3_wind_wave'
t = time.time()
df_ts_combined = ts.TimeSeries(lon=lon, lat=lat, start_time=start_time, end_time=end_time, product=product_wind_wave)
df_ts_combined.import_data(save_csv=True, save_nc=False)
print(f"wind_wave: {time.time() - t:.2f} seconds")

output:

wave: 1.99 seconds
wind: 4.81 seconds
wind_wave: 25.74 seconds

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions