Commit 2db13886 authored by Carl Schreck's avatar Carl Schreck

Automated Nightly Commit - Fri Jun 21 00:01:10 EDT 2019

parent d3c642c5
......@@ -34,7 +34,7 @@ if min_lon == max_lon:
out_path = out_path + '_' + cjs.lon_string(min_lon)
else:
wave = ds_in[wave_name].sel(lon=slice(min_lon,max_lon)).mean(dim='lon')
out_path = (out_path + '_' + cjs.lon_string(min_lon) + '-'
out_path = (out_path + '_' + cjs.lon_string(min_lon) + '-'
+ cjs.lon_string(max_lon))
cjs.tstamp('lat')
......@@ -43,9 +43,9 @@ if min_lat == max_lat:
out_path = out_path + '_' + cjs.lat_string(min_lat)
else:
wave = wave.sel(lat=slice(min_lat,max_lat)).mean(dim='lat')
out_path = (out_path + '_' + cjs.lat_string(min_lat) + '-'
out_path = (out_path + '_' + cjs.lat_string(min_lat) + '-'
+ cjs.lat_string(max_lat))
cjs.tstamp('Calculate tendency')
tend = wave.differentiate('time')
......@@ -64,12 +64,12 @@ phase = xr.where((wave < 0) & (abs(wave) >= abs(tend)), 'L', phase)
phase = xr.where((tend >= 0) & (abs(tend) >= abs(wave)), 'I', phase)
phase = xr.where((tend < 0) & (abs(tend) >= abs(wave)), 'D', phase)
phase.name = 'phase'
cjs.tstamp('Write result')
ds_out = xr.merge([wave, tend, amp, phase])
ds_out.to_netcdf(out_path + '.nc')
df = pd.DataFrame({'time':wave.time, 'wave':wave, 'tend':tend, 'amp':amp,
df = pd.DataFrame({'time':wave.time, 'wave':wave, 'tend':tend, 'amp':amp,
'phase':phase})
df.to_csv(out_path + '.csv', index=False, float_format='%6.3f')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment