Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.03 KB

change_resolution.rst

File metadata and controls

42 lines (29 loc) · 1.03 KB

Changing the resolution of a field

.. automodule:: fieldkit.manipulate
   :members: change_resolution
   :undoc-members:
   :show-inheritance:
   :noindex:

Example

This example shows how to change the resolution of an existing field.

import numpy as np

filename = "density.dat"
fields = read_from_file(filename)
fk.write_to_VTK("field.vtk", fields)

field_new = fk.change_resolution(fields, (64,64))
fk.write_to_VTK("res_64.vtk", field_new)

field_new = fk.replicate_fields(fields, (2,4))
fk.write_to_VTK("res_2_4.vtk", field_new)

Output

The following example outputs three 2D VTK files - field with resolution of (32,32), field with resolution of (64,64), and field with resolution of (2,4)

field with resolution of (32,32)

field with resolution of (64,64)

field with resolution of (2,4)