import pandas as pd def form2(x, pos): """ This function returns a string with 3 decimal places, given the input x""" return '%.2f' % x def form5(x, pos): """ This function returns a string with 3 decimal places, given the input x""" return '%.7f' % x xformatter = FuncFormatter(form2) yformatter = FuncFormatter(form5) #get species from current directory present_dir = os.getcwd() obs_fname,species,start_year,end_year,vres,timeres = modules.get_obs_info(present_dir) model_fname,species,start_year,end_year = modules.get_model_info(present_dir) obs_refs,obs_raw_time,obs_ref_time,obs_datetime_time,obs_std_var,obs_lats,obs_lons,obs_alt,obs_gap_inds = modules.read_obs_all(obs_fname,species,start_year,end_year) model_raw_time,model_ref_time,model_datetime_time,model_std_var,lat_e,lon_e,lat_c,lon_c,grid_size,gridbox_count = modules.read_model_all(model_fname,species,start_year,end_year) #get obs lat_lon grid central points obs_lats_centre, obs_lons_centre, model_indices = modules.grid_obs_centre_convergance(lat_e,lon_e,obs_lats,obs_lons) #get observational location tags #EU = europe, AF = africa, NA = north america, SA = south america, ANT = antarctica, ARC = arctic, O = oceanic, OC = oceania, AS = asia tags = modules.get_tags(np.copy(obs_refs)) #-------------------------------------------------------- #load in periodic lsp data
from scipy.odr import Model, RealData, ODR, Data from pylab import * import pandas as pd def interactive(event): modules.clicker_interactive_map_obsmodel( event, species, lat_e, lon_e, obs_datetimes, model_datetimes, obs_ts_grp, model_ts_grp, obs_period_grp, model_period_grp, obs_refs, tags, loc_dict, obs_d_waveform, obs_s_waveform, obs_all_waveform, model_d_waveform, model_s_waveform, model_all_waveform, fig, all_m) #get species from current directory present_dir = os.getcwd() obs_fname, species, start_year, end_year, vres, timeres = modules.get_obs_info( present_dir) model_fname, species, start_year, end_year = modules.get_model_info( present_dir) obs_refs, obs_raw_time, obs_ref_time, obs_datetime_time, obs_std_var, obs_lats, obs_lons, obs_alt, obs_gap_inds = modules.read_obs_all( obs_fname, species, start_year, end_year) model_raw_time, model_ref_time, model_datetime_time, model_std_var, lat_e, lon_e, lat_c, lon_c, grid_size, gridbox_count = modules.read_model_all( model_fname, species, start_year, end_year) #get obs lat_lon grid central points obs_lats_centre, obs_lons_centre, model_indices = modules.grid_obs_centre_convergance( lat_e, lon_e, obs_lats, obs_lons) #get observational location tags #EU = europe, AF = africa, NA = north america, SA = south america, ANT = antarctica, ARC = arctic, O = oceanic, OC = oceania, AS = asia tags = modules.get_tags(np.copy(obs_refs))