Esempio n. 1
0
    def _run_hwm07(self):
        """
        HWM 2007 Climatological model.

        """

        my_pwd = os.getcwd()

        hwm07_data_path = os.path.join(DIR_FILE, "hwm07_data/")

        os.chdir(hwm07_data_path)
        aphwm07 = [float('NaN'), self.ap]
        w = hwm07(
            self.iyd,
            self.utc_sec,
            self.alt,
            self.lat,
            np.mod(self.lon, 360),
            self.slt_hour,
            self.f107a,
            self.f107,
            aphwm07,
        )

        # Change back to original directory:
        os.chdir(my_pwd)
        self.v = w[0]
        self.u = w[1]
        self.hwm_version = '07'

        return self
Esempio n. 2
0
    def run_hwm07(self):
        from hwm07py import hwmqt as hwm07
        import pyglow
        import os
        import numpy as np

        my_pwd = os.getcwd()

        hwm07_data_path = '/'.join(pyglow.__file__.split("/")[:-1]) + "/hwm07_data/"
        #print "changing directory to \n", hwm07_data_path

        os.chdir(hwm07_data_path)
        aphwm07 = [float('NaN'), self.ap]
        w = hwm07(self.iyd,\
                self.utc_sec,\
                self.alt,\
                self.lat,\
                np.mod(self.lon,360),\
                self.slt_hour,\
                self.f107a,\
                self.f107,\
                aphwm07)
        os.chdir("%s" % my_pwd)
        self.v = w[0]
        self.u = w[1]
        self.hwm_version = '07'
Esempio n. 3
0
    def run_hwm07(self):
        from hwm07py import hwmqt as hwm07
        import pyglow
        import os
        import numpy as np

        my_pwd = os.getcwd()

        hwm07_data_path = '/'.join(
            pyglow.__file__.split("/")[:-1]) + "/hwm07_data/"
        #print "changing directory to \n", hwm07_data_path

        os.chdir(hwm07_data_path)
        aphwm07 = [float('NaN'), self.ap]
        w = hwm07(self.iyd,\
                self.utc_sec,\
                self.alt,\
                self.lat,\
                np.mod(self.lon,360),\
                self.slt_hour,\
                self.f107a,\
                self.f107,\
                aphwm07)
        os.chdir("%s" % my_pwd)
        self.v = w[0]
        self.u = w[1]
        self.hwm_version = '07'
Esempio n. 4
0
File: hwm.py Progetto: zfb132/pyglow
    def _run_hwm07(self, location_time, f107, f107a, ap):
        """
        HWM 2007 Climatological model.

        :param location_time: Instance of LocationTime
        :param f107: f107 indice
        :param f107a: f107a indice
        :param ap: ap indice
        """

        # Grab current directory:
        my_pwd = os.getcwd()

        # Figure out HWM07 data folder:
        if self.testing_data_stub:
            folder = "hwm07"
        else:
            folder = "hwm07_data"
        hwm07_data_path = os.path.join(
            self.data_path_stub,
            folder,
        )

        # Change directory to HWM07 data path:
        os.chdir(hwm07_data_path)

        # Call HWM07 wrapper:
        w = hwm07(
            location_time.iyd,
            location_time.utc_sec,
            location_time.alt,
            location_time.lat,
            np.mod(location_time.lon, 360),
            location_time.slt_hour,
            f107a,
            f107,
            [nan, ap],
        )

        # Change back to original directory:
        os.chdir(my_pwd)

        # Assign outputs:
        self.v = w[0]
        self.u = w[1]
        self.hwm_version = '07'

        return self
Esempio n. 5
0
    def _run_hwm07(self, location_time, f107, f107a, ap):
        """
        HWM 2007 Climatological model.

        :param location_time: Instance of LocationTime
        :param f107: f107 indice
        :param f107a: f107a indice
        :param ap: ap indice
        """

        # Grab current directory:
        my_pwd = os.getcwd()

        # Figure out HWM07 data folder:
        if self.testing_data_stub:
            folder = "hwm07"
        else:
            folder = "hwm07_data"
        hwm07_data_path = os.path.join(
            self.data_path_stub,
            folder,
        )

        # Change directory to HWM07 data path:
        os.chdir(hwm07_data_path)

        # Call HWM07 wrapper:
        w = hwm07(
            location_time.iyd,
            location_time.utc_sec,
            location_time.alt,
            location_time.lat,
            np.mod(location_time.lon, 360),
            location_time.slt_hour,
            f107a,
            f107,
            [nan, ap],
        )

        # Change back to original directory:
        os.chdir(my_pwd)

        # Assign outputs:
        self.v = w[0]
        self.u = w[1]
        self.hwm_version = '07'

        return self