Reader Objects

  • Chris MacMackin
  • November 2018

The most basic part of the plotting library is the classes it provides for reading the HDF5 files which ISOFT produces. These can be found in the plotting/readers.py file. The class which you will mostly use is ShelfPlumeCryosphere, which loads files from simulations run with the ice_shelf and plume (or static_plume or asym_plume) derived types. Readers of this type are created using the constructor

ShelfPlumeCryosphere(hdf_file)

where hdf_file is the name of an HDF5 file created by ISOFT.

This reader object a number of properties which provide information on the state of the simulation. Arrays containing simulation variables may, in principle, be multidimensional. However, as code currently exists only for 1-D simulations, they are all 1-D in practice (except uvec and Uvec, which are 2-D).

  • isoft_version: Version number of ISOFT which generated the HDF5 file
  • compilation_time: Time and date at which the ISOFT library used to generate the HDF5 file was compiled
  • output_time: Wall-clock time the HDF5 file was created
  • time: Time within the simulation when the HDF5 file was created
  • grid: The coordinates of the grid discretising the domain
  • glacier_type: The type of glacier object which created this data
  • h: Array containing thickness of the glacier's ice
  • uvec: Array containing glacier ice velocity in vector form, with u = uvec[...,0] and v = uvec[...,1] (if transverse present)
  • u: Array containing longitudinal glacier velocity
  • v: Array containing transverse glacier velocity; will raise an error if not present
  • s: The surface elevation of the glacier, h*(1.-1./r)
  • b: The basal depth of the glacier, -h/r
  • kappa: Array containingTaylor coefficients in z for a Lagrangian tracer field, with kappa[i,...] corresponding to the coefficient for the i-1th power term; raises an error if not present in simulation output
  • lambd: The dimensionless melt parameter,
  • chi: The dimensionless stretching parameter,
  • basal_surface_type: The type of basal_surface object to create this data
  • D: Array containing the thickness of the subglacial plume
  • Uvec: Array containing plume ice velocity in vector form, with U = Uvec[...,0] and V = Uvec[...,1] (if transverse present)
  • U: Array containing longitudinal plume velocity
  • V: Array containing transverse plume velocity; will raise an error if not present
  • S: Array containing plume salinity
  • T: Array containing plume temperature
  • delta: The buoyancy correction parameter,
  • mu: The dimensionless drag coefficient,
  • nu: The dimensionless eddy diffusivity,
  • r: The density ratio for ocean water and glacier ice,
  • phi: The dimensionless Coriolis parameter,

A simple example of using a reader object to make a plot is provided below:

from plotting.readers import ShelfPlumeCryosphere
import matplotlib.pyplot as plt

cryo = ShelfPlumeCryosphere('isoft-0000.h5')
plt.plot(plt.grid, plt.h)
plt.xlabel('$x$')
plt.ylabel('$h$')
plt.show()