ocmw.dataproc.ocmw_extract module

Functions to extract timeseries of data at specific locations in the water column from model data location extracts.

extract_ts_at_hub

Calculate TS of velocity data at depth zhub from OTM extracted data

extract_depthavg_ts

Extract TS depth averaged velocity from OTM extracted data

extract_rotav_ts_at_hub

Calculate TS of rotor averaged velocity at depth zhub from model extracted data

extract_model_ts_at_surface

Extract TS of surface velocity from model extracted data

load_ocmw_file

Reader for loading the OCMW formated extract files

save_ocmw_file

Write data dictionary to OCMW formated output file.

Functions to extract timeseries of data at specific locations in the water column from model data location extracts.

Chris Old IES, School of Engineering, University of Edinburgh Aug 2022

ocmw.dataproc.ocmw_extract.extract_ts_at_hub(datapath, filename, dataset, datasrc, zhub, hab=True)[source]

Calculate TS of velocity data at depth zhub from OTM extracted data

Parameters:
  • datapath (str) – Path to data file to be processed.

  • filename (str) – Filename of data file to be processed.

  • dataset (str) – Short description of data set being processed.

  • datasrc (str) – Short descrition of how the data set was generated.

  • zhub (float) – Vertical height where time series is to be extracted.

  • hab (bool, optional) – Toggle to indicate whether zhub is height above bed or depth below surface. The default is True.

Returns:

t_series (dict) – Dictionary structure containing the time series of velocities at zhub.

ocmw.dataproc.ocmw_extract.extract_depthavg_ts(datapath, filename, dataset, datasrc)[source]

Extract TS depth averaged velocity from OTM extracted data

Parameters:
  • datapath (str) – Path to data file to be processed.

  • filename (str) – Filename of data file to be processed.

  • dataset (str) – Short description of data set being processed.

  • datasrc (str) – Short descrition of how the data set was generated.

Returns:

t_series (dict) – Dictionary structure containing the time series of depth-averagd velocities.

ocmw.dataproc.ocmw_extract.extract_rotav_ts_at_hub(datapath, filename, dataset, datasrc, ppdata, rdia, zhub, hab=True, pwra=True, Cp=0.33)[source]

Calculate TS of rotor averaged velocity at depth zhub from model extracted data

Parameters:
  • datapath (str) – Path to data file to be processed.

  • filename (str) – Filename of data file to be processed.

  • dataset (str) – Short description of data set being processed.

  • datasrc (str) – Short descrition of how the data set was generated.

  • ppdata (dict) – Pre-processed time series data generated using “flowChar.preprocess_ts”.

  • rdia (float) – rotor diameter.

  • zhub (float) – Vertical height where time series is to be extracted.

  • hab (bool, optional) – Toggle to indicate whether zhub is height above bed or depth below surface. The default is True.

  • pwra (bool, optional) – Toggle to switch between power weighted rotor average and depth average. The default is True.

  • Cp (float, optional) – Turbine power coefficient. The default is 0.33.

Returns:

t_series (TYPE) – Dictionary structure containing the time series of rotor averaged velocities at zhub.

ocmw.dataproc.ocmw_extract.extract_model_ts_at_surface(datapath, filename, dataset, datasrc)[source]

Extract TS of surface velocity from model extracted data

datapathstr

Path to data file to be processed.

filenamestr

Filename of data file to be processed.

datasetstr

Short description of data set being processed.

datasrcstr

Short descrition of how the data set was generated.

Returns:

t_series (dict) – Dictionary structure containing the time series of surface velocities.

ocmw.dataproc.ocmw_extract.checkOCMWExtn(fileName)[source]
ocmw.dataproc.ocmw_extract.load_ocmw_file(dataPath, fileName)[source]

Reader for loading the OCMW formated extract files

Parameters:
  • datapath (str) – Path to data file to be processed.

  • filename (str) – Filename of data file to be processed.

Returns:

data (dict) – Dictionary structure containing the data from the OCMW file.

ocmw.dataproc.ocmw_extract.save_ocmw_file(dataPath, ocmwFileName, dataDict)[source]

Write data dictionary to OCMW formated output file.

Parameters:
  • dataPath (str) – Path to where data are to be saved.

  • ocmwFileName (str) – Filename ofoutput OCMW data file.

  • dataDict (dict) – Dictionary containing data to be written to OCMW output file

Returns:

none

ocmw.dataproc.ocmw_extract.speedBinIndices(dataPath, ocmwPPFile, binWidth)[source]

Calculate speed bin indices based on OCMW timeseries extracted at a fixed height above the seabed.

ocmw.dataproc.ocmw_extract.speedBinning(rootPath, dataFile, ocmwPPFile, binWidth)[source]

Speed bin OCMW extracted velocity data using a pre-processed OCMW data file to define the speed bin indices.