Skip to content

Commit

Permalink
test vert vel
Browse files Browse the repository at this point in the history
  • Loading branch information
callumrollo committed Nov 11, 2024
1 parent 9d24ca9 commit 5f998fc
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def test_plots(start_prof=0, end_prof=100):
fig, ax = tools.plot_basic_vars(ds,start_prof=start_prof, end_prof=end_prof)
assert ax[0].get_ylabel() == 'Depth (m)'
assert ax[0].get_xlabel() == f'Average Temperature [C] \nbetween profile {start_prof} and {end_prof}'
return fig


def test_up_down_bias(v_res=1, xlabel='Salinity'):
Expand Down Expand Up @@ -75,3 +74,17 @@ def test_check_monotony():
assert profile_number_monotony
assert not temperature_monotony


def test_vert_vel():
ds_sg014 = fetchers.load_sample_dataset(dataset_name="sg014_20040924T182454_delayed_subset.nc")
ds_sg014 = tools.calc_glider_w_from_depth(ds_sg014)
ds_sg014 = tools.calc_seawater_w(ds_sg014)
tools.plot_vertical_speeds_with_histograms(ds_sg014)
ds_dives = ds_sg014.sel(N_MEASUREMENTS=ds_sg014.PHASE == 2)
ds_climbs = ds_sg014.sel(N_MEASUREMENTS=ds_sg014.PHASE == 1)
ds_out_dives = tools.ramsey_binavg(ds_dives, var = 'VERT_CURR_MODEL', dz=10)
ds_out_climbs = tools.ramsey_binavg(ds_climbs, var = 'VERT_CURR_MODEL', dz=10)
tools.plot_combined_velocity_profiles(ds_out_dives, ds_out_climbs)
plt.close('all')


0 comments on commit 5f998fc

Please sign in to comment.