def ok(_): print('loading backup... ', self.backuppath, end='...') self.df = load_dataframe(self.backuppath) print('done.') self.filter_table(query='') self.update_layer_btns() self.show_first_oct() popup.dismiss()
def init_dataframe(args, input_file): df = common.load_dataframe('aaws', input_file, 8) df.index.name = 'time' df.loc[:, 'air_temp'] += common.freezing_point_temp df.loc[:, 'pressure'] *= common.pascal_per_millibar df = df.where((pd.notnull(df)), get_fillvalue(args)) return df
def load_annotation(self): """Load pandas table with annotation data""" print('loading annotation ...', self.annopath, end='...') self.df = load_dataframe(self.annopath) print('done.') # self.df.info() # print(self.df.head()) self.filter_table(query='') self.update_layer_btns()
def get_station(args, input_file, stations): df = common.load_dataframe('gcnet', input_file, 54, delim_whitespace=True) station_number = df['station_number'][0] if 30 <= station_number <= 32: name = 'gcnet_lar{}'.format(station_number - 29) station = stations[name] else: station = list(stations.values())[station_number] return common.parse_station(args, station)
def init_dataframe(args, input_file): convert_current = 1000 check_na = -999 df = common.load_dataframe('promice', input_file, 1, delim_whitespace=True) df.index.name = 'time' df.replace(check_na, np.nan, inplace=True) df.loc[:, ['air_temperature', 'air_temperature_hygroclip', 'surface_temp', 'ice_temp_01', 'ice_temp_02', 'ice_temp_03', 'ice_temp_04', 'ice_temp_05', 'ice_temp_06', 'ice_temp_07', 'ice_temp_08', 'logger_temp']] += common.freezing_point_temp df.loc[:, ['air_pressure']] *= common.pascal_per_millibar df.loc[:, ['fan_current']] /= convert_current df = df.where((pd.notnull(df)), get_fillvalue(args)) return df
def init_dataframe(args, input_file): check_na = 999.0 df = common.load_dataframe('gcnet', input_file, 54, delim_whitespace=True) df.index.name = 'time' df['qc25'] = df['qc25'].astype(str) # To avoid 999 values marked as N/A df.replace(check_na, np.nan, inplace=True) temperature_keys = [ 'temperature_tc_1', 'temperature_tc_2', 'temperature_cs500_1', 'temperature_cs500_2', 't_snow_01', 't_snow_02', 't_snow_03', 't_snow_04', 't_snow_05', 't_snow_06', 't_snow_07', 't_snow_08', 't_snow_09', 't_snow_10', 'max_air_temperature_1', 'max_air_temperature_2', 'min_air_temperature_1', 'min_air_temperature_2', 'ref_temperature'] df.loc[:, temperature_keys] += common.freezing_point_temp df.loc[:, 'atmos_pressure'] *= common.pascal_per_millibar df = df.where((pd.notnull(df)), get_fillvalue(args)) df['qc25'] = df['qc25'].astype(int) # Convert it back to int return df