A model in SMRT is composed of the electromagnetic scattering theory (
the radiative transfer solver (
smrt.emmodel is responsible for computation of the scattering and absorption coefficients and the phase function of a layer.
It is applied to each layer and it is even possible
to choose different emmodel for each layer (for instance for a complex medium made of different materials: snow, soil, water, atmosphere, …).
smrt.rtsolver is responsible for propagation of the incident or emitted energy through the layers, up to the surface, and eventually
through the atmosphere.
To build a model, use the
make_model() function with the type of emmodel and type of rtsolver as arguments.
Then call the
Model.run() method of the model instance by specifying the sensor (
smrt.core.snowpack.Snowpack) and optionally atmosphere (see
The results are returned as a
Result which can then been interrogated to retrieve brightness temperature,
backscattering coefficient, etc.
m = make_model("iba", "rtsolver") result = m.run(sensor, snowpack) # sensor and snowpack are created before print(result.TbV())
run() method can be used with list of snowpacks. In this case, it is recommended to set the snowpack_dimension_name and
snowpack_dimension_values variable which gives the name and values of the coordinates that are create for the Results. This is useful with
timeseries for instance.
snowpacks =  times =  for file in filenames: # create a snowpack for each time series sp = ... snowpacks.append(sp) times.append(sp) # now run the model res = m.run(sensor, snowpacks, snowpack_dimension=('time', times))
The res variable has now a coordinate time and res.TbV() returns a timeseries.
make_model(emmodel, rtsolver=None, emmodel_options=None, rtsolver_options=None, emmodel_kwargs=None, rtsolver_kwargs=None)¶
create a new model with a given EM model and RT solver. The model is then ready to be run using the
Model.run()method. This function is the privileged way to create models compared to class instantiation. It supports automatic import of the emmodel and rtsolver modules.
- emmodel (string or class or list of strings or classes. If a list is given, different models are used for the different layers of the snowpack. In this case, the size of the list must be the same as the number of layers in the snowpack.) – type of emmodel to use. Can be given by the name of a file/module in the emmodel directory (as a string) or a class.
- rtsolver (string or class. Can be None when only computation of the layer electromagnetic properties is needed.) – type of solver to use. Can be given by the name of a file/module in the rtsolver directeory (as a string) or a class.
- emmodel_options (dict or a list of dict. In the latter case, the size of the list must be the same as the number of layers in the snowpack.) – extra arguments to use to create emmodel instance. Valid arguments depend on the selected emmodel. It is documented in for each emmodel class.
- rtsolver_options (dict) – extra to use to create the rtsolver instance (see __init__ of the solver used).
a model instance
get a new emmodel class from the file name
make_emmodel(emmodel, sensor, layer, **emmodel_options)¶
create a new emmodel instance based on the emmodel class or string :param emmodel: type of emmodel to use. Can be given by the name of a file/module in the emmodel directory (as a string) or a class. :type emmodel: string or class or list of strings or classes. If a list is given, different models are used for the different layers of the snowpack. In this case, the size of the list must be the same as the number of layers in the snowpack. :param sensor: sensor to use for the calculation :param layer: layer to use for the calculation
Model(emmodel, rtsolver, emmodel_options=None, rtsolver_options=None)¶
This class drives the whole calculation
set the option for the rtsolver
set the options for the emmodel
run(sensor, snowpack, atmosphere=None, snowpack_dimension=None, progressbar=False)¶
Run the model for the given sensor configuration and return the results
- sensor – sensor to use for the calculation
- snowpack – snowpack to use for the calculation. Can be a single snowpack, a list or a SensitivityStudy object.
- snowpack_dimension – name and values (as a tuple) of the dimension to create for the results when a list of snowpack is provided. E.g. time, point, longitude, latitude. By default the dimension is called ‘snowpack’ and the values are from 1 to the number of snowpacks.
- progressbar – if True, display a progress bar during multi-snowpacks computation
result of the calculation(s) as a
run_later(sensor, snowpack, **kwargs)¶