Beispiel #1
0
    tiempos,
    UTC_to_hdec,
    proyecciones,
)

np.set_printoptions(precision=4)
"""
Este script plotea mag, swea, swia y lpw en la región de interés para cualquier
cruce.

"""
year, month, day, doy = fechas()
ti, tf = tiempos()

mag, t, B, posicion = importar_mag(year, month, day, ti, tf)
t1, t2, t3, t4 = importar_t1t2t3t4(year, month, day, int(ti))

t_up = t1 - 0.015
t_down = t4 + 0.015

# zoom_inicial = donde(t, t1-0.05)
# zoom_final = donde(t, t4 + 0.05)

Bnorm = np.linalg.norm(B, axis=1)

path = f"../../../datos/MAG_1s/{year}/"  # a los datos de 1s PDS
mag_low = np.loadtxt(
    path + f"mvn_mag_l2_{year}{doy}ss1s_{year}{month}{day}_v01_r01.sts",
    skiprows=160)
tlow = mag_low[:, 6]  # el dia decimal
tlow = (tlow - int(doy)) * 24  # para que me de sobre la cantidad de horas
Beispiel #2
0
El mapa de colores me va a dar el valor del cociente.
"""

import numpy as np
import time as time
from funciones import find_nearest, Mij, fechas
from importar_datos import importar_t1t2t3t4, importar_mag

# dates = np.loadtxt('outputs/t1t2t3t4.txt')

# for l in range(len(dates)):

year, month, day, doy = fechas()
hora = input("Hora en HH\n")

tiempos = importar_t1t2t3t4(year, month, day, doy, int(hora))

# ti = float(input('Tiempo inicial del barrido\n'))
# tf = float(input('Tiempo final del barrido\n'))
ti = tiempos[0]
tf = tiempos[3]

mag, t, B, posicion = importar_mag(year, month, day, ti, tf)

tiempo_central = np.zeros(int(
    (tf - ti) * 3600))  # la cantidad de segundos entre tf y ti
tiempo_central[0] = ti
for i in range(len(tiempo_central) - 1):
    tiempo_central[i +
                   1] = (tiempo_central[i] + 1 / 3600
                         )  # el tiempo central se va barriendo cada 5 segundos
Beispiel #3
0
np.set_printoptions(precision=4)
"""
Este script plotea mag, swea, swia y lpw en la región de interés
Es la fig principal del grl.

"""
year, month, day, doy = fechas()
ti, tf = tiempos("tiempo inicial y final en el viento solar\n")

path = f"../../../datos/clweb/{year}-{month}-{day}/"
# path = f"../../../../../media/gabybosc/datos/clweb/{year}-{month}-{day}/"  # path a los datos desde la desktop.
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)
Beispiel #4
0
Para datos de MAg de baja resolución

Este script pide como user input una fecha (puede ser o fecha dd-mm-aaaa o dia_del_año-año) y los cuatro tiempos t1 t2 t3 t4.
Eventualmente podría simplemente encontrar todos los cruces que quiero y decirle que lea directamente de algún lugar eso.
Antes de correr este programa hay que haber usado plot_seleccionar_puntos, para tener los cuatro tiempos elegidos.
Nos devuelve los lambdas, el cociente de lambdas, el omega, los autovectores y la normal para el MVA, el ajuste y el bootstrap.
Nos da el valor medio de B, de la altitud y el SZA. Grafica el hodograma.

Guarda los datos en una spreadsheet de google
"""

np.set_printoptions(precision=4)

year, month, day, doy = fechas()
hour = int(input("Hora en HH"))
t1, t2, t3, t4 = importar_t1t2t3t4(year, month, day, doy, hour)

mag, t, B, posicion = importar_mag_1s(year, month, day, t1, t4)
lpw, t_lpw, e_density = importar_lpw(year, month, day, t1, t4)

t_1 = donde(t, t1)
t_2 = donde(t, t2)
t_3 = donde(t, t3)
t_4 = donde(t, t4)

#################

# ahora empieza el MVA con los datos que elegí
B_cut = B[t_2:t_3 + 1, :]
posicion_cut = posicion[t_2:t_3 + 1, :]
Beispiel #5
0
"""
Calcula diferentes valores de B_upstream y B_downstream (en diferentes lapsos)
y los grafica. Sirve para elegir qué límites tomar.
"""

year, month, day, doy = fechas()
ti, tf = tiempos()
mag, t, B, posicion = importar_mag_1s(year, month, day, ti, tf)

M = len(t)  # el numero de datos

inicio = donde(t, ti)
fin = donde(t, tf)

t1, t2, t3, t4 = importar_t1t2t3t4()

Bu = np.zeros((180, 4))
for i in range(180):
    paso = t1 - 180 + 0.0001 * i
    inicio_up = donde(t, paso)
    fin_up = donde(t, t1)
    B_upstream = np.mean(B[inicio_up:fin_up, :], axis=0)  # nT
    Bu[i, 0:3] = B_upstream
    Bu[i, 3] = np.linalg.norm(B_upstream)

plt.figure(1)
plot_datetime(year, month, day, t[fin_up - 180 : fin_up], Bu[:, 0])
plot_datetime(year, month, day, t[fin_up - 180 : fin_up], Bu[:, 1], colour="C1")
plot_datetime(year, month, day, t[fin_up - 180 : fin_up], Bu[:, 2], colour="C2")
plt.xlabel("t (UTC)")