Skip to content

Commit

Permalink
Extending VoCC to 3D-VoCC.
Browse files Browse the repository at this point in the history
- Adding the depth of the particles in scope of the GeoInformatica submission.
  • Loading branch information
ywoelker committed Apr 2, 2024
1 parent 4128ddb commit 6cef981
Show file tree
Hide file tree
Showing 9 changed files with 2,774 additions and 67 deletions.
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ USER root
RUN apt update && \
apt install -y build-essential

RUN conda install geoviews cartopy cartopy_offlinedata xarray
RUN conda install xarray=2023.6.0 cartopy=0.21.1 pandas=1.4.2 scikit-learn=1.3.0

RUN pip3 install pyEddyTracker==3.6.0
RUN pip3 install pyeddytracker==3.6.0 ipykernel==6.29.3 oceansdb==0.8.15 area==1.1.1

USER ${NB_UID}

Expand Down
348 changes: 348 additions & 0 deletions experiments/5.1AutomaticDataComparison.ipynb

Large diffs are not rendered by default.

270 changes: 270 additions & 0 deletions experiments/6.1Layerwise.ipynb

Large diffs are not rendered by default.

261 changes: 261 additions & 0 deletions experiments/6.2Cylinder.ipynb

Large diffs are not rendered by default.

435 changes: 435 additions & 0 deletions experiments/6.3DepthAccumulator.ipynb

Large diffs are not rendered by default.

507 changes: 507 additions & 0 deletions experiments/6.4AreaTimeDivergence.ipynb

Large diffs are not rendered by default.

736 changes: 736 additions & 0 deletions experiments/6.5Volume.ipynb

Large diffs are not rendered by default.

54 changes: 48 additions & 6 deletions scripts/experiment_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@
import matplotlib.pyplot as plt
import numpy as np

depth_layers = np.array([4.7679895e-01, 1.5707064e+00, 2.8554180e+00, 4.3355064e+00,
6.0156703e+00, 7.9007444e+00, 9.9957113e+00, 1.2305715e+01,
1.4836073e+01, 1.7592300e+01, 2.0580124e+01, 2.3805506e+01,
2.7274673e+01, 3.0994144e+01, 3.4970764e+01, 3.9211739e+01,
4.3724689e+01, 4.8517693e+01, 5.3599339e+01, 5.8978794e+01,
6.4665886e+01, 7.0671165e+01, 7.7006004e+01, 8.3682709e+01,
9.0714615e+01, 9.8116249e+01, 1.0590342e+02, 1.1409344e+02,
1.2270523e+02, 1.3175960e+02, 1.4127936e+02, 1.5128963e+02,
1.6181805e+02, 1.7289508e+02, 1.8455423e+02, 1.9683240e+02,
2.0977017e+02, 2.2341211e+02, 2.3780708e+02, 2.5300858e+02,
2.6907489e+02, 2.8606949e+02, 3.0406100e+02, 3.2312344e+02,
3.4333621e+02, 3.6478378e+02, 3.8755551e+02, 4.1174518e+02,
4.3745007e+02, 4.6477032e+02, 4.9380743e+02, 5.2466309e+02,
5.5743713e+02, 5.9222620e+02, 6.2912128e+02, 6.6820563e+02,
7.0955292e+02, 7.5322528e+02, 7.9927124e+02, 8.4772443e+02,
8.9860266e+02, 9.5190729e+02, 1.0076231e+03, 1.0657189e+03,
1.1261479e+03, 1.1888505e+03, 1.2537540e+03, 1.3207762e+03,
1.3898268e+03, 1.4608092e+03, 1.5336232e+03, 1.6081664e+03,
1.6843364e+03, 1.7620319e+03, 1.8411539e+03, 1.9216071e+03,
2.0033002e+03, 2.0861470e+03, 2.1700664e+03, 2.2549822e+03,
2.3408240e+03, 2.4275269e+03, 2.5150303e+03, 2.6032795e+03,
2.6922241e+03, 2.7818181e+03, 2.8720193e+03, 2.9627896e+03,
3.0540945e+03, 3.1459023e+03, 3.2381846e+03, 3.3309153e+03,
3.4240706e+03, 3.5176292e+03, 3.6115713e+03, 3.7058794e+03,
3.8005366e+03, 3.8955283e+03, 3.9908408e+03, 4.0864612e+03,
4.1823779e+03, 4.2785801e+03, 4.3750576e+03, 4.4718013e+03,
4.5688027e+03, 4.6660532e+03, 4.7635449e+03, 4.8612715e+03,
4.9592251e+03, 5.0573999e+03, 5.1557891e+03, 5.2543877e+03,
5.3531895e+03, 5.4521890e+03, 5.5513809e+03, 5.6507607e+03,
5.7503232e+03, 5.8500645e+03, 5.9499790e+03, 6.0500630e+03],
dtype=np.float32)

def create_synthetic_outlier_set(seed):
np.random.seed(seed)
image = np.zeros(shape= (500, 300))
Expand Down Expand Up @@ -199,11 +231,16 @@ def calc_rates(true_labels, predicted_labels):
return {'TP': TP, 'TN': TN, 'FP': FP, 'FN': FN}


def create_real_world_image(coordinates, labels, output_name):
def create_real_world_image(coordinates, labels, output_name, text = False, ax = None, font_size = 16):
unique_labels = set(labels)
colors = plt.cm.gist_ncar(np.linspace(0, 1, len(unique_labels)))
fig = plt.figure(figsize= (10,5))
ax = fig.add_subplot(1,1,1, projection = PlateCarree())

if ax is None:
fig = plt.figure(figsize= (10,5))
ax = fig.add_subplot(1,1,1, projection = PlateCarree())
else:
output_name = None # Disable the saving because this is only part of a bigger plot

ax.add_feature(COASTLINE)
ax.add_feature(LAND, facecolor = 'darkgrey')

Expand All @@ -212,16 +249,21 @@ def create_real_world_image(coordinates, labels, output_name):
if k == -1:
ax.plot(xy[:, 0], xy[:, 1], '.',color='grey', markersize=0.1)
if k > -1:
ax.plot(xy[:, 0], xy[:, 1], 'o', markerfacecolor=col, markeredgecolor = 'k', markersize=6,zorder=2)
ax.plot(xy[:, 0], xy[:, 1], 'o', markerfacecolor=col, markeredgecolor = 'k', markersize=6,zorder=2, alpha = .3)
if text:
ax.text(xy[:, 0].mean(), xy[:, 1].mean(), str(int(k)), fontsize = font_size, c = 'w')

gl = ax.gridlines(draw_labels=True, dms=False, x_inline=False, y_inline=False)
gl.top_labels, gl.right_labels = False, False
gl.xlabel_style, gl.ylabel_style = {'fontsize': 16}, {'fontsize': 16}
gl.xlabel_style, gl.ylabel_style = {'fontsize': font_size}, {'fontsize': font_size}

lat_min = -45
lat_max = -31
lon_min = 5
lon_max = 35
ax.set_extent([lon_min, lon_max, lat_min, lat_max])

plt.savefig(f'../fig/{output_name}.png', dpi = 300)
if output_name is not None:
plt.savefig(f'../fig/{output_name}.png', dpi = 300)

return ax
Loading

0 comments on commit 6cef981

Please sign in to comment.