Module sia_model :: Class SIA_model
[hide private]
[frames] | no frames]

Class SIA_model

source code

object --+
         |
        SIA_model

The class doing all the model setup, running, output and some plotting.

Instance Methods [hide private]
 
__init__(self, conf_or_netcdf_file)
The standard initialisation function.
source code
 
read_model_config(self)
Read the configuration file of the model.
source code
 
read_model_input(self)
Reads all the input files:
source code
 
read_netCDF(self)
Reads a netCDF file (as saved by a previous model run) and puts everything into place, such that the model run can be contiued.
source code
 
write_netCDF(self)
Write all the calcualted data and also metadata to a netCDF file.
source code
 
run_model(self)
Runs the model according to the setup gathered from read_model_config and read_input.
source code
 
plot_thickness(self, time)
Plot the ice thickness at a particular time on top of the bed.
source code
 
plot_IC(self)
Plot the ice thickness at t0, together with the bed and mass balance distribution.
source code
 
createDimension(self, dimName, size)
Add a Dimension instance.
source code
 
createVariable(self, varname, datatype='d', dimensions=(), attrs={})
Add a Dimension instance.
source code
 
fix_Scientific_bug(self, input_dict)
The Scientific.IO.NetCDF.NetCDFFile retruns not numpy arrays but other one of a now outdated package numeric.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variables [hide private]
  dimensions
dict holding the Dimension instances
  variables
dict holding the Variable instances
  global_attrs
dict holding the global attributes
  t_steps
number of integeration steps
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, conf_or_netcdf_file)
(Constructor)

source code 
The standard initialisation function.
Parameters:
  • conf_or_netcdf_file (string) - A config file or a former netCDF output file.
Overrides: object.__init__

read_model_input(self)

source code 
Reads all the input files:
  • bed
  • initial thickness
  • mass balance distribution

plot_thickness(self, time)

source code 
Plot the ice thickness at a particular time on top of the bed.
Parameters:
  • time (float) - The time when to plot the solution. If <0 then the number is used as index (from the last).

createDimension(self, dimName, size)

source code 
Add a Dimension instance.
Parameters:
  • dimName (string) - The name of the dimension
  • size (integer) - the length of the dimension

createVariable(self, varname, datatype='d', dimensions=(), attrs={})

source code 
Add a Dimension instance.
Parameters:
  • varname (string) - The name of the variable
  • dimensions (a touple of strings) - what dimensions are associated with this variable, if () then its scalar.
  • attrs (dict) - a dictionary holding all the attirbutes of the variable.

fix_Scientific_bug(self, input_dict)

source code 
The Scientific.IO.NetCDF.NetCDFFile retruns not numpy arrays but other one of a now outdated package numeric. Thus all needs to be turned into numpy arrays.
Parameters:
  • input_dict (dict) - A dictionary containing numeric arrays
Returns:
A dictionary containing numpy arrays