partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
valid | fit_lens_data_with_sensitivity_tracers | Fit lens data with a normal tracer and sensitivity tracer, to determine our sensitivity to a selection of \
galaxy components. This factory automatically determines the type of fit based on the properties of the galaxies \
in the tracers.
Parameters
-----------
lens_data : lens_data.LensData or le... | autolens/lens/sensitivity_fit.py | def fit_lens_data_with_sensitivity_tracers(lens_data, tracer_normal, tracer_sensitive):
"""Fit lens data with a normal tracer and sensitivity tracer, to determine our sensitivity to a selection of \
galaxy components. This factory automatically determines the type of fit based on the properties of the galaxies... | def fit_lens_data_with_sensitivity_tracers(lens_data, tracer_normal, tracer_sensitive):
"""Fit lens data with a normal tracer and sensitivity tracer, to determine our sensitivity to a selection of \
galaxy components. This factory automatically determines the type of fit based on the properties of the galaxies... | [
"Fit",
"lens",
"data",
"with",
"a",
"normal",
"tracer",
"and",
"sensitivity",
"tracer",
"to",
"determine",
"our",
"sensitivity",
"to",
"a",
"selection",
"of",
"\\",
"galaxy",
"components",
".",
"This",
"factory",
"automatically",
"determines",
"the",
"type",
"... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/sensitivity_fit.py#L5-L35 | [
"def",
"fit_lens_data_with_sensitivity_tracers",
"(",
"lens_data",
",",
"tracer_normal",
",",
"tracer_sensitive",
")",
":",
"if",
"(",
"tracer_normal",
".",
"has_light_profile",
"and",
"tracer_sensitive",
".",
"has_light_profile",
")",
"and",
"(",
"not",
"tracer_normal"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | Mask.unmasked_for_shape_and_pixel_scale | Setup a mask where all pixels are unmasked.
Parameters
----------
shape : (int, int)
The (y,x) shape of the mask in units of pixels.
pixel_scale: float
The arc-second to pixel conversion factor of each pixel. | autolens/data/array/mask.py | def unmasked_for_shape_and_pixel_scale(cls, shape, pixel_scale, invert=False):
"""Setup a mask where all pixels are unmasked.
Parameters
----------
shape : (int, int)
The (y,x) shape of the mask in units of pixels.
pixel_scale: float
The arc-second to pix... | def unmasked_for_shape_and_pixel_scale(cls, shape, pixel_scale, invert=False):
"""Setup a mask where all pixels are unmasked.
Parameters
----------
shape : (int, int)
The (y,x) shape of the mask in units of pixels.
pixel_scale: float
The arc-second to pix... | [
"Setup",
"a",
"mask",
"where",
"all",
"pixels",
"are",
"unmasked",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/mask.py#L54-L66 | [
"def",
"unmasked_for_shape_and_pixel_scale",
"(",
"cls",
",",
"shape",
",",
"pixel_scale",
",",
"invert",
"=",
"False",
")",
":",
"mask",
"=",
"np",
".",
"full",
"(",
"tuple",
"(",
"map",
"(",
"lambda",
"d",
":",
"int",
"(",
"d",
")",
",",
"shape",
"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | Mask.circular | Setup a mask where unmasked pixels are within a circle of an input arc second radius and centre.
Parameters
----------
shape: (int, int)
The (y,x) shape of the mask in units of pixels.
pixel_scale: float
The arc-second to pixel conversion factor of each pixel.
... | autolens/data/array/mask.py | def circular(cls, shape, pixel_scale, radius_arcsec, centre=(0., 0.), invert=False):
"""Setup a mask where unmasked pixels are within a circle of an input arc second radius and centre.
Parameters
----------
shape: (int, int)
The (y,x) shape of the mask in units of pixels.
... | def circular(cls, shape, pixel_scale, radius_arcsec, centre=(0., 0.), invert=False):
"""Setup a mask where unmasked pixels are within a circle of an input arc second radius and centre.
Parameters
----------
shape: (int, int)
The (y,x) shape of the mask in units of pixels.
... | [
"Setup",
"a",
"mask",
"where",
"unmasked",
"pixels",
"are",
"within",
"a",
"circle",
"of",
"an",
"input",
"arc",
"second",
"radius",
"and",
"centre",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/mask.py#L69-L86 | [
"def",
"circular",
"(",
"cls",
",",
"shape",
",",
"pixel_scale",
",",
"radius_arcsec",
",",
"centre",
"=",
"(",
"0.",
",",
"0.",
")",
",",
"invert",
"=",
"False",
")",
":",
"mask",
"=",
"mask_util",
".",
"mask_circular_from_shape_pixel_scale_and_radius",
"("... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | Mask.circular_annular | Setup a mask where unmasked pixels are within an annulus of input inner and outer arc second radii and \
centre.
Parameters
----------
shape : (int, int)
The (y,x) shape of the mask in units of pixels.
pixel_scale: float
The arc-second to pixel conversio... | autolens/data/array/mask.py | def circular_annular(cls, shape, pixel_scale, inner_radius_arcsec, outer_radius_arcsec, centre=(0., 0.),
invert=False):
"""Setup a mask where unmasked pixels are within an annulus of input inner and outer arc second radii and \
centre.
Parameters
----------
... | def circular_annular(cls, shape, pixel_scale, inner_radius_arcsec, outer_radius_arcsec, centre=(0., 0.),
invert=False):
"""Setup a mask where unmasked pixels are within an annulus of input inner and outer arc second radii and \
centre.
Parameters
----------
... | [
"Setup",
"a",
"mask",
"where",
"unmasked",
"pixels",
"are",
"within",
"an",
"annulus",
"of",
"input",
"inner",
"and",
"outer",
"arc",
"second",
"radii",
"and",
"\\",
"centre",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/mask.py#L89-L110 | [
"def",
"circular_annular",
"(",
"cls",
",",
"shape",
",",
"pixel_scale",
",",
"inner_radius_arcsec",
",",
"outer_radius_arcsec",
",",
"centre",
"=",
"(",
"0.",
",",
"0.",
")",
",",
"invert",
"=",
"False",
")",
":",
"mask",
"=",
"mask_util",
".",
"mask_circ... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | Mask.circular_anti_annular | Setup a mask where unmasked pixels are outside an annulus of input inner and outer arc second radii, but \
within a second outer radius, and at a given centre.
This mask there has two distinct unmasked regions (an inner circle and outer annulus), with an inner annulus \
of masked pixels.
... | autolens/data/array/mask.py | def circular_anti_annular(cls, shape, pixel_scale, inner_radius_arcsec, outer_radius_arcsec, outer_radius_2_arcsec,
centre=(0., 0.), invert=False):
"""Setup a mask where unmasked pixels are outside an annulus of input inner and outer arc second radii, but \
within a second ... | def circular_anti_annular(cls, shape, pixel_scale, inner_radius_arcsec, outer_radius_arcsec, outer_radius_2_arcsec,
centre=(0., 0.), invert=False):
"""Setup a mask where unmasked pixels are outside an annulus of input inner and outer arc second radii, but \
within a second ... | [
"Setup",
"a",
"mask",
"where",
"unmasked",
"pixels",
"are",
"outside",
"an",
"annulus",
"of",
"input",
"inner",
"and",
"outer",
"arc",
"second",
"radii",
"but",
"\\",
"within",
"a",
"second",
"outer",
"radius",
"and",
"at",
"a",
"given",
"centre",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/mask.py#L113-L142 | [
"def",
"circular_anti_annular",
"(",
"cls",
",",
"shape",
",",
"pixel_scale",
",",
"inner_radius_arcsec",
",",
"outer_radius_arcsec",
",",
"outer_radius_2_arcsec",
",",
"centre",
"=",
"(",
"0.",
",",
"0.",
")",
",",
"invert",
"=",
"False",
")",
":",
"mask",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | Mask.elliptical | Setup a mask where unmasked pixels are within an ellipse of an input arc second major-axis and centre.
Parameters
----------
shape: (int, int)
The (y,x) shape of the mask in units of pixels.
pixel_scale: float
The arc-second to pixel conversion factor of each pix... | autolens/data/array/mask.py | def elliptical(cls, shape, pixel_scale, major_axis_radius_arcsec, axis_ratio, phi, centre=(0., 0.),
invert=False):
""" Setup a mask where unmasked pixels are within an ellipse of an input arc second major-axis and centre.
Parameters
----------
shape: (int, int)
... | def elliptical(cls, shape, pixel_scale, major_axis_radius_arcsec, axis_ratio, phi, centre=(0., 0.),
invert=False):
""" Setup a mask where unmasked pixels are within an ellipse of an input arc second major-axis and centre.
Parameters
----------
shape: (int, int)
... | [
"Setup",
"a",
"mask",
"where",
"unmasked",
"pixels",
"are",
"within",
"an",
"ellipse",
"of",
"an",
"input",
"arc",
"second",
"major",
"-",
"axis",
"and",
"centre",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/mask.py#L145-L168 | [
"def",
"elliptical",
"(",
"cls",
",",
"shape",
",",
"pixel_scale",
",",
"major_axis_radius_arcsec",
",",
"axis_ratio",
",",
"phi",
",",
"centre",
"=",
"(",
"0.",
",",
"0.",
")",
",",
"invert",
"=",
"False",
")",
":",
"mask",
"=",
"mask_util",
".",
"mas... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | Mask.elliptical_annular | Setup a mask where unmasked pixels are within an elliptical annulus of input inner and outer arc second \
major-axis and centre.
Parameters
----------
shape: (int, int)
The (y,x) shape of the mask in units of pixels.
pixel_scale: float
The arc-second to p... | autolens/data/array/mask.py | def elliptical_annular(cls, shape, pixel_scale,inner_major_axis_radius_arcsec, inner_axis_ratio, inner_phi,
outer_major_axis_radius_arcsec, outer_axis_ratio, outer_phi, centre=(0.0, 0.0),
invert=False):
"""Setup a mask where unmasked pixels are within an ell... | def elliptical_annular(cls, shape, pixel_scale,inner_major_axis_radius_arcsec, inner_axis_ratio, inner_phi,
outer_major_axis_radius_arcsec, outer_axis_ratio, outer_phi, centre=(0.0, 0.0),
invert=False):
"""Setup a mask where unmasked pixels are within an ell... | [
"Setup",
"a",
"mask",
"where",
"unmasked",
"pixels",
"are",
"within",
"an",
"elliptical",
"annulus",
"of",
"input",
"inner",
"and",
"outer",
"arc",
"second",
"\\",
"major",
"-",
"axis",
"and",
"centre",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/mask.py#L171-L204 | [
"def",
"elliptical_annular",
"(",
"cls",
",",
"shape",
",",
"pixel_scale",
",",
"inner_major_axis_radius_arcsec",
",",
"inner_axis_ratio",
",",
"inner_phi",
",",
"outer_major_axis_radius_arcsec",
",",
"outer_axis_ratio",
",",
"outer_phi",
",",
"centre",
"=",
"(",
"0.0... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | Mask.map_2d_array_to_masked_1d_array | For a 2D array (e.g. an image, noise_map, etc.) map it to a masked 1D array of valuees using this mask.
Parameters
----------
array_2d : ndarray | None | float
The 2D array to be mapped to a masked 1D array. | autolens/data/array/mask.py | def map_2d_array_to_masked_1d_array(self, array_2d):
"""For a 2D array (e.g. an image, noise_map, etc.) map it to a masked 1D array of valuees using this mask.
Parameters
----------
array_2d : ndarray | None | float
The 2D array to be mapped to a masked 1D array.
"""... | def map_2d_array_to_masked_1d_array(self, array_2d):
"""For a 2D array (e.g. an image, noise_map, etc.) map it to a masked 1D array of valuees using this mask.
Parameters
----------
array_2d : ndarray | None | float
The 2D array to be mapped to a masked 1D array.
"""... | [
"For",
"a",
"2D",
"array",
"(",
"e",
".",
"g",
".",
"an",
"image",
"noise_map",
"etc",
".",
")",
"map",
"it",
"to",
"a",
"masked",
"1D",
"array",
"of",
"valuees",
"using",
"this",
"mask",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/mask.py#L231-L241 | [
"def",
"map_2d_array_to_masked_1d_array",
"(",
"self",
",",
"array_2d",
")",
":",
"if",
"array_2d",
"is",
"None",
"or",
"isinstance",
"(",
"array_2d",
",",
"float",
")",
":",
"return",
"array_2d",
"return",
"mapping_util",
".",
"map_2d_array_to_masked_1d_array_from_... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | Mask.blurring_mask_for_psf_shape | Compute a blurring mask, which represents all masked pixels whose light will be blurred into unmasked \
pixels via PSF convolution (see grid_stack.RegularGrid.blurring_grid_from_mask_and_psf_shape).
Parameters
----------
psf_shape : (int, int)
The shape of the psf which defin... | autolens/data/array/mask.py | def blurring_mask_for_psf_shape(self, psf_shape):
"""Compute a blurring mask, which represents all masked pixels whose light will be blurred into unmasked \
pixels via PSF convolution (see grid_stack.RegularGrid.blurring_grid_from_mask_and_psf_shape).
Parameters
----------
psf_s... | def blurring_mask_for_psf_shape(self, psf_shape):
"""Compute a blurring mask, which represents all masked pixels whose light will be blurred into unmasked \
pixels via PSF convolution (see grid_stack.RegularGrid.blurring_grid_from_mask_and_psf_shape).
Parameters
----------
psf_s... | [
"Compute",
"a",
"blurring",
"mask",
"which",
"represents",
"all",
"masked",
"pixels",
"whose",
"light",
"will",
"be",
"blurred",
"into",
"unmasked",
"\\",
"pixels",
"via",
"PSF",
"convolution",
"(",
"see",
"grid_stack",
".",
"RegularGrid",
".",
"blurring_grid_fr... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/mask.py#L244-L259 | [
"def",
"blurring_mask_for_psf_shape",
"(",
"self",
",",
"psf_shape",
")",
":",
"if",
"psf_shape",
"[",
"0",
"]",
"%",
"2",
"==",
"0",
"or",
"psf_shape",
"[",
"1",
"]",
"%",
"2",
"==",
"0",
":",
"raise",
"exc",
".",
"MaskException",
"(",
"\"psf_size of ... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | Mask.zoom_region | The zoomed rectangular region corresponding to the square encompassing all unmasked values.
This is used to zoom in on the region of an image that is used in an analysis for visualization. | autolens/data/array/mask.py | def zoom_region(self):
"""The zoomed rectangular region corresponding to the square encompassing all unmasked values.
This is used to zoom in on the region of an image that is used in an analysis for visualization."""
# Have to convert mask to bool for invert function to work.
where = ... | def zoom_region(self):
"""The zoomed rectangular region corresponding to the square encompassing all unmasked values.
This is used to zoom in on the region of an image that is used in an analysis for visualization."""
# Have to convert mask to bool for invert function to work.
where = ... | [
"The",
"zoomed",
"rectangular",
"region",
"corresponding",
"to",
"the",
"square",
"encompassing",
"all",
"unmasked",
"values",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/mask.py#L301-L310 | [
"def",
"zoom_region",
"(",
"self",
")",
":",
"# Have to convert mask to bool for invert function to work.",
"where",
"=",
"np",
".",
"array",
"(",
"np",
".",
"where",
"(",
"np",
".",
"invert",
"(",
"self",
".",
"astype",
"(",
"'bool'",
")",
")",
")",
")",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | data_vector_from_blurred_mapping_matrix_and_data | Compute the hyper vector *D* from a blurred mapping matrix *f* and the 1D image *d* and 1D noise-map *\sigma* \
(see Warren & Dye 2003).
Parameters
-----------
blurred_mapping_matrix : ndarray
The matrix representing the blurred mappings between sub-grid pixels and pixelization pixels.
... | autolens/model/inversion/util/inversion_util.py | def data_vector_from_blurred_mapping_matrix_and_data(blurred_mapping_matrix, image_1d, noise_map_1d):
"""Compute the hyper vector *D* from a blurred mapping matrix *f* and the 1D image *d* and 1D noise-map *\sigma* \
(see Warren & Dye 2003).
Parameters
-----------
blurred_mapping_matrix : ndarr... | def data_vector_from_blurred_mapping_matrix_and_data(blurred_mapping_matrix, image_1d, noise_map_1d):
"""Compute the hyper vector *D* from a blurred mapping matrix *f* and the 1D image *d* and 1D noise-map *\sigma* \
(see Warren & Dye 2003).
Parameters
-----------
blurred_mapping_matrix : ndarr... | [
"Compute",
"the",
"hyper",
"vector",
"*",
"D",
"*",
"from",
"a",
"blurred",
"mapping",
"matrix",
"*",
"f",
"*",
"and",
"the",
"1D",
"image",
"*",
"d",
"*",
"and",
"1D",
"noise",
"-",
"map",
"*",
"\\",
"sigma",
"*",
"\\",
"(",
"see",
"Warren",
"&"... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/util/inversion_util.py#L5-L28 | [
"def",
"data_vector_from_blurred_mapping_matrix_and_data",
"(",
"blurred_mapping_matrix",
",",
"image_1d",
",",
"noise_map_1d",
")",
":",
"mapping_shape",
"=",
"blurred_mapping_matrix",
".",
"shape",
"data_vector",
"=",
"np",
".",
"zeros",
"(",
"mapping_shape",
"[",
"1"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | curvature_matrix_from_blurred_mapping_matrix | Compute the curvature matrix *F* from a blurred mapping matrix *f* and the 1D noise-map *\sigma* \
(see Warren & Dye 2003).
Parameters
-----------
blurred_mapping_matrix : ndarray
The matrix representing the blurred mappings between sub-grid pixels and pixelization pixels.
noise_map_1d : n... | autolens/model/inversion/util/inversion_util.py | def curvature_matrix_from_blurred_mapping_matrix(blurred_mapping_matrix, noise_map_1d):
"""Compute the curvature matrix *F* from a blurred mapping matrix *f* and the 1D noise-map *\sigma* \
(see Warren & Dye 2003).
Parameters
-----------
blurred_mapping_matrix : ndarray
The matrix represen... | def curvature_matrix_from_blurred_mapping_matrix(blurred_mapping_matrix, noise_map_1d):
"""Compute the curvature matrix *F* from a blurred mapping matrix *f* and the 1D noise-map *\sigma* \
(see Warren & Dye 2003).
Parameters
-----------
blurred_mapping_matrix : ndarray
The matrix represen... | [
"Compute",
"the",
"curvature",
"matrix",
"*",
"F",
"*",
"from",
"a",
"blurred",
"mapping",
"matrix",
"*",
"f",
"*",
"and",
"the",
"1D",
"noise",
"-",
"map",
"*",
"\\",
"sigma",
"*",
"\\",
"(",
"see",
"Warren",
"&",
"Dye",
"2003",
")",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/util/inversion_util.py#L30-L44 | [
"def",
"curvature_matrix_from_blurred_mapping_matrix",
"(",
"blurred_mapping_matrix",
",",
"noise_map_1d",
")",
":",
"flist",
"=",
"np",
".",
"zeros",
"(",
"blurred_mapping_matrix",
".",
"shape",
"[",
"0",
"]",
")",
"iflist",
"=",
"np",
".",
"zeros",
"(",
"blurr... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | curvature_matrix_from_blurred_mapping_matrix_jit | Compute the curvature matrix *F* from a blurred mapping matrix *f* and the 1D noise-map *\sigma* \
(see Warren & Dye 2003).
Parameters
-----------
blurred_mapping_matrix : ndarray
The matrix representing the blurred mappings between sub-grid pixels and pixelization pixels.
noise_map_1d : nd... | autolens/model/inversion/util/inversion_util.py | def curvature_matrix_from_blurred_mapping_matrix_jit(blurred_mapping_matrix, noise_map_1d, flist, iflist):
"""Compute the curvature matrix *F* from a blurred mapping matrix *f* and the 1D noise-map *\sigma* \
(see Warren & Dye 2003).
Parameters
-----------
blurred_mapping_matrix : ndarray
T... | def curvature_matrix_from_blurred_mapping_matrix_jit(blurred_mapping_matrix, noise_map_1d, flist, iflist):
"""Compute the curvature matrix *F* from a blurred mapping matrix *f* and the 1D noise-map *\sigma* \
(see Warren & Dye 2003).
Parameters
-----------
blurred_mapping_matrix : ndarray
T... | [
"Compute",
"the",
"curvature",
"matrix",
"*",
"F",
"*",
"from",
"a",
"blurred",
"mapping",
"matrix",
"*",
"f",
"*",
"and",
"the",
"1D",
"noise",
"-",
"map",
"*",
"\\",
"sigma",
"*",
"\\",
"(",
"see",
"Warren",
"&",
"Dye",
"2003",
")",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/util/inversion_util.py#L47-L83 | [
"def",
"curvature_matrix_from_blurred_mapping_matrix_jit",
"(",
"blurred_mapping_matrix",
",",
"noise_map_1d",
",",
"flist",
",",
"iflist",
")",
":",
"curvature_matrix",
"=",
"np",
".",
"zeros",
"(",
"(",
"blurred_mapping_matrix",
".",
"shape",
"[",
"1",
"]",
",",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | reconstructed_data_vector_from_blurred_mapping_matrix_and_solution_vector | Compute the reconstructed hyper vector from the blurrred mapping matrix *f* and solution vector *S*.
Parameters
-----------
blurred_mapping_matrix : ndarray
The matrix representing the blurred mappings between sub-grid pixels and pixelization pixels. | autolens/model/inversion/util/inversion_util.py | def reconstructed_data_vector_from_blurred_mapping_matrix_and_solution_vector(blurred_mapping_matrix, solution_vector):
""" Compute the reconstructed hyper vector from the blurrred mapping matrix *f* and solution vector *S*.
Parameters
-----------
blurred_mapping_matrix : ndarray
The matrix rep... | def reconstructed_data_vector_from_blurred_mapping_matrix_and_solution_vector(blurred_mapping_matrix, solution_vector):
""" Compute the reconstructed hyper vector from the blurrred mapping matrix *f* and solution vector *S*.
Parameters
-----------
blurred_mapping_matrix : ndarray
The matrix rep... | [
"Compute",
"the",
"reconstructed",
"hyper",
"vector",
"from",
"the",
"blurrred",
"mapping",
"matrix",
"*",
"f",
"*",
"and",
"solution",
"vector",
"*",
"S",
"*",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/util/inversion_util.py#L86-L100 | [
"def",
"reconstructed_data_vector_from_blurred_mapping_matrix_and_solution_vector",
"(",
"blurred_mapping_matrix",
",",
"solution_vector",
")",
":",
"reconstructed_data_vector",
"=",
"np",
".",
"zeros",
"(",
"blurred_mapping_matrix",
".",
"shape",
"[",
"0",
"]",
")",
"for",... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | Inversion.regularization_term | Compute the regularization term of an inversion. This term represents the sum of the difference in flux \
between every pair of neighboring pixels. This is computed as:
s_T * H * s = solution_vector.T * regularization_matrix * solution_vector
The term is referred to as *G_l* in Warren & Dye 20... | autolens/model/inversion/inversions.py | def regularization_term(self):
""" Compute the regularization term of an inversion. This term represents the sum of the difference in flux \
between every pair of neighboring pixels. This is computed as:
s_T * H * s = solution_vector.T * regularization_matrix * solution_vector
The term... | def regularization_term(self):
""" Compute the regularization term of an inversion. This term represents the sum of the difference in flux \
between every pair of neighboring pixels. This is computed as:
s_T * H * s = solution_vector.T * regularization_matrix * solution_vector
The term... | [
"Compute",
"the",
"regularization",
"term",
"of",
"an",
"inversion",
".",
"This",
"term",
"represents",
"the",
"sum",
"of",
"the",
"difference",
"in",
"flux",
"\\",
"between",
"every",
"pair",
"of",
"neighboring",
"pixels",
".",
"This",
"is",
"computed",
"as... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/inversions.py#L77-L88 | [
"def",
"regularization_term",
"(",
"self",
")",
":",
"return",
"np",
".",
"matmul",
"(",
"self",
".",
"solution_vector",
".",
"T",
",",
"np",
".",
"matmul",
"(",
"self",
".",
"regularization_matrix",
",",
"self",
".",
"solution_vector",
")",
")"
] | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | Inversion.log_determinant_of_matrix_cholesky | There are two terms in the inversion's Bayesian likelihood function which require the log determinant of \
a matrix. These are (Nightingale & Dye 2015, Nightingale, Dye and Massey 2018):
ln[det(F + H)] = ln[det(curvature_reg_matrix)]
ln[det(H)] = ln[det(regularization_matrix)]
The ... | autolens/model/inversion/inversions.py | def log_determinant_of_matrix_cholesky(matrix):
"""There are two terms in the inversion's Bayesian likelihood function which require the log determinant of \
a matrix. These are (Nightingale & Dye 2015, Nightingale, Dye and Massey 2018):
ln[det(F + H)] = ln[det(curvature_reg_matrix)]
ln... | def log_determinant_of_matrix_cholesky(matrix):
"""There are two terms in the inversion's Bayesian likelihood function which require the log determinant of \
a matrix. These are (Nightingale & Dye 2015, Nightingale, Dye and Massey 2018):
ln[det(F + H)] = ln[det(curvature_reg_matrix)]
ln... | [
"There",
"are",
"two",
"terms",
"in",
"the",
"inversion",
"s",
"Bayesian",
"likelihood",
"function",
"which",
"require",
"the",
"log",
"determinant",
"of",
"\\",
"a",
"matrix",
".",
"These",
"are",
"(",
"Nightingale",
"&",
"Dye",
"2015",
"Nightingale",
"Dye"... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/inversions.py#L99-L118 | [
"def",
"log_determinant_of_matrix_cholesky",
"(",
"matrix",
")",
":",
"try",
":",
"return",
"2.0",
"*",
"np",
".",
"sum",
"(",
"np",
".",
"log",
"(",
"np",
".",
"diag",
"(",
"np",
".",
"linalg",
".",
"cholesky",
"(",
"matrix",
")",
")",
")",
")",
"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | GalaxyModel.constant_light_profiles | Returns
-------
light_profiles: [light_profiles.LightProfile]
Light profiles with set variables | autolens/model/galaxy/galaxy_model.py | def constant_light_profiles(self):
"""
Returns
-------
light_profiles: [light_profiles.LightProfile]
Light profiles with set variables
"""
return [value for value in self.__dict__.values() if galaxy.is_light_profile(value)] | def constant_light_profiles(self):
"""
Returns
-------
light_profiles: [light_profiles.LightProfile]
Light profiles with set variables
"""
return [value for value in self.__dict__.values() if galaxy.is_light_profile(value)] | [
"Returns",
"-------",
"light_profiles",
":",
"[",
"light_profiles",
".",
"LightProfile",
"]",
"Light",
"profiles",
"with",
"set",
"variables"
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/galaxy/galaxy_model.py#L147-L154 | [
"def",
"constant_light_profiles",
"(",
"self",
")",
":",
"return",
"[",
"value",
"for",
"value",
"in",
"self",
".",
"__dict__",
".",
"values",
"(",
")",
"if",
"galaxy",
".",
"is_light_profile",
"(",
"value",
")",
"]"
] | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | GalaxyModel.constant_mass_profiles | Returns
-------
mass_profiles: [mass_profiles.MassProfile]
Mass profiles with set variables | autolens/model/galaxy/galaxy_model.py | def constant_mass_profiles(self):
"""
Returns
-------
mass_profiles: [mass_profiles.MassProfile]
Mass profiles with set variables
"""
return [value for value in self.__dict__.values() if galaxy.is_mass_profile(value)] | def constant_mass_profiles(self):
"""
Returns
-------
mass_profiles: [mass_profiles.MassProfile]
Mass profiles with set variables
"""
return [value for value in self.__dict__.values() if galaxy.is_mass_profile(value)] | [
"Returns",
"-------",
"mass_profiles",
":",
"[",
"mass_profiles",
".",
"MassProfile",
"]",
"Mass",
"profiles",
"with",
"set",
"variables"
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/galaxy/galaxy_model.py#L157-L164 | [
"def",
"constant_mass_profiles",
"(",
"self",
")",
":",
"return",
"[",
"value",
"for",
"value",
"in",
"self",
".",
"__dict__",
".",
"values",
"(",
")",
"if",
"galaxy",
".",
"is_mass_profile",
"(",
"value",
")",
"]"
] | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | GalaxyModel.prior_models | Returns
-------
prior_models: [model_mapper.PriorModel]
A list of the prior models (e.g. variable profiles) attached to this galaxy prior | autolens/model/galaxy/galaxy_model.py | def prior_models(self):
"""
Returns
-------
prior_models: [model_mapper.PriorModel]
A list of the prior models (e.g. variable profiles) attached to this galaxy prior
"""
return [value for _, value in
filter(lambda t: isinstance(t[1], pm.PriorMo... | def prior_models(self):
"""
Returns
-------
prior_models: [model_mapper.PriorModel]
A list of the prior models (e.g. variable profiles) attached to this galaxy prior
"""
return [value for _, value in
filter(lambda t: isinstance(t[1], pm.PriorMo... | [
"Returns",
"-------",
"prior_models",
":",
"[",
"model_mapper",
".",
"PriorModel",
"]",
"A",
"list",
"of",
"the",
"prior",
"models",
"(",
"e",
".",
"g",
".",
"variable",
"profiles",
")",
"attached",
"to",
"this",
"galaxy",
"prior"
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/galaxy/galaxy_model.py#L167-L175 | [
"def",
"prior_models",
"(",
"self",
")",
":",
"return",
"[",
"value",
"for",
"_",
",",
"value",
"in",
"filter",
"(",
"lambda",
"t",
":",
"isinstance",
"(",
"t",
"[",
"1",
"]",
",",
"pm",
".",
"PriorModel",
")",
",",
"self",
".",
"__dict__",
".",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | GalaxyModel.profile_prior_model_dict | Returns
-------
profile_prior_model_dict: {str: PriorModel}
A dictionary mapping_matrix instance variable names to variable profiles. | autolens/model/galaxy/galaxy_model.py | def profile_prior_model_dict(self):
"""
Returns
-------
profile_prior_model_dict: {str: PriorModel}
A dictionary mapping_matrix instance variable names to variable profiles.
"""
return {key: value for key, value in
filter(lambda t: isinstance(t... | def profile_prior_model_dict(self):
"""
Returns
-------
profile_prior_model_dict: {str: PriorModel}
A dictionary mapping_matrix instance variable names to variable profiles.
"""
return {key: value for key, value in
filter(lambda t: isinstance(t... | [
"Returns",
"-------",
"profile_prior_model_dict",
":",
"{",
"str",
":",
"PriorModel",
"}",
"A",
"dictionary",
"mapping_matrix",
"instance",
"variable",
"names",
"to",
"variable",
"profiles",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/galaxy/galaxy_model.py#L178-L187 | [
"def",
"profile_prior_model_dict",
"(",
"self",
")",
":",
"return",
"{",
"key",
":",
"value",
"for",
"key",
",",
"value",
"in",
"filter",
"(",
"lambda",
"t",
":",
"isinstance",
"(",
"t",
"[",
"1",
"]",
",",
"pm",
".",
"PriorModel",
")",
"and",
"is_pr... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | GalaxyModel.constant_profile_dict | Returns
-------
constant_profile_dict: {str: geometry_profiles.GeometryProfile}
A dictionary mapping_matrix instance variable names to profiles with set variables. | autolens/model/galaxy/galaxy_model.py | def constant_profile_dict(self):
"""
Returns
-------
constant_profile_dict: {str: geometry_profiles.GeometryProfile}
A dictionary mapping_matrix instance variable names to profiles with set variables.
"""
return {key: value for key, value in self.__dict__.item... | def constant_profile_dict(self):
"""
Returns
-------
constant_profile_dict: {str: geometry_profiles.GeometryProfile}
A dictionary mapping_matrix instance variable names to profiles with set variables.
"""
return {key: value for key, value in self.__dict__.item... | [
"Returns",
"-------",
"constant_profile_dict",
":",
"{",
"str",
":",
"geometry_profiles",
".",
"GeometryProfile",
"}",
"A",
"dictionary",
"mapping_matrix",
"instance",
"variable",
"names",
"to",
"profiles",
"with",
"set",
"variables",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/galaxy/galaxy_model.py#L200-L208 | [
"def",
"constant_profile_dict",
"(",
"self",
")",
":",
"return",
"{",
"key",
":",
"value",
"for",
"key",
",",
"value",
"in",
"self",
".",
"__dict__",
".",
"items",
"(",
")",
"if",
"galaxy",
".",
"is_light_profile",
"(",
"value",
")",
"or",
"galaxy",
".... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | GalaxyModel.prior_class_dict | Returns
-------
prior_class_dict: {Prior: class}
A dictionary mapping_matrix priors to the class associated with their prior model. | autolens/model/galaxy/galaxy_model.py | def prior_class_dict(self):
"""
Returns
-------
prior_class_dict: {Prior: class}
A dictionary mapping_matrix priors to the class associated with their prior model.
"""
return {prior: cls for prior_model in self.prior_models for prior, cls in
pr... | def prior_class_dict(self):
"""
Returns
-------
prior_class_dict: {Prior: class}
A dictionary mapping_matrix priors to the class associated with their prior model.
"""
return {prior: cls for prior_model in self.prior_models for prior, cls in
pr... | [
"Returns",
"-------",
"prior_class_dict",
":",
"{",
"Prior",
":",
"class",
"}",
"A",
"dictionary",
"mapping_matrix",
"priors",
"to",
"the",
"class",
"associated",
"with",
"their",
"prior",
"model",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/galaxy/galaxy_model.py#L233-L241 | [
"def",
"prior_class_dict",
"(",
"self",
")",
":",
"return",
"{",
"prior",
":",
"cls",
"for",
"prior_model",
"in",
"self",
".",
"prior_models",
"for",
"prior",
",",
"cls",
"in",
"prior_model",
".",
"prior_class_dict",
".",
"items",
"(",
")",
"}"
] | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | GalaxyModel.instance_for_arguments | Create an instance of the associated class for a set of arguments
Parameters
----------
arguments: {Prior: value}
Dictionary mapping_matrix priors to attribute analysis_path and value pairs
Returns
-------
An instance of the class | autolens/model/galaxy/galaxy_model.py | def instance_for_arguments(self, arguments):
"""
Create an instance of the associated class for a set of arguments
Parameters
----------
arguments: {Prior: value}
Dictionary mapping_matrix priors to attribute analysis_path and value pairs
Returns
---... | def instance_for_arguments(self, arguments):
"""
Create an instance of the associated class for a set of arguments
Parameters
----------
arguments: {Prior: value}
Dictionary mapping_matrix priors to attribute analysis_path and value pairs
Returns
---... | [
"Create",
"an",
"instance",
"of",
"the",
"associated",
"class",
"for",
"a",
"set",
"of",
"arguments"
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/galaxy/galaxy_model.py#L243-L275 | [
"def",
"instance_for_arguments",
"(",
"self",
",",
"arguments",
")",
":",
"profiles",
"=",
"{",
"*",
"*",
"{",
"key",
":",
"value",
".",
"instance_for_arguments",
"(",
"arguments",
")",
"for",
"key",
",",
"value",
"in",
"self",
".",
"profile_prior_model_dict... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | GalaxyModel.gaussian_prior_model_for_arguments | Create a new galaxy prior from a set of arguments, replacing the priors of some of this galaxy prior's prior
models with new arguments.
Parameters
----------
arguments: dict
A dictionary mapping_matrix between old priors and their replacements.
Returns
-----... | autolens/model/galaxy/galaxy_model.py | def gaussian_prior_model_for_arguments(self, arguments):
"""
Create a new galaxy prior from a set of arguments, replacing the priors of some of this galaxy prior's prior
models with new arguments.
Parameters
----------
arguments: dict
A dictionary mapping_mat... | def gaussian_prior_model_for_arguments(self, arguments):
"""
Create a new galaxy prior from a set of arguments, replacing the priors of some of this galaxy prior's prior
models with new arguments.
Parameters
----------
arguments: dict
A dictionary mapping_mat... | [
"Create",
"a",
"new",
"galaxy",
"prior",
"from",
"a",
"set",
"of",
"arguments",
"replacing",
"the",
"priors",
"of",
"some",
"of",
"this",
"galaxy",
"prior",
"s",
"prior",
"models",
"with",
"new",
"arguments",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/galaxy/galaxy_model.py#L277-L297 | [
"def",
"gaussian_prior_model_for_arguments",
"(",
"self",
",",
"arguments",
")",
":",
"new_model",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
")",
"for",
"key",
",",
"value",
"in",
"filter",
"(",
"lambda",
"t",
":",
"isinstance",
"(",
"t",
"[",
"1",
"]",... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_image | Plot the observed image of the ccd data.
Set *autolens.data.array.plotters.array_plotters* for a description of all input parameters not described below.
Parameters
-----------
image : ScaledSquarePixelArray
The image of the data.
plot_origin : True
If true, the origin of the data'... | autolens/data/plotters/data_plotters.py | def plot_image(
image, plot_origin=True, mask=None, extract_array_from_mask=False, zoom_around_mask=False,
should_plot_border=False, positions=None, as_subplot=False,
units='arcsec', kpc_per_arcsec=None, figsize=(7, 7), aspect='square',
cmap='jet', norm='linear', norm_min=None, norm_max=... | def plot_image(
image, plot_origin=True, mask=None, extract_array_from_mask=False, zoom_around_mask=False,
should_plot_border=False, positions=None, as_subplot=False,
units='arcsec', kpc_per_arcsec=None, figsize=(7, 7), aspect='square',
cmap='jet', norm='linear', norm_min=None, norm_max=... | [
"Plot",
"the",
"observed",
"image",
"of",
"the",
"ccd",
"data",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/plotters/data_plotters.py#L4-L39 | [
"def",
"plot_image",
"(",
"image",
",",
"plot_origin",
"=",
"True",
",",
"mask",
"=",
"None",
",",
"extract_array_from_mask",
"=",
"False",
",",
"zoom_around_mask",
"=",
"False",
",",
"should_plot_border",
"=",
"False",
",",
"positions",
"=",
"None",
",",
"a... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_ccd_subplot | Plot the ccd data as a sub-plot of all its quantites (e.g. the data, noise_map-map, PSF, Signal-to_noise-map, \
etc).
Set *autolens.data.array.plotters.array_plotters* for a description of all innput parameters not described below.
Parameters
-----------
ccd_data : data.CCDData
The ccd da... | autolens/data/plotters/ccd_plotters.py | def plot_ccd_subplot(
ccd_data, plot_origin=True, mask=None, extract_array_from_mask=False, zoom_around_mask=False,
should_plot_border=False, positions=None,
units='arcsec', kpc_per_arcsec=None, figsize=None, aspect='square',
cmap='jet', norm='linear', norm_min=None, norm_max=None, linth... | def plot_ccd_subplot(
ccd_data, plot_origin=True, mask=None, extract_array_from_mask=False, zoom_around_mask=False,
should_plot_border=False, positions=None,
units='arcsec', kpc_per_arcsec=None, figsize=None, aspect='square',
cmap='jet', norm='linear', norm_min=None, norm_max=None, linth... | [
"Plot",
"the",
"ccd",
"data",
"as",
"a",
"sub",
"-",
"plot",
"of",
"all",
"its",
"quantites",
"(",
"e",
".",
"g",
".",
"the",
"data",
"noise_map",
"-",
"map",
"PSF",
"Signal",
"-",
"to_noise",
"-",
"map",
"\\",
"etc",
")",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/plotters/ccd_plotters.py#L7-L120 | [
"def",
"plot_ccd_subplot",
"(",
"ccd_data",
",",
"plot_origin",
"=",
"True",
",",
"mask",
"=",
"None",
",",
"extract_array_from_mask",
"=",
"False",
",",
"zoom_around_mask",
"=",
"False",
",",
"should_plot_border",
"=",
"False",
",",
"positions",
"=",
"None",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_ccd_individual | Plot each attribute of the ccd data as individual figures one by one (e.g. the data, noise_map-map, PSF, \
Signal-to_noise-map, etc).
Set *autolens.data.array.plotters.array_plotters* for a description of all innput parameters not described below.
Parameters
-----------
ccd_data : data.CCDData
... | autolens/data/plotters/ccd_plotters.py | def plot_ccd_individual(
ccd_data, plot_origin=True, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None,
should_plot_image=False,
should_plot_noise_map=False,
should_plot_psf=False,
should_plot_signal_to_noise_map=False,
should_plot_absolute_... | def plot_ccd_individual(
ccd_data, plot_origin=True, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None,
should_plot_image=False,
should_plot_noise_map=False,
should_plot_psf=False,
should_plot_signal_to_noise_map=False,
should_plot_absolute_... | [
"Plot",
"each",
"attribute",
"of",
"the",
"ccd",
"data",
"as",
"individual",
"figures",
"one",
"by",
"one",
"(",
"e",
".",
"g",
".",
"the",
"data",
"noise_map",
"-",
"map",
"PSF",
"\\",
"Signal",
"-",
"to_noise",
"-",
"map",
"etc",
")",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/plotters/ccd_plotters.py#L123-L190 | [
"def",
"plot_ccd_individual",
"(",
"ccd_data",
",",
"plot_origin",
"=",
"True",
",",
"mask",
"=",
"None",
",",
"extract_array_from_mask",
"=",
"False",
",",
"zoom_around_mask",
"=",
"False",
",",
"positions",
"=",
"None",
",",
"should_plot_image",
"=",
"False",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | norm_and_check | Normalise and check a backend path.
Ensure that the requested backend path is specified as a relative path,
and resolves to a location under the given source tree.
Return an absolute version of the requested path. | pep517/wrappers.py | def norm_and_check(source_tree, requested):
"""Normalise and check a backend path.
Ensure that the requested backend path is specified as a relative path,
and resolves to a location under the given source tree.
Return an absolute version of the requested path.
"""
if os.path.isabs(requested):
... | def norm_and_check(source_tree, requested):
"""Normalise and check a backend path.
Ensure that the requested backend path is specified as a relative path,
and resolves to a location under the given source tree.
Return an absolute version of the requested path.
"""
if os.path.isabs(requested):
... | [
"Normalise",
"and",
"check",
"a",
"backend",
"path",
"."
] | pypa/pep517 | python | https://github.com/pypa/pep517/blob/ecd511e8fc85251d0496716939ebbe109e395924/pep517/wrappers.py#L52-L73 | [
"def",
"norm_and_check",
"(",
"source_tree",
",",
"requested",
")",
":",
"if",
"os",
".",
"path",
".",
"isabs",
"(",
"requested",
")",
":",
"raise",
"ValueError",
"(",
"\"paths must be relative\"",
")",
"abs_source",
"=",
"os",
".",
"path",
".",
"abspath",
... | ecd511e8fc85251d0496716939ebbe109e395924 |
valid | contained_in | Test if a file is located within the given directory. | pep517/_in_process.py | def contained_in(filename, directory):
"""Test if a file is located within the given directory."""
filename = os.path.normcase(os.path.abspath(filename))
directory = os.path.normcase(os.path.abspath(directory))
return os.path.commonprefix([filename, directory]) == directory | def contained_in(filename, directory):
"""Test if a file is located within the given directory."""
filename = os.path.normcase(os.path.abspath(filename))
directory = os.path.normcase(os.path.abspath(directory))
return os.path.commonprefix([filename, directory]) == directory | [
"Test",
"if",
"a",
"file",
"is",
"located",
"within",
"the",
"given",
"directory",
"."
] | pypa/pep517 | python | https://github.com/pypa/pep517/blob/ecd511e8fc85251d0496716939ebbe109e395924/pep517/_in_process.py#L41-L45 | [
"def",
"contained_in",
"(",
"filename",
",",
"directory",
")",
":",
"filename",
"=",
"os",
".",
"path",
".",
"normcase",
"(",
"os",
".",
"path",
".",
"abspath",
"(",
"filename",
")",
")",
"directory",
"=",
"os",
".",
"path",
".",
"normcase",
"(",
"os... | ecd511e8fc85251d0496716939ebbe109e395924 |
valid | _build_backend | Find and load the build backend | pep517/_in_process.py | def _build_backend():
"""Find and load the build backend"""
# Add in-tree backend directories to the front of sys.path.
backend_path = os.environ.get('PEP517_BACKEND_PATH')
if backend_path:
extra_pathitems = backend_path.split(os.pathsep)
sys.path[:0] = extra_pathitems
ep = os.envir... | def _build_backend():
"""Find and load the build backend"""
# Add in-tree backend directories to the front of sys.path.
backend_path = os.environ.get('PEP517_BACKEND_PATH')
if backend_path:
extra_pathitems = backend_path.split(os.pathsep)
sys.path[:0] = extra_pathitems
ep = os.envir... | [
"Find",
"and",
"load",
"the",
"build",
"backend"
] | pypa/pep517 | python | https://github.com/pypa/pep517/blob/ecd511e8fc85251d0496716939ebbe109e395924/pep517/_in_process.py#L48-L73 | [
"def",
"_build_backend",
"(",
")",
":",
"# Add in-tree backend directories to the front of sys.path.",
"backend_path",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"'PEP517_BACKEND_PATH'",
")",
"if",
"backend_path",
":",
"extra_pathitems",
"=",
"backend_path",
".",
"spli... | ecd511e8fc85251d0496716939ebbe109e395924 |
valid | build_sdist | Invoke the mandatory build_sdist hook. | pep517/_in_process.py | def build_sdist(sdist_directory, config_settings):
"""Invoke the mandatory build_sdist hook."""
backend = _build_backend()
try:
return backend.build_sdist(sdist_directory, config_settings)
except getattr(backend, 'UnsupportedOperation', _DummyException):
raise GotUnsupportedOperation(tra... | def build_sdist(sdist_directory, config_settings):
"""Invoke the mandatory build_sdist hook."""
backend = _build_backend()
try:
return backend.build_sdist(sdist_directory, config_settings)
except getattr(backend, 'UnsupportedOperation', _DummyException):
raise GotUnsupportedOperation(tra... | [
"Invoke",
"the",
"mandatory",
"build_sdist",
"hook",
"."
] | pypa/pep517 | python | https://github.com/pypa/pep517/blob/ecd511e8fc85251d0496716939ebbe109e395924/pep517/_in_process.py#L201-L207 | [
"def",
"build_sdist",
"(",
"sdist_directory",
",",
"config_settings",
")",
":",
"backend",
"=",
"_build_backend",
"(",
")",
"try",
":",
"return",
"backend",
".",
"build_sdist",
"(",
"sdist_directory",
",",
"config_settings",
")",
"except",
"getattr",
"(",
"backe... | ecd511e8fc85251d0496716939ebbe109e395924 |
valid | API.log_error | Print errors. Stop travis-ci from leaking api keys
:param e: The error
:return: None | socialreaper/apis.py | def log_error(self, e):
"""
Print errors. Stop travis-ci from leaking api keys
:param e: The error
:return: None
"""
if not environ.get('CI'):
self.log_function(e)
if hasattr(e, 'response') and hasattr(e.response, 'text'):
... | def log_error(self, e):
"""
Print errors. Stop travis-ci from leaking api keys
:param e: The error
:return: None
"""
if not environ.get('CI'):
self.log_function(e)
if hasattr(e, 'response') and hasattr(e.response, 'text'):
... | [
"Print",
"errors",
".",
"Stop",
"travis",
"-",
"ci",
"from",
"leaking",
"api",
"keys",
":",
"param",
"e",
":",
"The",
"error",
":",
"return",
":",
"None"
] | ScriptSmith/socialreaper | python | https://github.com/ScriptSmith/socialreaper/blob/87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da/socialreaper/apis.py#L27-L38 | [
"def",
"log_error",
"(",
"self",
",",
"e",
")",
":",
"if",
"not",
"environ",
".",
"get",
"(",
"'CI'",
")",
":",
"self",
".",
"log_function",
"(",
"e",
")",
"if",
"hasattr",
"(",
"e",
",",
"'response'",
")",
"and",
"hasattr",
"(",
"e",
".",
"respo... | 87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da |
valid | API._sleep | Sleep between requests, but don't force asynchronous code to wait
:param seconds: The number of seconds to sleep
:return: None | socialreaper/apis.py | def _sleep(self, seconds):
"""
Sleep between requests, but don't force asynchronous code to wait
:param seconds: The number of seconds to sleep
:return: None
"""
for _ in range(int(seconds)):
if not self.force_stop:
sleep(1) | def _sleep(self, seconds):
"""
Sleep between requests, but don't force asynchronous code to wait
:param seconds: The number of seconds to sleep
:return: None
"""
for _ in range(int(seconds)):
if not self.force_stop:
sleep(1) | [
"Sleep",
"between",
"requests",
"but",
"don",
"t",
"force",
"asynchronous",
"code",
"to",
"wait",
":",
"param",
"seconds",
":",
"The",
"number",
"of",
"seconds",
"to",
"sleep",
":",
"return",
":",
"None"
] | ScriptSmith/socialreaper | python | https://github.com/ScriptSmith/socialreaper/blob/87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da/socialreaper/apis.py#L40-L49 | [
"def",
"_sleep",
"(",
"self",
",",
"seconds",
")",
":",
"for",
"_",
"in",
"range",
"(",
"int",
"(",
"seconds",
")",
")",
":",
"if",
"not",
"self",
".",
"force_stop",
":",
"sleep",
"(",
"1",
")"
] | 87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da |
valid | API.get | An interface for get requests that handles errors more gracefully to
prevent data loss | socialreaper/apis.py | def get(self, *args, **kwargs):
"""
An interface for get requests that handles errors more gracefully to
prevent data loss
"""
try:
req_func = self.session.get if self.session else requests.get
req = req_func(*args, **kwargs)
req.ra... | def get(self, *args, **kwargs):
"""
An interface for get requests that handles errors more gracefully to
prevent data loss
"""
try:
req_func = self.session.get if self.session else requests.get
req = req_func(*args, **kwargs)
req.ra... | [
"An",
"interface",
"for",
"get",
"requests",
"that",
"handles",
"errors",
"more",
"gracefully",
"to",
"prevent",
"data",
"loss"
] | ScriptSmith/socialreaper | python | https://github.com/ScriptSmith/socialreaper/blob/87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da/socialreaper/apis.py#L57-L90 | [
"def",
"get",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"req_func",
"=",
"self",
".",
"session",
".",
"get",
"if",
"self",
".",
"session",
"else",
"requests",
".",
"get",
"req",
"=",
"req_func",
"(",
"*",
"args... | 87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da |
valid | Facebook.node_edge | :param node:
:param edge:
:param fields:
:param params:
:return: | socialreaper/apis.py | def node_edge(self, node, edge, fields=None, params=None):
"""
:param node:
:param edge:
:param fields:
:param params:
:return:
"""
if fields:
fields = ",".join(fields)
parameters = {"fields": fields,
... | def node_edge(self, node, edge, fields=None, params=None):
"""
:param node:
:param edge:
:param fields:
:param params:
:return:
"""
if fields:
fields = ",".join(fields)
parameters = {"fields": fields,
... | [
":",
"param",
"node",
":",
":",
"param",
"edge",
":",
":",
"param",
"fields",
":",
":",
"param",
"params",
":",
":",
"return",
":"
] | ScriptSmith/socialreaper | python | https://github.com/ScriptSmith/socialreaper/blob/87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da/socialreaper/apis.py#L410-L427 | [
"def",
"node_edge",
"(",
"self",
",",
"node",
",",
"edge",
",",
"fields",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"fields",
":",
"fields",
"=",
"\",\"",
".",
"join",
"(",
"fields",
")",
"parameters",
"=",
"{",
"\"fields\"",
":",
"f... | 87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da |
valid | Facebook.post | :param post_id:
:param fields:
:param params:
:return: | socialreaper/apis.py | def post(self, post_id, fields=None, **params):
"""
:param post_id:
:param fields:
:param params:
:return:
"""
if fields:
fields = ",".join(fields)
parameters = {"fields": fields,
"access_token": self.key}
... | def post(self, post_id, fields=None, **params):
"""
:param post_id:
:param fields:
:param params:
:return:
"""
if fields:
fields = ",".join(fields)
parameters = {"fields": fields,
"access_token": self.key}
... | [
":",
"param",
"post_id",
":",
":",
"param",
"fields",
":",
":",
"param",
"params",
":",
":",
"return",
":"
] | ScriptSmith/socialreaper | python | https://github.com/ScriptSmith/socialreaper/blob/87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da/socialreaper/apis.py#L429-L445 | [
"def",
"post",
"(",
"self",
",",
"post_id",
",",
"fields",
"=",
"None",
",",
"*",
"*",
"params",
")",
":",
"if",
"fields",
":",
"fields",
"=",
"\",\"",
".",
"join",
"(",
"fields",
")",
"parameters",
"=",
"{",
"\"fields\"",
":",
"fields",
",",
"\"ac... | 87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da |
valid | Facebook.page_posts | :param page_id:
:param after:
:param post_type: Can be 'posts', 'feed', 'tagged', 'promotable_posts'
:param include_hidden:
:param fields:
:param params:
:return: | socialreaper/apis.py | def page_posts(self, page_id, after='', post_type="posts",
include_hidden=False, fields=None, **params):
"""
:param page_id:
:param after:
:param post_type: Can be 'posts', 'feed', 'tagged', 'promotable_posts'
:param include_hidden:
:param fi... | def page_posts(self, page_id, after='', post_type="posts",
include_hidden=False, fields=None, **params):
"""
:param page_id:
:param after:
:param post_type: Can be 'posts', 'feed', 'tagged', 'promotable_posts'
:param include_hidden:
:param fi... | [
":",
"param",
"page_id",
":",
":",
"param",
"after",
":",
":",
"param",
"post_type",
":",
"Can",
"be",
"posts",
"feed",
"tagged",
"promotable_posts",
":",
"param",
"include_hidden",
":",
":",
"param",
"fields",
":",
":",
"param",
"params",
":",
":",
"ret... | ScriptSmith/socialreaper | python | https://github.com/ScriptSmith/socialreaper/blob/87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da/socialreaper/apis.py#L447-L469 | [
"def",
"page_posts",
"(",
"self",
",",
"page_id",
",",
"after",
"=",
"''",
",",
"post_type",
"=",
"\"posts\"",
",",
"include_hidden",
"=",
"False",
",",
"fields",
"=",
"None",
",",
"*",
"*",
"params",
")",
":",
"if",
"fields",
":",
"fields",
"=",
"\"... | 87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da |
valid | Facebook.post_comments | :param post_id:
:param after:
:param order: Can be 'ranked', 'chronological', 'reverse_chronological'
:param filter: Can be 'stream', 'toplevel'
:param fields: Can be 'id', 'application', 'attachment', 'can_comment',
'can_remove', 'can_hide', 'can_like', 'can_reply_privately... | socialreaper/apis.py | def post_comments(self, post_id, after='', order="chronological",
filter="stream", fields=None, **params):
"""
:param post_id:
:param after:
:param order: Can be 'ranked', 'chronological', 'reverse_chronological'
:param filter: Can be 'stream', 'to... | def post_comments(self, post_id, after='', order="chronological",
filter="stream", fields=None, **params):
"""
:param post_id:
:param after:
:param order: Can be 'ranked', 'chronological', 'reverse_chronological'
:param filter: Can be 'stream', 'to... | [
":",
"param",
"post_id",
":",
":",
"param",
"after",
":",
":",
"param",
"order",
":",
"Can",
"be",
"ranked",
"chronological",
"reverse_chronological",
":",
"param",
"filter",
":",
"Can",
"be",
"stream",
"toplevel",
":",
"param",
"fields",
":",
"Can",
"be",... | ScriptSmith/socialreaper | python | https://github.com/ScriptSmith/socialreaper/blob/87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da/socialreaper/apis.py#L471-L498 | [
"def",
"post_comments",
"(",
"self",
",",
"post_id",
",",
"after",
"=",
"''",
",",
"order",
"=",
"\"chronological\"",
",",
"filter",
"=",
"\"stream\"",
",",
"fields",
"=",
"None",
",",
"*",
"*",
"params",
")",
":",
"if",
"fields",
":",
"fields",
"=",
... | 87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da |
valid | flatten | Turn a nested dictionary into a flattened dictionary
:param dictionary: The dictionary to flatten
:param parent_key: The string to prepend to dictionary's keys
:param separator: The string used to separate flattened keys
:return: A flattened dictionary | socialreaper/tools.py | def flatten(dictionary, parent_key=False, separator='.'):
"""
Turn a nested dictionary into a flattened dictionary
:param dictionary: The dictionary to flatten
:param parent_key: The string to prepend to dictionary's keys
:param separator: The string used to separate flattened keys
:retu... | def flatten(dictionary, parent_key=False, separator='.'):
"""
Turn a nested dictionary into a flattened dictionary
:param dictionary: The dictionary to flatten
:param parent_key: The string to prepend to dictionary's keys
:param separator: The string used to separate flattened keys
:retu... | [
"Turn",
"a",
"nested",
"dictionary",
"into",
"a",
"flattened",
"dictionary",
":",
"param",
"dictionary",
":",
"The",
"dictionary",
"to",
"flatten",
":",
"param",
"parent_key",
":",
"The",
"string",
"to",
"prepend",
"to",
"dictionary",
"s",
"keys",
":",
"para... | ScriptSmith/socialreaper | python | https://github.com/ScriptSmith/socialreaper/blob/87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da/socialreaper/tools.py#L8-L28 | [
"def",
"flatten",
"(",
"dictionary",
",",
"parent_key",
"=",
"False",
",",
"separator",
"=",
"'.'",
")",
":",
"items",
"=",
"[",
"]",
"for",
"key",
",",
"value",
"in",
"dictionary",
".",
"items",
"(",
")",
":",
"new_key",
"=",
"str",
"(",
"parent_key... | 87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da |
valid | fill_gaps | Fill gaps in a list of dictionaries. Add empty keys to dictionaries in
the list that don't contain other entries' keys
:param list_dicts: A list of dictionaries
:return: A list of field names, a list of dictionaries with identical keys | socialreaper/tools.py | def fill_gaps(list_dicts):
"""
Fill gaps in a list of dictionaries. Add empty keys to dictionaries in
the list that don't contain other entries' keys
:param list_dicts: A list of dictionaries
:return: A list of field names, a list of dictionaries with identical keys
"""
field_name... | def fill_gaps(list_dicts):
"""
Fill gaps in a list of dictionaries. Add empty keys to dictionaries in
the list that don't contain other entries' keys
:param list_dicts: A list of dictionaries
:return: A list of field names, a list of dictionaries with identical keys
"""
field_name... | [
"Fill",
"gaps",
"in",
"a",
"list",
"of",
"dictionaries",
".",
"Add",
"empty",
"keys",
"to",
"dictionaries",
"in",
"the",
"list",
"that",
"don",
"t",
"contain",
"other",
"entries",
"keys",
":",
"param",
"list_dicts",
":",
"A",
"list",
"of",
"dictionaries",
... | ScriptSmith/socialreaper | python | https://github.com/ScriptSmith/socialreaper/blob/87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da/socialreaper/tools.py#L31-L49 | [
"def",
"fill_gaps",
"(",
"list_dicts",
")",
":",
"field_names",
"=",
"[",
"]",
"# != set bc. preserving order is better for output\r",
"for",
"datum",
"in",
"list_dicts",
":",
"for",
"key",
"in",
"datum",
".",
"keys",
"(",
")",
":",
"if",
"key",
"not",
"in",
... | 87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da |
valid | to_csv | DEPRECATED Write a list of dicts to a csv file
:param data: List of dicts
:param field_names: The list column names
:param filename: The name of the file
:param overwrite: Overwrite the file if exists
:param write_headers: Write the headers to the csv file
:param append: Write new row... | socialreaper/tools.py | def to_csv(data, field_names=None, filename='data.csv',
overwrite=True,
write_headers=True, append=False, flat=True,
primary_fields=None, sort_fields=True):
"""
DEPRECATED Write a list of dicts to a csv file
:param data: List of dicts
:param field_names: The ... | def to_csv(data, field_names=None, filename='data.csv',
overwrite=True,
write_headers=True, append=False, flat=True,
primary_fields=None, sort_fields=True):
"""
DEPRECATED Write a list of dicts to a csv file
:param data: List of dicts
:param field_names: The ... | [
"DEPRECATED",
"Write",
"a",
"list",
"of",
"dicts",
"to",
"a",
"csv",
"file",
":",
"param",
"data",
":",
"List",
"of",
"dicts",
":",
"param",
"field_names",
":",
"The",
"list",
"column",
"names",
":",
"param",
"filename",
":",
"The",
"name",
"of",
"the"... | ScriptSmith/socialreaper | python | https://github.com/ScriptSmith/socialreaper/blob/87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da/socialreaper/tools.py#L132-L194 | [
"def",
"to_csv",
"(",
"data",
",",
"field_names",
"=",
"None",
",",
"filename",
"=",
"'data.csv'",
",",
"overwrite",
"=",
"True",
",",
"write_headers",
"=",
"True",
",",
"append",
"=",
"False",
",",
"flat",
"=",
"True",
",",
"primary_fields",
"=",
"None"... | 87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da |
valid | to_json | Write an object to a json file
:param data: The object
:param filename: The name of the file
:param indent: The indentation of the file
:return: None | socialreaper/tools.py | def to_json(data, filename='data.json', indent=4):
"""
Write an object to a json file
:param data: The object
:param filename: The name of the file
:param indent: The indentation of the file
:return: None
"""
with open(filename, 'w') as f:
f.write(json.dumps(data, in... | def to_json(data, filename='data.json', indent=4):
"""
Write an object to a json file
:param data: The object
:param filename: The name of the file
:param indent: The indentation of the file
:return: None
"""
with open(filename, 'w') as f:
f.write(json.dumps(data, in... | [
"Write",
"an",
"object",
"to",
"a",
"json",
"file",
":",
"param",
"data",
":",
"The",
"object",
":",
"param",
"filename",
":",
"The",
"name",
"of",
"the",
"file",
":",
"param",
"indent",
":",
"The",
"indentation",
"of",
"the",
"file",
":",
"return",
... | ScriptSmith/socialreaper | python | https://github.com/ScriptSmith/socialreaper/blob/87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da/socialreaper/tools.py#L197-L208 | [
"def",
"to_json",
"(",
"data",
",",
"filename",
"=",
"'data.json'",
",",
"indent",
"=",
"4",
")",
":",
"with",
"open",
"(",
"filename",
",",
"'w'",
")",
"as",
"f",
":",
"f",
".",
"write",
"(",
"json",
".",
"dumps",
"(",
"data",
",",
"indent",
"="... | 87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da |
valid | save_file | Download and save a file at path
:param filename: The name of the file
:param source: The location of the resource online
:param folder: The directory the file will be saved in
:return: None | socialreaper/tools.py | def save_file(filename, source, folder="Downloads"):
"""
Download and save a file at path
:param filename: The name of the file
:param source: The location of the resource online
:param folder: The directory the file will be saved in
:return: None
"""
r = requests.get(source,... | def save_file(filename, source, folder="Downloads"):
"""
Download and save a file at path
:param filename: The name of the file
:param source: The location of the resource online
:param folder: The directory the file will be saved in
:return: None
"""
r = requests.get(source,... | [
"Download",
"and",
"save",
"a",
"file",
"at",
"path",
":",
"param",
"filename",
":",
"The",
"name",
"of",
"the",
"file",
":",
"param",
"source",
":",
"The",
"location",
"of",
"the",
"resource",
"online",
":",
"param",
"folder",
":",
"The",
"directory",
... | ScriptSmith/socialreaper | python | https://github.com/ScriptSmith/socialreaper/blob/87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da/socialreaper/tools.py#L211-L227 | [
"def",
"save_file",
"(",
"filename",
",",
"source",
",",
"folder",
"=",
"\"Downloads\"",
")",
":",
"r",
"=",
"requests",
".",
"get",
"(",
"source",
",",
"stream",
"=",
"True",
")",
"if",
"r",
".",
"status_code",
"==",
"200",
":",
"if",
"not",
"path",... | 87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da |
valid | convert_frames_to_video | Try to convert a tar file containing a sequence of frames saved by the
meshcat viewer into a single video file.
This relies on having `ffmpeg` installed on your system. | src/meshcat/animation.py | def convert_frames_to_video(tar_file_path, output_path="output.mp4", framerate=60, overwrite=False):
"""
Try to convert a tar file containing a sequence of frames saved by the
meshcat viewer into a single video file.
This relies on having `ffmpeg` installed on your system.
"""
output_path = os.... | def convert_frames_to_video(tar_file_path, output_path="output.mp4", framerate=60, overwrite=False):
"""
Try to convert a tar file containing a sequence of frames saved by the
meshcat viewer into a single video file.
This relies on having `ffmpeg` installed on your system.
"""
output_path = os.... | [
"Try",
"to",
"convert",
"a",
"tar",
"file",
"containing",
"a",
"sequence",
"of",
"frames",
"saved",
"by",
"the",
"meshcat",
"viewer",
"into",
"a",
"single",
"video",
"file",
"."
] | rdeits/meshcat-python | python | https://github.com/rdeits/meshcat-python/blob/aa3865143120f5ace8e62aab71d825e33674d277/src/meshcat/animation.py#L132-L165 | [
"def",
"convert_frames_to_video",
"(",
"tar_file_path",
",",
"output_path",
"=",
"\"output.mp4\"",
",",
"framerate",
"=",
"60",
",",
"overwrite",
"=",
"False",
")",
":",
"output_path",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"output_path",
")",
"if",
"o... | aa3865143120f5ace8e62aab71d825e33674d277 |
valid | FileMetadata.toJSON | Get a json dict of the attributes of this object. | python/kappy/kappa_common.py | def toJSON(self):
"""Get a json dict of the attributes of this object."""
return {"id": self.id,
"compile": self.compile,
"position": self.position,
"version": self.version} | def toJSON(self):
"""Get a json dict of the attributes of this object."""
return {"id": self.id,
"compile": self.compile,
"position": self.position,
"version": self.version} | [
"Get",
"a",
"json",
"dict",
"of",
"the",
"attributes",
"of",
"this",
"object",
"."
] | Kappa-Dev/KaSim | python | https://github.com/Kappa-Dev/KaSim/blob/12a01c616a47e3046323103625795fb2fca8273a/python/kappy/kappa_common.py#L72-L77 | [
"def",
"toJSON",
"(",
"self",
")",
":",
"return",
"{",
"\"id\"",
":",
"self",
".",
"id",
",",
"\"compile\"",
":",
"self",
".",
"compile",
",",
"\"position\"",
":",
"self",
".",
"position",
",",
"\"version\"",
":",
"self",
".",
"version",
"}"
] | 12a01c616a47e3046323103625795fb2fca8273a |
valid | File.from_string | Convenience method to create a file from a string.
This file object's metadata will have the id 'inlined_input'.
Inputs
------
content -- the content of the file (a string).
position -- (default 1) rank among all files of the model while parsing
see FileMetadata
... | python/kappy/kappa_common.py | def from_string(cls, content, position=1, file_id=None):
"""
Convenience method to create a file from a string.
This file object's metadata will have the id 'inlined_input'.
Inputs
------
content -- the content of the file (a string).
position -- (default 1) ran... | def from_string(cls, content, position=1, file_id=None):
"""
Convenience method to create a file from a string.
This file object's metadata will have the id 'inlined_input'.
Inputs
------
content -- the content of the file (a string).
position -- (default 1) ran... | [
"Convenience",
"method",
"to",
"create",
"a",
"file",
"from",
"a",
"string",
"."
] | Kappa-Dev/KaSim | python | https://github.com/Kappa-Dev/KaSim/blob/12a01c616a47e3046323103625795fb2fca8273a/python/kappy/kappa_common.py#L113-L129 | [
"def",
"from_string",
"(",
"cls",
",",
"content",
",",
"position",
"=",
"1",
",",
"file_id",
"=",
"None",
")",
":",
"if",
"file_id",
"is",
"None",
":",
"file_id",
"=",
"'inlined_input'",
"return",
"cls",
"(",
"FileMetadata",
"(",
"file_id",
",",
"positio... | 12a01c616a47e3046323103625795fb2fca8273a |
valid | File.from_file | Convience method to create a kappa file object from a file on disk
Inputs
------
fpath -- path to the file on disk
position -- (default 1) rank among all files of the model while parsing
see FileMetadata
file_id -- (default = fpath) the file_id that will be used by k... | python/kappy/kappa_common.py | def from_file(cls, fpath, position=1, file_id=None):
"""
Convience method to create a kappa file object from a file on disk
Inputs
------
fpath -- path to the file on disk
position -- (default 1) rank among all files of the model while parsing
see FileMetadat... | def from_file(cls, fpath, position=1, file_id=None):
"""
Convience method to create a kappa file object from a file on disk
Inputs
------
fpath -- path to the file on disk
position -- (default 1) rank among all files of the model while parsing
see FileMetadat... | [
"Convience",
"method",
"to",
"create",
"a",
"kappa",
"file",
"object",
"from",
"a",
"file",
"on",
"disk"
] | Kappa-Dev/KaSim | python | https://github.com/Kappa-Dev/KaSim/blob/12a01c616a47e3046323103625795fb2fca8273a/python/kappy/kappa_common.py#L132-L149 | [
"def",
"from_file",
"(",
"cls",
",",
"fpath",
",",
"position",
"=",
"1",
",",
"file_id",
"=",
"None",
")",
":",
"if",
"file_id",
"is",
"None",
":",
"file_id",
"=",
"fpath",
"with",
"open",
"(",
"fpath",
")",
"as",
"f",
":",
"code",
"=",
"f",
".",... | 12a01c616a47e3046323103625795fb2fca8273a |
valid | KappaApi._fix_docs | Make api method docs inheritted.
Specifically, insepect.getdoc will return values inheritted from this
abc for standardized api methods. | python/kappy/kappa_common.py | def _fix_docs(this_abc, child_class):
"""Make api method docs inheritted.
Specifically, insepect.getdoc will return values inheritted from this
abc for standardized api methods.
"""
# After python 3.5, this is basically handled automatically
if sys.version_info >= (3, 5)... | def _fix_docs(this_abc, child_class):
"""Make api method docs inheritted.
Specifically, insepect.getdoc will return values inheritted from this
abc for standardized api methods.
"""
# After python 3.5, this is basically handled automatically
if sys.version_info >= (3, 5)... | [
"Make",
"api",
"method",
"docs",
"inheritted",
"."
] | Kappa-Dev/KaSim | python | https://github.com/Kappa-Dev/KaSim/blob/12a01c616a47e3046323103625795fb2fca8273a/python/kappy/kappa_common.py#L244-L264 | [
"def",
"_fix_docs",
"(",
"this_abc",
",",
"child_class",
")",
":",
"# After python 3.5, this is basically handled automatically",
"if",
"sys",
".",
"version_info",
">=",
"(",
"3",
",",
"5",
")",
":",
"return",
"child_class",
"if",
"not",
"issubclass",
"(",
"child_... | 12a01c616a47e3046323103625795fb2fca8273a |
valid | KappaApi.add_model_string | Add a kappa model given in a string to the project. | python/kappy/kappa_common.py | def add_model_string(self, model_str, position=1, file_id=None):
"""Add a kappa model given in a string to the project."""
if file_id is None:
file_id = self.make_unique_id('inlined_input')
ret_data = self.file_create(File.from_string(model_str, position,
... | def add_model_string(self, model_str, position=1, file_id=None):
"""Add a kappa model given in a string to the project."""
if file_id is None:
file_id = self.make_unique_id('inlined_input')
ret_data = self.file_create(File.from_string(model_str, position,
... | [
"Add",
"a",
"kappa",
"model",
"given",
"in",
"a",
"string",
"to",
"the",
"project",
"."
] | Kappa-Dev/KaSim | python | https://github.com/Kappa-Dev/KaSim/blob/12a01c616a47e3046323103625795fb2fca8273a/python/kappy/kappa_common.py#L270-L276 | [
"def",
"add_model_string",
"(",
"self",
",",
"model_str",
",",
"position",
"=",
"1",
",",
"file_id",
"=",
"None",
")",
":",
"if",
"file_id",
"is",
"None",
":",
"file_id",
"=",
"self",
".",
"make_unique_id",
"(",
"'inlined_input'",
")",
"ret_data",
"=",
"... | 12a01c616a47e3046323103625795fb2fca8273a |
valid | KappaApi.add_model_file | Add a kappa model from a file at given path to the project. | python/kappy/kappa_common.py | def add_model_file(self, model_fpath, position=1, file_id=None):
"""Add a kappa model from a file at given path to the project."""
if file_id is None:
file_id = self.make_unique_id('file_input')
ret_data = self.file_create(File.from_file(model_fpath, position,
... | def add_model_file(self, model_fpath, position=1, file_id=None):
"""Add a kappa model from a file at given path to the project."""
if file_id is None:
file_id = self.make_unique_id('file_input')
ret_data = self.file_create(File.from_file(model_fpath, position,
... | [
"Add",
"a",
"kappa",
"model",
"from",
"a",
"file",
"at",
"given",
"path",
"to",
"the",
"project",
"."
] | Kappa-Dev/KaSim | python | https://github.com/Kappa-Dev/KaSim/blob/12a01c616a47e3046323103625795fb2fca8273a/python/kappy/kappa_common.py#L278-L284 | [
"def",
"add_model_file",
"(",
"self",
",",
"model_fpath",
",",
"position",
"=",
"1",
",",
"file_id",
"=",
"None",
")",
":",
"if",
"file_id",
"is",
"None",
":",
"file_id",
"=",
"self",
".",
"make_unique_id",
"(",
"'file_input'",
")",
"ret_data",
"=",
"sel... | 12a01c616a47e3046323103625795fb2fca8273a |
valid | KappaApi.set_default_sim_param | Set the simulation default simulation parameters.
You can pass one of two things in as input:
- a kappa_common.SimulationParameter instance
- the arguments and keyword argument to create such an instance.
The parameters you specify will be used by default in simulations run
by ... | python/kappy/kappa_common.py | def set_default_sim_param(self, *args, **kwargs):
"""Set the simulation default simulation parameters.
You can pass one of two things in as input:
- a kappa_common.SimulationParameter instance
- the arguments and keyword argument to create such an instance.
The parameters you s... | def set_default_sim_param(self, *args, **kwargs):
"""Set the simulation default simulation parameters.
You can pass one of two things in as input:
- a kappa_common.SimulationParameter instance
- the arguments and keyword argument to create such an instance.
The parameters you s... | [
"Set",
"the",
"simulation",
"default",
"simulation",
"parameters",
"."
] | Kappa-Dev/KaSim | python | https://github.com/Kappa-Dev/KaSim/blob/12a01c616a47e3046323103625795fb2fca8273a/python/kappy/kappa_common.py#L286-L300 | [
"def",
"set_default_sim_param",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"len",
"(",
"args",
")",
"is",
"1",
"and",
"isinstance",
"(",
"args",
"[",
"0",
"]",
",",
"SimulationParameter",
")",
":",
"self",
".",
"__default... | 12a01c616a47e3046323103625795fb2fca8273a |
valid | KappaApi.get_is_sim_running | Check if the current simulation is running. | python/kappy/kappa_common.py | def get_is_sim_running(self):
"""Check if the current simulation is running."""
sim_info = self.simulation_info()
try:
progress_info = sim_info['simulation_info_progress']
ret = progress_info['simulation_progress_is_running']
except KeyError: # Simulation has not... | def get_is_sim_running(self):
"""Check if the current simulation is running."""
sim_info = self.simulation_info()
try:
progress_info = sim_info['simulation_info_progress']
ret = progress_info['simulation_progress_is_running']
except KeyError: # Simulation has not... | [
"Check",
"if",
"the",
"current",
"simulation",
"is",
"running",
"."
] | Kappa-Dev/KaSim | python | https://github.com/Kappa-Dev/KaSim/blob/12a01c616a47e3046323103625795fb2fca8273a/python/kappy/kappa_common.py#L308-L316 | [
"def",
"get_is_sim_running",
"(",
"self",
")",
":",
"sim_info",
"=",
"self",
".",
"simulation_info",
"(",
")",
"try",
":",
"progress_info",
"=",
"sim_info",
"[",
"'simulation_info_progress'",
"]",
"ret",
"=",
"progress_info",
"[",
"'simulation_progress_is_running'",... | 12a01c616a47e3046323103625795fb2fca8273a |
valid | KappaApi.wait_for_simulation_stop | Block until the simulation is done or timeout seconds exceeded.
If the simulation stops before timeout, siminfo is returned. | python/kappy/kappa_common.py | def wait_for_simulation_stop(self, timeout=None):
"""Block until the simulation is done or timeout seconds exceeded.
If the simulation stops before timeout, siminfo is returned.
"""
start = datetime.now()
while self.get_is_sim_running():
sleep(0.5)
if tim... | def wait_for_simulation_stop(self, timeout=None):
"""Block until the simulation is done or timeout seconds exceeded.
If the simulation stops before timeout, siminfo is returned.
"""
start = datetime.now()
while self.get_is_sim_running():
sleep(0.5)
if tim... | [
"Block",
"until",
"the",
"simulation",
"is",
"done",
"or",
"timeout",
"seconds",
"exceeded",
"."
] | Kappa-Dev/KaSim | python | https://github.com/Kappa-Dev/KaSim/blob/12a01c616a47e3046323103625795fb2fca8273a/python/kappy/kappa_common.py#L318-L332 | [
"def",
"wait_for_simulation_stop",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"start",
"=",
"datetime",
".",
"now",
"(",
")",
"while",
"self",
".",
"get_is_sim_running",
"(",
")",
":",
"sleep",
"(",
"0.5",
")",
"if",
"timeout",
"is",
"not",
"N... | 12a01c616a47e3046323103625795fb2fca8273a |
valid | available_devices | Display available input and output audio devices along with their
port indices.
:return: Dictionary whose keys are the device index, the number of inputs and outputs, and their names.
:rtype: dict | sk_dsp_comm/pyaudio_helper.py | def available_devices():
"""
Display available input and output audio devices along with their
port indices.
:return: Dictionary whose keys are the device index, the number of inputs and outputs, and their names.
:rtype: dict
"""
devices = {}
pA = pyaudio.PyAudio()
device... | def available_devices():
"""
Display available input and output audio devices along with their
port indices.
:return: Dictionary whose keys are the device index, the number of inputs and outputs, and their names.
:rtype: dict
"""
devices = {}
pA = pyaudio.PyAudio()
device... | [
"Display",
"available",
"input",
"and",
"output",
"audio",
"devices",
"along",
"with",
"their",
"port",
"indices",
".",
":",
"return",
":",
"Dictionary",
"whose",
"keys",
"are",
"the",
"device",
"index",
"the",
"number",
"of",
"inputs",
"and",
"outputs",
"an... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/pyaudio_helper.py#L432-L449 | [
"def",
"available_devices",
"(",
")",
":",
"devices",
"=",
"{",
"}",
"pA",
"=",
"pyaudio",
".",
"PyAudio",
"(",
")",
"device_string",
"=",
"str",
"(",
")",
"for",
"k",
"in",
"range",
"(",
"pA",
".",
"get_device_count",
"(",
")",
")",
":",
"dev",
"=... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | DSP_io_stream.in_out_check | Checks the input and output to see if they are valid | sk_dsp_comm/pyaudio_helper.py | def in_out_check(self):
"""
Checks the input and output to see if they are valid
"""
devices = available_devices()
if not self.in_idx in devices:
raise OSError("Input device is unavailable")
in_check = devices[self.in_idx]
if not self... | def in_out_check(self):
"""
Checks the input and output to see if they are valid
"""
devices = available_devices()
if not self.in_idx in devices:
raise OSError("Input device is unavailable")
in_check = devices[self.in_idx]
if not self... | [
"Checks",
"the",
"input",
"and",
"output",
"to",
"see",
"if",
"they",
"are",
"valid"
] | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/pyaudio_helper.py#L94-L112 | [
"def",
"in_out_check",
"(",
"self",
")",
":",
"devices",
"=",
"available_devices",
"(",
")",
"if",
"not",
"self",
".",
"in_idx",
"in",
"devices",
":",
"raise",
"OSError",
"(",
"\"Input device is unavailable\"",
")",
"in_check",
"=",
"devices",
"[",
"self",
"... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | DSP_io_stream.interactive_stream | Stream audio with start and stop radio buttons
Interactive stream is designed for streaming audio through this object using
a callback function. This stream is threaded, so it can be used with ipywidgets.
Click on the "Start Streaming" button to start streaming and click on "Stop St... | sk_dsp_comm/pyaudio_helper.py | def interactive_stream(self,Tsec = 2, numChan = 1):
"""
Stream audio with start and stop radio buttons
Interactive stream is designed for streaming audio through this object using
a callback function. This stream is threaded, so it can be used with ipywidgets.
Clic... | def interactive_stream(self,Tsec = 2, numChan = 1):
"""
Stream audio with start and stop radio buttons
Interactive stream is designed for streaming audio through this object using
a callback function. This stream is threaded, so it can be used with ipywidgets.
Clic... | [
"Stream",
"audio",
"with",
"start",
"and",
"stop",
"radio",
"buttons",
"Interactive",
"stream",
"is",
"designed",
"for",
"streaming",
"audio",
"through",
"this",
"object",
"using",
"a",
"callback",
"function",
".",
"This",
"stream",
"is",
"threaded",
"so",
"it... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/pyaudio_helper.py#L122-L149 | [
"def",
"interactive_stream",
"(",
"self",
",",
"Tsec",
"=",
"2",
",",
"numChan",
"=",
"1",
")",
":",
"self",
".",
"Tsec",
"=",
"Tsec",
"self",
".",
"numChan",
"=",
"numChan",
"self",
".",
"interactiveFG",
"=",
"1",
"self",
".",
"play",
"=",
"interact... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | DSP_io_stream.thread_stream | Stream audio in a thread using callback. The stream is threaded, so widgets can be
used simultaneously during stream.
Parameters
----------
Tsec : stream time in seconds if Tsec > 0. If Tsec = 0, then stream goes to infinite
mode. When in infinite mode, Tsec.stop() can ... | sk_dsp_comm/pyaudio_helper.py | def thread_stream(self,Tsec = 2,numChan = 1):
"""
Stream audio in a thread using callback. The stream is threaded, so widgets can be
used simultaneously during stream.
Parameters
----------
Tsec : stream time in seconds if Tsec > 0. If Tsec = 0, then stream goes... | def thread_stream(self,Tsec = 2,numChan = 1):
"""
Stream audio in a thread using callback. The stream is threaded, so widgets can be
used simultaneously during stream.
Parameters
----------
Tsec : stream time in seconds if Tsec > 0. If Tsec = 0, then stream goes... | [
"Stream",
"audio",
"in",
"a",
"thread",
"using",
"callback",
".",
"The",
"stream",
"is",
"threaded",
"so",
"widgets",
"can",
"be",
"used",
"simultaneously",
"during",
"stream",
".",
"Parameters",
"----------",
"Tsec",
":",
"stream",
"time",
"in",
"seconds",
... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/pyaudio_helper.py#L151-L172 | [
"def",
"thread_stream",
"(",
"self",
",",
"Tsec",
"=",
"2",
",",
"numChan",
"=",
"1",
")",
":",
"def",
"stream_thread",
"(",
"time",
",",
"channel",
")",
":",
"self",
".",
"stream",
"(",
"Tsec",
"=",
"time",
",",
"numChan",
"=",
"channel",
")",
"# ... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | DSP_io_stream.stream | Stream audio using callback
Parameters
----------
Tsec : stream time in seconds if Tsec > 0. If Tsec = 0, then stream goes to infinite
mode. When in infinite mode, Tsec.stop() can be used to stop the stream.
numChan : number of channels. Use 1 for mono and 2 f... | sk_dsp_comm/pyaudio_helper.py | def stream(self,Tsec = 2,numChan = 1):
"""
Stream audio using callback
Parameters
----------
Tsec : stream time in seconds if Tsec > 0. If Tsec = 0, then stream goes to infinite
mode. When in infinite mode, Tsec.stop() can be used to stop the stream.
... | def stream(self,Tsec = 2,numChan = 1):
"""
Stream audio using callback
Parameters
----------
Tsec : stream time in seconds if Tsec > 0. If Tsec = 0, then stream goes to infinite
mode. When in infinite mode, Tsec.stop() can be used to stop the stream.
... | [
"Stream",
"audio",
"using",
"callback",
"Parameters",
"----------",
"Tsec",
":",
"stream",
"time",
"in",
"seconds",
"if",
"Tsec",
">",
"0",
".",
"If",
"Tsec",
"=",
"0",
"then",
"stream",
"goes",
"to",
"infinite",
"mode",
".",
"When",
"in",
"infinite",
"m... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/pyaudio_helper.py#L174-L241 | [
"def",
"stream",
"(",
"self",
",",
"Tsec",
"=",
"2",
",",
"numChan",
"=",
"1",
")",
":",
"self",
".",
"Tsec",
"=",
"Tsec",
"self",
".",
"numChan",
"=",
"numChan",
"self",
".",
"N_samples",
"=",
"int",
"(",
"self",
".",
"fs",
"*",
"Tsec",
")",
"... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | DSP_io_stream.DSP_capture_add_samples | Append new samples to the data_capture array and increment the sample counter
If length reaches Tcapture, then the newest samples will be kept. If Tcapture = 0
then new values are not appended to the data_capture array. | sk_dsp_comm/pyaudio_helper.py | def DSP_capture_add_samples(self,new_data):
"""
Append new samples to the data_capture array and increment the sample counter
If length reaches Tcapture, then the newest samples will be kept. If Tcapture = 0
then new values are not appended to the data_capture array.
... | def DSP_capture_add_samples(self,new_data):
"""
Append new samples to the data_capture array and increment the sample counter
If length reaches Tcapture, then the newest samples will be kept. If Tcapture = 0
then new values are not appended to the data_capture array.
... | [
"Append",
"new",
"samples",
"to",
"the",
"data_capture",
"array",
"and",
"increment",
"the",
"sample",
"counter",
"If",
"length",
"reaches",
"Tcapture",
"then",
"the",
"newest",
"samples",
"will",
"be",
"kept",
".",
"If",
"Tcapture",
"=",
"0",
"then",
"new",... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/pyaudio_helper.py#L250-L261 | [
"def",
"DSP_capture_add_samples",
"(",
"self",
",",
"new_data",
")",
":",
"self",
".",
"capture_sample_count",
"+=",
"len",
"(",
"new_data",
")",
"if",
"self",
".",
"Tcapture",
">",
"0",
":",
"self",
".",
"data_capture",
"=",
"np",
".",
"hstack",
"(",
"(... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | DSP_io_stream.DSP_capture_add_samples_stereo | Append new samples to the data_capture_left array and the data_capture_right
array and increment the sample counter. If length reaches Tcapture, then the
newest samples will be kept. If Tcapture = 0 then new values are not appended
to the data_capture array. | sk_dsp_comm/pyaudio_helper.py | def DSP_capture_add_samples_stereo(self,new_data_left,new_data_right):
"""
Append new samples to the data_capture_left array and the data_capture_right
array and increment the sample counter. If length reaches Tcapture, then the
newest samples will be kept. If Tcapture = 0 then new ... | def DSP_capture_add_samples_stereo(self,new_data_left,new_data_right):
"""
Append new samples to the data_capture_left array and the data_capture_right
array and increment the sample counter. If length reaches Tcapture, then the
newest samples will be kept. If Tcapture = 0 then new ... | [
"Append",
"new",
"samples",
"to",
"the",
"data_capture_left",
"array",
"and",
"the",
"data_capture_right",
"array",
"and",
"increment",
"the",
"sample",
"counter",
".",
"If",
"length",
"reaches",
"Tcapture",
"then",
"the",
"newest",
"samples",
"will",
"be",
"kep... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/pyaudio_helper.py#L263-L278 | [
"def",
"DSP_capture_add_samples_stereo",
"(",
"self",
",",
"new_data_left",
",",
"new_data_right",
")",
":",
"self",
".",
"capture_sample_count",
"=",
"self",
".",
"capture_sample_count",
"+",
"len",
"(",
"new_data_left",
")",
"+",
"len",
"(",
"new_data_right",
")... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | DSP_io_stream.DSP_callback_tic | Add new tic time to the DSP_tic list. Will not be called if
Tcapture = 0. | sk_dsp_comm/pyaudio_helper.py | def DSP_callback_tic(self):
"""
Add new tic time to the DSP_tic list. Will not be called if
Tcapture = 0.
"""
if self.Tcapture > 0:
self.DSP_tic.append(time.time()-self.start_time) | def DSP_callback_tic(self):
"""
Add new tic time to the DSP_tic list. Will not be called if
Tcapture = 0.
"""
if self.Tcapture > 0:
self.DSP_tic.append(time.time()-self.start_time) | [
"Add",
"new",
"tic",
"time",
"to",
"the",
"DSP_tic",
"list",
".",
"Will",
"not",
"be",
"called",
"if",
"Tcapture",
"=",
"0",
"."
] | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/pyaudio_helper.py#L281-L288 | [
"def",
"DSP_callback_tic",
"(",
"self",
")",
":",
"if",
"self",
".",
"Tcapture",
">",
"0",
":",
"self",
".",
"DSP_tic",
".",
"append",
"(",
"time",
".",
"time",
"(",
")",
"-",
"self",
".",
"start_time",
")"
] | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | DSP_io_stream.DSP_callback_toc | Add new toc time to the DSP_toc list. Will not be called if
Tcapture = 0. | sk_dsp_comm/pyaudio_helper.py | def DSP_callback_toc(self):
"""
Add new toc time to the DSP_toc list. Will not be called if
Tcapture = 0.
"""
if self.Tcapture > 0:
self.DSP_toc.append(time.time()-self.start_time) | def DSP_callback_toc(self):
"""
Add new toc time to the DSP_toc list. Will not be called if
Tcapture = 0.
"""
if self.Tcapture > 0:
self.DSP_toc.append(time.time()-self.start_time) | [
"Add",
"new",
"toc",
"time",
"to",
"the",
"DSP_toc",
"list",
".",
"Will",
"not",
"be",
"called",
"if",
"Tcapture",
"=",
"0",
"."
] | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/pyaudio_helper.py#L291-L298 | [
"def",
"DSP_callback_toc",
"(",
"self",
")",
":",
"if",
"self",
".",
"Tcapture",
">",
"0",
":",
"self",
".",
"DSP_toc",
".",
"append",
"(",
"time",
".",
"time",
"(",
")",
"-",
"self",
".",
"start_time",
")"
] | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | DSP_io_stream.stream_stats | Display basic statistics of callback execution: ideal period
between callbacks, average measured period between callbacks,
and average time spent in the callback. | sk_dsp_comm/pyaudio_helper.py | def stream_stats(self):
"""
Display basic statistics of callback execution: ideal period
between callbacks, average measured period between callbacks,
and average time spent in the callback.
"""
Tp = self.frame_length/float(self.fs)*1000
print('D... | def stream_stats(self):
"""
Display basic statistics of callback execution: ideal period
between callbacks, average measured period between callbacks,
and average time spent in the callback.
"""
Tp = self.frame_length/float(self.fs)*1000
print('D... | [
"Display",
"basic",
"statistics",
"of",
"callback",
"execution",
":",
"ideal",
"period",
"between",
"callbacks",
"average",
"measured",
"period",
"between",
"callbacks",
"and",
"average",
"time",
"spent",
"in",
"the",
"callback",
"."
] | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/pyaudio_helper.py#L301-L315 | [
"def",
"stream_stats",
"(",
"self",
")",
":",
"Tp",
"=",
"self",
".",
"frame_length",
"/",
"float",
"(",
"self",
".",
"fs",
")",
"*",
"1000",
"print",
"(",
"'Delay (latency) in Entering the Callback the First Time = %6.2f (ms)'",
"%",
"(",
"self",
".",
"DSP_tic"... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | DSP_io_stream.cb_active_plot | Plot timing information of time spent in the callback. This is similar
to what a logic analyzer provides when probing an interrupt.
cb_active_plot( start_ms,stop_ms,line_color='b') | sk_dsp_comm/pyaudio_helper.py | def cb_active_plot(self,start_ms,stop_ms,line_color='b'):
"""
Plot timing information of time spent in the callback. This is similar
to what a logic analyzer provides when probing an interrupt.
cb_active_plot( start_ms,stop_ms,line_color='b')
"""
# Find ... | def cb_active_plot(self,start_ms,stop_ms,line_color='b'):
"""
Plot timing information of time spent in the callback. This is similar
to what a logic analyzer provides when probing an interrupt.
cb_active_plot( start_ms,stop_ms,line_color='b')
"""
# Find ... | [
"Plot",
"timing",
"information",
"of",
"time",
"spent",
"in",
"the",
"callback",
".",
"This",
"is",
"similar",
"to",
"what",
"a",
"logic",
"analyzer",
"provides",
"when",
"probing",
"an",
"interrupt",
".",
"cb_active_plot",
"(",
"start_ms",
"stop_ms",
"line_co... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/pyaudio_helper.py#L318-L351 | [
"def",
"cb_active_plot",
"(",
"self",
",",
"start_ms",
",",
"stop_ms",
",",
"line_color",
"=",
"'b'",
")",
":",
"# Find bounding k values that contain the [start_ms,stop_ms]\r",
"k_min_idx",
"=",
"np",
".",
"nonzero",
"(",
"np",
".",
"ravel",
"(",
"np",
".",
"ar... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | DSP_io_stream.get_LR | Splits incoming packed stereo data into separate left and right channels
and returns an array of left samples and an array of right samples
Parameters
----------
in_data : input data from the streaming object in the callback function.
Returns
--... | sk_dsp_comm/pyaudio_helper.py | def get_LR(self,in_data):
"""
Splits incoming packed stereo data into separate left and right channels
and returns an array of left samples and an array of right samples
Parameters
----------
in_data : input data from the streaming object in the callback f... | def get_LR(self,in_data):
"""
Splits incoming packed stereo data into separate left and right channels
and returns an array of left samples and an array of right samples
Parameters
----------
in_data : input data from the streaming object in the callback f... | [
"Splits",
"incoming",
"packed",
"stereo",
"data",
"into",
"separate",
"left",
"and",
"right",
"channels",
"and",
"returns",
"an",
"array",
"of",
"left",
"samples",
"and",
"an",
"array",
"of",
"right",
"samples",
"Parameters",
"----------",
"in_data",
":",
"inp... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/pyaudio_helper.py#L353-L373 | [
"def",
"get_LR",
"(",
"self",
",",
"in_data",
")",
":",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"self",
".",
"frame_length",
"*",
"2",
")",
":",
"if",
"i",
"%",
"2",
":",
"self",
".",
"right_in",
"[",
"(",
"int",
")",
"(",
"i",
"/",
"2",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | DSP_io_stream.pack_LR | Packs separate left and right channel data into one array to output
and returns the output.
Parameters
----------
left_out : left channel array of samples going to output
right_out : right channel array of samples going to output
Returns
-------
... | sk_dsp_comm/pyaudio_helper.py | def pack_LR(self,left_out,right_out):
"""
Packs separate left and right channel data into one array to output
and returns the output.
Parameters
----------
left_out : left channel array of samples going to output
right_out : right channel array of samples... | def pack_LR(self,left_out,right_out):
"""
Packs separate left and right channel data into one array to output
and returns the output.
Parameters
----------
left_out : left channel array of samples going to output
right_out : right channel array of samples... | [
"Packs",
"separate",
"left",
"and",
"right",
"channel",
"data",
"into",
"one",
"array",
"to",
"output",
"and",
"returns",
"the",
"output",
".",
"Parameters",
"----------",
"left_out",
":",
"left",
"channel",
"array",
"of",
"samples",
"going",
"to",
"output",
... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/pyaudio_helper.py#L375-L394 | [
"def",
"pack_LR",
"(",
"self",
",",
"left_out",
",",
"right_out",
")",
":",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"self",
".",
"frame_length",
"*",
"2",
")",
":",
"if",
"i",
"%",
"2",
":",
"self",
".",
"out",
"[",
"i",
"]",
"=",
"right_out"... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | IIR_lpf | Design an IIR lowpass filter using scipy.signal.iirdesign.
The filter order is determined based on
f_pass Hz, f_stop Hz, and the desired stopband attenuation
d_stop in dB, all relative to a sampling rate of fs Hz.
Parameters
----------
f_pass : Passband critical frequency in Hz
f_... | sk_dsp_comm/iir_design_helper.py | def IIR_lpf(f_pass, f_stop, Ripple_pass, Atten_stop,
fs = 1.00, ftype = 'butter'):
"""
Design an IIR lowpass filter using scipy.signal.iirdesign.
The filter order is determined based on
f_pass Hz, f_stop Hz, and the desired stopband attenuation
d_stop in dB, all relative to a sa... | def IIR_lpf(f_pass, f_stop, Ripple_pass, Atten_stop,
fs = 1.00, ftype = 'butter'):
"""
Design an IIR lowpass filter using scipy.signal.iirdesign.
The filter order is determined based on
f_pass Hz, f_stop Hz, and the desired stopband attenuation
d_stop in dB, all relative to a sa... | [
"Design",
"an",
"IIR",
"lowpass",
"filter",
"using",
"scipy",
".",
"signal",
".",
"iirdesign",
".",
"The",
"filter",
"order",
"is",
"determined",
"based",
"on",
"f_pass",
"Hz",
"f_stop",
"Hz",
"and",
"the",
"desired",
"stopband",
"attenuation",
"d_stop",
"in... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/iir_design_helper.py#L39-L90 | [
"def",
"IIR_lpf",
"(",
"f_pass",
",",
"f_stop",
",",
"Ripple_pass",
",",
"Atten_stop",
",",
"fs",
"=",
"1.00",
",",
"ftype",
"=",
"'butter'",
")",
":",
"b",
",",
"a",
"=",
"signal",
".",
"iirdesign",
"(",
"2",
"*",
"float",
"(",
"f_pass",
")",
"/",... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | IIR_bsf | Design an IIR bandstop filter using scipy.signal.iirdesign.
The filter order is determined based on
f_pass Hz, f_stop Hz, and the desired stopband attenuation
d_stop in dB, all relative to a sampling rate of fs Hz.
Mark Wickert October 2016 | sk_dsp_comm/iir_design_helper.py | def IIR_bsf(f_pass1, f_stop1, f_stop2, f_pass2, Ripple_pass, Atten_stop,
fs = 1.00, ftype = 'butter'):
"""
Design an IIR bandstop filter using scipy.signal.iirdesign.
The filter order is determined based on
f_pass Hz, f_stop Hz, and the desired stopband attenuation
d_stop in dB,... | def IIR_bsf(f_pass1, f_stop1, f_stop2, f_pass2, Ripple_pass, Atten_stop,
fs = 1.00, ftype = 'butter'):
"""
Design an IIR bandstop filter using scipy.signal.iirdesign.
The filter order is determined based on
f_pass Hz, f_stop Hz, and the desired stopband attenuation
d_stop in dB,... | [
"Design",
"an",
"IIR",
"bandstop",
"filter",
"using",
"scipy",
".",
"signal",
".",
"iirdesign",
".",
"The",
"filter",
"order",
"is",
"determined",
"based",
"on",
"f_pass",
"Hz",
"f_stop",
"Hz",
"and",
"the",
"desired",
"stopband",
"attenuation",
"d_stop",
"i... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/iir_design_helper.py#L190-L211 | [
"def",
"IIR_bsf",
"(",
"f_pass1",
",",
"f_stop1",
",",
"f_stop2",
",",
"f_pass2",
",",
"Ripple_pass",
",",
"Atten_stop",
",",
"fs",
"=",
"1.00",
",",
"ftype",
"=",
"'butter'",
")",
":",
"b",
",",
"a",
"=",
"signal",
".",
"iirdesign",
"(",
"[",
"2",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | freqz_resp_list | A method for displaying digital filter frequency response magnitude,
phase, and group delay. A plot is produced using matplotlib
freq_resp(self,mode = 'dB',Npts = 1024)
A method for displaying the filter frequency response magnitude,
phase, and group delay. A plot is produced using matplotlib
... | sk_dsp_comm/iir_design_helper.py | def freqz_resp_list(b,a=np.array([1]),mode = 'dB',fs=1.0,Npts = 1024,fsize=(6,4)):
"""
A method for displaying digital filter frequency response magnitude,
phase, and group delay. A plot is produced using matplotlib
freq_resp(self,mode = 'dB',Npts = 1024)
A method for displaying the filter ... | def freqz_resp_list(b,a=np.array([1]),mode = 'dB',fs=1.0,Npts = 1024,fsize=(6,4)):
"""
A method for displaying digital filter frequency response magnitude,
phase, and group delay. A plot is produced using matplotlib
freq_resp(self,mode = 'dB',Npts = 1024)
A method for displaying the filter ... | [
"A",
"method",
"for",
"displaying",
"digital",
"filter",
"frequency",
"response",
"magnitude",
"phase",
"and",
"group",
"delay",
".",
"A",
"plot",
"is",
"produced",
"using",
"matplotlib",
"freq_resp",
"(",
"self",
"mode",
"=",
"dB",
"Npts",
"=",
"1024",
")",... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/iir_design_helper.py#L213-L298 | [
"def",
"freqz_resp_list",
"(",
"b",
",",
"a",
"=",
"np",
".",
"array",
"(",
"[",
"1",
"]",
")",
",",
"mode",
"=",
"'dB'",
",",
"fs",
"=",
"1.0",
",",
"Npts",
"=",
"1024",
",",
"fsize",
"=",
"(",
"6",
",",
"4",
")",
")",
":",
"if",
"type",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | freqz_cas | Cascade frequency response
Mark Wickert October 2016 | sk_dsp_comm/iir_design_helper.py | def freqz_cas(sos,w):
"""
Cascade frequency response
Mark Wickert October 2016
"""
Ns,Mcol = sos.shape
w,Hcas = signal.freqz(sos[0,:3],sos[0,3:],w)
for k in range(1,Ns):
w,Htemp = signal.freqz(sos[k,:3],sos[k,3:],w)
Hcas *= Htemp
return w, Hcas | def freqz_cas(sos,w):
"""
Cascade frequency response
Mark Wickert October 2016
"""
Ns,Mcol = sos.shape
w,Hcas = signal.freqz(sos[0,:3],sos[0,3:],w)
for k in range(1,Ns):
w,Htemp = signal.freqz(sos[k,:3],sos[k,3:],w)
Hcas *= Htemp
return w, Hcas | [
"Cascade",
"frequency",
"response",
"Mark",
"Wickert",
"October",
"2016"
] | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/iir_design_helper.py#L301-L312 | [
"def",
"freqz_cas",
"(",
"sos",
",",
"w",
")",
":",
"Ns",
",",
"Mcol",
"=",
"sos",
".",
"shape",
"w",
",",
"Hcas",
"=",
"signal",
".",
"freqz",
"(",
"sos",
"[",
"0",
",",
":",
"3",
"]",
",",
"sos",
"[",
"0",
",",
"3",
":",
"]",
",",
"w",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | unique_cpx_roots | The average of the root values is used when multiplicity
is greater than one.
Mark Wickert October 2016 | sk_dsp_comm/iir_design_helper.py | def unique_cpx_roots(rlist,tol = 0.001):
"""
The average of the root values is used when multiplicity
is greater than one.
Mark Wickert October 2016
"""
uniq = [rlist[0]]
mult = [1]
for k in range(1,len(rlist)):
N_uniq = len(uniq)
for m in range(N_uniq)... | def unique_cpx_roots(rlist,tol = 0.001):
"""
The average of the root values is used when multiplicity
is greater than one.
Mark Wickert October 2016
"""
uniq = [rlist[0]]
mult = [1]
for k in range(1,len(rlist)):
N_uniq = len(uniq)
for m in range(N_uniq)... | [
"The",
"average",
"of",
"the",
"root",
"values",
"is",
"used",
"when",
"multiplicity",
"is",
"greater",
"than",
"one",
".",
"Mark",
"Wickert",
"October",
"2016"
] | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/iir_design_helper.py#L403-L422 | [
"def",
"unique_cpx_roots",
"(",
"rlist",
",",
"tol",
"=",
"0.001",
")",
":",
"uniq",
"=",
"[",
"rlist",
"[",
"0",
"]",
"]",
"mult",
"=",
"[",
"1",
"]",
"for",
"k",
"in",
"range",
"(",
"1",
",",
"len",
"(",
"rlist",
")",
")",
":",
"N_uniq",
"=... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | sos_zplane | Create an z-plane pole-zero plot.
Create an z-plane pole-zero plot using the numerator
and denominator z-domain system function coefficient
ndarrays b and a respectively. Assume descending powers of z.
Parameters
----------
sos : ndarray of the sos coefficients
auto_scale : bool (... | sk_dsp_comm/iir_design_helper.py | def sos_zplane(sos,auto_scale=True,size=2,tol = 0.001):
"""
Create an z-plane pole-zero plot.
Create an z-plane pole-zero plot using the numerator
and denominator z-domain system function coefficient
ndarrays b and a respectively. Assume descending powers of z.
Parameters
--------... | def sos_zplane(sos,auto_scale=True,size=2,tol = 0.001):
"""
Create an z-plane pole-zero plot.
Create an z-plane pole-zero plot using the numerator
and denominator z-domain system function coefficient
ndarrays b and a respectively. Assume descending powers of z.
Parameters
--------... | [
"Create",
"an",
"z",
"-",
"plane",
"pole",
"-",
"zero",
"plot",
".",
"Create",
"an",
"z",
"-",
"plane",
"pole",
"-",
"zero",
"plot",
"using",
"the",
"numerator",
"and",
"denominator",
"z",
"-",
"domain",
"system",
"function",
"coefficient",
"ndarrays",
"... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/iir_design_helper.py#L433-L536 | [
"def",
"sos_zplane",
"(",
"sos",
",",
"auto_scale",
"=",
"True",
",",
"size",
"=",
"2",
",",
"tol",
"=",
"0.001",
")",
":",
"Ns",
",",
"Mcol",
"=",
"sos",
".",
"shape",
"# Extract roots from sos num and den removing z = 0\r",
"# roots due to first-order sections\r... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | firwin_bpf | Design a windowed FIR bandpass filter in terms of passband
critical frequencies f1 < f2 in Hz relative to sampling rate
fs in Hz. The number of taps must be provided.
Mark Wickert October 2016 | sk_dsp_comm/fir_design_helper.py | def firwin_bpf(N_taps, f1, f2, fs = 1.0, pass_zero=False):
"""
Design a windowed FIR bandpass filter in terms of passband
critical frequencies f1 < f2 in Hz relative to sampling rate
fs in Hz. The number of taps must be provided.
Mark Wickert October 2016
"""
return signal.firwin(N_... | def firwin_bpf(N_taps, f1, f2, fs = 1.0, pass_zero=False):
"""
Design a windowed FIR bandpass filter in terms of passband
critical frequencies f1 < f2 in Hz relative to sampling rate
fs in Hz. The number of taps must be provided.
Mark Wickert October 2016
"""
return signal.firwin(N_... | [
"Design",
"a",
"windowed",
"FIR",
"bandpass",
"filter",
"in",
"terms",
"of",
"passband",
"critical",
"frequencies",
"f1",
"<",
"f2",
"in",
"Hz",
"relative",
"to",
"sampling",
"rate",
"fs",
"in",
"Hz",
".",
"The",
"number",
"of",
"taps",
"must",
"be",
"pr... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/fir_design_helper.py#L48-L56 | [
"def",
"firwin_bpf",
"(",
"N_taps",
",",
"f1",
",",
"f2",
",",
"fs",
"=",
"1.0",
",",
"pass_zero",
"=",
"False",
")",
":",
"return",
"signal",
".",
"firwin",
"(",
"N_taps",
",",
"2",
"*",
"(",
"f1",
",",
"f2",
")",
"/",
"fs",
",",
"pass_zero",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | firwin_kaiser_lpf | Design an FIR lowpass filter using the sinc() kernel and
a Kaiser window. The filter order is determined based on
f_pass Hz, f_stop Hz, and the desired stopband attenuation
d_stop in dB, all relative to a sampling rate of fs Hz.
Note: the passband ripple cannot be set independent of the
stopba... | sk_dsp_comm/fir_design_helper.py | def firwin_kaiser_lpf(f_pass, f_stop, d_stop, fs = 1.0, N_bump=0):
"""
Design an FIR lowpass filter using the sinc() kernel and
a Kaiser window. The filter order is determined based on
f_pass Hz, f_stop Hz, and the desired stopband attenuation
d_stop in dB, all relative to a sampling rate of f... | def firwin_kaiser_lpf(f_pass, f_stop, d_stop, fs = 1.0, N_bump=0):
"""
Design an FIR lowpass filter using the sinc() kernel and
a Kaiser window. The filter order is determined based on
f_pass Hz, f_stop Hz, and the desired stopband attenuation
d_stop in dB, all relative to a sampling rate of f... | [
"Design",
"an",
"FIR",
"lowpass",
"filter",
"using",
"the",
"sinc",
"()",
"kernel",
"and",
"a",
"Kaiser",
"window",
".",
"The",
"filter",
"order",
"is",
"determined",
"based",
"on",
"f_pass",
"Hz",
"f_stop",
"Hz",
"and",
"the",
"desired",
"stopband",
"atte... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/fir_design_helper.py#L59-L84 | [
"def",
"firwin_kaiser_lpf",
"(",
"f_pass",
",",
"f_stop",
",",
"d_stop",
",",
"fs",
"=",
"1.0",
",",
"N_bump",
"=",
"0",
")",
":",
"wc",
"=",
"2",
"*",
"np",
".",
"pi",
"*",
"(",
"f_pass",
"+",
"f_stop",
")",
"/",
"2",
"/",
"fs",
"delta_w",
"="... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | firwin_kaiser_bpf | Design an FIR bandpass filter using the sinc() kernel and
a Kaiser window. The filter order is determined based on
f_stop1 Hz, f_pass1 Hz, f_pass2 Hz, f_stop2 Hz, and the
desired stopband attenuation d_stop in dB for both stopbands,
all relative to a sampling rate of fs Hz.
Note: the passband... | sk_dsp_comm/fir_design_helper.py | def firwin_kaiser_bpf(f_stop1, f_pass1, f_pass2, f_stop2, d_stop,
fs = 1.0, N_bump=0):
"""
Design an FIR bandpass filter using the sinc() kernel and
a Kaiser window. The filter order is determined based on
f_stop1 Hz, f_pass1 Hz, f_pass2 Hz, f_stop2 Hz, and the
desired... | def firwin_kaiser_bpf(f_stop1, f_pass1, f_pass2, f_stop2, d_stop,
fs = 1.0, N_bump=0):
"""
Design an FIR bandpass filter using the sinc() kernel and
a Kaiser window. The filter order is determined based on
f_stop1 Hz, f_pass1 Hz, f_pass2 Hz, f_stop2 Hz, and the
desired... | [
"Design",
"an",
"FIR",
"bandpass",
"filter",
"using",
"the",
"sinc",
"()",
"kernel",
"and",
"a",
"Kaiser",
"window",
".",
"The",
"filter",
"order",
"is",
"determined",
"based",
"on",
"f_stop1",
"Hz",
"f_pass1",
"Hz",
"f_pass2",
"Hz",
"f_stop2",
"Hz",
"and"... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/fir_design_helper.py#L122-L161 | [
"def",
"firwin_kaiser_bpf",
"(",
"f_stop1",
",",
"f_pass1",
",",
"f_pass2",
",",
"f_stop2",
",",
"d_stop",
",",
"fs",
"=",
"1.0",
",",
"N_bump",
"=",
"0",
")",
":",
"# Design BPF starting from simple LPF equivalent\r",
"# The upper and lower stopbands are assumed to hav... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | lowpass_order | Optimal FIR (equal ripple) Lowpass Order Determination
Text reference: Ifeachor, Digital Signal Processing a Practical Approach,
second edition, Prentice Hall, 2002.
Journal paper reference: Herriman et al., Practical Design Rules for Optimum
Finite Imulse Response Digitl Filters, Bell Syst. ... | sk_dsp_comm/fir_design_helper.py | def lowpass_order(f_pass, f_stop, dpass_dB, dstop_dB, fsamp = 1):
"""
Optimal FIR (equal ripple) Lowpass Order Determination
Text reference: Ifeachor, Digital Signal Processing a Practical Approach,
second edition, Prentice Hall, 2002.
Journal paper reference: Herriman et al., Practical ... | def lowpass_order(f_pass, f_stop, dpass_dB, dstop_dB, fsamp = 1):
"""
Optimal FIR (equal ripple) Lowpass Order Determination
Text reference: Ifeachor, Digital Signal Processing a Practical Approach,
second edition, Prentice Hall, 2002.
Journal paper reference: Herriman et al., Practical ... | [
"Optimal",
"FIR",
"(",
"equal",
"ripple",
")",
"Lowpass",
"Order",
"Determination",
"Text",
"reference",
":",
"Ifeachor",
"Digital",
"Signal",
"Processing",
"a",
"Practical",
"Approach",
"second",
"edition",
"Prentice",
"Hall",
"2002",
".",
"Journal",
"paper",
"... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/fir_design_helper.py#L214-L241 | [
"def",
"lowpass_order",
"(",
"f_pass",
",",
"f_stop",
",",
"dpass_dB",
",",
"dstop_dB",
",",
"fsamp",
"=",
"1",
")",
":",
"dpass",
"=",
"1",
"-",
"10",
"**",
"(",
"-",
"dpass_dB",
"/",
"20",
")",
"dstop",
"=",
"10",
"**",
"(",
"-",
"dstop_dB",
"/... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | bandpass_order | Optimal FIR (equal ripple) Bandpass Order Determination
Text reference: Ifeachor, Digital Signal Processing a Practical Approach,
second edition, Prentice Hall, 2002.
Journal paper reference: F. Mintzer & B. Liu, Practical Design Rules for Optimum
FIR Bandpass Digital Filters, IEEE Transactio... | sk_dsp_comm/fir_design_helper.py | def bandpass_order(f_stop1, f_pass1, f_pass2, f_stop2, dpass_dB, dstop_dB, fsamp = 1):
"""
Optimal FIR (equal ripple) Bandpass Order Determination
Text reference: Ifeachor, Digital Signal Processing a Practical Approach,
second edition, Prentice Hall, 2002.
Journal paper reference: F. Mi... | def bandpass_order(f_stop1, f_pass1, f_pass2, f_stop2, dpass_dB, dstop_dB, fsamp = 1):
"""
Optimal FIR (equal ripple) Bandpass Order Determination
Text reference: Ifeachor, Digital Signal Processing a Practical Approach,
second edition, Prentice Hall, 2002.
Journal paper reference: F. Mi... | [
"Optimal",
"FIR",
"(",
"equal",
"ripple",
")",
"Bandpass",
"Order",
"Determination",
"Text",
"reference",
":",
"Ifeachor",
"Digital",
"Signal",
"Processing",
"a",
"Practical",
"Approach",
"second",
"edition",
"Prentice",
"Hall",
"2002",
".",
"Journal",
"paper",
... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/fir_design_helper.py#L244-L273 | [
"def",
"bandpass_order",
"(",
"f_stop1",
",",
"f_pass1",
",",
"f_pass2",
",",
"f_stop2",
",",
"dpass_dB",
",",
"dstop_dB",
",",
"fsamp",
"=",
"1",
")",
":",
"dpass",
"=",
"1",
"-",
"10",
"**",
"(",
"-",
"dpass_dB",
"/",
"20",
")",
"dstop",
"=",
"10... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | fir_remez_lpf | Design an FIR lowpass filter using remez with order
determination. The filter order is determined based on
f_pass Hz, fstop Hz, and the desired passband ripple
d_pass dB and stopband attenuation d_stop dB all
relative to a sampling rate of fs Hz.
Mark Wickert October 2016, updated October ... | sk_dsp_comm/fir_design_helper.py | def fir_remez_lpf(f_pass, f_stop, d_pass, d_stop, fs = 1.0, N_bump=5):
"""
Design an FIR lowpass filter using remez with order
determination. The filter order is determined based on
f_pass Hz, fstop Hz, and the desired passband ripple
d_pass dB and stopband attenuation d_stop dB all
rel... | def fir_remez_lpf(f_pass, f_stop, d_pass, d_stop, fs = 1.0, N_bump=5):
"""
Design an FIR lowpass filter using remez with order
determination. The filter order is determined based on
f_pass Hz, fstop Hz, and the desired passband ripple
d_pass dB and stopband attenuation d_stop dB all
rel... | [
"Design",
"an",
"FIR",
"lowpass",
"filter",
"using",
"remez",
"with",
"order",
"determination",
".",
"The",
"filter",
"order",
"is",
"determined",
"based",
"on",
"f_pass",
"Hz",
"fstop",
"Hz",
"and",
"the",
"desired",
"passband",
"ripple",
"d_pass",
"dB",
"a... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/fir_design_helper.py#L308-L324 | [
"def",
"fir_remez_lpf",
"(",
"f_pass",
",",
"f_stop",
",",
"d_pass",
",",
"d_stop",
",",
"fs",
"=",
"1.0",
",",
"N_bump",
"=",
"5",
")",
":",
"n",
",",
"ff",
",",
"aa",
",",
"wts",
"=",
"lowpass_order",
"(",
"f_pass",
",",
"f_stop",
",",
"d_pass",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | fir_remez_hpf | Design an FIR highpass filter using remez with order
determination. The filter order is determined based on
f_pass Hz, fstop Hz, and the desired passband ripple
d_pass dB and stopband attenuation d_stop dB all
relative to a sampling rate of fs Hz.
Mark Wickert October 2016, updated October... | sk_dsp_comm/fir_design_helper.py | def fir_remez_hpf(f_stop, f_pass, d_pass, d_stop, fs = 1.0, N_bump=5):
"""
Design an FIR highpass filter using remez with order
determination. The filter order is determined based on
f_pass Hz, fstop Hz, and the desired passband ripple
d_pass dB and stopband attenuation d_stop dB all
re... | def fir_remez_hpf(f_stop, f_pass, d_pass, d_stop, fs = 1.0, N_bump=5):
"""
Design an FIR highpass filter using remez with order
determination. The filter order is determined based on
f_pass Hz, fstop Hz, and the desired passband ripple
d_pass dB and stopband attenuation d_stop dB all
re... | [
"Design",
"an",
"FIR",
"highpass",
"filter",
"using",
"remez",
"with",
"order",
"determination",
".",
"The",
"filter",
"order",
"is",
"determined",
"based",
"on",
"f_pass",
"Hz",
"fstop",
"Hz",
"and",
"the",
"desired",
"passband",
"ripple",
"d_pass",
"dB",
"... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/fir_design_helper.py#L327-L350 | [
"def",
"fir_remez_hpf",
"(",
"f_stop",
",",
"f_pass",
",",
"d_pass",
",",
"d_stop",
",",
"fs",
"=",
"1.0",
",",
"N_bump",
"=",
"5",
")",
":",
"# Transform HPF critical frequencies to lowpass equivalent\r",
"f_pass_eq",
"=",
"fs",
"/",
"2.",
"-",
"f_pass",
"f_s... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | fir_remez_bpf | Design an FIR bandpass filter using remez with order
determination. The filter order is determined based on
f_stop1 Hz, f_pass1 Hz, f_pass2 Hz, f_stop2 Hz, and the
desired passband ripple d_pass dB and stopband attenuation
d_stop dB all relative to a sampling rate of fs Hz.
Mark Wickert Oct... | sk_dsp_comm/fir_design_helper.py | def fir_remez_bpf(f_stop1, f_pass1, f_pass2, f_stop2, d_pass, d_stop,
fs = 1.0, N_bump=5):
"""
Design an FIR bandpass filter using remez with order
determination. The filter order is determined based on
f_stop1 Hz, f_pass1 Hz, f_pass2 Hz, f_stop2 Hz, and the
desired passba... | def fir_remez_bpf(f_stop1, f_pass1, f_pass2, f_stop2, d_pass, d_stop,
fs = 1.0, N_bump=5):
"""
Design an FIR bandpass filter using remez with order
determination. The filter order is determined based on
f_stop1 Hz, f_pass1 Hz, f_pass2 Hz, f_stop2 Hz, and the
desired passba... | [
"Design",
"an",
"FIR",
"bandpass",
"filter",
"using",
"remez",
"with",
"order",
"determination",
".",
"The",
"filter",
"order",
"is",
"determined",
"based",
"on",
"f_stop1",
"Hz",
"f_pass1",
"Hz",
"f_pass2",
"Hz",
"f_stop2",
"Hz",
"and",
"the",
"desired",
"p... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/fir_design_helper.py#L353-L371 | [
"def",
"fir_remez_bpf",
"(",
"f_stop1",
",",
"f_pass1",
",",
"f_pass2",
",",
"f_stop2",
",",
"d_pass",
",",
"d_stop",
",",
"fs",
"=",
"1.0",
",",
"N_bump",
"=",
"5",
")",
":",
"n",
",",
"ff",
",",
"aa",
",",
"wts",
"=",
"bandpass_order",
"(",
"f_st... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | fir_remez_bsf | Design an FIR bandstop filter using remez with order
determination. The filter order is determined based on
f_pass1 Hz, f_stop1 Hz, f_stop2 Hz, f_pass2 Hz, and the
desired passband ripple d_pass dB and stopband attenuation
d_stop dB all relative to a sampling rate of fs Hz.
Mark Wickert Oct... | sk_dsp_comm/fir_design_helper.py | def fir_remez_bsf(f_pass1, f_stop1, f_stop2, f_pass2, d_pass, d_stop,
fs = 1.0, N_bump=5):
"""
Design an FIR bandstop filter using remez with order
determination. The filter order is determined based on
f_pass1 Hz, f_stop1 Hz, f_stop2 Hz, f_pass2 Hz, and the
desired passba... | def fir_remez_bsf(f_pass1, f_stop1, f_stop2, f_pass2, d_pass, d_stop,
fs = 1.0, N_bump=5):
"""
Design an FIR bandstop filter using remez with order
determination. The filter order is determined based on
f_pass1 Hz, f_stop1 Hz, f_stop2 Hz, f_pass2 Hz, and the
desired passba... | [
"Design",
"an",
"FIR",
"bandstop",
"filter",
"using",
"remez",
"with",
"order",
"determination",
".",
"The",
"filter",
"order",
"is",
"determined",
"based",
"on",
"f_pass1",
"Hz",
"f_stop1",
"Hz",
"f_stop2",
"Hz",
"f_pass2",
"Hz",
"and",
"the",
"desired",
"p... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/fir_design_helper.py#L373-L396 | [
"def",
"fir_remez_bsf",
"(",
"f_pass1",
",",
"f_stop1",
",",
"f_stop2",
",",
"f_pass2",
",",
"d_pass",
",",
"d_stop",
",",
"fs",
"=",
"1.0",
",",
"N_bump",
"=",
"5",
")",
":",
"n",
",",
"ff",
",",
"aa",
",",
"wts",
"=",
"bandstop_order",
"(",
"f_pa... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | CIC | A functional form implementation of a cascade of integrator comb (CIC) filters.
Parameters
----------
M : Effective number of taps per section (typically the decimation factor).
K : The number of CIC sections cascaded (larger K gives the filter a wider image rejection bandwidth).
Returns
-----... | sk_dsp_comm/sigsys.py | def CIC(M, K):
"""
A functional form implementation of a cascade of integrator comb (CIC) filters.
Parameters
----------
M : Effective number of taps per section (typically the decimation factor).
K : The number of CIC sections cascaded (larger K gives the filter a wider image rejection bandwid... | def CIC(M, K):
"""
A functional form implementation of a cascade of integrator comb (CIC) filters.
Parameters
----------
M : Effective number of taps per section (typically the decimation factor).
K : The number of CIC sections cascaded (larger K gives the filter a wider image rejection bandwid... | [
"A",
"functional",
"form",
"implementation",
"of",
"a",
"cascade",
"of",
"integrator",
"comb",
"(",
"CIC",
")",
"filters",
"."
] | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/sigsys.py#L61-L92 | [
"def",
"CIC",
"(",
"M",
",",
"K",
")",
":",
"if",
"K",
"==",
"1",
":",
"b",
"=",
"np",
".",
"ones",
"(",
"M",
")",
"else",
":",
"h",
"=",
"np",
".",
"ones",
"(",
"M",
")",
"b",
"=",
"h",
"for",
"i",
"in",
"range",
"(",
"1",
",",
"K",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | ten_band_eq_filt | Filter the input signal x with a ten-band equalizer having octave gain values in ndarray GdB.
The signal x is filtered using octave-spaced peaking filters starting at 31.25 Hz and
stopping at 16 kHz. The Q of each filter is 3.5, but can be changed. The sampling rate
is assumed to be 44.1 kHz.
... | sk_dsp_comm/sigsys.py | def ten_band_eq_filt(x,GdB,Q=3.5):
"""
Filter the input signal x with a ten-band equalizer having octave gain values in ndarray GdB.
The signal x is filtered using octave-spaced peaking filters starting at 31.25 Hz and
stopping at 16 kHz. The Q of each filter is 3.5, but can be changed. The samplin... | def ten_band_eq_filt(x,GdB,Q=3.5):
"""
Filter the input signal x with a ten-band equalizer having octave gain values in ndarray GdB.
The signal x is filtered using octave-spaced peaking filters starting at 31.25 Hz and
stopping at 16 kHz. The Q of each filter is 3.5, but can be changed. The samplin... | [
"Filter",
"the",
"input",
"signal",
"x",
"with",
"a",
"ten",
"-",
"band",
"equalizer",
"having",
"octave",
"gain",
"values",
"in",
"ndarray",
"GdB",
".",
"The",
"signal",
"x",
"is",
"filtered",
"using",
"octave",
"-",
"spaced",
"peaking",
"filters",
"start... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/sigsys.py#L94-L139 | [
"def",
"ten_band_eq_filt",
"(",
"x",
",",
"GdB",
",",
"Q",
"=",
"3.5",
")",
":",
"fs",
"=",
"44100.0",
"# Hz",
"NB",
"=",
"len",
"(",
"GdB",
")",
"if",
"not",
"NB",
"==",
"10",
":",
"raise",
"ValueError",
"(",
"\"GdB length not equal to ten\"",
")",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | ten_band_eq_resp | Create a frequency response magnitude plot in dB of a ten band equalizer
using a semilogplot (semilogx()) type plot
Parameters
----------
GdB : Gain vector for 10 peaking filters [G0,...,G9]
Q : Quality factor for each peaking filter (default 3.5)
Returns
-------
Nothing :... | sk_dsp_comm/sigsys.py | def ten_band_eq_resp(GdB,Q=3.5):
"""
Create a frequency response magnitude plot in dB of a ten band equalizer
using a semilogplot (semilogx()) type plot
Parameters
----------
GdB : Gain vector for 10 peaking filters [G0,...,G9]
Q : Quality factor for each peaking filter (default 3.... | def ten_band_eq_resp(GdB,Q=3.5):
"""
Create a frequency response magnitude plot in dB of a ten band equalizer
using a semilogplot (semilogx()) type plot
Parameters
----------
GdB : Gain vector for 10 peaking filters [G0,...,G9]
Q : Quality factor for each peaking filter (default 3.... | [
"Create",
"a",
"frequency",
"response",
"magnitude",
"plot",
"in",
"dB",
"of",
"a",
"ten",
"band",
"equalizer",
"using",
"a",
"semilogplot",
"(",
"semilogx",
"()",
")",
"type",
"plot",
"Parameters",
"----------",
"GdB",
":",
"Gain",
"vector",
"for",
"10",
... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/sigsys.py#L142-L197 | [
"def",
"ten_band_eq_resp",
"(",
"GdB",
",",
"Q",
"=",
"3.5",
")",
":",
"fs",
"=",
"44100.0",
"# Hz",
"NB",
"=",
"len",
"(",
"GdB",
")",
"if",
"not",
"NB",
"==",
"10",
":",
"raise",
"ValueError",
"(",
"\"GdB length not equal to ten\"",
")",
"Fc",
"=",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | peaking | A second-order peaking filter having GdB gain at fc and approximately
and 0 dB otherwise.
The filter coefficients returns correspond to a biquadratic system function
containing five parameters.
Parameters
----------
GdB : Lowpass gain in dB
fc : Center frequency in Hz
Q : Filte... | sk_dsp_comm/sigsys.py | def peaking(GdB, fc, Q=3.5, fs=44100.):
"""
A second-order peaking filter having GdB gain at fc and approximately
and 0 dB otherwise.
The filter coefficients returns correspond to a biquadratic system function
containing five parameters.
Parameters
----------
GdB : Lowpass gain... | def peaking(GdB, fc, Q=3.5, fs=44100.):
"""
A second-order peaking filter having GdB gain at fc and approximately
and 0 dB otherwise.
The filter coefficients returns correspond to a biquadratic system function
containing five parameters.
Parameters
----------
GdB : Lowpass gain... | [
"A",
"second",
"-",
"order",
"peaking",
"filter",
"having",
"GdB",
"gain",
"at",
"fc",
"and",
"approximately",
"and",
"0",
"dB",
"otherwise",
".",
"The",
"filter",
"coefficients",
"returns",
"correspond",
"to",
"a",
"biquadratic",
"system",
"function",
"contai... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/sigsys.py#L200-L249 | [
"def",
"peaking",
"(",
"GdB",
",",
"fc",
",",
"Q",
"=",
"3.5",
",",
"fs",
"=",
"44100.",
")",
":",
"mu",
"=",
"10",
"**",
"(",
"GdB",
"/",
"20.",
")",
"kq",
"=",
"4",
"/",
"(",
"1",
"+",
"mu",
")",
"*",
"np",
".",
"tan",
"(",
"2",
"*",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | ex6_2 | Generate a triangle pulse as described in Example 6-2
of Chapter 6.
You need to supply an index array n that covers at least [-2, 5].
The function returns the hard-coded signal of the example.
Parameters
----------
n : time index ndarray covering at least -2 to +5.
Returns
... | sk_dsp_comm/sigsys.py | def ex6_2(n):
"""
Generate a triangle pulse as described in Example 6-2
of Chapter 6.
You need to supply an index array n that covers at least [-2, 5].
The function returns the hard-coded signal of the example.
Parameters
----------
n : time index ndarray covering at least -2 ... | def ex6_2(n):
"""
Generate a triangle pulse as described in Example 6-2
of Chapter 6.
You need to supply an index array n that covers at least [-2, 5].
The function returns the hard-coded signal of the example.
Parameters
----------
n : time index ndarray covering at least -2 ... | [
"Generate",
"a",
"triangle",
"pulse",
"as",
"described",
"in",
"Example",
"6",
"-",
"2",
"of",
"Chapter",
"6",
".",
"You",
"need",
"to",
"supply",
"an",
"index",
"array",
"n",
"that",
"covers",
"at",
"least",
"[",
"-",
"2",
"5",
"]",
".",
"The",
"f... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/sigsys.py#L252-L281 | [
"def",
"ex6_2",
"(",
"n",
")",
":",
"x",
"=",
"np",
".",
"zeros",
"(",
"len",
"(",
"n",
")",
")",
"for",
"k",
",",
"nn",
"in",
"enumerate",
"(",
"n",
")",
":",
"if",
"nn",
">=",
"-",
"2",
"and",
"nn",
"<=",
"5",
":",
"x",
"[",
"k",
"]",... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | position_CD | CD sled position control case study of Chapter 18.
The function returns the closed-loop and open-loop
system function for a CD/DVD sled position control
system. The loop amplifier gain is the only variable
that may be changed. The returned system function can
however be changed.
Parameters
... | sk_dsp_comm/sigsys.py | def position_CD(Ka,out_type = 'fb_exact'):
"""
CD sled position control case study of Chapter 18.
The function returns the closed-loop and open-loop
system function for a CD/DVD sled position control
system. The loop amplifier gain is the only variable
that may be changed. The returned system f... | def position_CD(Ka,out_type = 'fb_exact'):
"""
CD sled position control case study of Chapter 18.
The function returns the closed-loop and open-loop
system function for a CD/DVD sled position control
system. The loop amplifier gain is the only variable
that may be changed. The returned system f... | [
"CD",
"sled",
"position",
"control",
"case",
"study",
"of",
"Chapter",
"18",
"."
] | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/sigsys.py#L284-L329 | [
"def",
"position_CD",
"(",
"Ka",
",",
"out_type",
"=",
"'fb_exact'",
")",
":",
"rs",
"=",
"10",
"/",
"(",
"2",
"*",
"np",
".",
"pi",
")",
"# Load b and a ndarrays with the coefficients",
"if",
"out_type",
".",
"lower",
"(",
")",
"==",
"'open_loop'",
":",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | cruise_control | Cruise control with PI controller and hill disturbance.
This function returns various system function configurations
for a the cruise control Case Study example found in
the supplementary article. The plant model is obtained by the
linearizing the equations of motion and the controller contains a
... | sk_dsp_comm/sigsys.py | def cruise_control(wn,zeta,T,vcruise,vmax,tf_mode='H'):
"""
Cruise control with PI controller and hill disturbance.
This function returns various system function configurations
for a the cruise control Case Study example found in
the supplementary article. The plant model is obtained by the
li... | def cruise_control(wn,zeta,T,vcruise,vmax,tf_mode='H'):
"""
Cruise control with PI controller and hill disturbance.
This function returns various system function configurations
for a the cruise control Case Study example found in
the supplementary article. The plant model is obtained by the
li... | [
"Cruise",
"control",
"with",
"PI",
"controller",
"and",
"hill",
"disturbance",
"."
] | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/sigsys.py#L332-L388 | [
"def",
"cruise_control",
"(",
"wn",
",",
"zeta",
",",
"T",
",",
"vcruise",
",",
"vmax",
",",
"tf_mode",
"=",
"'H'",
")",
":",
"tau",
"=",
"T",
"/",
"2.",
"*",
"vmax",
"/",
"vcruise",
"g",
"=",
"9.8",
"g",
"*=",
"3",
"*",
"60",
"**",
"2",
"/",... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | splane | Create an s-plane pole-zero plot.
As input the function uses the numerator and denominator
s-domain system function coefficient ndarrays b and a respectively.
Assumed to be stored in descending powers of s.
Parameters
----------
b : numerator coefficient ndarray.
a : denominator... | sk_dsp_comm/sigsys.py | def splane(b,a,auto_scale=True,size=[-1,1,-1,1]):
"""
Create an s-plane pole-zero plot.
As input the function uses the numerator and denominator
s-domain system function coefficient ndarrays b and a respectively.
Assumed to be stored in descending powers of s.
Parameters
--------... | def splane(b,a,auto_scale=True,size=[-1,1,-1,1]):
"""
Create an s-plane pole-zero plot.
As input the function uses the numerator and denominator
s-domain system function coefficient ndarrays b and a respectively.
Assumed to be stored in descending powers of s.
Parameters
--------... | [
"Create",
"an",
"s",
"-",
"plane",
"pole",
"-",
"zero",
"plot",
".",
"As",
"input",
"the",
"function",
"uses",
"the",
"numerator",
"and",
"denominator",
"s",
"-",
"domain",
"system",
"function",
"coefficient",
"ndarrays",
"b",
"and",
"a",
"respectively",
"... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/sigsys.py#L391-L471 | [
"def",
"splane",
"(",
"b",
",",
"a",
",",
"auto_scale",
"=",
"True",
",",
"size",
"=",
"[",
"-",
"1",
",",
"1",
",",
"-",
"1",
",",
"1",
"]",
")",
":",
"M",
"=",
"len",
"(",
"b",
")",
"-",
"1",
"N",
"=",
"len",
"(",
"a",
")",
"-",
"1"... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | OS_filter | Overlap and save transform domain FIR filtering.
This function implements the classical overlap and save method of
transform domain filtering using a length P FIR filter.
Parameters
----------
x : input signal to be filtered as an ndarray
h : FIR filter coefficients as an ndarray of le... | sk_dsp_comm/sigsys.py | def OS_filter(x,h,N,mode=0):
"""
Overlap and save transform domain FIR filtering.
This function implements the classical overlap and save method of
transform domain filtering using a length P FIR filter.
Parameters
----------
x : input signal to be filtered as an ndarray
h : FI... | def OS_filter(x,h,N,mode=0):
"""
Overlap and save transform domain FIR filtering.
This function implements the classical overlap and save method of
transform domain filtering using a length P FIR filter.
Parameters
----------
x : input signal to be filtered as an ndarray
h : FI... | [
"Overlap",
"and",
"save",
"transform",
"domain",
"FIR",
"filtering",
".",
"This",
"function",
"implements",
"the",
"classical",
"overlap",
"and",
"save",
"method",
"of",
"transform",
"domain",
"filtering",
"using",
"a",
"length",
"P",
"FIR",
"filter",
".",
"Pa... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/sigsys.py#L474-L531 | [
"def",
"OS_filter",
"(",
"x",
",",
"h",
",",
"N",
",",
"mode",
"=",
"0",
")",
":",
"P",
"=",
"len",
"(",
"h",
")",
"# zero pad start of x so first frame can recover first true samples of x",
"x",
"=",
"np",
".",
"hstack",
"(",
"(",
"np",
".",
"zeros",
"(... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | lp_samp | Lowpass sampling theorem plotting function.
Display the spectrum of a sampled signal after setting the bandwidth,
sampling frequency, maximum display frequency, and spectral shape.
Parameters
----------
fb : spectrum lowpass bandwidth in Hz
fs : sampling frequency in Hz
fmax : plo... | sk_dsp_comm/sigsys.py | def lp_samp(fb,fs,fmax,N,shape='tri',fsize=(6,4)):
"""
Lowpass sampling theorem plotting function.
Display the spectrum of a sampled signal after setting the bandwidth,
sampling frequency, maximum display frequency, and spectral shape.
Parameters
----------
fb : spectrum lowpass b... | def lp_samp(fb,fs,fmax,N,shape='tri',fsize=(6,4)):
"""
Lowpass sampling theorem plotting function.
Display the spectrum of a sampled signal after setting the bandwidth,
sampling frequency, maximum display frequency, and spectral shape.
Parameters
----------
fb : spectrum lowpass b... | [
"Lowpass",
"sampling",
"theorem",
"plotting",
"function",
".",
"Display",
"the",
"spectrum",
"of",
"a",
"sampled",
"signal",
"after",
"setting",
"the",
"bandwidth",
"sampling",
"frequency",
"maximum",
"display",
"frequency",
"and",
"spectral",
"shape",
".",
"Param... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/sigsys.py#L592-L654 | [
"def",
"lp_samp",
"(",
"fb",
",",
"fs",
",",
"fmax",
",",
"N",
",",
"shape",
"=",
"'tri'",
",",
"fsize",
"=",
"(",
"6",
",",
"4",
")",
")",
":",
"plt",
".",
"figure",
"(",
"figsize",
"=",
"fsize",
")",
"# define the plot interval",
"f",
"=",
"np"... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | lp_tri | Triangle spectral shape function used by :func:`lp_samp`.
Parameters
----------
f : ndarray containing frequency samples
fb : the bandwidth as a float constant
Returns
-------
x : ndarray of spectrum samples for a single triangle shape
Notes
-----
This is a support functio... | sk_dsp_comm/sigsys.py | def lp_tri(f, fb):
"""
Triangle spectral shape function used by :func:`lp_samp`.
Parameters
----------
f : ndarray containing frequency samples
fb : the bandwidth as a float constant
Returns
-------
x : ndarray of spectrum samples for a single triangle shape
Notes
----... | def lp_tri(f, fb):
"""
Triangle spectral shape function used by :func:`lp_samp`.
Parameters
----------
f : ndarray containing frequency samples
fb : the bandwidth as a float constant
Returns
-------
x : ndarray of spectrum samples for a single triangle shape
Notes
----... | [
"Triangle",
"spectral",
"shape",
"function",
"used",
"by",
":",
"func",
":",
"lp_samp",
"."
] | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/sigsys.py#L657-L684 | [
"def",
"lp_tri",
"(",
"f",
",",
"fb",
")",
":",
"x",
"=",
"np",
".",
"zeros",
"(",
"len",
"(",
"f",
")",
")",
"for",
"k",
"in",
"range",
"(",
"len",
"(",
"f",
")",
")",
":",
"if",
"abs",
"(",
"f",
"[",
"k",
"]",
")",
"<=",
"fb",
":",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | sinusoidAWGN | Add white Gaussian noise to a single real sinusoid.
Input a single sinusoid to this function and it returns a noisy
sinusoid at a specific SNR value in dB. Sinusoid power is calculated
using np.var.
Parameters
----------
x : Input signal as ndarray consisting of a single sinusoid
S... | sk_dsp_comm/sigsys.py | def sinusoidAWGN(x,SNRdB):
"""
Add white Gaussian noise to a single real sinusoid.
Input a single sinusoid to this function and it returns a noisy
sinusoid at a specific SNR value in dB. Sinusoid power is calculated
using np.var.
Parameters
----------
x : Input signal as ndarra... | def sinusoidAWGN(x,SNRdB):
"""
Add white Gaussian noise to a single real sinusoid.
Input a single sinusoid to this function and it returns a noisy
sinusoid at a specific SNR value in dB. Sinusoid power is calculated
using np.var.
Parameters
----------
x : Input signal as ndarra... | [
"Add",
"white",
"Gaussian",
"noise",
"to",
"a",
"single",
"real",
"sinusoid",
".",
"Input",
"a",
"single",
"sinusoid",
"to",
"this",
"function",
"and",
"it",
"returns",
"a",
"noisy",
"sinusoid",
"at",
"a",
"specific",
"SNR",
"value",
"in",
"dB",
".",
"Si... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/sigsys.py#L687-L716 | [
"def",
"sinusoidAWGN",
"(",
"x",
",",
"SNRdB",
")",
":",
"# Estimate signal power",
"x_pwr",
"=",
"np",
".",
"var",
"(",
"x",
")",
"# Create noise vector",
"noise",
"=",
"np",
".",
"sqrt",
"(",
"x_pwr",
"/",
"10",
"**",
"(",
"SNRdB",
"/",
"10.",
")",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | discrim | function disdata = discrim(x)
where x is an angle modulated signal in complex baseband form.
Mark Wickert | sk_dsp_comm/rtlsdr_helper.py | def discrim(x):
"""
function disdata = discrim(x)
where x is an angle modulated signal in complex baseband form.
Mark Wickert
"""
X=np.real(x) # X is the real part of the received signal
Y=np.imag(x) # Y is the imaginary part of the received signal
b=np.array(... | def discrim(x):
"""
function disdata = discrim(x)
where x is an angle modulated signal in complex baseband form.
Mark Wickert
"""
X=np.real(x) # X is the real part of the received signal
Y=np.imag(x) # Y is the imaginary part of the received signal
b=np.array(... | [
"function",
"disdata",
"=",
"discrim",
"(",
"x",
")",
"where",
"x",
"is",
"an",
"angle",
"modulated",
"signal",
"in",
"complex",
"baseband",
"form",
".",
"Mark",
"Wickert"
] | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/rtlsdr_helper.py#L55-L69 | [
"def",
"discrim",
"(",
"x",
")",
":",
"X",
"=",
"np",
".",
"real",
"(",
"x",
")",
"# X is the real part of the received signal\r",
"Y",
"=",
"np",
".",
"imag",
"(",
"x",
")",
"# Y is the imaginary part of the received signal\r",
"b",
"=",
"np",
".",
"array",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | mono_FM | Decimate complex baseband input by 10
Design 1st decimation lowpass filter (f_c = 200 KHz) | sk_dsp_comm/rtlsdr_helper.py | def mono_FM(x,fs=2.4e6,file_name='test.wav'):
"""
Decimate complex baseband input by 10
Design 1st decimation lowpass filter (f_c = 200 KHz)
"""
b = signal.firwin(64,2*200e3/float(fs))
# Filter and decimate (should be polyphase)
y = signal.lfilter(b,1,x)
z = ss.downsample(y,10)
... | def mono_FM(x,fs=2.4e6,file_name='test.wav'):
"""
Decimate complex baseband input by 10
Design 1st decimation lowpass filter (f_c = 200 KHz)
"""
b = signal.firwin(64,2*200e3/float(fs))
# Filter and decimate (should be polyphase)
y = signal.lfilter(b,1,x)
z = ss.downsample(y,10)
... | [
"Decimate",
"complex",
"baseband",
"input",
"by",
"10",
"Design",
"1st",
"decimation",
"lowpass",
"filter",
"(",
"f_c",
"=",
"200",
"KHz",
")"
] | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/rtlsdr_helper.py#L72-L92 | [
"def",
"mono_FM",
"(",
"x",
",",
"fs",
"=",
"2.4e6",
",",
"file_name",
"=",
"'test.wav'",
")",
":",
"b",
"=",
"signal",
".",
"firwin",
"(",
"64",
",",
"2",
"*",
"200e3",
"/",
"float",
"(",
"fs",
")",
")",
"# Filter and decimate (should be polyphase)\r",
... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | stereo_FM | Stereo demod from complex baseband at sampling rate fs.
Assume fs is 2400 ksps
Mark Wickert July 2017 | sk_dsp_comm/rtlsdr_helper.py | def stereo_FM(x,fs=2.4e6,file_name='test.wav'):
"""
Stereo demod from complex baseband at sampling rate fs.
Assume fs is 2400 ksps
Mark Wickert July 2017
"""
N1 = 10
b = signal.firwin(64,2*200e3/float(fs))
# Filter and decimate (should be polyphase)
y = signal.lfilter(... | def stereo_FM(x,fs=2.4e6,file_name='test.wav'):
"""
Stereo demod from complex baseband at sampling rate fs.
Assume fs is 2400 ksps
Mark Wickert July 2017
"""
N1 = 10
b = signal.firwin(64,2*200e3/float(fs))
# Filter and decimate (should be polyphase)
y = signal.lfilter(... | [
"Stereo",
"demod",
"from",
"complex",
"baseband",
"at",
"sampling",
"rate",
"fs",
".",
"Assume",
"fs",
"is",
"2400",
"ksps",
"Mark",
"Wickert",
"July",
"2017"
] | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/rtlsdr_helper.py#L95-L155 | [
"def",
"stereo_FM",
"(",
"x",
",",
"fs",
"=",
"2.4e6",
",",
"file_name",
"=",
"'test.wav'",
")",
":",
"N1",
"=",
"10",
"b",
"=",
"signal",
".",
"firwin",
"(",
"64",
",",
"2",
"*",
"200e3",
"/",
"float",
"(",
"fs",
")",
")",
"# Filter and decimate (... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | pilot_PLL | theta, phi_error = pilot_PLL(xr,fq,fs,loop_type,Bn,zeta)
Mark Wickert, April 2014 | sk_dsp_comm/rtlsdr_helper.py | def pilot_PLL(xr,fq,fs,loop_type,Bn,zeta):
"""
theta, phi_error = pilot_PLL(xr,fq,fs,loop_type,Bn,zeta)
Mark Wickert, April 2014
"""
T = 1/float(fs)
# Set the VCO gain in Hz/V
Kv = 1.0
# Design a lowpass filter to remove the double freq term
Norder = 5
b_lp,a_lp... | def pilot_PLL(xr,fq,fs,loop_type,Bn,zeta):
"""
theta, phi_error = pilot_PLL(xr,fq,fs,loop_type,Bn,zeta)
Mark Wickert, April 2014
"""
T = 1/float(fs)
# Set the VCO gain in Hz/V
Kv = 1.0
# Design a lowpass filter to remove the double freq term
Norder = 5
b_lp,a_lp... | [
"theta",
"phi_error",
"=",
"pilot_PLL",
"(",
"xr",
"fq",
"fs",
"loop_type",
"Bn",
"zeta",
")",
"Mark",
"Wickert",
"April",
"2014"
] | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/rtlsdr_helper.py#L171-L242 | [
"def",
"pilot_PLL",
"(",
"xr",
",",
"fq",
",",
"fs",
",",
"loop_type",
",",
"Bn",
",",
"zeta",
")",
":",
"T",
"=",
"1",
"/",
"float",
"(",
"fs",
")",
"# Set the VCO gain in Hz/V \r",
"Kv",
"=",
"1.0",
"# Design a lowpass filter to remove the double freq term\... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | sccs_bit_sync | rx_symb_d,clk,track = sccs_bit_sync(y,Ns)
//////////////////////////////////////////////////////
Symbol synchronization algorithm using SCCS
//////////////////////////////////////////////////////
y = baseband NRZ data waveform
Ns = nominal number of samples per symbol
Rew... | sk_dsp_comm/rtlsdr_helper.py | def sccs_bit_sync(y,Ns):
"""
rx_symb_d,clk,track = sccs_bit_sync(y,Ns)
//////////////////////////////////////////////////////
Symbol synchronization algorithm using SCCS
//////////////////////////////////////////////////////
y = baseband NRZ data waveform
Ns = nominal numb... | def sccs_bit_sync(y,Ns):
"""
rx_symb_d,clk,track = sccs_bit_sync(y,Ns)
//////////////////////////////////////////////////////
Symbol synchronization algorithm using SCCS
//////////////////////////////////////////////////////
y = baseband NRZ data waveform
Ns = nominal numb... | [
"rx_symb_d",
"clk",
"track",
"=",
"sccs_bit_sync",
"(",
"y",
"Ns",
")",
"//////////////////////////////////////////////////////",
"Symbol",
"synchronization",
"algorithm",
"using",
"SCCS",
"//////////////////////////////////////////////////////",
"y",
"=",
"baseband",
"NRZ",
... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/rtlsdr_helper.py#L245-L302 | [
"def",
"sccs_bit_sync",
"(",
"y",
",",
"Ns",
")",
":",
"# decimated symbol sequence for SEP\r",
"rx_symb_d",
"=",
"np",
".",
"zeros",
"(",
"int",
"(",
"np",
".",
"fix",
"(",
"len",
"(",
"y",
")",
"/",
"Ns",
")",
")",
")",
"track",
"=",
"np",
".",
"... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | fsk_BEP | fsk_BEP(rx_data,m,flip)
Estimate the BEP of the data bits recovered
by the RTL-SDR Based FSK Receiver.
The reference m-sequence generated in Python
was found to produce sequences running in the opposite
direction relative to the m-sequences generated by the
mbed. To allow erro... | sk_dsp_comm/rtlsdr_helper.py | def fsk_BEP(rx_data,m,flip):
"""
fsk_BEP(rx_data,m,flip)
Estimate the BEP of the data bits recovered
by the RTL-SDR Based FSK Receiver.
The reference m-sequence generated in Python
was found to produce sequences running in the opposite
direction relative to the m-sequence... | def fsk_BEP(rx_data,m,flip):
"""
fsk_BEP(rx_data,m,flip)
Estimate the BEP of the data bits recovered
by the RTL-SDR Based FSK Receiver.
The reference m-sequence generated in Python
was found to produce sequences running in the opposite
direction relative to the m-sequence... | [
"fsk_BEP",
"(",
"rx_data",
"m",
"flip",
")",
"Estimate",
"the",
"BEP",
"of",
"the",
"data",
"bits",
"recovered",
"by",
"the",
"RTL",
"-",
"SDR",
"Based",
"FSK",
"Receiver",
".",
"The",
"reference",
"m",
"-",
"sequence",
"generated",
"in",
"Python",
"was"... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/rtlsdr_helper.py#L305-L340 | [
"def",
"fsk_BEP",
"(",
"rx_data",
",",
"m",
",",
"flip",
")",
":",
"Nbits",
"=",
"len",
"(",
"rx_data",
")",
"c",
"=",
"dc",
".",
"m_seq",
"(",
"m",
")",
"if",
"flip",
"==",
"1",
":",
"# Flip the sequence to compenstate for mbed code difference\r",
"# Firs... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
valid | complex2wav | Save a complex signal vector to a wav file for compact binary
storage of 16-bit signal samples. The wav left and right channels
are used to save real (I) and imaginary (Q) values. The rate is
just a convent way of documenting the original signal sample rate.
complex2wav(filename,rate,x)
Mar... | sk_dsp_comm/rtlsdr_helper.py | def complex2wav(filename,rate,x):
"""
Save a complex signal vector to a wav file for compact binary
storage of 16-bit signal samples. The wav left and right channels
are used to save real (I) and imaginary (Q) values. The rate is
just a convent way of documenting the original signal sample rate... | def complex2wav(filename,rate,x):
"""
Save a complex signal vector to a wav file for compact binary
storage of 16-bit signal samples. The wav left and right channels
are used to save real (I) and imaginary (Q) values. The rate is
just a convent way of documenting the original signal sample rate... | [
"Save",
"a",
"complex",
"signal",
"vector",
"to",
"a",
"wav",
"file",
"for",
"compact",
"binary",
"storage",
"of",
"16",
"-",
"bit",
"signal",
"samples",
".",
"The",
"wav",
"left",
"and",
"right",
"channels",
"are",
"used",
"to",
"save",
"real",
"(",
"... | mwickert/scikit-dsp-comm | python | https://github.com/mwickert/scikit-dsp-comm/blob/5c1353412a4d81a8d7da169057564ecf940f8b5b/sk_dsp_comm/rtlsdr_helper.py#L349-L362 | [
"def",
"complex2wav",
"(",
"filename",
",",
"rate",
",",
"x",
")",
":",
"x_wav",
"=",
"np",
".",
"hstack",
"(",
"(",
"np",
".",
"array",
"(",
"[",
"x",
".",
"real",
"]",
")",
".",
"T",
",",
"np",
".",
"array",
"(",
"[",
"x",
".",
"imag",
"]... | 5c1353412a4d81a8d7da169057564ecf940f8b5b |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.