def __init__(self, station, data ): self.station = station self.data = data self.ymd = data[:,daydata.YYYYMMDD] self.date_s = utils.f_to_s(self.ymd[ 0]) # First day data self.date_e = utils.f_to_s(self.ymd[-1]) # Last day data self.period = f'{self.date_s}-{self.date_e}' self.tg_gem = stats.average(data,'TG') # Avergae TG self.tx_max_sort = stats.sort( data, 'TX') self.tx_max = self.tx_max_sort[0, daydata.ndx_ent('TX')] # Get max is 1st in list self.tg_max_sort = stats.sort( data, 'TG') self.tg_max = self.tg_max_sort[0, daydata.ndx_ent('TG')] self.tn_max_sort = stats.sort( data, 'TN') self.tn_max = self.tn_max_sort[0, daydata.ndx_ent('TN')] self.sq_tot = stats.sum(data,'SQ') # Total sunshine hours self.sq_sort = stats.sort(data, 'SQ') self.rh_tot = stats.sum(data,'RH') # Total rain self.rh_sort = stats.sort( data, 'RH') self.days_tx_gte_20 = stats.terms_days(data,'TX','≥',20) # Warm days self.days_tx_gte_25 = stats.terms_days(data,'TX','≥',25) # Summer days self.days_tx_gte_30 = stats.terms_days(data,'TX','≥',30) # Tropical days self.days_tx_gte_35 = stats.terms_days(data,'TX','≥',35) # Tropical days self.days_tx_gte_40 = stats.terms_days(data,'TX','≥',40) # Extreme Tropical days self.days_tg_gte_18 = stats.terms_days(data,'TG','≥',18) # Warmte getal dag self.days_tg_gte_20 = stats.terms_days(data,'TG','≥',20) # Warme gemiddelde self.days_tn_gte_20 = stats.terms_days(data,'TN','≥',20) # Tropical nights self.days_sq_gte_10 = stats.terms_days(data,'SQ','≥',10) # Sunny days > 10 hours self.days_rh_gte_10 = stats.terms_days(data,'RH','≥',10) # Rainy days > 10mm self.heat_ndx = stats.heat_ndx(data) self.days_heat_ndx = self.days_tg_gte_18
def __init__(self, station, data): self.station = station self.data = data self.ymd = data[:, daydata.YYYYMMDD] self.date_s = utils.f_to_s(self.ymd[0]) # First day data self.date_e = utils.f_to_s(self.ymd[-1]) # Last day data self.period = f'{self.date_s}-{self.date_e}' # Average calculations self.tg_gem = stats.average(data, 'TG') # Min extremes self.tx_min_sort = stats.sort(data, 'TX', reverse=True) self.tx_min = self.tx_min_sort[0, daydata.ndx_ent('TX')] self.tg_min_sort = stats.sort(data, 'TG', reverse=True) self.tg_min = self.tg_min_sort[0, daydata.ndx_ent('TG')] self.tn_min_sort = stats.sort(data, 'TN', reverse=True) self.tn_min = self.tn_min_sort[0, daydata.ndx_ent('TN')] self.rh_sort = stats.sort(data, 'RH') self.rh_sum = stats.sum(data, 'RH') self.sq_sort = stats.sort(data, 'SQ') self.sq_sum = stats.sum(data, 'SQ') # Days lists self.days_tx_lt_0 = stats.terms_days(data, 'TX', '<', 0) self.days_tg_lt_0 = stats.terms_days(data, 'TG', '<', 0) self.days_tn_lt_0 = stats.terms_days(data, 'TN', '<', 0) self.days_tn_lt__5 = stats.terms_days(data, 'TN', '<', -5) self.days_tn_lt__10 = stats.terms_days(data, 'TN', '<', -10) self.days_tn_lt__15 = stats.terms_days(data, 'TN', '<', -15) self.days_tn_lt__20 = stats.terms_days(data, 'TN', '<', -20) self.days_hellmann = self.days_tg_lt_0 self.sum_hellmann = stats.hellmann(data) self.frost_sum = stats.frost_sum(data) self.frost_sum_data = self.days_tn_lt_0 # All days with a T < 0 self.ijnsen = stats.ijnsen(data)
def __init__(self, station, data, year): self.station = station self.data = data self.ymd = data[:, daydata.YYYYMMDD] self.year = year self.p_start = utils.f_to_s(self.ymd[0]) # First day data self.p_end = utils.f_to_s(self.ymd[-1]) # Last day data self.period = f'{self.p_start}-{self.p_end}' self.tg_max_sort = stats.sort(data, 'TG') self.tg_max = cfg.no_data_given if self.tg_max_sort.size == 0 else self.tg_max_sort[ 0, daydata.ndx_ent('TG')] self.tg_min = cfg.no_data_given if self.tg_max_sort.size == 0 else self.tg_max_sort[ -1, daydata.ndx_ent('TG')] self.tx_max_sort = stats.sort(data, 'TX') self.tx_max = cfg.no_data_given if self.tx_max_sort.size == 0 else self.tx_max_sort[ 0, daydata.ndx_ent('TX')] self.tx_min = cfg.no_data_given if self.tx_max_sort.size == 0 else self.tx_max_sort[ -1, daydata.ndx_ent('TX')] self.tn_max_sort = stats.sort(data, 'TN') self.tn_max = cfg.no_data_given if self.tn_max_sort.size == 0 else self.tn_max_sort[ 0, daydata.ndx_ent('TN')] self.tn_min = cfg.no_data_given if self.tn_max_sort.size == 0 else self.tn_max_sort[ -1, daydata.ndx_ent('TN')] self.tn10_max_sort = stats.sort(data, 'T10N') self.tn10_max = cfg.no_data_given if self.tn10_max_sort.size == 0 else self.tn10_max_sort[ 0, daydata.ndx_ent('T10N')] self.tn10_min = cfg.no_data_given if self.tn10_max_sort.size == 0 else self.tn10_max_sort[ -1, daydata.ndx_ent('T10N')] self.sq_max_sort = stats.sort(data, 'SQ') self.sq_max = cfg.no_data_given if self.sq_max_sort.size == 0 else self.sq_max_sort[ 0, daydata.ndx_ent('SQ')] self.rh_max_sort = stats.sort(data, 'RH') self.rh_max = cfg.no_data_given if self.rh_max_sort.size == 0 else self.rh_max_sort[ 0, daydata.ndx_ent('RH')]
def __init__(self, station, data): self.station = station self.data = data self.ymd = data[:, daydata.YYYYMMDD] self.p_start = utils.f_to_s(self.ymd[0]) # First day data self.p_end = utils.f_to_s(self.ymd[-1]) # Last day data self.period = f'{self.p_start}-{self.p_end}' self.tg_ave = stats.average(data, 'TG') self.tx_max_sort = stats.sort(data, 'TX') self.tx_max = self.tx_max_sort[0, daydata.ndx_ent('TX')] self.tg_max_sort = stats.sort(data, 'TG') self.tg_max = self.tg_max_sort[0, daydata.ndx_ent('TG')] self.tn_max_sort = stats.sort(data, 'TN') self.tn_max = self.tn_max_sort[0, daydata.ndx_ent('TN')] self.tx_min_sort = stats.sort(data, 'TX', reverse=True) self.tx_min = self.tx_min_sort[0, daydata.ndx_ent('TX')] self.tg_min_sort = stats.sort(data, 'TG', reverse=True) self.tg_min = self.tg_min_sort[0, daydata.ndx_ent('TG')] self.tn_min_sort = stats.sort(data, 'TN', reverse=True) self.tn_min = self.tn_min_sort[0, daydata.ndx_ent('TN')] self.sq_sum = stats.sum(data, 'SQ') # Total sunshine hours self.sq_sort = stats.sort(data, 'SQ') self.rh_sum = stats.sum(data, 'RH') # Total rain self.rh_sort = stats.sort(data, 'RH') # Days lists self.days_tx_lt_0 = stats.terms_days(data, 'TX', '<', 0) self.days_tg_lt_0 = stats.terms_days(data, 'TG', '<', 0) self.days_tn_lt_0 = stats.terms_days(data, 'TN', '<', 0) self.days_tn_lt__5 = stats.terms_days(data, 'TN', '<', -5) self.days_tn_lt__10 = stats.terms_days(data, 'TN', '<', -10) self.days_tn_lt__15 = stats.terms_days(data, 'TN', '<', -15) self.days_tn_lt__20 = stats.terms_days(data, 'TN', '<', -20) self.days_tx_gte_20 = stats.terms_days(data, 'TX', '≥', 20) # Warm days self.days_tx_gte_25 = stats.terms_days(data, 'TX', '≥', 25) # Summer days self.days_tx_gte_30 = stats.terms_days(data, 'TX', '≥', 30) # Tropical days self.days_tx_gte_35 = stats.terms_days(data, 'TX', '≥', 35) # Tropical days self.days_tx_gte_40 = stats.terms_days(data, 'TX', '≥', 40) # Tropical days self.days_tg_gte_18 = stats.terms_days(data, 'TG', '≥', 18) # Warmte getal dag self.days_tg_gte_20 = stats.terms_days(data, 'TG', '≥', 20) # Warme gemiddelde self.days_tn_gte_20 = stats.terms_days(data, 'TN', '≥', 20) # Tropical nights self.days_sq_gte_10 = stats.terms_days(data, 'SQ', '≥', 10) # Sunny days > 10 hours self.days_rh_gte_10 = stats.terms_days(data, 'RH', '≥', 10) # Rainy days > 10mm self.heat_ndx = stats.heat_ndx(data) self.days_heat_ndx = self.days_tg_gte_18 self.hellmann = stats.hellmann(data) self.days_hellmann = self.days_tg_lt_0 self.ijnsen = stats.ijnsen(data) self.frost_sum = stats.frost_sum(data) self.frost_sum_data = self.days_tn_lt_0 # All days with a T < 0