Example #1
0
    def register_3D_variable(self, units, variable, varname, file_type,
                             gridded_int):
        """Registers a 3d interpolator with 3d signature"""

        #determine coordinate variables by file_type
        if file_type == 'density':
            t, lat, lon = self._time, self._lat, self._lon
            xvec_dependencies = {'time': 'hr', 'lat': 'deg', 'lon': 'deg'}
        if file_type == 'height':
            t, lat, lon = self._time, self._lat_height, self._lon_height
            xvec_dependencies = {'time': 'hr', 'lat': 'deg', 'lon': 'deg'}
        if file_type == 'neutral':
            if variable.shape[1] == self._elat.shape[0]:
                t, lat, lon = self._time, self._elat, self._elon
                xvec_dependencies = {
                    'time': 'hr',
                    'elat': 'deg',
                    'elon': 'deg'
                }
            else:
                t, lat, lon = self._time, self._lat_neutral, self._lon_neutral
                xvec_dependencies = {'time': 'hr', 'lat': 'deg', 'lon': 'deg'}

        #define and register the interpolators
        self = RU.regdef_3D_interpolators(self, units, variable, t, lat, lon,
                                          varname, xvec_dependencies,
                                          gridded_int)
        return
Example #2
0
        def register_3D_variable(self, units, variable, varname, gridded_int):
            """Registers a 3d interpolator with 3d signature"""

            #define and register the interpolators
            xvec_dependencies = {'time': 'hr', 'lon': 'deg', 'lat': 'deg'}
            self = regdef_3D_interpolators(self, units, variable, self._time,
                                           self._lon, self._lat, varname,
                                           xvec_dependencies, gridded_int)
            return
Example #3
0
 def register_3D_variable(self, units, variable, varname, gridded_int):
     """Registers a 3d interpolator with 3d signature"""
     
     #determine which file the variable came from
     for i in range(len(self.patterns)-1,-1,-1):  #go in reverse to account for overwritten variables
         if varname in self.varfiles[str(i)]:
             lat = getattr(self, '_lat'+str(i))  #get the correct coordinates
             lon = getattr(self, '_lon'+str(i))
             #print(varname, self.patterns[i])
             break
     
     #define and register the interpolators
     xvec_dependencies = {'time':'hr','lat':'deg','lon':'deg'}
     self = RU.regdef_3D_interpolators(self, units, variable, self._time, 
                                    lat, lon, varname, 
                                    xvec_dependencies, gridded_int)       
     return 
Example #4
0
        def register_3D_variable(self, units, variable, varname, gridded_int):
            """Registers a 3d interpolator with 3d signature"""

            #determine coordinate variables and xvec by coord list
            coord_list = [value[5][-1] for key, value in model_varnames.items() \
                           if value[0]==varname][0]
            if 'lat' in coord_list:  #3D variables only come from the neutral file
                lon, lat = self._lon0, self._lat0
                xvec_dependencies = {'time': 'hr', 'lon': 'deg', 'lat': 'deg'}
            if 'Elat' in coord_list:
                lon, lat = self._Elon, self._Elat
                xvec_dependencies = {
                    'time': 'hr',
                    'Elon': 'deg',
                    'Elat': 'deg'
                }

            #define and register the interpolators
            self = regdef_3D_interpolators(self, units, variable, self._time,
                                           lon, lat, varname,
                                           xvec_dependencies, gridded_int)
            return