rsoft_cad.utils.rsoft_file_plot package

Submodules

rsoft_cad.utils.rsoft_file_plot.combined_field_plots module

rsoft_cad.utils.rsoft_file_plot.combined_field_plots.visualise_modes(folder_name, data_dir='output', save_folder='rsoft_data_files', file_prefix='manual_config', num_modes=20, nrow=4, ncol=5, figsize=(12, 10), dpi=300, show_plot=True, cleanup_files=True, files_to_keep=None)[source]

Visualise electromagnetic modes in a grid layout.

Parameters:

folder_namestr

Name of the folder containing the mode data

num_modesint, default=20

Number of modes to visualise

nrowint, default=4

Number of rows in the subplot grid

ncolint, default=5

Number of columns in the subplot grid

figsizetuple, default=(12, 10)

Figure size as (width, height)

dpiint, default=300

Resolution for saved figure

show_plotbool, default=True

Whether to display the plot

cleanup_filesbool, default=True

Whether to clean up files after plotting

files_to_keeplist, default=None

List of files to keep during cleanup. If None, keeps default files.

Returns:

str

Path to the saved figure file

rsoft_cad.utils.rsoft_file_plot.field_plots module

Field_plots module for RSoft CAD utilities

rsoft_cad.utils.rsoft_file_plot.field_plots.plot_field_data(data_dict, plot_type='magnitude', figsize=(10, 8), cmap='viridis')[source]

Plot the complex field data from a dictionary returned by read_femsim_field_data.

Parameters:

data_dictdict

Dictionary containing the complex data and metadata from read_femsim_field_data

plot_typestr, optional

Type of plot to generate: ‘magnitude’, ‘phase’, ‘real’, ‘imaginary’, or ‘all’ Default is ‘magnitude’

figsizetuple, optional

Size of the figure in inches. Default is (10, 8)

cmapstr, optional

Colormap to use for the plots. Default is ‘viridis’

Returns:

figmatplotlib.figure.Figure

The figure object containing the plot(s)

rsoft_cad.utils.rsoft_file_plot.monitor_plots module

rsoft_cad.utils.rsoft_file_plot.monitor_plots.plot_mon_data(header_info, data_df, monitors_to_plot=None, figsize=(10, 6), title='Monitor Data')[source]

Plot data from a .mon file.

Parameters: file_path (str): Path to the .mon file monitors_to_plot (list, optional): List of monitor indices to plot. If None, all non-zero monitors are plotted. figsize (tuple, optional): Figure size (width, height) in inches. Default is (12, 8). title (str, optional): Plot title. Default is “Monitor Data”.

Returns: matplotlib.figure.Figure: The generated figure