Exemplo n.º 1
0
 def __init__(self, year, timeframe):
     self.year = year
     self.timeframe = timeframe
     self.hedata = loadswicsiondata("He2+", 720., self.year, self.timeframe,
                                    "/data/etph/ace/")
     self.odata = loadswicsiondata("O6+", 720., self.year, self.timeframe,
                                   "/data/etph/ace/")
     self.hdata = swicsdcrtcr("H1+", self.year, self.timeframe,
                              "/data/etph/ace/pui/12mdata/")
     self.swedata = swepamdata(64., self.year, self.timeframe,
                               "/data/etph/ace/swepam/")
     self.swedata.sync_h(self.hedata)
     self.mag = magdata(1., self.year, self.timeframe,
                        "/data/etph/ace/mag/")
     self.mag.sync_mag(self.hedata)
     self.theta = arccos(cos(self.mag.phi) * cos(self.mag.theta))
     self.valf = 21.8 / sqrt(self.swedata.dens) * (self.mag.magb)
     self.valf[isinf(self.valf)] = -1.
     self.valf[isnan(self.valf)] = -2.
     self.effh = zeros([58])
     self.effhe = zeros([58])
     self.effo = zeros([58])
     self.gp = Gnuplot()
     self.gp("set xr [-2:3]")
     self.gp("set yr [0:1]")
     self.gp("set xlabel '(v-v_{sw})/C_{A}'")
     self.stdhe = []
     self.stdo = []
     self.stdh = []
     self.skewhe = []
     self.skewo = []
     self.skewh = []
     self.kurthe = []
     self.kurto = []
     self.kurth = []
     self.meanvhe = []
     self.meanvo = []
     self.meanvh = []
     self.maxvhe = []
     self.maxvo = []
     self.maxvh = []
     self.time = []
     self.years = []
     self.valfs = []
     self.magb = []
     self.thetas = []
     self.sigtheta = []
     self.vsw = []
     self.dsw = []
     self.tsw = []
     self.load_eff()
Exemplo n.º 2
0
from Gnuplot import Gnuplot, Data

year = 2001
timeframe = [[325., 327.]]
timeframe = [[146.62775, 146.62775 + 1. / 120.]]
timeframe = [[167., 168.]]
timeframe = [[222, 223.]]
timeframe = [[39., 40.]]
timeframe = [[4., 5.]]
timeframe = [[153., 155.]]
timeframe = [[32., 34.]]
#year=2008
#timeframe=[[20.,22.]]

hdata = swicsdcrtcr("H1+", year, timeframe, "/data/etph/ace/pui/12mdata/")
hedata = loadswicsiondata("He2+", 720., year, timeframe, "/data/etph/ace/")
odata = loadswicsiondata("O6+", 720., year, timeframe, "/data/etph/ace/")
fedata = loadswicsiondata("Fe9+", 720., year, timeframe, "/data/etph/ace/")
sidata = loadswicsiondata("C6+", 720., year, timeframe, "/data/etph/ace/")
cdata = loadswicsiondata("Fe8+", 720., year, timeframe, "/data/etph/ace/")
swdata = swepamdata(64., year, timeframe, "/data/etph/ace/swepam/")
magdat = magdata(1., year, timeframe, "/data/etph/ace/mag/")

#magdat.sync_mag(hedata)


#gp=Gnuplot()
def get_tseries(iond):
    from numpy import where, mean
    timestep = 12. / 86400.  # time of single esa-step
    d3iondata = []
Exemplo n.º 3
0
from libacepy.attitude import attdata, sync_attitude
from libacepy.vdetector import vdetector
from libacepy.funcs import twobimaxmag

ion = "He2+"
ion2 = "C5+"
res = 720.
year = 2008
path = "/data/wimmer/ace/"
#timeframe=array([[60.,90.]])

#for i in range(19):
for i in range(1):
    timeframe = array([[float(i) * 20. + 1., float(i + 1) * 20. + 1]])
    timeframe = array([[10.25, 10.75]])
    hedata = loadswicsiondata(ion, res, year, timeframe, path)
    odata = loadswicsiondata(ion2, res, year, timeframe, path)
    hdata = swepamdata(64., year, timeframe, path + "swepam/")
    hdata.sync_h(hedata)
    magdata = loadmagdata(1., year, timeframe, path + "mag/")
    magdata.sync_mag(hedata)
    att = attdata(year, "/data/ivar/ace/")
    att.load()
    syncatt = sync_attitude(att, hedata)

    thetaarr = arccos(cos(magdata.phi) * cos(magdata.theta))
    valf = 21.8 * magdata.magb / sqrt(hdata.dens)

    hphi = arctan(hdata.vely / hdata.velx)
    htheta = arctan(hdata.velz / sqrt(hdata.velx**2 + hdata.velz**2))
Exemplo n.º 4
0
                 he1data[ycount][doy - 1] += sum(
                     tmpdcr[step, he1para[step][0] -
                            2 * int(he1para[step][1]):he1para[step][0] +
                            2 * int(he1para[step][1])])
                 he1wlist.append(
                     sum(tmpdcr[step, he1para[step][0] - 2 *
                                int(he1para[step][1]):he1para[step][0] +
                                2 * int(he1para[step][1])]))
                 wlist.append(he1para[step][2] / vsw)
         if vsw > 400. and vsw < 500.:
             dcr += tmpdcr
 # load tcr data
 tmptcr = loadswicsiondata("He1+",
                           720.,
                           year,
                           timeframe,
                           path2,
                           loadres=0,
                           loadflux=0,
                           loaddump=0)
 t = 0
 for val in tmptcr.countspec:
     for val2 in val:
         if tmptcr.vsws[t] > 200. and val2[0] / tmptcr.vsws[
                 t] > 1.5 and val2[0] / tmptcr.vsws[t] < 2. and val2[
                     1] > 0.:
             he1data[ycount][int(tmptcr.time[t]) - 1] += val2[1]
             he1wlist.append(val2[1])
             wlist.append(val2[0] / tmptcr.vsws[t])
             he1wlist2.append(val2[1])
             wlist2.append(val2[0] / tmptcr.vsws[t])
     t += 1
Exemplo n.º 5
0
# get theoretical dv values
pthdv = Data(getthdv(600., 0.55, 80., 1), with_="l lt -1 lw 3")
pthdv2 = Data(getthdv(600., 0.55, 80., -1), with_="l lt -1 lw 3")

iyear = -1
for year in years:
    iyear += 1
    p = -1
    for tf in timeframe[iyear]:
        p += 1

        ion = ionlist[0]
        timeframe2 = [tf]
        iondata = loadswicsiondata(ion,
                                   resswics,
                                   year,
                                   timeframe2,
                                   datapath,
                                   loadflux=0)
        plotelemname = iondata.name.replace("%s+" % (str(iondata.charge)), "")
        plotchargename = str(iondata.charge) + "+"
        swepam = swepamdata(resswepam, year, timeframe2, swepampath)
        mag = loadmagdata(resmag, year, timeframe2, magpath)
        #mag.sync_mag_hires(iondata)
        #swepam.sync_h_hires(iondata)
        mag.sync_mag(iondata)
        swepam.sync_h(iondata)

        # calculate angles between proton velocity and magnetic field vector
        theta = arccos(
            (swepam.velx * mag.magbx +
             (swepam.vely) * mag.magby + swepam.velz * mag.magbz) /