avni.models.realization module#

This script/module contains routines that are used to analyze/visualize the data sets in the standard AVNI format.

class avni.models.realization.Realization(file=None)[source]#

Bases: object

A class for the realization of a 3D model

property type#
property name#
property refmodel#
property keys#
read(file)[source]#

Try reading the file into resolution/realization either as ascii, hdf5 or nc4

decode_units()[source]#
decode_symbols(searchstr, unique=False)[source]#
scale_coefficients()[source]#

scale model coefficients based on scaling

decode_scaling()[source]#
decode_mapping()[source]#
readascii(modelfile)[source]#

Reads a standard 3D model file. maxkern is the maximum number of radial kernels and maxcoeff is the maximum number of corresponding lateral basis functions. resolution and realization are the indices for the resolution level and the realization from a model ensemble (usually 0 if a single file)

readnc4(ds)[source]#

Read netCDF4 file into a resolution and realization of model3D class.

to_xarray(outfile=None, complevel=9, engine='netcdf4', writenc4=False)[source]#

write an xarrary dataset from a avni formatted ascii file

ascii_file: path to avni format output file

outfile: output netcdf file

setup_file: setup file containing metadata for the model

complevel, engine: options for compression in netcdf file

writenc4: write a netcdf4 file, if True

to_harmonics(lmax=40, variables=None)[source]#