def calculate_phase(period, obsDur, winSize):
    """ Function to calculate the min and max phase. 

        Parameters
        ----------
        period : float
            The period of the transit in days. 
        obsdur : float
            The duration of the observation in hours.
        winSize : float
            The window size of transit in hours. Default is 1 hour.

        Returns
        -------
        minphase : float
            The minimum phase constraint.
        maxphase : float
            The maximum phase constraint. """
    minphase = 1.0 - (obsDur + winSize) / 2.0 / 24 / period
    maxphase = 1.0 - (obsDur - winSize) / 2.0 / 24 / period
    return minphase, maxphase
