import csv
import matplotlib.pyplot as plt
import numpy as np
from src.algorithms.slp import haversine, median
from src.utils.geo import GeoCoord

class EstimatorCurve:
    '''
    The EstimatorCurve class is used to assess the confidence of a predicted location for SLP.

    Attributes:
        w_stdev  (numpy arr): A two dimensional numpy array representing the estimator curve. The x
            axis is the standard deviations and y axis is the probability. The curve is a CDF. This
            curve is generated from known locations where at least two neighbors are at different
            locations.
        wo_stdev (numpy_arr): A two dimensional numpy array representing the estimator curve

    '''

    def __init__(self, w_stdev, wo_stdev):
        self.w_stdev = w_stdev
        self.wo_stdev = wo_stdev

    def predict_probability_area(self, upper_bound, lower_bound, estimated_loc):
        '''
        Given a prediction and a bounding box this will return a confidence range
        for that prediction

        Args:
            upper_bound (geoCoord): bounding box top right geoCoord