omf_io.writer.writer.OMFWriter

class omf_io.writer.writer.OMFWriter(filepath)[source]

A class to write elements to an OMF file.

__init__(filepath)[source]

Instantiate the OMFPandasWriter object.

Parameters:

filepath (Path) – Path to the OMF file.

Methods

__init__(filepath)

Instantiate the OMFPandasWriter object.

export_blockmodel_profile_report(**kwargs)

export_blockmodel_to_file(blockmodel_name, ...)

Convert a blockmodel to a file.

export_image_to_file(image_name, output_file)

Convert an image to a file.

export_surface_to_raster_file(surface_name, ...)

Convert a surface to a raster file.

write_blockmodel_from_dataframe(df, name, ...)

Load a blockmodel from a pandas DataFrame into an OMF BlockModel object.

write_blockmodel_from_file(blockmodel_file, ...)

Load a blockmodel from a file into an OMF BlockModel object.

write_raster_from_array(array, name, **kwargs)

Load a raster from a numpy array into an OMF GridSurface object.

write_raster_from_file(raster_file, name, ...)

Load a raster from a file into an OMF GridSurface object.

Attributes

element_types

Dictionary of elements keyed by name

write_blockmodel_from_dataframe(df, name, **kwargs)[source]

Load a blockmodel from a pandas DataFrame into an OMF BlockModel object.

Parameters:
  • df (pd.DataFrame) – The blockmodel as a pandas DataFrame.

  • name (str) – The name of the blockmodel.

  • **kwargs – Additional keyword arguments.

write_blockmodel_from_file(blockmodel_file, name, **kwargs)[source]

Load a blockmodel from a file into an OMF BlockModel object.

Parameters:
  • blockmodel_file (PathLike) – Path to the blockmodel file.

  • name (str) – The name of the blockmodel.

  • **kwargs – Additional keyword arguments.

write_raster_from_array(array, name, **kwargs)[source]

Load a raster from a numpy array into an OMF GridSurface object.

Parameters:
  • array (np.ndarray) – The raster as a numpy array.

  • name (str) – The name of the raster.

  • **kwargs – Additional keyword arguments.

write_raster_from_file(raster_file, name, **kwargs)[source]

Load a raster from a file into an OMF GridSurface object.

Parameters:
  • raster_file (PathLike) – Path to the raster file (e.g., GeoTIFF).

  • name (str) – The name of the raster.

  • **kwargs – Additional keyword arguments.