Exemplo n.º 1
0
dqf_gen.npy

b_mag_spc.npy
n_p_filtered.npy
temp_filtered.npy
v_r_filtered.npy
"""

import numpy as np
import cdflib
from pspconstants import *
import datetime
import psplib
import os

carrlon, scpos = psplib.multi_unpack_vars(path,
                                          ['carr_longitude', 'sc_pos_HCI'])
dist = psplib.compute_magnitudes(scpos / au_km, True)
epoch_ns = psplib.multi_unpack_vars(path, ['epoch'])[0]
epoch = np.array(
    [datetime_t0 + datetime.timedelta(seconds=i / 1e9) for i in epoch_ns])
dqf = np.load(precomp_path + 'dqf_gen.npy')

# carrlon = np.load(precomp_path+"spiral_longitude.npy")

boxcar_path = precomp_path + "boxcar/"
filter_time = datetime.timedelta(hours=1)  #1 hour
filenames = [
    'b_mag_spc.npy', 'n_p_filtered.npy', 'temp_filtered.npy',
    'v_r_filtered.npy'
]
Exemplo n.º 2
0
out to .npy binary files to use for quick plotting
"""

import cdflib
import numpy as np
from pspconstants import *
import psplib
import traces
import datetime
from os import listdir

maxdiff = 0.1

filter_time = datetime.timedelta(hours=1)  #1 hour

epoch_ns, dqf = psplib.multi_unpack_vars(path, ['epoch', 'DQF'])
dqf = dqf[:, 0]
epoch = np.sort(
    np.array(
        [datetime_t0 + datetime.timedelta(seconds=i / 1e9) for i in epoch_ns]))

epoch_min_diff = psplib.get_min_diff(epoch)

vp, vp_fit = psplib.multi_unpack_vars(path, ['vp_moment_RTN', 'vp_fit_RTN'])
v_r = vp[:, 0]
v_r_fit = vp_fit[:, 0]
np.save(precomp_path + 'v_r', v_r)
np.save(precomp_path + 'v_r_fit', v_r_fit)
print('v_r computed')
v_r_good = np.where(
    np.logical_and((v_r - v_r_fit) / v_r < maxdiff,