Operational Planning#
Operational Planning module
Module to support operational planning The module allows calculating statistics of number of weather windows and/or statistics of length of operations, when accounting for weather downtime
In this module weather window is defined as uninterrupted window of given length, when the operational critera are met. The main deliverable is the number (count) of weather windows (and various statistics around the number). The number of weather windows for a given period of time can be considered back-to-back (next window is considered after the end of pervious window) or for any timestamp - every timestamop is considered as potential start of a weather window
The operational length is how long will it take to carry out the operation of given nominal length, when taking into account weather downtime. Operational length is provided in units of time. When calculating the length, operations can be considered critical or non-critical. With critical operations, the full operations have to restart if criteria is exceeded. With non-critical operations, they can be paused for the bad weather and continued once the conditions meet the criteria
The module, in order of execution to produce a full result, consists of:
Use a pandas query to limit the dataset to the timestamps matching operational criteria (data.query(“hs < 2 and tp < 3”) for instance)
ww_calc - method to identify the weather windows
oplen_calc - method to calculate operational length
wwmonstats - method that produces monthly statistics of number of weather windows
olmonstats - method that produces monthly statistics of operational length values
Created on Wed Dec 2 14:14:48 2020
@author: david.darbinyan
- resourcecode.opsplanning.olmonstats(oplendetect)#
Method to produce monthly statistics of operational lengths. Produces plots and, optionally, can save the results in csv files
- Parameters:
oplendetect (PANDAS Series) – Series containing the starting dates and corresponding operational lengths, produced using oplen_calc method.
- Returns:
olmonres – Returns operational length in hours by year/month.
- Return type:
PANDAS DATAFRAME
- resourcecode.opsplanning.oplen_calc(critsubs, oplen, critical_operation=False, date=1, monstrt=True)#
Method for calculating length of operations when taking into account the weather downtime. The operational length is calculated for a given starting date
- Parameters:
critsubs (PANDAS DATAFRAME) – Subset of original dataset containing only data that meets the criteria
oplen (DOUBLE) – Nominal length of the operation (if no downtime), in hours
critical_operation (BOOLEAN) –
False for non-critical operations: With this flag to False, it is assumed that the operation can be halted for the duration of weather downtime and started again
True is for continuous window search: In this case operations can’t be halted and if stopped due to weather downtime have to restart from the beginning once the conditions allow
The default is non critical operation.
date (INT,DATETIME optional) – If the method is used for one off operational length calulation (see monstrt) the start date in DATETIME format should be defined If the method is used for producing a monthly statistics of operational lengths for opearations starting on the day of month defined as integer in date parameter. The default is 1 (with default monstrt = True)
monstrt (BOOLEAN, optional) – Calculate operational lengths for monthly start dates or for a specific date. If monstrt is True, the method will take start day from ‘date’ parameter and calculate operational lengths for each month starting at the provided day. If it is Flase, the operational length will be calculated for a single start date provided by ‘date’ parameter. The default is True.
- Raises:
NameError – Errors if the data types don’t match.
- Returns:
oplendetect – Output pandas series where indexes reflect the start date of the operation and the OpLengthHrs column shows the length of the operations in Timedelta format.
- Return type:
PANDAS Series
- resourcecode.opsplanning.ww_calc(critsubs: DataFrame, winlen: float, concurrent_windows: bool = True) Series #
Method that calculates and returns start date of each weather window
- Parameters:
critsubs (PANDAS DATAFRAME) – Subset of original dataset containing only data that meets the criteria
winlen (float) – Length of the weather window in hours
concurrent_windows (bool) –
If True, the algorithm searches for window, if a window is found, search of next window will start from the end of the previous window.
- If False, it uses continuous window search:
The algorithm searches for window starting from every time step that meets the criteria.
- Returns:
windetect – Series containing the starting dates of weather windows
- Return type:
PANDAS Series
- resourcecode.opsplanning.wwmonstats(windetect)#
Method to produce monthly statistics of weather windows. Produces plots and, optionally, can save the results in csv files
- Parameters:
windetect (PANDAS Series) – Series containing the starting dates of weather windows, produced using ww_calc method
- Returns:
wwmonres – Returns number of weather window by year/month.
- Return type:
PANDAS DATAFRAME