From 196789ed880ce3a6318a26655b32ce66036d33dd Mon Sep 17 00:00:00 2001 From: javitausia Date: Thu, 26 Aug 2021 10:00:55 +0200 Subject: [PATCH] updated python example file 2608 --- scripts/example_01.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/scripts/example_01.py b/scripts/example_01.py index 53c6ee5..0e8fd97 100644 --- a/scripts/example_01.py +++ b/scripts/example_01.py @@ -26,28 +26,33 @@ # Csiro data csiro = pd.read_pickle(op.join(p_data, 'hindcast', - 'csiro_dataframe.pkl')) + 'csiro_dataframe_can.pkl')) print(csiro.info()) # Satellite data, see extract_csiro.py # An example for satellite boundary box is: # 43.8, 44.2, 356.2, 356.6 satellite = xr.open_dataset(op.join(p_data, 'satellite', - 'satellite_dataset.nc')) + 'satellite_dataset_can.nc')) print(satellite) # Buoy data -buoy = pd.read_pickle(op.join(p_data, 'buoy', - 'Bilbao-Vizcaya Ext.pkl')) -print(buoy.info()) +buoy = xr.open_dataset(op.join(p_data, 'buoy', + 'bilbao_offshore_buoy.pkl')) +print(buoy) print('--------------------------------------------------------') print('Initializing the constructor...') print('--------------------------------------------------------') -calval_case = CalVal(hindcast=csiro, - satellite=satellite, - buoy=buoy, buoy_corrections=True) +calval_case = calval.CalVal(hindcast=csiro, + hindcast_longitude=csiro_lon, + hindcast_latitude=csiro_lat, + satellite=satellite, + buoy=(True,buoy.to_dataframe()), + buoy_longitude=buoy.longitude, + buoy_latitude=buoy.latitude, + buoy_corrections=False) # if buoy data does not exist, just delte the buoy and buoy_correction # attributes, and then comment the methods that use the buoy information @@ -69,4 +74,6 @@ calval_case.hindcast_sat_corr.to_pickle(op.join(p_data, 'hindcast', 'csiro_dataframe_sat_corr.pkl')) calval_case.hindcast_buoy_corr.to_pickle(op.join(p_data, 'hindcast', - 'csiro_dataframe_buoy_corr.pkl')) \ No newline at end of file + 'csiro_dataframe_buoy_corr.pkl')) + +