os.chdir(directory) sat = [] df = [] rlon = [] rlat = [] for i in range(len(files)): name = files[i].split('_') sat.append(name[1]) df.append(f1.read(files[i], epoque1, epoque2)) df[i] = df[i].set_index("tsn") df[i].columns = [ 'el_{0}'.format(sat[i]), 'az_{0}'.format(sat[i]), 'tec_{0}'.format(sat[i]) ] rlon.append(f1.lecture_lon(files[i])) rlat.append(f1.lecture_lat(files[i])) dftot = reduce(lambda x, y: pd.merge(x, y, on="tsn"), df) df_rlat = pd.DataFrame([rlat]) df_rlon = pd.DataFrame([rlon]) df_el = pd.DataFrame() df_az = pd.DataFrame() df_tec = pd.DataFrame() for j in range(len(files)): df_el = df_el.append(dftot['el_{0}'.format(sat[j])]) df_az = df_az.append(dftot['az_{0}'.format(sat[j])]) df_tec = df_tec.append(dftot['tec_{0}'.format(sat[j])]) #### df_el = np.radians(df_el) df_az = np.radians(df_az) ####
rep = os.path.abspath(os.path.expanduser(directory)) files = os.listdir(rep) files.sort() os.chdir(directory) for i in range(len(files)): name = files[i].split('_') station.append(name[0]) df.append(f1.read(files[i], epoque1, epoque2)) df[i] = df[i].set_index("tsn") df[i].columns = [ 'el_{0}'.format(station[i]), 'az_{0}'.format(station[i]), 'tec_{0}'.format(station[i]) ] lon_station.append(f1.lecture_lon(files[i])) lat_station.append(f1.lecture_lat(files[i])) dftot = reduce(lambda x, y: pd.merge(x, y, on="tsn"), df) df_lat_station = pd.DataFrame([lat_station]) df_lon_station = pd.DataFrame([lon_station]) for j in range(len(files)): df_el = df_el.append(dftot['el_{0}'.format(station[j])]) df_az = df_az.append(dftot['az_{0}'.format(station[j])]) df_tec = df_tec.append(dftot['tec_{0}'.format(station[j])]) df_el = np.radians(df_el).T df_az = np.radians(df_az).T df_tec = df_tec.T df_tec = df_tec - df_tec.iloc[0] df_x = np.arcsin((Re * np.cos(df_el)) / (Re + H)) df_ksi = (np.pi / 2) - (df_el.add((df_x), fill_value=0)) tplat = pd.np.multiply(np.sin(df_ksi), np.cos(df_az)) tplon = pd.np.multiply(np.sin(df_ksi), np.sin(df_az))