File size: 2,096 Bytes
98a2104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
def frost_bool(Tmin,Tfrost):

    """
    Test if the day is a frost day (minimum daily temperature below frost threshold).

    Parameters
    ----------
    Tmin : float
        Minimum daily air temperature (deg Celsius).

    Tfrost : float
        Frost temperature (regular or strong frost) (deg Celsius).

    Returns
    -------
    bool
        True if it's a frost day, else False.
    """

    return Tmin <= Tfrost




def scorch_bool(Tmax,Tscorch):

    """
    Test if the day is a scorching day (jour échaudant) (maximum daily temperature above scorch threshold).

    Parameters
    ----------
    Tmax : float
        Maximum daily air temperature (deg Celsius).

    Tscorch : float
        Temperature threshold above which the day is considered scorching (crop-dependent) (deg Celsius).

    Returns
    -------
    bool
        True if it's a scorching day, else False.
    """
    
    return Tmax >= Tscorch



def thermalstress_bool(Tmax, Tstress):

    """
    Define if the day is a source of thermal stress (maximum daily temperature above stress threshold).

    Parameters
    ----------
    Tmax : float
        Maximum daily air temperature (deg Celsius).

    Tstress : float
        Temperature threshold above which the day is considered stressful (deg Celsius).

    Returns
    -------
    bool
        True if the day is a source of thermal stress, else False.
    """
    return Tmax >= Tstress

    

def summerday_bool(Tmax):
    """
    Define if the day is a summer day (maximum daily temperature above 25°C).

    Parameters
    ----------
    Tmax : float
        Maximum daily air temperature (deg Celsius).

    Returns
    -------
    bool
        True if it's a summer day, else False.
    """

    return Tmax >= 25


def tropicalnight_bool(Tmin):

    """
    Define if night is a tropical night (min night temperature above 20°).

    Parameters
    ----------
    Tmin : float
        Min Night Air temperature (degrees Celsius).

    Returns
    -------
    bool
        True if tropical night, else False.
    """

    return Tmin >= 20