コード例 #1
0
ファイル: test.py プロジェクト: w2naf/pyIRI2016
def test_main1():

    Obj = IRI2016()
    IRIData, IRIDATAAdd = Obj.IRI()
    assert_allclose((IRIData['ne'], IRIDATAAdd['NmF2'], IRIDATAAdd['hmF2']),
                    (267285184512.0,2580958937088.0,438.78643798828125))
コード例 #2
0
ファイル: iri2016prof2D.py プロジェクト: w2naf/pyIRI2016
    def LatVsFL(self, date=[2003, 11, 21], FIRI=False, IGRF=False, time=[23, 15, 0], \
        gc=[-77.76, -11.95], \
        hlim=[80., 200.], hstp=1., mlatlim=[-10., 10.], mlatstp=.1):

        #
        # INPUTS
        #

        # Date
        year, month, day = date

        # Time
        hour, minute, second = time

        # Geog. Coord.
        dlon, dlat = gc

        # hlim -> Height range at equator, in km
        # hstp -> height resolution at equator, in km
        # mlatlim -> Geom. latitude range, in degrees
        # mlatstp -> Geom. latitude resolution, in degrees

        #
        ###

        doy = TimeUtilities().CalcDOY(year, month, day)
        date2 = year + doy / (365 + 1 if TimeUtilities().IsLeapYear else 0)


        # f = figure(figsize=(16,6))

        # pn = f.add_subplot(111)

        self.coordl, self.qdcoordl = [], []

        for h in arange(hlim[0], hlim[1] + hstp, hstp):

            gc, qc = pyapex.ApexFL().getFL(date=date2, dlon=dlon, dlat=dlat, \
                hateq=h, mlatRange=mlatlim, mlatSTP=mlatstp)

            # x, y, z = gc['lat'], gc['alt'], gc['lon']

            # ind = where(y < hlim[0])
            # if len(ind) > 0: x[ind], y[ind], z[ind] = nan, nan, nan
            # pn.plot(x, y)

            self.coordl.append([gc['lon'], gc['alt'], gc['lat']])
            self.qdcoordl.append([qc['lon'], gc['alt'], qc['lat']])

        # pn.invert_xaxis()
        # show()

        jf = IRI2016().Switches()
        jmag = 0
        mmdd = int(month * 100) + day
        hour2 = hour + minute / 60 + second / 3600

        self.coordl = array(self.coordl)
        self.qdcoordl = array(self.qdcoordl)

        # nfl -> No. of field-line (or height)
        # nc -> No. of coord. (0 -> lon, 1 -> alt, 2 -> lat)
        # np -> No. of points per field-line
        nfl, nc, np = self.coordl.shape

        self.ne, self.te = tile(nan, (np, nfl)), tile(nan, (np, nfl))
        self.ti, self.tn = tile(nan, (np, nfl)), tile(nan, (np, nfl))
        self.nHe, self.nO = tile(nan, (np, nfl)), tile(nan, (np, nfl))
        self.nN2, self.nO2 = tile(nan, (np, nfl)), tile(nan, (np, nfl))
        self.nAr, self.nH = tile(nan, (np, nfl)), tile(nan, (np, nfl))
        self.nN, self.babs = tile(nan, (np, nfl)), tile(nan, (np, nfl))
        if FIRI: self.neFIRI = tile(nan, (np, nfl))

        for fl in range(nfl):

            curr_coordl = transpose(self.coordl[fl, :, :])

            ind = where(curr_coordl[:, 1] >= (hlim[0] - 10.))

            if len(ind[0]) > 0:

                outf, oarr = irisubgl(jf, jmag, year, mmdd, hour2, \
                    curr_coordl[ind[0], :], DataFolder)

                self.ne[ind[0], fl] = outf[0, :]

                self.tn[ind[0], fl] = outf[1, :]
                self.ti[ind[0], fl] = outf[2, :]
                self.te[ind[0], fl] = outf[3, :]

                if FIRI: self.neFIRI[ind[0], fl], ierr = firisubl(year, doy, hour2, \
                    curr_coordl[ind[0], :], DataFolder)

                self.nHe[ind[0], fl] = outf[20, :]
                self.nO[ind[0], fl] = outf[21, :]
                self.nN2[ind[0], fl] = outf[22, :]
                self.nO2[ind[0], fl] = outf[23, :]
                self.nAr[ind[0], fl] = outf[24, :]
                self.nH[ind[0], fl] = outf[26, :]
                self.nN[ind[0], fl] = outf[27, :]

                self.babs[ind[0], fl] = list(self.getIGRF(curr_coordl[ind[0], :], date2)) \
                    if IGRF else outf[19, :]

        self.hlim = hlim

        self.date, self.time = date, time
        self.f107cm = oarr[40, 0]
        self.ap, self.Ap = oarr[50, 0], oarr[51, 0]
コード例 #3
0
#!/usr/bin/env python
from pyiri2016 import IRI2016

sim = IRI2016()
IRIData, IRIDATAAdd = sim.IRI()
print('Ne {:.3e}'.format(IRIData['ne']))
print('NmF2 {:.3e}'.format(IRIDATAAdd['NmF2']))
print('hmF2 {:.3e}'.format(IRIDATAAdd['hmF2']))
コード例 #4
0
ファイル: example01.py プロジェクト: w2naf/pyIRI2016
    def main1():

        Obj = IRI2016()
        IRIData, IRIDATAAdd = Obj.IRI()
        print(IRIData['ne'])
        print(IRIDATAAdd['NmF2'], IRIDATAAdd['hmF2'])