gwent package¶
Submodules¶
gwent.binary module¶
gwent.detector module¶
gwent.snr module¶
gwent.snrplot module¶
-
gwent.snrplot.
Get_Axes_Labels
(ax, var_axis, var, var_scale, orig_labels, line_val, label_kwargs, tick_label_kwargs, line_kwargs)[source]¶ Gives paper plot labels for given axis
Parameters: - ax: object
The current axes object
- var_axis: str
The axis to change labels and ticks, can either be
'y'
or'x'
- var: str
The variable to label
- orig_labels: list,np.ndarray
The original labels for the particular axis, may be updated depending on parameter
- line_val: int,float
Value of line plotted on
var_axis
if not None. Assumed to be non-log10 value- label_kwargs: dict
The dictionary adjusting the particular axis’ label kwargs
- tick_label_kwargs: dict
The dictionary adjusting the particular axis’ tick label kwargs
- line_kwargs: dict
The dictionary associated with the line displayed on
var_axis
-
gwent.snrplot.
Plot_SNR
(var_x, sample_x, var_y, sample_y, SNRMatrix, fig=None, ax=None, display=True, return_plt=False, dl_axis=False, lb_axis=False, smooth_contours=True, cfill=True, display_cbar=True, x_axis_label=True, y_axis_label=True, x_axis_line=None, y_axis_line=None, logLevels_min=-1.0, logLevels_max=0.0, hspace=0.15, wspace=0.1, contour_kwargs={}, contourf_kwargs={}, xticklabels_kwargs={}, xlabels_kwargs={}, xline_kwargs={}, yticklabels_kwargs={}, ylabels_kwargs={}, yline_kwargs={})[source]¶ Plots the SNR contours from calcSNR
Parameters: - var_x: str
x-axis variable
- sample_x: array
samples at which
SNRMatrix
was calculated corresponding to the x-axis variable- var_y: str
y-axis variable
- sample_y: array
samples at which
SNRMatrix
was calculated corresponding to the y-axis variable- SNRMatrix: array-like
the matrix at which the SNR was calculated corresponding to the particular x and y-axis variable choices
- fig: object, optional
matplotlib figure object on which to collate the individual plots
- ax: object, optional
matplotlib axes object on which to plot the individual plot
- display: bool, optional
Option to turn off display if saving multiple plots to a file
- return_plt: bool, optional
Option to return
fig
andax
- dl_axis: bool, optional
Option to turn on the right hand side labels of luminosity distance
- lb_axis: bool, optional
Option to turn on the right hand side labels of lookback time
- smooth_contours: bool, optional
Option to have contours appear smooth instead of tiered (depending on sample size the edges appear boxey).
- cfill: bool, optional
Option to use filled contours or not, default is
True
- display_cbar: bool, optional
Option to display the colorbar on the axes object
- x_axis_label: bool, optional
Option to display the x axis label
- y_axis_label: bool, optional
Option to display the y axis label
- x_axis_line: int,float, optional
Option to display a line on the x axis if not None
- y_axis_line: int,float, optional
Option to display a line on the y axis if not None
- logLevels_min: float, optional
Sets the minimum log level of the colorbar, default is -1.0 which set the minimum to the log minimum of the given
SNRMatrix
- logLevels_max: float, optional
Sets the maximum log level of the colorbar, default is 0.0, which sets the maximum to the log maximum value of the given
SNRMatrix
- hspace: float, optional
Sets the vertical space between axes objects, default is 0.15
- wspace: float, optional
Sets the horizontal space between axes objects, default is 0.1
- contour_kwargs: dict, optional
Sets additional kwargs taken by contour in matplotlib
- contourf_kwargs: dict, optional
Sets additional kwargs taken by contourf in matplotlib
- xticklabels_kwargs: dict, optional
Sets additional kwargs taken by xticklabel in matplotlib
- xlabels_kwargs=: dict, optional
Sets additional kwargs taken by xlabel in matplotlib
- xline_kwargs: dict, optional
Sets additional kwargs taken by ax.axvline in matplotlib
- yticklabels_kwargs: dict, optional
Sets additional kwargs taken by yticklabel in matplotlib
- ylabels_kwargs: dict, optional
Sets additional kwargs taken by ylabel in matplotlib
- yline_kwargs: dict, optional
Sets additional kwargs taken by ax.axhline in matplotlib
gwent.utils module¶
-
gwent.utils.
Get_Var_Dict
(obj, value)[source]¶ Updates and initializes variable dictionaries used to keep track of current values and variable minima and maxima.
Parameters: - obj: object
Instance of class with parameter variables
- value: array-like
value(s) that are assigned into dictionary
Notes
value contains the variable name in the first index the next is the current value of the variable the last two are optional and contain the variable min and max
Examples
obj.var_dict = ['M',value]
- where obj is in this case an instance of a BinaryBlackHole
-
gwent.utils.
make_quant
(param, default_unit)[source]¶ Convenience function to intialize a parameter as an astropy quantity.
Parameters: - param: float, or Astropy Quantity
Parameter to initialize
- default_unit: str
Astropy unit string, sets as default for param.
Returns: - an astropy quantity
Notes
Taken from <https://github.com/Hazboun6/hasasia/blob/master/hasasia/sensitivity.py#L834>
Examples
self.f0 = make_quant(f0,’MHz’)
gwent.waveform module¶
Module contents¶
Top-level package for gwent.