Skip to content

Commit

Permalink
updated python example file 2608
Browse files Browse the repository at this point in the history
  • Loading branch information
javitausia committed Aug 26, 2021
1 parent 4626a1d commit 196789e
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions scripts/example_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'))
'csiro_dataframe_buoy_corr.pkl'))


0 comments on commit 196789e

Please sign in to comment.