aerosandbox.visualization.carpet_plot_utils
#
Utilities for making better carpet plots
Module Contents#
Functions#
|
Allows you to run a block of code with a timeout. This way, you can sweep through points to make a carpet plot |
|
Removes NaN values in a 1D array. |
|
Patches NaN values in a 2D array. Can patch holes or entire regions. Uses Laplacian smoothing. |
- aerosandbox.visualization.carpet_plot_utils.time_limit(seconds)[source]#
- Allows you to run a block of code with a timeout. This way, you can sweep through points to make a carpet plot
without getting stuck on a particular point that may not terminate in a reasonable amount of time.
Only runs on Linux!
- Usage:
Attempt to set x equal to the value of a complicated function. If it takes longer than 5 seconds, skip it. >>> try: >>> with time_limit(5): >>> x = complicated_function() >>> except TimeoutException: >>> x = np.nan
- Parameters:
seconds – Duration of timeout [seconds]
Returns:
- aerosandbox.visualization.carpet_plot_utils.remove_nans(array)[source]#
Removes NaN values in a 1D array. :param array: a 1D array of data.
Returns: The array with all NaN values stripped.