General Helper Functions

aurora.general_helper_functions.execute_command(cmd, **kwargs)[source]

Executes command in terminal from script.

Parameters:

cmd (str): command to exectute from a terminal kwargs: exec_dir (str): the directory from which to execute kwargs: no_exception: suppress output if exception

Other Parameters:

exit_status: 0 is good, otherwise there is some problem

Note

When executing rm * this crashes if the directory we are removing from is empty

Note

if you can you should probably use execute_subprocess() instead

aurora.general_helper_functions.execute_subprocess(cmd, **kwargs)[source]
Parameters
cmdstring

command as it would be typed in a terminal

kwargs
aurora.general_helper_functions.read_complex(*args, **kwargs)[source]
aurora.general_helper_functions.save_complex(data_array, *args, **kwargs)[source]

netcdf and h5 do not handle complex values. This method is a workaround. https://stackoverflow.com/questions/47162983/how-to-save-xarray-dataarray-with-complex128-data-to-netcdf Example Usage: band_da is an xarray save_complex(band_da, TEST_BAND_FILE) band_da = read_complex(TEST_BAND_FILE)

Parameters
data_array
args
kwargs
aurora.general_helper_functions.save_to_mat(data, variable_name, filename)[source]

Example Usage: x = X.to_array(dim=”channel”) save_to_mat(x.data, “x”, “x.mat”)

Reading into matlab or Octave: tmp = load(“x.mat”); data = tmp.x;

Parameters
datanumpy array

the data to save to file. its fine if this is complex-valued.

variable_namestring

The name that we use to reference the variable within the struct in the matfile.

filenamestring

The filepath to output