# fin_swea = np.where(t_swea == find_nearest(t_swea, t4 + 0.075))[0][0] # ####### densidad SWIA # swia, t_swia, density = importar_swia(year, month, day, ti, tf) t_swica, t_swifa, density_swica, density_swifa = importar_swicfa( year, month, day, ti, tf) # ###### densidad electrones lpw, t_lpw, e_density = importar_lpw(year, month, day, ti, tf) # ############ tiempos UTC year = int(year) month = int(month) day = int(day) tiempo_mag = np.array([np.datetime64(datenum(year, month, day, x)) for x in t]) # datenum es una función mía tiempo_swea = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_swea]) tiempo_swica = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_swica]) tiempo_swifa = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_swifa]) tiempo_lpw = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_lpw]) tiempo_low = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_plot]) tm1 = donde(t, t1) tm2 = donde(t, t2) tm3 = donde(t, t3)
####### densidad electrones t_unix_lpw = lpw.varget("time_unix") e_density = lpw.varget("density") t_lpw = unix_to_decimal(t_unix_lpw) ti_lpw = np.where(t_lpw == find_nearest(t_lpw, 17.85))[0][0] tf_lpw = np.where(t_lpw == find_nearest(t_lpw, 18.4))[0][0] tiempo_lpw = np.array([ np.datetime64(datetime(2016, 3, 16, int(x[0]), int(x[1]), int(x[2]))) for x in lpw[ti_lpw:tf_lpw, :] ]) # un array de datetimes con las horas entre 17.85 y 18.4 ############# MAG tiempo_mag = np.array([ np.datetime64(datenum(2016, 3, 16, x)) for x in t[j_inicial:j_final] ]) # datenum es una función mía ###########el plot t1 = datetime(2016, 3, 16, 18, 13, 00) t2 = np.where(t[j_inicial:j_final] == find_nearest(t, 18.2201))[0][0] t3 = np.where(t[j_inicial:j_final] == find_nearest(t, 18.235))[0][0] t4 = np.where(t[j_inicial:j_final] == find_nearest(t, 18.2476))[0][0] t_bs = np.where(t[j_inicial:j_final] == find_nearest(t, 18.05))[0][0] dstart = datetime(2016, 3, 16, 17, 50) dend = datetime(2016, 3, 16, 18, 25) plt.clf() # clear figure fig = plt.figure(
inicio_swea = np.where(t_swea == find_nearest(t_swea, ti))[0][0] fin_swea = np.where(t_swea == find_nearest(t_swea, tf))[0][0] # ##############################################################################################SWIA swia, t_swia, density = importar_swia(year, month, day, ti, tf) # ############################################################################################## LPW lpw, t_lpw, e_density = importar_lpw(year, month, day, ti, tf) year = int(year) month = int(month) day = int(day) tiempo_mag = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t] ) # datenum es una función mía tiempo_swea = np.array([np.datetime64(datenum(year, month, day, x)) for x in t_swea]) tiempo_swia = np.array([np.datetime64(datenum(year, month, day, x)) for x in t_swia]) tiempo_lpw = np.array([np.datetime64(datenum(year, month, day, x)) for x in t_lpw]) tiempo_low = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_plot] ) # datenum es una función mía tm1 = np.where(t == find_nearest(t, t1)) tm2 = np.where(t == find_nearest(t, t2)) tm3 = np.where(t == find_nearest(t, t3)) tm4 = np.where(t == find_nearest(t, t4)) tiempo_lim = [tiempo_mag[tm1], tiempo_mag[tm2], tiempo_mag[tm3], tiempo_mag[tm4]]
swia, t_swia, proton_density, sw_vel = importar_swica(2016, "03", 16, t_cut[0], t_cut[-1]) # los valores estos los elegi mirando los gráficos de la función ancho ti_simu = t_simu[donde(x_tray, 1.15)] tf_simu = t_simu[donde(x_tray, 1.01)] ii = donde(t_simu, ti_simu) jj = donde(t_simu, tf_simu) year = 2016 month = 3 day = 16 tiempo_mag = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_cut]) tiempo_simu = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_simu]) tiempo_swia = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_swia]) tiempo_lpw = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_lpw]) # idx_flag = [i for i in range(len(flag)) if flag[i] > 50] normal = np.array([0.920, -0.302, 0.251]) ancho_mpb = np.dot(r_simu[jj] - r_simu[ii], normal) tt = donde(t_cut, t1) ff = donde(t_cut, t4) # ancho = np.dot(posicion_cut[tt] - posicion_cut[ff], normal)
inicio_swea = donde(t_swea, ti) # debería ser 0 fin_swea = donde(t_swea, tf) # ######################################################################## SWIA swia, t_swia, density = importar_swia(year, month, day, ti, tf) # ########################## STATIC static, t_static, mass, counts = importar_static(year, month, day, ti, tf) # ############ tiempos UTC year = int(year) month = int(month) day = int(day) tiempo_mag = np.array([np.datetime64(datenum(year, month, day, x)) for x in t]) # datenum es una función mía tiempo_swea = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_swea]) tiempo_swia = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_swia]) tiempo_static = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_static]) tm1 = np.where(t == find_nearest(t, t1)) tm2 = np.where(t == find_nearest(t, t2)) tm3 = np.where(t == find_nearest(t, t3)) tm4 = np.where(t == find_nearest(t, t4)) # tm_up = np.where(t == find_nearest(t, t_up)) # tm_down = np.where(t == find_nearest(t, t_down)) # tmva = np.where(t == find_nearest(t, np.mean([t1, t2, t3, t4])))
tlow = (tlow - int(doy)) * 24 # para que me de sobre la cantidad de horas Mlow = np.size(tlow) # el numero de datos # el campo Blow = np.zeros((Mlow, 3)) for i in range(7, 10): Blow[:, i - 7] = mag_low[:, i] B_para, B_perp_norm, t_plot = Bpara_Bperp(Blow, tlow, t[0], t[-1]) # ############ tiempos UTC year = int(year) month = int(month) day = int(day) tiempo_mag = np.array([np.datetime64(datenum(year, month, day, x)) for x in t]) # datenum es una función mía tiempo_low = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_plot]) tm1 = donde(t, t1) tm2 = donde(t, t2) tm3 = donde(t, t3) tm4 = donde(t, t4) tm_up = donde(t, t_up) tm_down = donde(t, t_down) tmva = donde(t, UTC_to_hdec("18:13:33")) tbs = donde(t, UTC_to_hdec("18:02:00")) tmpr = donde(t, UTC_to_hdec("18:19:00")) tiempo_lim = [
datos_t = np.loadtxt("../outputs/t1t2t3t4.txt") mag, t, B, posicion = importar_mag(year, month, day, ti, tf) t1, t2, t3, t4 = importar_t1t2t3t4(year, doy, int(ti)) t_up = t1 - 0.015 t_down = t4 + 0.015 Bnorm = np.linalg.norm(B, axis=1) # ############ tiempos UTC year = int(year) month = int(month) day = int(day) tiempo_mag = np.array([np.datetime64(datenum(year, month, day, x)) for x in t]) # datenum es una función mía tm1 = donde(t, t1) tm2 = donde(t, t2) tm3 = donde(t, t3) tm4 = donde(t, t4) tm_up = donde(t, t_up) tm_down = donde(t, t_down) tiempo_lim = [ tiempo_mag[tm1], tiempo_mag[tm2], tiempo_mag[tm3], tiempo_mag[tm4] ] B1, B2, B3 = proyecciones(B)
ti_simu = t_simu[donde(x, 1.15)] tf_simu = t_simu[donde(x, 1.01)] ii = donde(t_simu, ti_simu) jj = donde(t_simu, tf_simu) lpw, t_lpw, e_density, flag = importar_lpw(2016, "03", 16, t_cut[0], t_cut[-1]) swia, t_swia, proton_density, sw_vel = importar_swica( 2016, "03", 16, t_cut[0], t_cut[-1] ) year = 2016 month = 3 day = 16 tiempo_mag = np.array([np.datetime64(datenum(year, month, day, x)) for x in t_cut]) tiempo_simu = np.array([np.datetime64(datenum(year, month, day, x)) for x in t_simu]) tiempo_swia = np.array([np.datetime64(datenum(year, month, day, x)) for x in t_swia]) tiempo_lpw = np.array([np.datetime64(datenum(year, month, day, x)) for x in t_lpw]) tiempo_static = np.array( [np.datetime64(datenum(year, month, day, x)) for x in t_static] ) idx_flag = [i for i in range(len(flag)) if flag[i] > 50] normal = np.array([0.920, -0.302, 0.251]) ancho_mpb = np.dot(r_simu[jj] - r_simu[ii], normal) posicion_cut = posicion[zi:zf] t_cut = t[zi:zf]