示例#1
0
    def initialize(self, filename):
        """Initialize the River module"""
        self._model = RiverModule.from_path(filename)

        self._values = {
            'channel_centerline__x_coordinate':
                lambda: self._model.river_x_coordinates,
            'channel_centerline__y_coordinate':
                lambda: self._model.river_y_coordinates,
            'channel_water_sediment~bedload__volume_flow_rate':
                lambda: self._model.sediment_flux,
            'channel_exit__x_coordinate':
                lambda: self._model.river_x_coordinates[-1],
            'channel_exit__y_coordinate':
                lambda: self._model.river_y_coordinates[-1],
            'land_surface__elevation': lambda: self._model.elevation,
            'channel_profile': lambda: self._model.profile,
            'avulsion_record': lambda: self._model.avulsions,
        }

        self._var_units = {
            'channel_centerline__x_coordinate': 'm',
            'channel_centerline__y_coordinate': 'm',
            'channel_water_sediment~bedload__volume_flow_rate': "kg s^-1",
            'channel_exit__x_coordinate': 'm',
            'channel_exit__y_coordinate': 'm',
            'land_surface__elevation': 'm',
            'channel_profile': 'm',
            'avulsion_record': 'none',
        }
示例#2
0
    def initialize(self, filename):
        """Initialize the River module."""
        self._model = RiverModule.from_path(filename)

        self._values = {
            'channel_centerline__x_coordinate':
                lambda: self._model.river_x_coordinates,
            'channel_centerline__y_coordinate':
                lambda: self._model.river_y_coordinates,
            'channel_exit_water_sediment~bedload__volume_flow_rate':
                lambda: self._model.sediment_flux,
            'channel_exit__x_coordinate':
                lambda: self._model.river_x_coordinates[-1],
            'channel_exit__y_coordinate':
                lambda: self._model.river_y_coordinates[-1],
            'land_surface__elevation': lambda: self._model.elevation,
            'channel_centerline__elevation': lambda: self._model.profile,
            'sea_water_surface__elevation': lambda: self._model.sea_level,
            'avulsion_record': lambda: self._model.avulsions,
        }

        self._var_units = {
            'channel_centerline__x_coordinate': 'm',
            'channel_centerline__y_coordinate': 'm',
            'channel_exit_water_sediment~bedload__volume_flow_rate': "m^3 s^-1",
            'channel_exit__x_coordinate': 'm',
            'channel_exit__y_coordinate': 'm',
            'land_surface__elevation': 'm',
            'channel_centerline__elevation': 'm',
            'sea_water_surface__elevation': 'm',
            'avulsion_record': 'none',
        }

        self._var_type = {}
        for name in self._input_var_names + self._output_var_names:
            self._var_type[name] = str(np.dtype(float))

        self._var_grid = {
            'channel_centerline__x_coordinate': 1,
            'channel_centerline__y_coordinate': 1,
            'channel_exit_water_sediment~bedload__volume_flow_rate': 2,
            'channel_exit__x_coordinate': 2,
            'channel_exit__y_coordinate': 2,
            'land_surface__elevation': 0,
            'channel_centerline__elevation': 1,
            'sea_water_surface__elevation': 2,
            'avulsion_record': None,
        }

        self._grid_rank = {
            0: 2,
            1: 1,
            2: 0,
        }