Skip to content

Commit

Permalink
Add new ref files for debugging mac (adj x and y)
Browse files Browse the repository at this point in the history
  • Loading branch information
SorooshMani-NOAA committed Aug 1, 2024
1 parent b4e76ea commit 4329065
Show file tree
Hide file tree
Showing 17 changed files with 184 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjx_K1_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
,0
0,286.875
1,287.0
2,287.125
3,287.25
4,287.375
5,287.5
6,287.625
7,287.75
8,287.875
9,288.0
10,288.125
12 changes: 12 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjx_K2_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
,0
0,286.875
1,287.0
2,287.125
3,287.25
4,287.375
5,287.5
6,287.625
7,287.75
8,287.875
9,288.0
10,288.125
12 changes: 12 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjx_M2_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
,0
0,286.875
1,287.0
2,287.125
3,287.25
4,287.375
5,287.5
6,287.625
7,287.75
8,287.875
9,288.0
10,288.125
12 changes: 12 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjx_N2_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
,0
0,286.875
1,287.0
2,287.125
3,287.25
4,287.375
5,287.5
6,287.625
7,287.75
8,287.875
9,288.0
10,288.125
12 changes: 12 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjx_O1_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
,0
0,286.875
1,287.0
2,287.125
3,287.25
4,287.375
5,287.5
6,287.625
7,287.75
8,287.875
9,288.0
10,288.125
12 changes: 12 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjx_P1_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
,0
0,286.875
1,287.0
2,287.125
3,287.25
4,287.375
5,287.5
6,287.625
7,287.75
8,287.875
9,288.0
10,288.125
12 changes: 12 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjx_Q1_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
,0
0,286.875
1,287.0
2,287.125
3,287.25
4,287.375
5,287.5
6,287.625
7,287.75
8,287.875
9,288.0
10,288.125
12 changes: 12 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjx_S2_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
,0
0,286.875
1,287.0
2,287.125
3,287.25
4,287.375
5,287.5
6,287.625
7,287.75
8,287.875
9,288.0
10,288.125
9 changes: 9 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjy_K1_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
,0
0,40.25
1,40.375
2,40.5
3,40.625
4,40.75
5,40.875
6,41.0
7,41.125
9 changes: 9 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjy_K2_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
,0
0,40.25
1,40.375
2,40.5
3,40.625
4,40.75
5,40.875
6,41.0
7,41.125
9 changes: 9 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjy_M2_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
,0
0,40.25
1,40.375
2,40.5
3,40.625
4,40.75
5,40.875
6,41.0
7,41.125
9 changes: 9 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjy_N2_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
,0
0,40.25
1,40.375
2,40.5
3,40.625
4,40.75
5,40.875
6,41.0
7,41.125
9 changes: 9 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjy_O1_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
,0
0,40.25
1,40.375
2,40.5
3,40.625
4,40.75
5,40.875
6,41.0
7,41.125
9 changes: 9 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjy_P1_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
,0
0,40.25
1,40.375
2,40.5
3,40.625
4,40.75
5,40.875
6,41.0
7,41.125
9 changes: 9 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjy_Q1_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
,0
0,40.25
1,40.375
2,40.5
3,40.625
4,40.75
5,40.875
6,41.0
7,41.125
9 changes: 9 additions & 0 deletions tests/data/reference/test_tidal_run/debug_adjy_S2_0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
,0
0,40.25
1,40.375
2,40.5
3,40.625
4,40.75
5,40.875
6,41.0
7,41.125
16 changes: 16 additions & 0 deletions tests/test_tidal_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import pytest
import pandas as pd
import numpy as np

from adcircpy.cmd import tidal_run
from adcircpy.driver import AdcircRun
Expand Down Expand Up @@ -54,6 +55,21 @@ def test_tidal_run(shinnecock_mesh_directory):
vertices = mesh.get_xy(crs='EPSG:4326').iloc[row.indexes, :].values
df_verts = pd.DataFrame(vertices)
df_verts.to_csv(output_directory / f'debug_bnd_{constituent}_{index}.csv')
###############
xq = np.asarray([x + 360.0 if x < 0.0 else x for x in vertices[:, 0]]).flatten()
yq = vertices[:, 1].flatten()
ds = mesh.forcings.tides.tidal_dataset
dx = (ds.x[-1] - ds.x[0]) / len(ds.x)
xidx = np.logical_and(ds.x >= np.min(xq) - 2.0 * dx, ds.x <= np.max(xq) + 2.0 * dx)
dy = (ds.y[-1] - ds.y[0]) / len(ds.y)
yidx = np.logical_and(ds.y >= np.min(yq) - 2.0 * dy, ds.y <= np.max(yq) + 2.0 * dy)
xi, yi = np.meshgrid(ds.x[xidx], ds.y[yidx])

df_adjx = pd.DataFrame(xi[0, :])
df_adjx.to_csv(output_directory / f'debug_adjx_{constituent}_{index}.csv')
df_adjy = pd.DataFrame(yi[:, 0])
df_adjy.to_csv(output_directory / f'debug_adjy_{constituent}_{index}.csv')
###############
amp, phase = mesh.forcings.tides.tidal_dataset(constituent, vertices)
df_tide = pd.DataFrame({'amp': amp, 'phase': phase})
df_tide.to_csv(output_directory / f'debug_tide_{constituent}_{index}.csv')
Expand Down

0 comments on commit 4329065

Please sign in to comment.