Esempio n. 1
0
def CallActualProductionValues():
    """Interface Package Description"""
    interface = {
        "WellorArea": str,
        "Wedge": str,
        "StartDate": datetime,
        "EndDate": datetime,
        "LEName": str,
        "AdjustedBool": bool,
        "Phase": ['Gas', 'Oil', 'Water']
    }

    pkg = js.loads(request.data)
    prodData = []
    pkg, success, msg = ValidatePackage(pkg, interface)

    if success:
        WellorArea = pkg['WellorArea']
        Wedge = pkg['Wedge']
        start_date = pkg['StartDate']
        end_date = pkg['EndDate']
        LEName = pkg['LEName']
        Adjusted = pkg['AdjustedBool']
        Phase = pkg['Phase']

        prodData, success, msg = sgm.GetActuals([WellorArea], [Wedge],
                                                start_date, end_date, LEName,
                                                Adjusted, Phase)

    output = ConfigureOutput(prodData, success, msg)
    return output
Esempio n. 2
0
def CallGetLE():
    """Interface Package Description"""
    interface = {
        "StartDate": datetime,
        "EndDate": datetime,
        "LastWeek": bool,
        "FirstOfMonth": bool,
        "WellorArea": str,
        "Wedge": str,
        "NameFilter": str
    }

    LE = []
    pkg, success, msg = InitializePayload(request, interface)

    if success:
        StartDate = pkg['StartDate']
        EndDate = pkg['EndDate']
        WellorArea = pkg['WellorArea']
        Wedge = pkg['Wedge']
        NameFilter = pkg['NameFilter']
        LastWeek = pkg['LastWeek']
        FirstOfMonth = pkg['FirstOfMonth']

        if LastWeek:
            LE, success, msg = sgm.GetLastWeekLE(StartDate, WellorArea, Wedge,
                                                 NameFilter)
        elif FirstOfMonth:
            LE, success, msg = sgm.GetFirstOfMonthLE(StartDate, WellorArea,
                                                     Wedge, NameFilter)
        else:
            LE, success, msg = sgm.SelectLEByCriteria(Wedge, WellorArea,
                                                      NameFilter, StartDate,
                                                      EndDate)

    output = ConfigureOutput(LE, success, msg)
    return output
Esempio n. 3
0
def CallGetForecastValues():
    """Interface Package Description"""
    interface = {
        "ForecastName": str,
        "Wedge": str,
        "WellorArea": str,
        "Phase": ['Gas', 'Oil', 'Water']
    }

    prodDate = []
    pkg, success, msg = InitializePayload(request, interface)

    if success:
        ForecastName = pkg['ForecastName']
        Wedge = pkg['Wedge']
        WellorArea = pkg['WellorArea']
        Phase = pkg['Phase']

        prodData, success, msg = sgm.GetForecastProduction(
            ForecastName, Wedge, WellorArea, Phase)

    output = ConfigureOutput(prodData, success, msg)
    return output
Esempio n. 4
0
def CallGetForecast():
    """Interface Package Description"""
    interface = {
        "WellorArea": str,
        "Wedge": str,
        "NameFilter": str,
        "GFOz": bool
    }

    Forecast = []
    pkg, success, msg = InitializePayload(request, interface)

    if success:
        WellorArea = pkg['WellorArea']
        Wedge = pkg['Wedge']
        NameFilter = pkg['NameFilter']
        GFOz = pkg['GFOz']

        Forecast, success, msg = sgm.SelectForecastByCriteria(
            WellorArea, Wedge, NameFilter, GFOz)

    output = ConfigureOutput(Forecast, success, msg)
    return output