holab.utils
load_image(domain, image_name, normalize=True, folder='experiments/images')
Loads an image from the experiments/images
folder and returns it as a FourierSeries
. It takes care of resizing
it to the grid size of the domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
domain |
Domain
|
The domain of the simulation. |
required |
image_name |
str
|
The name of the image to load. |
required |
normalize |
bool
|
Whether to normalize the image. |
True
|
folder |
str
|
The folder to load the image from. |
'experiments/images'
|
Returns:
Name | Type | Description |
---|---|---|
FourierSeries |
FourierSeries
|
The image as a FourierSeries. |
save_simulation_to_mat(filename, lens, source, far_field, lossval, f0)
Saves the lens parameters to a .mat file. The file will contain the following variables:
Variables
sound_speed
: The sound speed fielddensity
: The density fieldabsorption_coefficient
: The absorption coefficient fieldsource
: The source fieldfrequency
: The transducer frequencydx
: The grid spacingloss
: the loss valuefar_field
: The far field pattern
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename |
str
|
The filename to save the lens parameters to, the extension '.mat' will be added automatically |
required |
lens |
Lens
|
The lens object |
required |
source |
FourierSeries
|
The source field |
required |
far_field |
FourierSeries
|
The far field |
required |
lossval |
float
|
The loss value |
required |
settings |
dict
|
The settings dictionary |
required |