EOLDAS Utility Documentation

The eoldas_Lib Module

class eoldaslib.eoldas_Lib.ObservationOperator(nbands, nbands_max, npt, bandwith, obscovar, location, whichfile, doys, qa, theta_v, theta_i, phi_v, phi_i, isobs, params_x, obs=0.0, bandpass_library=False)

Bases: object

Depreciated

Methods

destroy()

Some memory free-ing

Deallocates arrays in the RT code, and hence frees memory

rt_model()

Run the fwd model

rt_model_ad()

Run the adjoint model

eoldaslib.eoldas_Lib.check_limits_valid(limits)

Return a limits list that doesn’t contain zero in the step term. (if it is zero, it is set to 1e-20, i.e. a small number)

eoldaslib.eoldas_Lib.demonstration(conf='default.conf')

Need to develop a new demo

eoldaslib.eoldas_Lib.dequantize_location(qvalue, limits)

Dequantize a value by limits and return the unquantized value.

eoldaslib.eoldas_Lib.dummyprint(x)
class eoldaslib.eoldas_Lib.eoldas_setup(datafile, options)

Bases: object

This is redundant

Methods

get_x(x_obs, x_model, summer=False)

return an x_model representation which has parameter values for the complete model grid. The array x_obs has a representation of the parameter values only for observation points, whereas x_model is typically defined over the whole assimilation period/region.

When loading parameters in this way (from observation space to model space, only the parameter associated with the first observation at a particular point is taken (summer=False)

When loading derivatives (e.g. when using the adjoint) we need to sum over all observation grid points (summer=True)

Parameters :

x_obs : array-like

The state vector representation that corresponds to the observations

x_model : array-like

The state vector representation that corresponds to the assimilation interval.

setup()

Access and set up critical elements of the problem.

This includes:

The existence of:
options.parameter.names (a list)
write_parameters(filename, params, ofmt='ASCII')

Write the parameters out to filename

eoldaslib.eoldas_Lib.fixXstate(op, fromList, toList, logger=None)

A method to extend the state vector definition by e.g. making each state have a value per waveband. This is useful for non spectral models (e.g. MODIS kernels)

Inputs: op : a ParamStorage containing ‘x’ fromList: what the states were previously called toList : what we will call them now

eoldaslib.eoldas_Lib.get_col(index, liner)

For a list liner, return a float representation of the value in column index, or 0 if the len(index) is zero.

eoldaslib.eoldas_Lib.get_filename(fname, datadir=['.', '~/.eoldas'], env=None, multiple=False)

A very useful utility method to get a full list of potential filenames.

Arguments:
fname : filename (relative or absolute)
Options:

datadir=[] : list of directories to search in env=None : environment variable to give a colon (:)

separated string to provide a list of directories to search in

The filename fname is first expanded to take account of ~ or other symbols.

If the resultant filename is an absolute filename (i.e. starts with ‘/’ on Unix or related on windows, and it is confirmed to be a file, and is readable, then only this filename is returned.

If the fname is absolute, but it is not a file, then the basename of fname is assumed to be what the user wanted to refer to as fname. The basename is the second half of what is returned by split(fname).

If the filename is a relative filename then the list dirs is first searched for readable files fname .

If the option multiple is set True, then a complete list of readable files is returned. Otherwise, just the first readable entry encountered.

eoldaslib.eoldas_Lib.isfloat(s)

Returns True if the value is a float or int, False otherwise

eoldaslib.eoldas_Lib.quantize_location(value, limits)

Quantize a value by limits and return the quantized value.

eoldaslib.eoldas_Lib.set_default_limits(location)

For a given location list of len len(location) return a set of default limits information [0,None,1] of the right length.

eoldaslib.eoldas_Lib.set_up_logfile(logfile, name='eoldas', logdir=None, debug=True)

A convenience function to set up the logfiles

The logfile is generated in logfile which may be in logdir if it is not an absolute filename.

The item ‘name’ is used as an identifier in the log.

The debug sets the level of logging (not curretly in use)

eoldaslib.eoldas_Lib.sort_non_spectral_model(parameter, ops, logger=None)

For a non-spectral model, e.g. Kernels observation operator we have to increase size of the model state vector by multiplying by the number of observation ‘states’ (wavebands).

For example, if we have a MODIS kernel model, with 3 parameters

Isotropic RossThick LiSparseModis

and we have observations in 7 MODIS wavebands:

465.6 553.6 645.5 856.5 1241.6 1629.1 2114.1

Then we require 7 x 3 = 21 state variables per observation location (i.e. per day, row, col) to represent this.

We do this by forming pseudo state variables e.g.

Isotropic.465.6 Isotropic.553.6 etc

but it would be rather tedious to have to define all of that in a problem configuration.

This method sort_non_spectral_model is only called if there is a y State (an observation) that is declared to be non spectral. This is switched on by using:

general.is_spectral = False

in the configuration file.

Note that not all state variables are ‘made spectral’ (i.e. transformed to Isotropic.465.6 Isotropic.553.6 etc.) ... it is only those associated with the x state of operators that contain both x and y states. So, for example, we might have an operator (e.g. a regularisation operator) with a parameter gamma_time. Since this operator contains only x state, there is no need to ‘make spectral’ the gamma_time state. If however we had a prior operator, which would have both x and y states, the declared x state would be ‘made spectral’.

eoldaslib.eoldas_Lib.sortlog(self, logfile, logger, name='eoldas', logdir=None, debug=True)

A safe interface to logging for passing log information between lots of classes

eoldaslib.eoldas_Lib.sortopt(options, key, value)

A utility to set the dictionary entry to value if it is not set, and in any case return the entry.

Table Of Contents

Previous topic

File handling Documentation

Next topic

The Observation Operator Documentation

This Page