The cutting process of an entire field can be useful in different situations. Generally, zooming in a specific region of the flow-field helps getting results without having to handle the entire, really heavy dataset.
In this tutorial we will cut the dataset that was initialized in the (so make sure to read it in case you jumped straight here; sorry for this, but I ensure it won't take you more than 5 minutes).
"""
Created on Fri May 24 14:50:44 2024
@author: lorenzo piu
"""
Import and field initialization
>>> import os
>>> import aPrioriDNS as ap
>>> import json
>>> directory = os.path.join('.','Lifted_H2_subdomain') # change this with your path to the data folder
>>> print(f"\nChecking the path \'{T_path}\' is correct...")
>>> if not os.path.exists(T_path):
>>> raise ValueError("The path '{T_path}' does not exist in your system. Check to have the correct path to your data folder in the code")
Checking the path '../data/Lifted_H2_subdomain/data/T_K_id000.dat' is correct...
>>> DNS_field = ap.Field3D(directory)
Now we are going to cut the field and see what happens in our folder:
>>> cut_field_name = DNS_field.cut([20,20,10])
---------------------------------------------------------------
Cutting Field '../data/Lifted_H2_subdomain'...
Done cutting Field '../data/Lifted_H2_subdomain'.
This command acts directly on the folder, creating another folder with cut data formatted in the same way as the original ones. This makes the procedure of initializing again another field with the cut data very easy.
If you followed this procedure, this is what your folder should look like:
NOTE:
the command
>>> DNS_field.cut([20,20,10])
returns the name of the containing folder of the new cut field. So it will be easy to initialize it as we have done before with the original DNS field.
Read the cut field and compare it with the original