def _run_hwm14(self): """ HWM 2014 Climatological model. """ my_pwd = os.getcwd() hwm14_data_path = os.path.join(DIR_FILE, "hwm14_data/") os.chdir(hwm14_data_path) v, u = hwm14( self.iyd, self.utc_sec, self.alt, self.lat, np.mod(self.lon, 360), np.nan, np.nan, np.nan, [np.nan, self.ap], ) # Change back to original directory: os.chdir(my_pwd) self.v = v self.u = u self.hwm_version = '14' return self
def run_hwm14(self): from hwm14py import hwm14 import pyglow import os import numpy as np my_pwd = os.getcwd() hwm14_data_path = '/'.join(pyglow.__file__.split("/")[:-1]) + "/hwm14_data/" os.chdir(hwm14_data_path) (v,u) = hwm14(\ self.iyd,\ self.utc_sec,\ self.alt,\ self.lat,\ np.mod(self.lon,360),\ np.nan,\ np.nan,\ np.nan,\ [np.nan,self.ap],\ ) os.chdir("%s" % my_pwd) self.v = v self.u = u self.hwm_version = '14'
def run_hwm14(self): from hwm14py import hwm14 import pyglow import os import numpy as np my_pwd = os.getcwd() hwm14_data_path = '/'.join( pyglow.__file__.split("/")[:-1]) + "/hwm14_data/" os.chdir(hwm14_data_path) (v,u) = hwm14(\ self.iyd,\ self.utc_sec,\ self.alt,\ self.lat,\ np.mod(self.lon,360),\ np.nan,\ np.nan,\ np.nan,\ [np.nan,self.ap],\ ) os.chdir("%s" % my_pwd) self.v = v self.u = u self.hwm_version = '14'
def _run_hwm14(self, location_time, ap): """ HWM 2014 Climatological model. :param location_time: Instance of LocationTime :param ap: ap indice """ # Grab current directory: my_pwd = os.getcwd() # Figure out HWM14 data folder: if self.testing_data_stub: folder = "hwm14" else: folder = "hwm14_data" hwm14_data_path = os.path.join( self.data_path_stub, folder, ) # Change directory to HWM14 data path: os.chdir(hwm14_data_path) # Call HWM14 wrapper: v, u = hwm14( location_time.iyd, location_time.utc_sec, location_time.alt, location_time.lat, np.mod(location_time.lon, 360), nan, nan, nan, [nan, ap], ) # Change back to original directory: os.chdir(my_pwd) # Assign outputs: self.v = v self.u = u self.hwm_version = '14' return self