示例#1
0
    def LonProfile(self):
        """ Longitude Profile """

        if self.verbose:
            print('LONGITUDE PROFILE')
            print(
                '                   quiet         disturbed             total')
            print(
                '  glon      mer      zon      mer      zon      mer      zon')

        self.glonbins = arange(self.glonlim[0], self.glonlim[1] + self.glonstp,
                               self.glonstp)

        for glon in self.glonbins:

            wqt = hwm14.hwm14( self.iyd, self.sec, self.alt, self.glat, glon, -1, \
                self.f107a, self.f107, self.apqt )

            wdt = hwm14.dwm07(self.iyd, self.sec, self.alt, self.glat, glon,
                              self.ap)

            w = hwm14.hwm14( self.iyd, self.sec, self.alt, self.glat, glon, -1, \
                self.f107a, self.f107, self.ap )

            if self.verbose:                print( ' %5.1f %8.3f %8.3f %8.3f %8.3f %8.3f %8.3f' % \
   ( glon, wqt[0], wqt[1], wdt[0], wdt[1], w[0], w[1] ) )

            self.Uwind.append(w[1])
            self.Vwind.append(w[0])
示例#2
0
    def HeiProfile(self):
        """ Height Profile """

        if self.verbose:
            print('HEIGHT PROFILE')
            print('                 quiet         disturbed             total')
            print(' alt      mer      zon      mer      zon      mer      zon')

        self.altbins = arange(self.altlim[0], self.altlim[1] + self.altstp,
                              self.altstp)

        for alt in self.altbins:

            wqt = hwm14.hwm14( self.iyd, self.sec, alt, self.glat, self.glon, self.stl, \
                self.f107a, self.f107, self.apqt )

            wdt = hwm14.dwm07(self.iyd, self.sec, alt, self.glat, self.glon,
                              self.ap)

            w = hwm14.hwm14( self.iyd, self.sec, alt, self.glat, self.glon, self.stl, \
                self.f107a, self.f107, self.ap )

            if self.verbose:                print( ' %3i %8.3f %8.3f %8.3f %8.3f %8.3f %8.3f' % \
  ( alt, wqt[0], wqt[1], wdt[0], wdt[1], w[0], w[1] ) )

            self.Uwind.append(w[1])
            self.Vwind.append(w[0])
示例#3
0
    def GMTProfile(self):
        """ GMT Profile """

        if self.verbose:
            print('GMT PROFILE')
            print(
                '                   quiet         disturbed             total')
            print(
                '   stl      mer      zon      mer      zon      mer      zon')

        self.utbins = arange(self.utlim[0], self.utlim[1] + self.utstp,
                             self.utstp)
        self.mltbins = []

        for ut in self.utbins:

            if True:
                self.toMLT(ut)
                self.mltbins.append(self.mlt)

            sec = ut * 3600

            wqt = hwm14.hwm14( self.iyd, sec, self.alt, self.glat, self.glon, -1, \
                self.f107a, self.f107, self.apqt )

            wdt = hwm14.dwm07(self.iyd, sec, self.alt, self.glat, self.glon,
                              self.ap)

            w = hwm14.hwm14( self.iyd, sec, self.alt, self.glat, self.glon, -1, \
                self.f107a, self.f107, self.ap )

            if self.verbose:                print( ' %5.1f %8.3f %8.3f %8.3f %8.3f %8.3f %8.3f' % \
   ( ut, wqt[0], wqt[1], wdt[0], wdt[1], w[0], w[1] ) )

            self.Uwind.append(w[1])
            self.Vwind.append(w[0])
示例#4
0
from pyhwm2014 import hwm14

ut, stl, glon, alt, glat, f107a, f107, ap = 12, 17, -77.76, 130., -11.95, 90, 90, [
    2, 2
]
iyd = 95150
sec = ut * 3600.
sec = (stl - glon / 15.) * 3600.
w = hwm14.hwm14(iyd, sec, alt, glat, glon, stl, f107a, f107, ap)
print(w)

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

# from pyhwm2014.pyhwm14 import HWM14, HWM14Plot

# # Single Height profile
# #hwm14Obj = HWM14( option=1, ut=12, verbose=False )
# hwm14Obj = HWM14( altlim=[50,200], altstp=10, option=1, ut=5, verbose=False )
# hwm14Gbj = HWM14Plot( profObj=hwm14Obj )

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

# from pyhwm2014.pyhwm14 import HWM142D, HWM142DPlot

# # # Height vs LT array
# # hwm14Obj = HWM142D( altlim=[90,200], altstp=2, option=1, sltlim=[0.,23.75], sltstp=.25, verbose=False )
# # hwm14Gbj = HWM142DPlot( profObj=hwm14Obj )

# Latitude vs Height array
# hwm14Obj = HWM142D( altlim=[90., 200.], altstp=10., glatlim=[-40., 40.], glatstp=5.,
#     option=2, verbose=False )
示例#5
0
    def LatVsFL(self,
                date=[2003, 11, 21],
                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
        self.year, self.month, self.day = year, month, day

        # Time
        hour, minute, second = time
        self.hour, self.minute, self.second = hour, minute, second

        # Geog. Coord.
        dlon, dlat = gc
        self.dlon, self.dlat = dlon, dlat

        # 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

        #
        ###

        self.hlim = hlim

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

        self.coordl = []

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

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

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

        self.coordl = asarray(self.coordl)

        # 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.Uwind, self.Vwind = tile(nan, (np, nfl)), tile(nan, (np, nfl))

        iyd = int((year - (2000 if year >= 2000 else 1900)) * 1e3) + self.doy
        sec = (hour + minute / 60 + second / 3600) * 3600
        stl, f107a, f107, ap = 17., 90, 90, [2, 2]
        self.stl, self.f107a, self.f107, ap = stl, f107a, f107, ap

        for fl in range(nfl):

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

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

            if len(ind[0]) > 0:

                ns, dummy = curr_coordl[ind[0], :].shape

                for s in range(ns):

                    glon, alt, glat = curr_coordl[ind[0][s], :]

                    w = hwm14.hwm14(iyd, sec, alt, glat, glon, stl, f107a,
                                    f107, ap)

                    self.Uwind[ind[0][s], fl] = w[1]
                    self.Vwind[ind[0][s], fl] = w[0]