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 | XVG.ma | Represent data as a masked array.
The array is returned with column-first indexing, i.e. for a data file with
columns X Y1 Y2 Y3 ... the array a will be a[0] = X, a[1] = Y1, ... .
inf and nan are filtered via :func:`numpy.isfinite`. | gromacs/fileformats/xvg.py | def ma(self):
"""Represent data as a masked array.
The array is returned with column-first indexing, i.e. for a data file with
columns X Y1 Y2 Y3 ... the array a will be a[0] = X, a[1] = Y1, ... .
inf and nan are filtered via :func:`numpy.isfinite`.
"""
a = self.array
... | def ma(self):
"""Represent data as a masked array.
The array is returned with column-first indexing, i.e. for a data file with
columns X Y1 Y2 Y3 ... the array a will be a[0] = X, a[1] = Y1, ... .
inf and nan are filtered via :func:`numpy.isfinite`.
"""
a = self.array
... | [
"Represent",
"data",
"as",
"a",
"masked",
"array",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L360-L369 | [
"def",
"ma",
"(",
"self",
")",
":",
"a",
"=",
"self",
".",
"array",
"return",
"numpy",
".",
"ma",
".",
"MaskedArray",
"(",
"a",
",",
"mask",
"=",
"numpy",
".",
"logical_not",
"(",
"numpy",
".",
"isfinite",
"(",
"a",
")",
")",
")"
] | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG._tcorrel | Correlation "time" of data.
The 0-th column of the data is interpreted as a time and the
decay of the data is computed from the autocorrelation
function (using FFT).
.. SeeAlso:: :func:`numkit.timeseries.tcorrel` | gromacs/fileformats/xvg.py | def _tcorrel(self, nstep=100, **kwargs):
"""Correlation "time" of data.
The 0-th column of the data is interpreted as a time and the
decay of the data is computed from the autocorrelation
function (using FFT).
.. SeeAlso:: :func:`numkit.timeseries.tcorrel`
"""
t... | def _tcorrel(self, nstep=100, **kwargs):
"""Correlation "time" of data.
The 0-th column of the data is interpreted as a time and the
decay of the data is computed from the autocorrelation
function (using FFT).
.. SeeAlso:: :func:`numkit.timeseries.tcorrel`
"""
t... | [
"Correlation",
"time",
"of",
"data",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L391-L402 | [
"def",
"_tcorrel",
"(",
"self",
",",
"nstep",
"=",
"100",
",",
"*",
"*",
"kwargs",
")",
":",
"t",
"=",
"self",
".",
"array",
"[",
"0",
",",
":",
":",
"nstep",
"]",
"r",
"=",
"gromacs",
".",
"collections",
".",
"Collection",
"(",
"[",
"numkit",
... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG.set_correlparameters | Set and change the parameters for calculations with correlation functions.
The parameters persist until explicitly changed.
:Keywords:
*nstep*
only process every *nstep* data point to speed up the FFT; if
left empty a default is chosen that produces roughly 25... | gromacs/fileformats/xvg.py | def set_correlparameters(self, **kwargs):
"""Set and change the parameters for calculations with correlation functions.
The parameters persist until explicitly changed.
:Keywords:
*nstep*
only process every *nstep* data point to speed up the FFT; if
le... | def set_correlparameters(self, **kwargs):
"""Set and change the parameters for calculations with correlation functions.
The parameters persist until explicitly changed.
:Keywords:
*nstep*
only process every *nstep* data point to speed up the FFT; if
le... | [
"Set",
"and",
"change",
"the",
"parameters",
"for",
"calculations",
"with",
"correlation",
"functions",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L404-L433 | [
"def",
"set_correlparameters",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"ncorrel",
"=",
"kwargs",
".",
"pop",
"(",
"'ncorrel'",
",",
"self",
".",
"ncorrel",
")",
"or",
"25000",
"nstep",
"=",
"kwargs",
".",
"pop",
"(",
"'nstep'",
"... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG.parse | Read and cache the file as a numpy array.
Store every *stride* line of data; if ``None`` then the class default is used.
The array is returned with column-first indexing, i.e. for a data file with
columns X Y1 Y2 Y3 ... the array a will be a[0] = X, a[1] = Y1, ... . | gromacs/fileformats/xvg.py | def parse(self, stride=None):
"""Read and cache the file as a numpy array.
Store every *stride* line of data; if ``None`` then the class default is used.
The array is returned with column-first indexing, i.e. for a data file with
columns X Y1 Y2 Y3 ... the array a will be a[0] = X, a[1... | def parse(self, stride=None):
"""Read and cache the file as a numpy array.
Store every *stride* line of data; if ``None`` then the class default is used.
The array is returned with column-first indexing, i.e. for a data file with
columns X Y1 Y2 Y3 ... the array a will be a[0] = X, a[1... | [
"Read",
"and",
"cache",
"the",
"file",
"as",
"a",
"numpy",
"array",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L469-L537 | [
"def",
"parse",
"(",
"self",
",",
"stride",
"=",
"None",
")",
":",
"if",
"stride",
"is",
"None",
":",
"stride",
"=",
"self",
".",
"stride",
"self",
".",
"corrupted_lineno",
"=",
"[",
"]",
"irow",
"=",
"0",
"# count rows of data",
"# cannot use numpy.loadtx... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG.plot | Plot xvg file data.
The first column of the data is always taken as the abscissa
X. Additional columns are plotted as ordinates Y1, Y2, ...
In the special case that there is only a single column then this column
is plotted against the index, i.e. (N, Y).
:Keywords:
*... | gromacs/fileformats/xvg.py | def plot(self, **kwargs):
"""Plot xvg file data.
The first column of the data is always taken as the abscissa
X. Additional columns are plotted as ordinates Y1, Y2, ...
In the special case that there is only a single column then this column
is plotted against the index, i.e. (N... | def plot(self, **kwargs):
"""Plot xvg file data.
The first column of the data is always taken as the abscissa
X. Additional columns are plotted as ordinates Y1, Y2, ...
In the special case that there is only a single column then this column
is plotted against the index, i.e. (N... | [
"Plot",
"xvg",
"file",
"data",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L550-L635 | [
"def",
"plot",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"columns",
"=",
"kwargs",
".",
"pop",
"(",
"'columns'",
",",
"Ellipsis",
")",
"# slice for everything",
"maxpoints",
"=",
"kwargs",
".",
"pop",
"(",
"'maxpoints'",
",",
"self",
".",
"maxpoint... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG.plot_coarsened | Plot data like :meth:`XVG.plot` with the range of **all** data shown.
Data are reduced to *maxpoints* (good results are obtained
with low values such as 100) and the actual range of observed
data is plotted as a translucent error band around the mean.
Each column in *columns* (except t... | gromacs/fileformats/xvg.py | def plot_coarsened(self, **kwargs):
"""Plot data like :meth:`XVG.plot` with the range of **all** data shown.
Data are reduced to *maxpoints* (good results are obtained
with low values such as 100) and the actual range of observed
data is plotted as a translucent error band around the me... | def plot_coarsened(self, **kwargs):
"""Plot data like :meth:`XVG.plot` with the range of **all** data shown.
Data are reduced to *maxpoints* (good results are obtained
with low values such as 100) and the actual range of observed
data is plotted as a translucent error band around the me... | [
"Plot",
"data",
"like",
":",
"meth",
":",
"XVG",
".",
"plot",
"with",
"the",
"range",
"of",
"**",
"all",
"**",
"data",
"shown",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L637-L689 | [
"def",
"plot_coarsened",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"ax",
"=",
"kwargs",
".",
"pop",
"(",
"'ax'",
",",
"None",
")",
"columns",
"=",
"kwargs",
".",
"pop",
"(",
"'columns'",
",",
"Ellipsis",
")",
"# slice for everything",
"if",
"colu... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG.errorbar | errorbar plot for a single time series with errors.
Set *columns* keyword to select [x, y, dy] or [x, y, dx, dy],
e.g. ``columns=[0,1,2]``. See :meth:`XVG.plot` for
details. Only a single timeseries can be plotted and the user
needs to select the appropriate columns with the *columns*
... | gromacs/fileformats/xvg.py | def errorbar(self, **kwargs):
"""errorbar plot for a single time series with errors.
Set *columns* keyword to select [x, y, dy] or [x, y, dx, dy],
e.g. ``columns=[0,1,2]``. See :meth:`XVG.plot` for
details. Only a single timeseries can be plotted and the user
needs to select the... | def errorbar(self, **kwargs):
"""errorbar plot for a single time series with errors.
Set *columns* keyword to select [x, y, dy] or [x, y, dx, dy],
e.g. ``columns=[0,1,2]``. See :meth:`XVG.plot` for
details. Only a single timeseries can be plotted and the user
needs to select the... | [
"errorbar",
"plot",
"for",
"a",
"single",
"time",
"series",
"with",
"errors",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L691-L834 | [
"def",
"errorbar",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"ax",
"=",
"kwargs",
".",
"pop",
"(",
"'ax'",
",",
"None",
")",
"color",
"=",
"kwargs",
".",
"pop",
"(",
"'color'",
",",
"'black'",
")",
"filled",
"=",
"kwargs",
".",
"pop",
"(",
... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG.decimate | Decimate data *a* to *maxpoints* using *method*.
If *a* is a 1D array then it is promoted to a (2, N) array
where the first column simply contains the index.
If the array contains fewer than *maxpoints* points or if
*maxpoints* is ``None`` then it is returned as it is. The
defa... | gromacs/fileformats/xvg.py | def decimate(self, method, a, maxpoints=10000, **kwargs):
"""Decimate data *a* to *maxpoints* using *method*.
If *a* is a 1D array then it is promoted to a (2, N) array
where the first column simply contains the index.
If the array contains fewer than *maxpoints* points or if
*... | def decimate(self, method, a, maxpoints=10000, **kwargs):
"""Decimate data *a* to *maxpoints* using *method*.
If *a* is a 1D array then it is promoted to a (2, N) array
where the first column simply contains the index.
If the array contains fewer than *maxpoints* points or if
*... | [
"Decimate",
"data",
"*",
"a",
"*",
"to",
"*",
"maxpoints",
"*",
"using",
"*",
"method",
"*",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L836-L893 | [
"def",
"decimate",
"(",
"self",
",",
"method",
",",
"a",
",",
"maxpoints",
"=",
"10000",
",",
"*",
"*",
"kwargs",
")",
":",
"methods",
"=",
"{",
"'mean'",
":",
"self",
".",
"decimate_mean",
",",
"'min'",
":",
"self",
".",
"decimate_min",
",",
"'max'"... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG.decimate_mean | Return data *a* mean-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the weighted average in each bin as the decimated data, using
:func:`numkit.timeseries.mean_histogrammed_function`. The coarse grained
time in the first column contains the centers... | gromacs/fileformats/xvg.py | def decimate_mean(self, a, maxpoints, **kwargs):
"""Return data *a* mean-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the weighted average in each bin as the decimated data, using
:func:`numkit.timeseries.mean_histogrammed_function`. The coarse g... | def decimate_mean(self, a, maxpoints, **kwargs):
"""Return data *a* mean-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the weighted average in each bin as the decimated data, using
:func:`numkit.timeseries.mean_histogrammed_function`. The coarse g... | [
"Return",
"data",
"*",
"a",
"*",
"mean",
"-",
"decimated",
"on",
"*",
"maxpoints",
"*",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L895-L913 | [
"def",
"decimate_mean",
"(",
"self",
",",
"a",
",",
"maxpoints",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_decimate",
"(",
"numkit",
".",
"timeseries",
".",
"mean_histogrammed_function",
",",
"a",
",",
"maxpoints",
",",
"*",
"*",
"kwarg... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG.decimate_circmean | Return data *a* circmean-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the weighted circular mean in each bin as the decimated data,
using
:func:`numkit.timeseries.circmean_histogrammed_function`. The
coarse grained time in the first colum... | gromacs/fileformats/xvg.py | def decimate_circmean(self, a, maxpoints, **kwargs):
"""Return data *a* circmean-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the weighted circular mean in each bin as the decimated data,
using
:func:`numkit.timeseries.circmean_histogramm... | def decimate_circmean(self, a, maxpoints, **kwargs):
"""Return data *a* circmean-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the weighted circular mean in each bin as the decimated data,
using
:func:`numkit.timeseries.circmean_histogramm... | [
"Return",
"data",
"*",
"a",
"*",
"circmean",
"-",
"decimated",
"on",
"*",
"maxpoints",
"*",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L915-L955 | [
"def",
"decimate_circmean",
"(",
"self",
",",
"a",
",",
"maxpoints",
",",
"*",
"*",
"kwargs",
")",
":",
"a_rad",
"=",
"numpy",
".",
"vstack",
"(",
"(",
"a",
"[",
"0",
"]",
",",
"numpy",
".",
"deg2rad",
"(",
"a",
"[",
"1",
":",
"]",
")",
")",
... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG.decimate_min | Return data *a* min-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the minimum in each bin as the decimated data, using
:func:`numkit.timeseries.min_histogrammed_function`. The coarse grained
time in the first column contains the centers of the his... | gromacs/fileformats/xvg.py | def decimate_min(self, a, maxpoints, **kwargs):
"""Return data *a* min-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the minimum in each bin as the decimated data, using
:func:`numkit.timeseries.min_histogrammed_function`. The coarse grained
... | def decimate_min(self, a, maxpoints, **kwargs):
"""Return data *a* min-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the minimum in each bin as the decimated data, using
:func:`numkit.timeseries.min_histogrammed_function`. The coarse grained
... | [
"Return",
"data",
"*",
"a",
"*",
"min",
"-",
"decimated",
"on",
"*",
"maxpoints",
"*",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L957-L975 | [
"def",
"decimate_min",
"(",
"self",
",",
"a",
",",
"maxpoints",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_decimate",
"(",
"numkit",
".",
"timeseries",
".",
"min_histogrammed_function",
",",
"a",
",",
"maxpoints",
",",
"*",
"*",
"kwargs"... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG.decimate_max | Return data *a* max-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the maximum in each bin as the decimated data, using
:func:`numkit.timeseries.max_histogrammed_function`. The coarse grained
time in the first column contains the centers of the his... | gromacs/fileformats/xvg.py | def decimate_max(self, a, maxpoints, **kwargs):
"""Return data *a* max-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the maximum in each bin as the decimated data, using
:func:`numkit.timeseries.max_histogrammed_function`. The coarse grained
... | def decimate_max(self, a, maxpoints, **kwargs):
"""Return data *a* max-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the maximum in each bin as the decimated data, using
:func:`numkit.timeseries.max_histogrammed_function`. The coarse grained
... | [
"Return",
"data",
"*",
"a",
"*",
"max",
"-",
"decimated",
"on",
"*",
"maxpoints",
"*",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L977-L995 | [
"def",
"decimate_max",
"(",
"self",
",",
"a",
",",
"maxpoints",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_decimate",
"(",
"numkit",
".",
"timeseries",
".",
"max_histogrammed_function",
",",
"a",
",",
"maxpoints",
",",
"*",
"*",
"kwargs"... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG.decimate_rms | Return data *a* rms-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the root mean square sum in each bin as the decimated data,
using :func:`numkit.timeseries.rms_histogrammed_function`. The coarse
grained time in the first column contains the cente... | gromacs/fileformats/xvg.py | def decimate_rms(self, a, maxpoints, **kwargs):
"""Return data *a* rms-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the root mean square sum in each bin as the decimated data,
using :func:`numkit.timeseries.rms_histogrammed_function`. The coarse
... | def decimate_rms(self, a, maxpoints, **kwargs):
"""Return data *a* rms-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the root mean square sum in each bin as the decimated data,
using :func:`numkit.timeseries.rms_histogrammed_function`. The coarse
... | [
"Return",
"data",
"*",
"a",
"*",
"rms",
"-",
"decimated",
"on",
"*",
"maxpoints",
"*",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L997-L1015 | [
"def",
"decimate_rms",
"(",
"self",
",",
"a",
",",
"maxpoints",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_decimate",
"(",
"numkit",
".",
"timeseries",
".",
"rms_histogrammed_function",
",",
"a",
",",
"maxpoints",
",",
"*",
"*",
"kwargs"... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG.decimate_percentile | Return data *a* percentile-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the percentile *per* in each bin as the decimated data, using
:func:`numkit.timeseries.percentile_histogrammed_function`. The
coarse grained time in the first column contains... | gromacs/fileformats/xvg.py | def decimate_percentile(self, a, maxpoints, **kwargs):
"""Return data *a* percentile-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the percentile *per* in each bin as the decimated data, using
:func:`numkit.timeseries.percentile_histogrammed_funct... | def decimate_percentile(self, a, maxpoints, **kwargs):
"""Return data *a* percentile-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates
the percentile *per* in each bin as the decimated data, using
:func:`numkit.timeseries.percentile_histogrammed_funct... | [
"Return",
"data",
"*",
"a",
"*",
"percentile",
"-",
"decimated",
"on",
"*",
"maxpoints",
"*",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L1017-L1042 | [
"def",
"decimate_percentile",
"(",
"self",
",",
"a",
",",
"maxpoints",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_decimate",
"(",
"numkit",
".",
"timeseries",
".",
"percentile_histogrammed_function",
",",
"a",
",",
"maxpoints",
",",
"*",
"... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG.decimate_error | Return data *a* error-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates an
error estimate in each bin as the decimated data, using
:func:`numkit.timeseries.error_histogrammed_function`. The
coarse grained time in the first column contains the centers
... | gromacs/fileformats/xvg.py | def decimate_error(self, a, maxpoints, **kwargs):
"""Return data *a* error-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates an
error estimate in each bin as the decimated data, using
:func:`numkit.timeseries.error_histogrammed_function`. The
... | def decimate_error(self, a, maxpoints, **kwargs):
"""Return data *a* error-decimated on *maxpoints*.
Histograms each column into *maxpoints* bins and calculates an
error estimate in each bin as the decimated data, using
:func:`numkit.timeseries.error_histogrammed_function`. The
... | [
"Return",
"data",
"*",
"a",
"*",
"error",
"-",
"decimated",
"on",
"*",
"maxpoints",
"*",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L1044-L1070 | [
"def",
"decimate_error",
"(",
"self",
",",
"a",
",",
"maxpoints",
",",
"*",
"*",
"kwargs",
")",
":",
"warnings",
".",
"warn",
"(",
"\"Using undocumented decimate_error() is highly EXPERIMENTAL\"",
",",
"category",
"=",
"gromacs",
".",
"exceptions",
".",
"LowAccura... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | XVG.decimate_smooth | Return smoothed data *a* decimated on approximately *maxpoints* points.
1. Produces a smoothed graph using the smoothing window *window*;
"flat" is a running average.
2. select points at a step size approximatelt producing maxpoints
If *a* contains <= *maxpoints* then *a* is simply ... | gromacs/fileformats/xvg.py | def decimate_smooth(self, a, maxpoints, window="flat"):
"""Return smoothed data *a* decimated on approximately *maxpoints* points.
1. Produces a smoothed graph using the smoothing window *window*;
"flat" is a running average.
2. select points at a step size approximatelt producing ma... | def decimate_smooth(self, a, maxpoints, window="flat"):
"""Return smoothed data *a* decimated on approximately *maxpoints* points.
1. Produces a smoothed graph using the smoothing window *window*;
"flat" is a running average.
2. select points at a step size approximatelt producing ma... | [
"Return",
"smoothed",
"data",
"*",
"a",
"*",
"decimated",
"on",
"approximately",
"*",
"maxpoints",
"*",
"points",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/xvg.py#L1089-L1131 | [
"def",
"decimate_smooth",
"(",
"self",
",",
"a",
",",
"maxpoints",
",",
"window",
"=",
"\"flat\"",
")",
":",
"ny",
"=",
"a",
".",
"shape",
"[",
"-",
"1",
"]",
"# assume 1D or 2D array with last dimension varying fastest",
"# reduce size by averaging oover stepsize ste... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | TOP._parse | Parse a processed.top GROMACS topology file
The function reads in the file line-by-line, and it's a bunch of 'elif' statements,
writing parameter/atom line to current section/molecule.
ParamTypes are added to self.xyztypes (AtomType goes to self.atomtypes).
Params are added to current ... | gromacs/fileformats/top.py | def _parse(self, fname):
"""Parse a processed.top GROMACS topology file
The function reads in the file line-by-line, and it's a bunch of 'elif' statements,
writing parameter/atom line to current section/molecule.
ParamTypes are added to self.xyztypes (AtomType goes to self.atomtypes).
... | def _parse(self, fname):
"""Parse a processed.top GROMACS topology file
The function reads in the file line-by-line, and it's a bunch of 'elif' statements,
writing parameter/atom line to current section/molecule.
ParamTypes are added to self.xyztypes (AtomType goes to self.atomtypes).
... | [
"Parse",
"a",
"processed",
".",
"top",
"GROMACS",
"topology",
"file"
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/top.py#L152-L839 | [
"def",
"_parse",
"(",
"self",
",",
"fname",
")",
":",
"def",
"_find_section",
"(",
"line",
")",
":",
"return",
"line",
".",
"strip",
"(",
"'['",
")",
".",
"strip",
"(",
"']'",
")",
".",
"strip",
"(",
")",
"def",
"_add_info",
"(",
"sys_or_mol",
",",... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | SystemToGroTop.assemble_topology | Call the various member self._make_* functions to convert the topology object into a string | gromacs/fileformats/top.py | def assemble_topology(self):
"""Call the various member self._make_* functions to convert the topology object into a string"""
self.logger.debug("starting to assemble topology...")
top = ''
self.logger.debug("making atom/pair/bond/angle/dihedral/improper types")
top += self.top... | def assemble_topology(self):
"""Call the various member self._make_* functions to convert the topology object into a string"""
self.logger.debug("starting to assemble topology...")
top = ''
self.logger.debug("making atom/pair/bond/angle/dihedral/improper types")
top += self.top... | [
"Call",
"the",
"various",
"member",
"self",
".",
"_make_",
"*",
"functions",
"to",
"convert",
"the",
"topology",
"object",
"into",
"a",
"string"
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/top.py#L949-L1005 | [
"def",
"assemble_topology",
"(",
"self",
")",
":",
"self",
".",
"logger",
".",
"debug",
"(",
"\"starting to assemble topology...\"",
")",
"top",
"=",
"''",
"self",
".",
"logger",
".",
"debug",
"(",
"\"making atom/pair/bond/angle/dihedral/improper types\"",
")",
"top... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | topology | Build Gromacs topology files from pdb.
:Keywords:
*struct*
input structure (**required**)
*protein*
name of the output files
*top*
name of the topology file
*dirname*
directory in which the new topology will be stored
*ff*
fo... | gromacs/setup.py | def topology(struct=None, protein='protein',
top='system.top', dirname='top',
posres="posres.itp",
ff="oplsaa", water="tip4p",
**pdb2gmx_args):
"""Build Gromacs topology files from pdb.
:Keywords:
*struct*
input structure (**required**)
... | def topology(struct=None, protein='protein',
top='system.top', dirname='top',
posres="posres.itp",
ff="oplsaa", water="tip4p",
**pdb2gmx_args):
"""Build Gromacs topology files from pdb.
:Keywords:
*struct*
input structure (**required**)
... | [
"Build",
"Gromacs",
"topology",
"files",
"from",
"pdb",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/setup.py#L171-L219 | [
"def",
"topology",
"(",
"struct",
"=",
"None",
",",
"protein",
"=",
"'protein'",
",",
"top",
"=",
"'system.top'",
",",
"dirname",
"=",
"'top'",
",",
"posres",
"=",
"\"posres.itp\"",
",",
"ff",
"=",
"\"oplsaa\"",
",",
"water",
"=",
"\"tip4p\"",
",",
"*",
... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | make_main_index | Make index file with the special groups.
This routine adds the group __main__ and the group __environment__
to the end of the index file. __main__ contains what the user
defines as the *central* and *most important* parts of the
system. __environment__ is everything else.
The template mdp file, fo... | gromacs/setup.py | def make_main_index(struct, selection='"Protein"', ndx='main.ndx', oldndx=None):
"""Make index file with the special groups.
This routine adds the group __main__ and the group __environment__
to the end of the index file. __main__ contains what the user
defines as the *central* and *most important* par... | def make_main_index(struct, selection='"Protein"', ndx='main.ndx', oldndx=None):
"""Make index file with the special groups.
This routine adds the group __main__ and the group __environment__
to the end of the index file. __main__ contains what the user
defines as the *central* and *most important* par... | [
"Make",
"index",
"file",
"with",
"the",
"special",
"groups",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/setup.py#L221-L307 | [
"def",
"make_main_index",
"(",
"struct",
",",
"selection",
"=",
"'\"Protein\"'",
",",
"ndx",
"=",
"'main.ndx'",
",",
"oldndx",
"=",
"None",
")",
":",
"logger",
".",
"info",
"(",
"\"Building the main index file {ndx!r}...\"",
".",
"format",
"(",
"*",
"*",
"vars... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | get_lipid_vdwradii | Find vdwradii.dat and add special entries for lipids.
See :data:`gromacs.setup.vdw_lipid_resnames` for lipid
resnames. Add more if necessary. | gromacs/setup.py | def get_lipid_vdwradii(outdir=os.path.curdir, libdir=None):
"""Find vdwradii.dat and add special entries for lipids.
See :data:`gromacs.setup.vdw_lipid_resnames` for lipid
resnames. Add more if necessary.
"""
vdwradii_dat = os.path.join(outdir, "vdwradii.dat")
if libdir is not None:
fi... | def get_lipid_vdwradii(outdir=os.path.curdir, libdir=None):
"""Find vdwradii.dat and add special entries for lipids.
See :data:`gromacs.setup.vdw_lipid_resnames` for lipid
resnames. Add more if necessary.
"""
vdwradii_dat = os.path.join(outdir, "vdwradii.dat")
if libdir is not None:
fi... | [
"Find",
"vdwradii",
".",
"dat",
"and",
"add",
"special",
"entries",
"for",
"lipids",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/setup.py#L317-L359 | [
"def",
"get_lipid_vdwradii",
"(",
"outdir",
"=",
"os",
".",
"path",
".",
"curdir",
",",
"libdir",
"=",
"None",
")",
":",
"vdwradii_dat",
"=",
"os",
".",
"path",
".",
"join",
"(",
"outdir",
",",
"\"vdwradii.dat\"",
")",
"if",
"libdir",
"is",
"not",
"Non... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | solvate | Put protein into box, add water, add counter-ions.
Currently this really only supports solutes in water. If you need
to embedd a protein in a membrane then you will require more
sophisticated approaches.
However, you *can* supply a protein already inserted in a
bilayer. In this case you will proba... | gromacs/setup.py | def solvate(struct='top/protein.pdb', top='top/system.top',
distance=0.9, boxtype='dodecahedron',
concentration=0, cation='NA', anion='CL',
water='tip4p', solvent_name='SOL', with_membrane=False,
ndx = 'main.ndx', mainselection = '"Protein"',
dirname='solvate'... | def solvate(struct='top/protein.pdb', top='top/system.top',
distance=0.9, boxtype='dodecahedron',
concentration=0, cation='NA', anion='CL',
water='tip4p', solvent_name='SOL', with_membrane=False,
ndx = 'main.ndx', mainselection = '"Protein"',
dirname='solvate'... | [
"Put",
"protein",
"into",
"box",
"add",
"water",
"add",
"counter",
"-",
"ions",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/setup.py#L535-L627 | [
"def",
"solvate",
"(",
"struct",
"=",
"'top/protein.pdb'",
",",
"top",
"=",
"'top/system.top'",
",",
"distance",
"=",
"0.9",
",",
"boxtype",
"=",
"'dodecahedron'",
",",
"concentration",
"=",
"0",
",",
"cation",
"=",
"'NA'",
",",
"anion",
"=",
"'CL'",
",",
... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | check_mdpargs | Check if any arguments remain in dict *d*. | gromacs/setup.py | def check_mdpargs(d):
"""Check if any arguments remain in dict *d*."""
if len(d) > 0:
wmsg = "Unprocessed mdp option are interpreted as options for grompp:\n"+str(d)
logger.warn(wmsg)
warnings.warn(wmsg, category=UsageWarning)
return len(d) == 0 | def check_mdpargs(d):
"""Check if any arguments remain in dict *d*."""
if len(d) > 0:
wmsg = "Unprocessed mdp option are interpreted as options for grompp:\n"+str(d)
logger.warn(wmsg)
warnings.warn(wmsg, category=UsageWarning)
return len(d) == 0 | [
"Check",
"if",
"any",
"arguments",
"remain",
"in",
"dict",
"*",
"d",
"*",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/setup.py#L630-L636 | [
"def",
"check_mdpargs",
"(",
"d",
")",
":",
"if",
"len",
"(",
"d",
")",
">",
"0",
":",
"wmsg",
"=",
"\"Unprocessed mdp option are interpreted as options for grompp:\\n\"",
"+",
"str",
"(",
"d",
")",
"logger",
".",
"warn",
"(",
"wmsg",
")",
"warnings",
".",
... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | energy_minimize | Energy minimize the system.
This sets up the system (creates run input files) and also runs
``mdrun_d``. Thus it can take a while.
Additional itp files should be in the same directory as the top file.
Many of the keyword arguments below already have sensible values.
:Keywords:
*dirname*
... | gromacs/setup.py | def energy_minimize(dirname='em', mdp=config.templates['em.mdp'],
struct='solvate/ionized.gro', top='top/system.top',
output='em.pdb', deffnm="em",
mdrunner=None, mdrun_args=None,
**kwargs):
"""Energy minimize the system.
This sets... | def energy_minimize(dirname='em', mdp=config.templates['em.mdp'],
struct='solvate/ionized.gro', top='top/system.top',
output='em.pdb', deffnm="em",
mdrunner=None, mdrun_args=None,
**kwargs):
"""Energy minimize the system.
This sets... | [
"Energy",
"minimize",
"the",
"system",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/setup.py#L638-L759 | [
"def",
"energy_minimize",
"(",
"dirname",
"=",
"'em'",
",",
"mdp",
"=",
"config",
".",
"templates",
"[",
"'em.mdp'",
"]",
",",
"struct",
"=",
"'solvate/ionized.gro'",
",",
"top",
"=",
"'top/system.top'",
",",
"output",
"=",
"'em.pdb'",
",",
"deffnm",
"=",
... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | em_schedule | Run multiple energy minimizations one after each other.
:Keywords:
*integrators*
list of integrators (from 'l-bfgs', 'cg', 'steep')
[['bfgs', 'steep']]
*nsteps*
list of maximum number of steps; one for each integrator in
in the *integrators* list [[100,1000]]... | gromacs/setup.py | def em_schedule(**kwargs):
"""Run multiple energy minimizations one after each other.
:Keywords:
*integrators*
list of integrators (from 'l-bfgs', 'cg', 'steep')
[['bfgs', 'steep']]
*nsteps*
list of maximum number of steps; one for each integrator in
in t... | def em_schedule(**kwargs):
"""Run multiple energy minimizations one after each other.
:Keywords:
*integrators*
list of integrators (from 'l-bfgs', 'cg', 'steep')
[['bfgs', 'steep']]
*nsteps*
list of maximum number of steps; one for each integrator in
in t... | [
"Run",
"multiple",
"energy",
"minimizations",
"one",
"after",
"each",
"other",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/setup.py#L761-L822 | [
"def",
"em_schedule",
"(",
"*",
"*",
"kwargs",
")",
":",
"mdrunner",
"=",
"kwargs",
".",
"pop",
"(",
"'mdrunner'",
",",
"None",
")",
"integrators",
"=",
"kwargs",
".",
"pop",
"(",
"'integrators'",
",",
"[",
"'l-bfgs'",
",",
"'steep'",
"]",
")",
"kwargs... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | _setup_MD | Generic function to set up a ``mdrun`` MD simulation.
See the user functions for usage. | gromacs/setup.py | def _setup_MD(dirname,
deffnm='md', mdp=config.templates['md_OPLSAA.mdp'],
struct=None,
top='top/system.top', ndx=None,
mainselection='"Protein"',
qscript=config.qscript_template, qname=None, startdir=None, mdrun_opts="", budget=None, walltime=1/3.,
... | def _setup_MD(dirname,
deffnm='md', mdp=config.templates['md_OPLSAA.mdp'],
struct=None,
top='top/system.top', ndx=None,
mainselection='"Protein"',
qscript=config.qscript_template, qname=None, startdir=None, mdrun_opts="", budget=None, walltime=1/3.,
... | [
"Generic",
"function",
"to",
"set",
"up",
"a",
"mdrun",
"MD",
"simulation",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/setup.py#L825-L961 | [
"def",
"_setup_MD",
"(",
"dirname",
",",
"deffnm",
"=",
"'md'",
",",
"mdp",
"=",
"config",
".",
"templates",
"[",
"'md_OPLSAA.mdp'",
"]",
",",
"struct",
"=",
"None",
",",
"top",
"=",
"'top/system.top'",
",",
"ndx",
"=",
"None",
",",
"mainselection",
"=",... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | MD_restrained | Set up MD with position restraints.
Additional itp files should be in the same directory as the top file.
Many of the keyword arguments below already have sensible values. Note that
setting *mainselection* = ``None`` will disable many of the automated
choices and is often recommended when using your o... | gromacs/setup.py | def MD_restrained(dirname='MD_POSRES', **kwargs):
"""Set up MD with position restraints.
Additional itp files should be in the same directory as the top file.
Many of the keyword arguments below already have sensible values. Note that
setting *mainselection* = ``None`` will disable many of the automat... | def MD_restrained(dirname='MD_POSRES', **kwargs):
"""Set up MD with position restraints.
Additional itp files should be in the same directory as the top file.
Many of the keyword arguments below already have sensible values. Note that
setting *mainselection* = ``None`` will disable many of the automat... | [
"Set",
"up",
"MD",
"with",
"position",
"restraints",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/setup.py#L964-L1061 | [
"def",
"MD_restrained",
"(",
"dirname",
"=",
"'MD_POSRES'",
",",
"*",
"*",
"kwargs",
")",
":",
"logger",
".",
"info",
"(",
"\"[{dirname!s}] Setting up MD with position restraints...\"",
".",
"format",
"(",
"*",
"*",
"vars",
"(",
")",
")",
")",
"kwargs",
".",
... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | MD | Set up equilibrium MD.
Additional itp files should be in the same directory as the top file.
Many of the keyword arguments below already have sensible values. Note that
setting *mainselection* = ``None`` will disable many of the automated
choices and is often recommended when using your own mdp file.
... | gromacs/setup.py | def MD(dirname='MD', **kwargs):
"""Set up equilibrium MD.
Additional itp files should be in the same directory as the top file.
Many of the keyword arguments below already have sensible values. Note that
setting *mainselection* = ``None`` will disable many of the automated
choices and is often rec... | def MD(dirname='MD', **kwargs):
"""Set up equilibrium MD.
Additional itp files should be in the same directory as the top file.
Many of the keyword arguments below already have sensible values. Note that
setting *mainselection* = ``None`` will disable many of the automated
choices and is often rec... | [
"Set",
"up",
"equilibrium",
"MD",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/setup.py#L1063-L1121 | [
"def",
"MD",
"(",
"dirname",
"=",
"'MD'",
",",
"*",
"*",
"kwargs",
")",
":",
"logger",
".",
"info",
"(",
"\"[{dirname!s}] Setting up MD...\"",
".",
"format",
"(",
"*",
"*",
"vars",
"(",
")",
")",
")",
"kwargs",
".",
"setdefault",
"(",
"'struct'",
",",
... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | generate_submit_scripts | Write scripts for queuing systems.
This sets up queuing system run scripts with a simple search and replace in
templates. See :func:`gromacs.cbook.edit_txt` for details. Shell scripts
are made executable.
:Arguments:
*templates*
Template file or list of template files. The "files" can... | gromacs/qsub.py | def generate_submit_scripts(templates, prefix=None, deffnm='md', jobname='MD', budget=None,
mdrun_opts=None, walltime=1.0, jobarray_string=None, startdir=None,
npme=None, **kwargs):
"""Write scripts for queuing systems.
This sets up queuing system run sc... | def generate_submit_scripts(templates, prefix=None, deffnm='md', jobname='MD', budget=None,
mdrun_opts=None, walltime=1.0, jobarray_string=None, startdir=None,
npme=None, **kwargs):
"""Write scripts for queuing systems.
This sets up queuing system run sc... | [
"Write",
"scripts",
"for",
"queuing",
"systems",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/qsub.py#L306-L402 | [
"def",
"generate_submit_scripts",
"(",
"templates",
",",
"prefix",
"=",
"None",
",",
"deffnm",
"=",
"'md'",
",",
"jobname",
"=",
"'MD'",
",",
"budget",
"=",
"None",
",",
"mdrun_opts",
"=",
"None",
",",
"walltime",
"=",
"1.0",
",",
"jobarray_string",
"=",
... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | generate_submit_array | Generate a array job.
For each ``work_dir`` in *directories*, the array job will
1. cd into ``work_dir``
2. run the job as detailed in the template
It will use all the queuing system directives found in the
template. If more complicated set ups are required, then this
function cannot be used.... | gromacs/qsub.py | def generate_submit_array(templates, directories, **kwargs):
"""Generate a array job.
For each ``work_dir`` in *directories*, the array job will
1. cd into ``work_dir``
2. run the job as detailed in the template
It will use all the queuing system directives found in the
template. If more comp... | def generate_submit_array(templates, directories, **kwargs):
"""Generate a array job.
For each ``work_dir`` in *directories*, the array job will
1. cd into ``work_dir``
2. run the job as detailed in the template
It will use all the queuing system directives found in the
template. If more comp... | [
"Generate",
"a",
"array",
"job",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/qsub.py#L405-L449 | [
"def",
"generate_submit_array",
"(",
"templates",
",",
"directories",
",",
"*",
"*",
"kwargs",
")",
":",
"dirname",
"=",
"kwargs",
".",
"setdefault",
"(",
"'dirname'",
",",
"os",
".",
"path",
".",
"curdir",
")",
"reldirs",
"=",
"[",
"relpath",
"(",
"p",
... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | QueuingSystem.array | Return multiline string for simple array jobs over *directories*.
.. Warning:: The string is in ``bash`` and hence the template must also
be ``bash`` (and *not* ``csh`` or ``sh``). | gromacs/qsub.py | def array(self, directories):
"""Return multiline string for simple array jobs over *directories*.
.. Warning:: The string is in ``bash`` and hence the template must also
be ``bash`` (and *not* ``csh`` or ``sh``).
"""
if not self.has_arrays():
raise NotI... | def array(self, directories):
"""Return multiline string for simple array jobs over *directories*.
.. Warning:: The string is in ``bash`` and hence the template must also
be ``bash`` (and *not* ``csh`` or ``sh``).
"""
if not self.has_arrays():
raise NotI... | [
"Return",
"multiline",
"string",
"for",
"simple",
"array",
"jobs",
"over",
"*",
"directories",
"*",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/qsub.py#L251-L279 | [
"def",
"array",
"(",
"self",
",",
"directories",
")",
":",
"if",
"not",
"self",
".",
"has_arrays",
"(",
")",
":",
"raise",
"NotImplementedError",
"(",
"'Not known how make array jobs for '",
"'queuing system %(name)s'",
"%",
"vars",
"(",
"self",
")",
")",
"hrule... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | QueuingSystem.isMine | Primitive queuing system detection; only looks at suffix at the moment. | gromacs/qsub.py | def isMine(self, scriptname):
"""Primitive queuing system detection; only looks at suffix at the moment."""
suffix = os.path.splitext(scriptname)[1].lower()
if suffix.startswith('.'):
suffix = suffix[1:]
return self.suffix == suffix | def isMine(self, scriptname):
"""Primitive queuing system detection; only looks at suffix at the moment."""
suffix = os.path.splitext(scriptname)[1].lower()
if suffix.startswith('.'):
suffix = suffix[1:]
return self.suffix == suffix | [
"Primitive",
"queuing",
"system",
"detection",
";",
"only",
"looks",
"at",
"suffix",
"at",
"the",
"moment",
"."
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/qsub.py#L281-L286 | [
"def",
"isMine",
"(",
"self",
",",
"scriptname",
")",
":",
"suffix",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"scriptname",
")",
"[",
"1",
"]",
".",
"lower",
"(",
")",
"if",
"suffix",
".",
"startswith",
"(",
"'.'",
")",
":",
"suffix",
"=",
"... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | Molecule.anumb_to_atom | Returns the atom object corresponding to an atom number | gromacs/fileformats/blocks.py | def anumb_to_atom(self, anumb):
'''Returns the atom object corresponding to an atom number'''
assert isinstance(anumb, int), "anumb must be integer"
if not self._anumb_to_atom: # empty dictionary
if self.atoms:
for atom in self.atoms:
self._an... | def anumb_to_atom(self, anumb):
'''Returns the atom object corresponding to an atom number'''
assert isinstance(anumb, int), "anumb must be integer"
if not self._anumb_to_atom: # empty dictionary
if self.atoms:
for atom in self.atoms:
self._an... | [
"Returns",
"the",
"atom",
"object",
"corresponding",
"to",
"an",
"atom",
"number"
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/blocks.py#L145-L165 | [
"def",
"anumb_to_atom",
"(",
"self",
",",
"anumb",
")",
":",
"assert",
"isinstance",
"(",
"anumb",
",",
"int",
")",
",",
"\"anumb must be integer\"",
"if",
"not",
"self",
".",
"_anumb_to_atom",
":",
"# empty dictionary",
"if",
"self",
".",
"atoms",
":",
"for... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | Molecule.renumber_atoms | Reset the molecule's atoms :attr:`number` to be 1-indexed | gromacs/fileformats/blocks.py | def renumber_atoms(self):
"""Reset the molecule's atoms :attr:`number` to be 1-indexed"""
if self.atoms:
# reset the mapping
self._anumb_to_atom = {}
for i,atom in enumerate(self.atoms):
atom.number = i+1 # starting from 1
else:
... | def renumber_atoms(self):
"""Reset the molecule's atoms :attr:`number` to be 1-indexed"""
if self.atoms:
# reset the mapping
self._anumb_to_atom = {}
for i,atom in enumerate(self.atoms):
atom.number = i+1 # starting from 1
else:
... | [
"Reset",
"the",
"molecule",
"s",
"atoms",
":",
"attr",
":",
"number",
"to",
"be",
"1",
"-",
"indexed"
] | Becksteinlab/GromacsWrapper | python | https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/fileformats/blocks.py#L168-L179 | [
"def",
"renumber_atoms",
"(",
"self",
")",
":",
"if",
"self",
".",
"atoms",
":",
"# reset the mapping",
"self",
".",
"_anumb_to_atom",
"=",
"{",
"}",
"for",
"i",
",",
"atom",
"in",
"enumerate",
"(",
"self",
".",
"atoms",
")",
":",
"atom",
".",
"number"... | d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9 |
valid | total_regular_pixels_from_mask | Compute the total number of unmasked regular pixels in a masks. | autolens/data/array/util/mask_util.py | def total_regular_pixels_from_mask(mask):
"""Compute the total number of unmasked regular pixels in a masks."""
total_regular_pixels = 0
for y in range(mask.shape[0]):
for x in range(mask.shape[1]):
if not mask[y, x]:
total_regular_pixels += 1
return total_regular_... | def total_regular_pixels_from_mask(mask):
"""Compute the total number of unmasked regular pixels in a masks."""
total_regular_pixels = 0
for y in range(mask.shape[0]):
for x in range(mask.shape[1]):
if not mask[y, x]:
total_regular_pixels += 1
return total_regular_... | [
"Compute",
"the",
"total",
"number",
"of",
"unmasked",
"regular",
"pixels",
"in",
"a",
"masks",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/mask_util.py#L18-L28 | [
"def",
"total_regular_pixels_from_mask",
"(",
"mask",
")",
":",
"total_regular_pixels",
"=",
"0",
"for",
"y",
"in",
"range",
"(",
"mask",
".",
"shape",
"[",
"0",
"]",
")",
":",
"for",
"x",
"in",
"range",
"(",
"mask",
".",
"shape",
"[",
"1",
"]",
")",... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | total_sparse_pixels_from_mask | Given the full (i.e. without removing pixels which are outside the regular-masks) pixelization grid's pixel centers
and the regular-masks, compute the total number of pixels which are within the regular-masks and thus used by the
pixelization grid.
Parameters
-----------
mask : ccd.masks.Mask
... | autolens/data/array/util/mask_util.py | def total_sparse_pixels_from_mask(mask, unmasked_sparse_grid_pixel_centres):
"""Given the full (i.e. without removing pixels which are outside the regular-masks) pixelization grid's pixel centers
and the regular-masks, compute the total number of pixels which are within the regular-masks and thus used by the
... | def total_sparse_pixels_from_mask(mask, unmasked_sparse_grid_pixel_centres):
"""Given the full (i.e. without removing pixels which are outside the regular-masks) pixelization grid's pixel centers
and the regular-masks, compute the total number of pixels which are within the regular-masks and thus used by the
... | [
"Given",
"the",
"full",
"(",
"i",
".",
"e",
".",
"without",
"removing",
"pixels",
"which",
"are",
"outside",
"the",
"regular",
"-",
"masks",
")",
"pixelization",
"grid",
"s",
"pixel",
"centers",
"and",
"the",
"regular",
"-",
"masks",
"compute",
"the",
"t... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/mask_util.py#L36-L59 | [
"def",
"total_sparse_pixels_from_mask",
"(",
"mask",
",",
"unmasked_sparse_grid_pixel_centres",
")",
":",
"total_sparse_pixels",
"=",
"0",
"for",
"unmasked_sparse_pixel_index",
"in",
"range",
"(",
"unmasked_sparse_grid_pixel_centres",
".",
"shape",
"[",
"0",
"]",
")",
"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | mask_circular_from_shape_pixel_scale_and_radius | Compute a circular masks from an input masks radius and regular shape. | autolens/data/array/util/mask_util.py | def mask_circular_from_shape_pixel_scale_and_radius(shape, pixel_scale, radius_arcsec, centre=(0.0, 0.0)):
"""Compute a circular masks from an input masks radius and regular shape."""
mask = np.full(shape, True)
centres_arcsec = mask_centres_from_shape_pixel_scale_and_centre(shape=mask.shape, pixel_scale=... | def mask_circular_from_shape_pixel_scale_and_radius(shape, pixel_scale, radius_arcsec, centre=(0.0, 0.0)):
"""Compute a circular masks from an input masks radius and regular shape."""
mask = np.full(shape, True)
centres_arcsec = mask_centres_from_shape_pixel_scale_and_centre(shape=mask.shape, pixel_scale=... | [
"Compute",
"a",
"circular",
"masks",
"from",
"an",
"input",
"masks",
"radius",
"and",
"regular",
"shape",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/mask_util.py#L62-L80 | [
"def",
"mask_circular_from_shape_pixel_scale_and_radius",
"(",
"shape",
",",
"pixel_scale",
",",
"radius_arcsec",
",",
"centre",
"=",
"(",
"0.0",
",",
"0.0",
")",
")",
":",
"mask",
"=",
"np",
".",
"full",
"(",
"shape",
",",
"True",
")",
"centres_arcsec",
"="... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | mask_circular_annular_from_shape_pixel_scale_and_radii | Compute an annular masks from an input inner and outer masks radius and regular shape. | autolens/data/array/util/mask_util.py | def mask_circular_annular_from_shape_pixel_scale_and_radii(shape, pixel_scale, inner_radius_arcsec, outer_radius_arcsec,
centre=(0.0, 0.0)):
"""Compute an annular masks from an input inner and outer masks radius and regular shape."""
mask = np.full(sha... | def mask_circular_annular_from_shape_pixel_scale_and_radii(shape, pixel_scale, inner_radius_arcsec, outer_radius_arcsec,
centre=(0.0, 0.0)):
"""Compute an annular masks from an input inner and outer masks radius and regular shape."""
mask = np.full(sha... | [
"Compute",
"an",
"annular",
"masks",
"from",
"an",
"input",
"inner",
"and",
"outer",
"masks",
"radius",
"and",
"regular",
"shape",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/mask_util.py#L83-L102 | [
"def",
"mask_circular_annular_from_shape_pixel_scale_and_radii",
"(",
"shape",
",",
"pixel_scale",
",",
"inner_radius_arcsec",
",",
"outer_radius_arcsec",
",",
"centre",
"=",
"(",
"0.0",
",",
"0.0",
")",
")",
":",
"mask",
"=",
"np",
".",
"full",
"(",
"shape",
",... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | mask_elliptical_from_shape_pixel_scale_and_radius | Compute a circular masks from an input masks radius and regular shape. | autolens/data/array/util/mask_util.py | def mask_elliptical_from_shape_pixel_scale_and_radius(shape, pixel_scale, major_axis_radius_arcsec, axis_ratio, phi,
centre=(0.0, 0.0)):
"""Compute a circular masks from an input masks radius and regular shape."""
mask = np.full(shape, True)
centres_ar... | def mask_elliptical_from_shape_pixel_scale_and_radius(shape, pixel_scale, major_axis_radius_arcsec, axis_ratio, phi,
centre=(0.0, 0.0)):
"""Compute a circular masks from an input masks radius and regular shape."""
mask = np.full(shape, True)
centres_ar... | [
"Compute",
"a",
"circular",
"masks",
"from",
"an",
"input",
"masks",
"radius",
"and",
"regular",
"shape",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/mask_util.py#L139-L159 | [
"def",
"mask_elliptical_from_shape_pixel_scale_and_radius",
"(",
"shape",
",",
"pixel_scale",
",",
"major_axis_radius_arcsec",
",",
"axis_ratio",
",",
"phi",
",",
"centre",
"=",
"(",
"0.0",
",",
"0.0",
")",
")",
":",
"mask",
"=",
"np",
".",
"full",
"(",
"shape... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | mask_elliptical_annular_from_shape_pixel_scale_and_radius | Compute a circular masks from an input masks radius and regular shape. | autolens/data/array/util/mask_util.py | def mask_elliptical_annular_from_shape_pixel_scale_and_radius(shape, pixel_scale,
inner_major_axis_radius_arcsec, inner_axis_ratio, inner_phi,
outer_major_axis_radius_arcsec, outer_axis_ratio, out... | def mask_elliptical_annular_from_shape_pixel_scale_and_radius(shape, pixel_scale,
inner_major_axis_radius_arcsec, inner_axis_ratio, inner_phi,
outer_major_axis_radius_arcsec, outer_axis_ratio, out... | [
"Compute",
"a",
"circular",
"masks",
"from",
"an",
"input",
"masks",
"radius",
"and",
"regular",
"shape",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/mask_util.py#L162-L189 | [
"def",
"mask_elliptical_annular_from_shape_pixel_scale_and_radius",
"(",
"shape",
",",
"pixel_scale",
",",
"inner_major_axis_radius_arcsec",
",",
"inner_axis_ratio",
",",
"inner_phi",
",",
"outer_major_axis_radius_arcsec",
",",
"outer_axis_ratio",
",",
"outer_phi",
",",
"centre... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | mask_blurring_from_mask_and_psf_shape | Compute a blurring masks from an input masks and psf shape.
The blurring masks corresponds to all pixels which are outside of the masks but will have a fraction of their \
light blur into the masked region due to PSF convolution. | autolens/data/array/util/mask_util.py | def mask_blurring_from_mask_and_psf_shape(mask, psf_shape):
"""Compute a blurring masks from an input masks and psf shape.
The blurring masks corresponds to all pixels which are outside of the masks but will have a fraction of their \
light blur into the masked region due to PSF convolution."""
blurri... | def mask_blurring_from_mask_and_psf_shape(mask, psf_shape):
"""Compute a blurring masks from an input masks and psf shape.
The blurring masks corresponds to all pixels which are outside of the masks but will have a fraction of their \
light blur into the masked region due to PSF convolution."""
blurri... | [
"Compute",
"a",
"blurring",
"masks",
"from",
"an",
"input",
"masks",
"and",
"psf",
"shape",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/mask_util.py#L192-L213 | [
"def",
"mask_blurring_from_mask_and_psf_shape",
"(",
"mask",
",",
"psf_shape",
")",
":",
"blurring_mask",
"=",
"np",
".",
"full",
"(",
"mask",
".",
"shape",
",",
"True",
")",
"for",
"y",
"in",
"range",
"(",
"mask",
".",
"shape",
"[",
"0",
"]",
")",
":"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | masked_grid_1d_index_to_2d_pixel_index_from_mask | Compute a 1D array that maps every unmasked pixel to its corresponding 2d pixel using its (y,x) pixel indexes.
For howtolens if pixel [2,5] corresponds to the second pixel on the 1D array, grid_to_pixel[1] = [2,5] | autolens/data/array/util/mask_util.py | def masked_grid_1d_index_to_2d_pixel_index_from_mask(mask):
"""Compute a 1D array that maps every unmasked pixel to its corresponding 2d pixel using its (y,x) pixel indexes.
For howtolens if pixel [2,5] corresponds to the second pixel on the 1D array, grid_to_pixel[1] = [2,5]"""
total_regular_pixels = tot... | def masked_grid_1d_index_to_2d_pixel_index_from_mask(mask):
"""Compute a 1D array that maps every unmasked pixel to its corresponding 2d pixel using its (y,x) pixel indexes.
For howtolens if pixel [2,5] corresponds to the second pixel on the 1D array, grid_to_pixel[1] = [2,5]"""
total_regular_pixels = tot... | [
"Compute",
"a",
"1D",
"array",
"that",
"maps",
"every",
"unmasked",
"pixel",
"to",
"its",
"corresponding",
"2d",
"pixel",
"using",
"its",
"(",
"y",
"x",
")",
"pixel",
"indexes",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/mask_util.py#L216-L231 | [
"def",
"masked_grid_1d_index_to_2d_pixel_index_from_mask",
"(",
"mask",
")",
":",
"total_regular_pixels",
"=",
"total_regular_pixels_from_mask",
"(",
"mask",
")",
"grid_to_pixel",
"=",
"np",
".",
"zeros",
"(",
"shape",
"=",
"(",
"total_regular_pixels",
",",
"2",
")",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | masked_sub_grid_1d_index_to_2d_sub_pixel_index_from_mask | Compute a 1D array that maps every unmasked pixel to its corresponding 2d pixel using its (y,x) pixel indexes.
For howtolens if pixel [2,5] corresponds to the second pixel on the 1D array, grid_to_pixel[1] = [2,5] | autolens/data/array/util/mask_util.py | def masked_sub_grid_1d_index_to_2d_sub_pixel_index_from_mask(mask, sub_grid_size):
"""Compute a 1D array that maps every unmasked pixel to its corresponding 2d pixel using its (y,x) pixel indexes.
For howtolens if pixel [2,5] corresponds to the second pixel on the 1D array, grid_to_pixel[1] = [2,5]"""
tot... | def masked_sub_grid_1d_index_to_2d_sub_pixel_index_from_mask(mask, sub_grid_size):
"""Compute a 1D array that maps every unmasked pixel to its corresponding 2d pixel using its (y,x) pixel indexes.
For howtolens if pixel [2,5] corresponds to the second pixel on the 1D array, grid_to_pixel[1] = [2,5]"""
tot... | [
"Compute",
"a",
"1D",
"array",
"that",
"maps",
"every",
"unmasked",
"pixel",
"to",
"its",
"corresponding",
"2d",
"pixel",
"using",
"its",
"(",
"y",
"x",
")",
"pixel",
"indexes",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/mask_util.py#L234-L251 | [
"def",
"masked_sub_grid_1d_index_to_2d_sub_pixel_index_from_mask",
"(",
"mask",
",",
"sub_grid_size",
")",
":",
"total_sub_pixels",
"=",
"total_sub_pixels_from_mask_and_sub_grid_size",
"(",
"mask",
"=",
"mask",
",",
"sub_grid_size",
"=",
"sub_grid_size",
")",
"sub_grid_to_sub... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | total_edge_pixels_from_mask | Compute the total number of borders-pixels in a masks. | autolens/data/array/util/mask_util.py | def total_edge_pixels_from_mask(mask):
"""Compute the total number of borders-pixels in a masks."""
border_pixel_total = 0
for y in range(mask.shape[0]):
for x in range(mask.shape[1]):
if not mask[y, x]:
if mask[y + 1, x] or mask[y - 1, x] or mask[y, x + 1] or mask[y, x... | def total_edge_pixels_from_mask(mask):
"""Compute the total number of borders-pixels in a masks."""
border_pixel_total = 0
for y in range(mask.shape[0]):
for x in range(mask.shape[1]):
if not mask[y, x]:
if mask[y + 1, x] or mask[y - 1, x] or mask[y, x + 1] or mask[y, x... | [
"Compute",
"the",
"total",
"number",
"of",
"borders",
"-",
"pixels",
"in",
"a",
"masks",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/mask_util.py#L254-L266 | [
"def",
"total_edge_pixels_from_mask",
"(",
"mask",
")",
":",
"border_pixel_total",
"=",
"0",
"for",
"y",
"in",
"range",
"(",
"mask",
".",
"shape",
"[",
"0",
"]",
")",
":",
"for",
"x",
"in",
"range",
"(",
"mask",
".",
"shape",
"[",
"1",
"]",
")",
":... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | edge_pixels_from_mask | Compute a 1D array listing all edge pixel indexes in the masks. An edge pixel is a pixel which is not fully \
surrounding by False masks values i.e. it is on an edge. | autolens/data/array/util/mask_util.py | def edge_pixels_from_mask(mask):
"""Compute a 1D array listing all edge pixel indexes in the masks. An edge pixel is a pixel which is not fully \
surrounding by False masks values i.e. it is on an edge."""
edge_pixel_total = total_edge_pixels_from_mask(mask)
edge_pixels = np.zeros(edge_pixel_total)
... | def edge_pixels_from_mask(mask):
"""Compute a 1D array listing all edge pixel indexes in the masks. An edge pixel is a pixel which is not fully \
surrounding by False masks values i.e. it is on an edge."""
edge_pixel_total = total_edge_pixels_from_mask(mask)
edge_pixels = np.zeros(edge_pixel_total)
... | [
"Compute",
"a",
"1D",
"array",
"listing",
"all",
"edge",
"pixel",
"indexes",
"in",
"the",
"masks",
".",
"An",
"edge",
"pixel",
"is",
"a",
"pixel",
"which",
"is",
"not",
"fully",
"\\",
"surrounding",
"by",
"False",
"masks",
"values",
"i",
".",
"e",
".",... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/mask_util.py#L269-L289 | [
"def",
"edge_pixels_from_mask",
"(",
"mask",
")",
":",
"edge_pixel_total",
"=",
"total_edge_pixels_from_mask",
"(",
"mask",
")",
"edge_pixels",
"=",
"np",
".",
"zeros",
"(",
"edge_pixel_total",
")",
"edge_index",
"=",
"0",
"regular_index",
"=",
"0",
"for",
"y",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | total_border_pixels_from_mask_and_edge_pixels | Compute the total number of borders-pixels in a masks. | autolens/data/array/util/mask_util.py | def total_border_pixels_from_mask_and_edge_pixels(mask, edge_pixels, masked_grid_index_to_pixel):
"""Compute the total number of borders-pixels in a masks."""
border_pixel_total = 0
for i in range(edge_pixels.shape[0]):
if check_if_border_pixel(mask, edge_pixels[i], masked_grid_index_to_pixel):
... | def total_border_pixels_from_mask_and_edge_pixels(mask, edge_pixels, masked_grid_index_to_pixel):
"""Compute the total number of borders-pixels in a masks."""
border_pixel_total = 0
for i in range(edge_pixels.shape[0]):
if check_if_border_pixel(mask, edge_pixels[i], masked_grid_index_to_pixel):
... | [
"Compute",
"the",
"total",
"number",
"of",
"borders",
"-",
"pixels",
"in",
"a",
"masks",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/mask_util.py#L308-L318 | [
"def",
"total_border_pixels_from_mask_and_edge_pixels",
"(",
"mask",
",",
"edge_pixels",
",",
"masked_grid_index_to_pixel",
")",
":",
"border_pixel_total",
"=",
"0",
"for",
"i",
"in",
"range",
"(",
"edge_pixels",
".",
"shape",
"[",
"0",
"]",
")",
":",
"if",
"che... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | border_pixels_from_mask | Compute a 1D array listing all borders pixel indexes in the masks. A borders pixel is a pixel which:
1) is not fully surrounding by False masks values.
2) Can reach the edge of the array without hitting a masked pixel in one of four directions (upwards, downwards,
left, right).
The borders pixels ... | autolens/data/array/util/mask_util.py | def border_pixels_from_mask(mask):
"""Compute a 1D array listing all borders pixel indexes in the masks. A borders pixel is a pixel which:
1) is not fully surrounding by False masks values.
2) Can reach the edge of the array without hitting a masked pixel in one of four directions (upwards, downwards,
... | def border_pixels_from_mask(mask):
"""Compute a 1D array listing all borders pixel indexes in the masks. A borders pixel is a pixel which:
1) is not fully surrounding by False masks values.
2) Can reach the edge of the array without hitting a masked pixel in one of four directions (upwards, downwards,
... | [
"Compute",
"a",
"1D",
"array",
"listing",
"all",
"borders",
"pixel",
"indexes",
"in",
"the",
"masks",
".",
"A",
"borders",
"pixel",
"is",
"a",
"pixel",
"which",
":"
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/mask_util.py#L321-L346 | [
"def",
"border_pixels_from_mask",
"(",
"mask",
")",
":",
"edge_pixels",
"=",
"edge_pixels_from_mask",
"(",
"mask",
")",
"masked_grid_index_to_pixel",
"=",
"masked_grid_1d_index_to_2d_pixel_index_from_mask",
"(",
"mask",
")",
"border_pixel_total",
"=",
"total_border_pixels_fro... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | bin_up_mask_2d | Bin up an array to coarser resolution, by binning up groups of pixels and using their sum value to determine \
the value of the new pixel.
If an array of shape (8,8) is input and the bin up size is 2, this would return a new array of size (4,4) where \
every pixel was the sum of each collection of 2x2 pix... | autolens/data/array/util/mask_util.py | def bin_up_mask_2d(mask_2d, bin_up_factor):
"""Bin up an array to coarser resolution, by binning up groups of pixels and using their sum value to determine \
the value of the new pixel.
If an array of shape (8,8) is input and the bin up size is 2, this would return a new array of size (4,4) where \
ev... | def bin_up_mask_2d(mask_2d, bin_up_factor):
"""Bin up an array to coarser resolution, by binning up groups of pixels and using their sum value to determine \
the value of the new pixel.
If an array of shape (8,8) is input and the bin up size is 2, this would return a new array of size (4,4) where \
ev... | [
"Bin",
"up",
"an",
"array",
"to",
"coarser",
"resolution",
"by",
"binning",
"up",
"groups",
"of",
"pixels",
"and",
"using",
"their",
"sum",
"value",
"to",
"determine",
"\\",
"the",
"value",
"of",
"the",
"new",
"pixel",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/mask_util.py#L368-L417 | [
"def",
"bin_up_mask_2d",
"(",
"mask_2d",
",",
"bin_up_factor",
")",
":",
"padded_array_2d",
"=",
"array_util",
".",
"pad_2d_array_for_binning_up_with_bin_up_factor",
"(",
"array_2d",
"=",
"mask_2d",
",",
"bin_up_factor",
"=",
"bin_up_factor",
",",
"pad_value",
"=",
"T... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_fit_subplot_lens_plane_only | Plot the model datas_ of an analysis, using the *Fitter* class object.
The visualization and output type can be fully customized.
Parameters
-----------
fit : autolens.lens.fitting.Fitter
Class containing fit between the model datas_ and observed lens datas_ (including residual_map, chi_square... | autolens/lens/plotters/lens_fit_plotters.py | def plot_fit_subplot_lens_plane_only(
fit, should_plot_mask=True, extract_array_from_mask=False, zoom_around_mask=False, positions=None,
should_plot_image_plane_pix=False,
units='arcsec', figsize=None, aspect='square',
cmap='jet', norm='linear', norm_min=None, norm_max=None, linthresh=0.... | def plot_fit_subplot_lens_plane_only(
fit, should_plot_mask=True, extract_array_from_mask=False, zoom_around_mask=False, positions=None,
should_plot_image_plane_pix=False,
units='arcsec', figsize=None, aspect='square',
cmap='jet', norm='linear', norm_min=None, norm_max=None, linthresh=0.... | [
"Plot",
"the",
"model",
"datas_",
"of",
"an",
"analysis",
"using",
"the",
"*",
"Fitter",
"*",
"class",
"object",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/plotters/lens_fit_plotters.py#L45-L158 | [
"def",
"plot_fit_subplot_lens_plane_only",
"(",
"fit",
",",
"should_plot_mask",
"=",
"True",
",",
"extract_array_from_mask",
"=",
"False",
",",
"zoom_around_mask",
"=",
"False",
",",
"positions",
"=",
"None",
",",
"should_plot_image_plane_pix",
"=",
"False",
",",
"u... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_fit_subplot_lens_and_source_planes | Plot the model datas_ of an analysis, using the *Fitter* class object.
The visualization and output type can be fully customized.
Parameters
-----------
fit : autolens.lens.fitting.Fitter
Class containing fit between the model datas_ and observed lens datas_ (including residual_map, chi_square... | autolens/lens/plotters/lens_fit_plotters.py | def plot_fit_subplot_lens_and_source_planes(
fit, should_plot_mask=True, extract_array_from_mask=False, zoom_around_mask=False,
should_plot_source_grid=False, positions=None, should_plot_image_plane_pix=False, plot_mass_profile_centres=True,
units='arcsec', figsize=None, aspect='square',
... | def plot_fit_subplot_lens_and_source_planes(
fit, should_plot_mask=True, extract_array_from_mask=False, zoom_around_mask=False,
should_plot_source_grid=False, positions=None, should_plot_image_plane_pix=False, plot_mass_profile_centres=True,
units='arcsec', figsize=None, aspect='square',
... | [
"Plot",
"the",
"model",
"datas_",
"of",
"an",
"analysis",
"using",
"the",
"*",
"Fitter",
"*",
"class",
"object",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/plotters/lens_fit_plotters.py#L160-L338 | [
"def",
"plot_fit_subplot_lens_and_source_planes",
"(",
"fit",
",",
"should_plot_mask",
"=",
"True",
",",
"extract_array_from_mask",
"=",
"False",
",",
"zoom_around_mask",
"=",
"False",
",",
"should_plot_source_grid",
"=",
"False",
",",
"positions",
"=",
"None",
",",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_fit_individuals_lens_plane_only | Plot the model datas_ of an analysis, using the *Fitter* class object.
The visualization and output type can be fully customized.
Parameters
-----------
fit : autolens.lens.fitting.Fitter
Class containing fit between the model datas_ and observed lens datas_ (including residual_map, chi_square... | autolens/lens/plotters/lens_fit_plotters.py | def plot_fit_individuals_lens_plane_only(
fit, should_plot_mask=True, extract_array_from_mask=False, zoom_around_mask=False, positions=None,
should_plot_image_plane_pix=False,
should_plot_image=False,
should_plot_noise_map=False,
should_plot_signal_to_noise_map=False,
sho... | def plot_fit_individuals_lens_plane_only(
fit, should_plot_mask=True, extract_array_from_mask=False, zoom_around_mask=False, positions=None,
should_plot_image_plane_pix=False,
should_plot_image=False,
should_plot_noise_map=False,
should_plot_signal_to_noise_map=False,
sho... | [
"Plot",
"the",
"model",
"datas_",
"of",
"an",
"analysis",
"using",
"the",
"*",
"Fitter",
"*",
"class",
"object",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/plotters/lens_fit_plotters.py#L392-L465 | [
"def",
"plot_fit_individuals_lens_plane_only",
"(",
"fit",
",",
"should_plot_mask",
"=",
"True",
",",
"extract_array_from_mask",
"=",
"False",
",",
"zoom_around_mask",
"=",
"False",
",",
"positions",
"=",
"None",
",",
"should_plot_image_plane_pix",
"=",
"False",
",",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_fit_individuals_lens_and_source_planes | Plot the model datas_ of an analysis, using the *Fitter* class object.
The visualization and output type can be fully customized.
Parameters
-----------
fit : autolens.lens.fitting.Fitter
Class containing fit between the model datas_ and observed lens datas_ (including residual_map, chi_square... | autolens/lens/plotters/lens_fit_plotters.py | def plot_fit_individuals_lens_and_source_planes(
fit, should_plot_mask=True, extract_array_from_mask=False, zoom_around_mask=False, positions=None,
should_plot_image_plane_pix=False,
should_plot_image=False,
should_plot_noise_map=False,
should_plot_signal_to_noise_map=False,
... | def plot_fit_individuals_lens_and_source_planes(
fit, should_plot_mask=True, extract_array_from_mask=False, zoom_around_mask=False, positions=None,
should_plot_image_plane_pix=False,
should_plot_image=False,
should_plot_noise_map=False,
should_plot_signal_to_noise_map=False,
... | [
"Plot",
"the",
"model",
"datas_",
"of",
"an",
"analysis",
"using",
"the",
"*",
"Fitter",
"*",
"class",
"object",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/plotters/lens_fit_plotters.py#L467-L583 | [
"def",
"plot_fit_individuals_lens_and_source_planes",
"(",
"fit",
",",
"should_plot_mask",
"=",
"True",
",",
"extract_array_from_mask",
"=",
"False",
",",
"zoom_around_mask",
"=",
"False",
",",
"positions",
"=",
"None",
",",
"should_plot_image_plane_pix",
"=",
"False",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | setup_figure | Setup a figure for plotting an image.
Parameters
-----------
figsize : (int, int)
The size of the figure in (rows, columns).
as_subplot : bool
If the figure is a subplot, the setup_figure function is omitted to ensure that each subplot does not create a \
new figure and so that ... | autolens/plotters/plotter_util.py | def setup_figure(figsize, as_subplot):
"""Setup a figure for plotting an image.
Parameters
-----------
figsize : (int, int)
The size of the figure in (rows, columns).
as_subplot : bool
If the figure is a subplot, the setup_figure function is omitted to ensure that each subplot does ... | def setup_figure(figsize, as_subplot):
"""Setup a figure for plotting an image.
Parameters
-----------
figsize : (int, int)
The size of the figure in (rows, columns).
as_subplot : bool
If the figure is a subplot, the setup_figure function is omitted to ensure that each subplot does ... | [
"Setup",
"a",
"figure",
"for",
"plotting",
"an",
"image",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/plotter_util.py#L35-L48 | [
"def",
"setup_figure",
"(",
"figsize",
",",
"as_subplot",
")",
":",
"if",
"not",
"as_subplot",
":",
"fig",
"=",
"plt",
".",
"figure",
"(",
"figsize",
"=",
"figsize",
")",
"return",
"fig"
] | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | output_figure | Output the figure, either as an image on the screen or to the hard-disk as a .png or .fits file.
Parameters
-----------
array : ndarray
The 2D array of image to be output, required for outputting the image as a fits file.
as_subplot : bool
Whether the figure is part of subplot, in which... | autolens/plotters/plotter_util.py | def output_figure(array, as_subplot, output_path, output_filename, output_format):
"""Output the figure, either as an image on the screen or to the hard-disk as a .png or .fits file.
Parameters
-----------
array : ndarray
The 2D array of image to be output, required for outputting the image as ... | def output_figure(array, as_subplot, output_path, output_filename, output_format):
"""Output the figure, either as an image on the screen or to the hard-disk as a .png or .fits file.
Parameters
-----------
array : ndarray
The 2D array of image to be output, required for outputting the image as ... | [
"Output",
"the",
"figure",
"either",
"as",
"an",
"image",
"on",
"the",
"screen",
"or",
"to",
"the",
"hard",
"-",
"disk",
"as",
"a",
".",
"png",
"or",
".",
"fits",
"file",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/plotter_util.py#L64-L92 | [
"def",
"output_figure",
"(",
"array",
",",
"as_subplot",
",",
"output_path",
",",
"output_filename",
",",
"output_format",
")",
":",
"if",
"not",
"as_subplot",
":",
"if",
"output_format",
"is",
"'show'",
":",
"plt",
".",
"show",
"(",
")",
"elif",
"output_for... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | output_subplot_array | Output a figure which consists of a set of subplot,, either as an image on the screen or to the hard-disk as a \
.png file.
Parameters
-----------
output_path : str
The path on the hard-disk where the figure is output.
output_filename : str
The filename of the figure that is output.... | autolens/plotters/plotter_util.py | def output_subplot_array(output_path, output_filename, output_format):
"""Output a figure which consists of a set of subplot,, either as an image on the screen or to the hard-disk as a \
.png file.
Parameters
-----------
output_path : str
The path on the hard-disk where the figure is output... | def output_subplot_array(output_path, output_filename, output_format):
"""Output a figure which consists of a set of subplot,, either as an image on the screen or to the hard-disk as a \
.png file.
Parameters
-----------
output_path : str
The path on the hard-disk where the figure is output... | [
"Output",
"a",
"figure",
"which",
"consists",
"of",
"a",
"set",
"of",
"subplot",
"either",
"as",
"an",
"image",
"on",
"the",
"screen",
"or",
"to",
"the",
"hard",
"-",
"disk",
"as",
"a",
"\\",
".",
"png",
"file",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/plotter_util.py#L95-L115 | [
"def",
"output_subplot_array",
"(",
"output_path",
",",
"output_filename",
",",
"output_format",
")",
":",
"if",
"output_format",
"is",
"'show'",
":",
"plt",
".",
"show",
"(",
")",
"elif",
"output_format",
"is",
"'png'",
":",
"plt",
".",
"savefig",
"(",
"out... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | image_psf_shape_tag_from_image_psf_shape | Generate an image psf shape tag, to customize phase names based on size of the image PSF that the original PSF \
is trimmed to for faster run times.
This changes the phase name 'phase_name' as follows:
image_psf_shape = 1 -> phase_name
image_psf_shape = 2 -> phase_name_image_psf_shape_2
image_psf_... | autolens/pipeline/tagging.py | def image_psf_shape_tag_from_image_psf_shape(image_psf_shape):
"""Generate an image psf shape tag, to customize phase names based on size of the image PSF that the original PSF \
is trimmed to for faster run times.
This changes the phase name 'phase_name' as follows:
image_psf_shape = 1 -> phase_name
... | def image_psf_shape_tag_from_image_psf_shape(image_psf_shape):
"""Generate an image psf shape tag, to customize phase names based on size of the image PSF that the original PSF \
is trimmed to for faster run times.
This changes the phase name 'phase_name' as follows:
image_psf_shape = 1 -> phase_name
... | [
"Generate",
"an",
"image",
"psf",
"shape",
"tag",
"to",
"customize",
"phase",
"names",
"based",
"on",
"size",
"of",
"the",
"image",
"PSF",
"that",
"the",
"original",
"PSF",
"\\",
"is",
"trimmed",
"to",
"for",
"faster",
"run",
"times",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/pipeline/tagging.py#L56-L71 | [
"def",
"image_psf_shape_tag_from_image_psf_shape",
"(",
"image_psf_shape",
")",
":",
"if",
"image_psf_shape",
"is",
"None",
":",
"return",
"''",
"else",
":",
"y",
"=",
"str",
"(",
"image_psf_shape",
"[",
"0",
"]",
")",
"x",
"=",
"str",
"(",
"image_psf_shape",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | inversion_psf_shape_tag_from_inversion_psf_shape | Generate an inversion psf shape tag, to customize phase names based on size of the inversion PSF that the \
original PSF is trimmed to for faster run times.
This changes the phase name 'phase_name' as follows:
inversion_psf_shape = 1 -> phase_name
inversion_psf_shape = 2 -> phase_name_inversion_psf_sh... | autolens/pipeline/tagging.py | def inversion_psf_shape_tag_from_inversion_psf_shape(inversion_psf_shape):
"""Generate an inversion psf shape tag, to customize phase names based on size of the inversion PSF that the \
original PSF is trimmed to for faster run times.
This changes the phase name 'phase_name' as follows:
inversion_psf_... | def inversion_psf_shape_tag_from_inversion_psf_shape(inversion_psf_shape):
"""Generate an inversion psf shape tag, to customize phase names based on size of the inversion PSF that the \
original PSF is trimmed to for faster run times.
This changes the phase name 'phase_name' as follows:
inversion_psf_... | [
"Generate",
"an",
"inversion",
"psf",
"shape",
"tag",
"to",
"customize",
"phase",
"names",
"based",
"on",
"size",
"of",
"the",
"inversion",
"PSF",
"that",
"the",
"\\",
"original",
"PSF",
"is",
"trimmed",
"to",
"for",
"faster",
"run",
"times",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/pipeline/tagging.py#L73-L88 | [
"def",
"inversion_psf_shape_tag_from_inversion_psf_shape",
"(",
"inversion_psf_shape",
")",
":",
"if",
"inversion_psf_shape",
"is",
"None",
":",
"return",
"''",
"else",
":",
"y",
"=",
"str",
"(",
"inversion_psf_shape",
"[",
"0",
"]",
")",
"x",
"=",
"str",
"(",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | bulge_disk_tag_from_align_bulge_disks | Generate a tag for the alignment of the geometry of the bulge and disk of a bulge-disk system, to customize \
phase names based on the bulge-disk model. This adds together the bulge_disk tags generated in the 3 functions
above | autolens/pipeline/tagging.py | def bulge_disk_tag_from_align_bulge_disks(align_bulge_disk_centre, align_bulge_disk_axis_ratio, align_bulge_disk_phi):
"""Generate a tag for the alignment of the geometry of the bulge and disk of a bulge-disk system, to customize \
phase names based on the bulge-disk model. This adds together the bulge_disk ta... | def bulge_disk_tag_from_align_bulge_disks(align_bulge_disk_centre, align_bulge_disk_axis_ratio, align_bulge_disk_phi):
"""Generate a tag for the alignment of the geometry of the bulge and disk of a bulge-disk system, to customize \
phase names based on the bulge-disk model. This adds together the bulge_disk ta... | [
"Generate",
"a",
"tag",
"for",
"the",
"alignment",
"of",
"the",
"geometry",
"of",
"the",
"bulge",
"and",
"disk",
"of",
"a",
"bulge",
"-",
"disk",
"system",
"to",
"customize",
"\\",
"phase",
"names",
"based",
"on",
"the",
"bulge",
"-",
"disk",
"model",
... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/pipeline/tagging.py#L170-L182 | [
"def",
"bulge_disk_tag_from_align_bulge_disks",
"(",
"align_bulge_disk_centre",
",",
"align_bulge_disk_axis_ratio",
",",
"align_bulge_disk_phi",
")",
":",
"align_bulge_disk_centre_tag",
"=",
"align_bulge_disk_centre_tag_from_align_bulge_disk_centre",
"(",
"align_bulge_disk_centre",
"="... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | ordered_plane_redshifts_from_galaxies | Given a list of galaxies (with redshifts), return a list of the redshifts in ascending order.
If two or more galaxies have the same redshift that redshift is not double counted.
Parameters
-----------
galaxies : [Galaxy]
The list of galaxies in the ray-tracing calculation. | autolens/lens/util/lens_util.py | def ordered_plane_redshifts_from_galaxies(galaxies):
"""Given a list of galaxies (with redshifts), return a list of the redshifts in ascending order.
If two or more galaxies have the same redshift that redshift is not double counted.
Parameters
-----------
galaxies : [Galaxy]
The list of g... | def ordered_plane_redshifts_from_galaxies(galaxies):
"""Given a list of galaxies (with redshifts), return a list of the redshifts in ascending order.
If two or more galaxies have the same redshift that redshift is not double counted.
Parameters
-----------
galaxies : [Galaxy]
The list of g... | [
"Given",
"a",
"list",
"of",
"galaxies",
"(",
"with",
"redshifts",
")",
"return",
"a",
"list",
"of",
"the",
"redshifts",
"in",
"ascending",
"order",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/util/lens_util.py#L30-L46 | [
"def",
"ordered_plane_redshifts_from_galaxies",
"(",
"galaxies",
")",
":",
"ordered_galaxies",
"=",
"sorted",
"(",
"galaxies",
",",
"key",
"=",
"lambda",
"galaxy",
":",
"galaxy",
".",
"redshift",
",",
"reverse",
"=",
"False",
")",
"# Ideally we'd extract the planes_... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | ordered_plane_redshifts_from_lens_and_source_plane_redshifts_and_slice_sizes | Given a set of lens plane redshifts, the source-plane redshift and the number of planes between each, setup the \
plane redshifts using these values. A lens redshift corresponds to the 'main' lens galaxy(s),
whereas the slices collect line-of-sight halos over a range of redshifts.
The source-plane redshift... | autolens/lens/util/lens_util.py | def ordered_plane_redshifts_from_lens_and_source_plane_redshifts_and_slice_sizes(lens_redshifts, planes_between_lenses,
source_plane_redshift):
"""Given a set of lens plane redshifts, the source-plane redshift and the number of planes ... | def ordered_plane_redshifts_from_lens_and_source_plane_redshifts_and_slice_sizes(lens_redshifts, planes_between_lenses,
source_plane_redshift):
"""Given a set of lens plane redshifts, the source-plane redshift and the number of planes ... | [
"Given",
"a",
"set",
"of",
"lens",
"plane",
"redshifts",
"the",
"source",
"-",
"plane",
"redshift",
"and",
"the",
"number",
"of",
"planes",
"between",
"each",
"setup",
"the",
"\\",
"plane",
"redshifts",
"using",
"these",
"values",
".",
"A",
"lens",
"redshi... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/util/lens_util.py#L48-L99 | [
"def",
"ordered_plane_redshifts_from_lens_and_source_plane_redshifts_and_slice_sizes",
"(",
"lens_redshifts",
",",
"planes_between_lenses",
",",
"source_plane_redshift",
")",
":",
"# Check that the number of slices between lens planes is equal to the number of intervals between the lens planes."... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | galaxies_in_redshift_ordered_planes_from_galaxies | Given a list of galaxies (with redshifts), return a list of the galaxies where each entry contains a list \
of galaxies at the same redshift in ascending redshift order.
Parameters
-----------
galaxies : [Galaxy]
The list of galaxies in the ray-tracing calculation. | autolens/lens/util/lens_util.py | def galaxies_in_redshift_ordered_planes_from_galaxies(galaxies, plane_redshifts):
"""Given a list of galaxies (with redshifts), return a list of the galaxies where each entry contains a list \
of galaxies at the same redshift in ascending redshift order.
Parameters
-----------
galaxies : [Galaxy]
... | def galaxies_in_redshift_ordered_planes_from_galaxies(galaxies, plane_redshifts):
"""Given a list of galaxies (with redshifts), return a list of the galaxies where each entry contains a list \
of galaxies at the same redshift in ascending redshift order.
Parameters
-----------
galaxies : [Galaxy]
... | [
"Given",
"a",
"list",
"of",
"galaxies",
"(",
"with",
"redshifts",
")",
"return",
"a",
"list",
"of",
"the",
"galaxies",
"where",
"each",
"entry",
"contains",
"a",
"list",
"\\",
"of",
"galaxies",
"at",
"the",
"same",
"redshift",
"in",
"ascending",
"redshift"... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/util/lens_util.py#L101-L119 | [
"def",
"galaxies_in_redshift_ordered_planes_from_galaxies",
"(",
"galaxies",
",",
"plane_redshifts",
")",
":",
"galaxies_in_redshift_ordered_planes",
"=",
"[",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"plane_redshifts",
")",
")",
"]",
"for",
"galaxy",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | compute_deflections_at_next_plane | This function determines whether the tracer should compute the deflections at the next plane.
This is True if there is another plane after this plane, else it is False..
Parameters
-----------
plane_index : int
The index of the plane we are deciding if we should compute its deflections.
to... | autolens/lens/util/lens_util.py | def compute_deflections_at_next_plane(plane_index, total_planes):
"""This function determines whether the tracer should compute the deflections at the next plane.
This is True if there is another plane after this plane, else it is False..
Parameters
-----------
plane_index : int
The index ... | def compute_deflections_at_next_plane(plane_index, total_planes):
"""This function determines whether the tracer should compute the deflections at the next plane.
This is True if there is another plane after this plane, else it is False..
Parameters
-----------
plane_index : int
The index ... | [
"This",
"function",
"determines",
"whether",
"the",
"tracer",
"should",
"compute",
"the",
"deflections",
"at",
"the",
"next",
"plane",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/util/lens_util.py#L121-L138 | [
"def",
"compute_deflections_at_next_plane",
"(",
"plane_index",
",",
"total_planes",
")",
":",
"if",
"plane_index",
"<",
"total_planes",
"-",
"1",
":",
"return",
"True",
"elif",
"plane_index",
"==",
"total_planes",
"-",
"1",
":",
"return",
"False",
"else",
":",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | scaled_deflection_stack_from_plane_and_scaling_factor | Given a plane and scaling factor, compute a set of scaled deflections.
Parameters
-----------
plane : plane.Plane
The plane whose deflection stack is scaled.
scaling_factor : float
The factor the deflection angles are scaled by, which is typically the scaling factor between redshifts fo... | autolens/lens/util/lens_util.py | def scaled_deflection_stack_from_plane_and_scaling_factor(plane, scaling_factor):
"""Given a plane and scaling factor, compute a set of scaled deflections.
Parameters
-----------
plane : plane.Plane
The plane whose deflection stack is scaled.
scaling_factor : float
The factor the de... | def scaled_deflection_stack_from_plane_and_scaling_factor(plane, scaling_factor):
"""Given a plane and scaling factor, compute a set of scaled deflections.
Parameters
-----------
plane : plane.Plane
The plane whose deflection stack is scaled.
scaling_factor : float
The factor the de... | [
"Given",
"a",
"plane",
"and",
"scaling",
"factor",
"compute",
"a",
"set",
"of",
"scaled",
"deflections",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/util/lens_util.py#L140-L158 | [
"def",
"scaled_deflection_stack_from_plane_and_scaling_factor",
"(",
"plane",
",",
"scaling_factor",
")",
":",
"def",
"scale",
"(",
"grid",
")",
":",
"return",
"np",
".",
"multiply",
"(",
"scaling_factor",
",",
"grid",
")",
"if",
"plane",
".",
"deflection_stack",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | grid_stack_from_deflection_stack | For a deflection stack, comput a new grid stack but subtracting the deflections | autolens/lens/util/lens_util.py | def grid_stack_from_deflection_stack(grid_stack, deflection_stack):
"""For a deflection stack, comput a new grid stack but subtracting the deflections"""
if deflection_stack is not None:
def minus(grid, deflections):
return grid - deflections
return grid_stack.map_function(minus, d... | def grid_stack_from_deflection_stack(grid_stack, deflection_stack):
"""For a deflection stack, comput a new grid stack but subtracting the deflections"""
if deflection_stack is not None:
def minus(grid, deflections):
return grid - deflections
return grid_stack.map_function(minus, d... | [
"For",
"a",
"deflection",
"stack",
"comput",
"a",
"new",
"grid",
"stack",
"but",
"subtracting",
"the",
"deflections"
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/util/lens_util.py#L160-L167 | [
"def",
"grid_stack_from_deflection_stack",
"(",
"grid_stack",
",",
"deflection_stack",
")",
":",
"if",
"deflection_stack",
"is",
"not",
"None",
":",
"def",
"minus",
"(",
"grid",
",",
"deflections",
")",
":",
"return",
"grid",
"-",
"deflections",
"return",
"grid_... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_ray_tracing_subplot | Plot the observed _tracer of an analysis, using the *CCD* class object.
The visualization and output type can be fully customized.
Parameters
-----------
tracer : autolens.ccd.tracer.CCD
Class containing the _tracer, noise_map-mappers and PSF that are to be plotted.
The font size of th... | autolens/lens/plotters/ray_tracing_plotters.py | def plot_ray_tracing_subplot(
tracer, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None,
units='arcsec', figsize=None, aspect='square',
cmap='jet', norm='linear', norm_min=None, norm_max=None, linthresh=0.05, linscale=0.01,
cb_ticksize=10, cb_fraction=0.047... | def plot_ray_tracing_subplot(
tracer, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None,
units='arcsec', figsize=None, aspect='square',
cmap='jet', norm='linear', norm_min=None, norm_max=None, linthresh=0.05, linscale=0.01,
cb_ticksize=10, cb_fraction=0.047... | [
"Plot",
"the",
"observed",
"_tracer",
"of",
"an",
"analysis",
"using",
"the",
"*",
"CCD",
"*",
"class",
"object",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/plotters/ray_tracing_plotters.py#L7-L116 | [
"def",
"plot_ray_tracing_subplot",
"(",
"tracer",
",",
"mask",
"=",
"None",
",",
"extract_array_from_mask",
"=",
"False",
",",
"zoom_around_mask",
"=",
"False",
",",
"positions",
"=",
"None",
",",
"units",
"=",
"'arcsec'",
",",
"figsize",
"=",
"None",
",",
"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_ray_tracing_individual | Plot the observed _tracer of an analysis, using the *CCD* class object.
The visualization and output type can be fully customized.
Parameters
-----------
tracer : autolens.ccd.tracer.CCD
Class containing the _tracer, noise_map-mappers and PSF that are to be plotted.
The font size of th... | autolens/lens/plotters/ray_tracing_plotters.py | def plot_ray_tracing_individual(
tracer, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None,
should_plot_image_plane_image=False,
should_plot_source_plane=False,
should_plot_convergence=False,
should_plot_potential=False,
should_plot_deflecti... | def plot_ray_tracing_individual(
tracer, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None,
should_plot_image_plane_image=False,
should_plot_source_plane=False,
should_plot_convergence=False,
should_plot_potential=False,
should_plot_deflecti... | [
"Plot",
"the",
"observed",
"_tracer",
"of",
"an",
"analysis",
"using",
"the",
"*",
"CCD",
"*",
"class",
"object",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/plotters/ray_tracing_plotters.py#L118-L188 | [
"def",
"plot_ray_tracing_individual",
"(",
"tracer",
",",
"mask",
"=",
"None",
",",
"extract_array_from_mask",
"=",
"False",
",",
"zoom_around_mask",
"=",
"False",
",",
"positions",
"=",
"None",
",",
"should_plot_image_plane_image",
"=",
"False",
",",
"should_plot_s... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | constant_regularization_matrix_from_pixel_neighbors | From the pixel-neighbors, setup the regularization matrix using the constant regularization scheme.
Parameters
----------
coefficients : tuple
The regularization coefficients which controls the degree of smoothing of the inversion reconstruction.
pixel_neighbors : ndarray
An array of le... | autolens/model/inversion/util/regularization_util.py | def constant_regularization_matrix_from_pixel_neighbors(coefficients, pixel_neighbors, pixel_neighbors_size):
"""From the pixel-neighbors, setup the regularization matrix using the constant regularization scheme.
Parameters
----------
coefficients : tuple
The regularization coefficients which c... | def constant_regularization_matrix_from_pixel_neighbors(coefficients, pixel_neighbors, pixel_neighbors_size):
"""From the pixel-neighbors, setup the regularization matrix using the constant regularization scheme.
Parameters
----------
coefficients : tuple
The regularization coefficients which c... | [
"From",
"the",
"pixel",
"-",
"neighbors",
"setup",
"the",
"regularization",
"matrix",
"using",
"the",
"constant",
"regularization",
"scheme",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/util/regularization_util.py#L5-L33 | [
"def",
"constant_regularization_matrix_from_pixel_neighbors",
"(",
"coefficients",
",",
"pixel_neighbors",
",",
"pixel_neighbors_size",
")",
":",
"pixels",
"=",
"len",
"(",
"pixel_neighbors",
")",
"regularization_matrix",
"=",
"np",
".",
"zeros",
"(",
"shape",
"=",
"(... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | weighted_pixel_signals_from_images | Compute the (scaled) signal in each pixel, where the signal is the sum of its datas_-pixel fluxes. \
These pixel-signals are used to compute the effective regularization weight of each pixel.
The pixel signals are scaled in the following ways:
1) Divided by the number of datas_-pixels in the pixel, to ens... | autolens/model/inversion/util/regularization_util.py | def weighted_pixel_signals_from_images(pixels, signal_scale, regular_to_pix, galaxy_image):
"""Compute the (scaled) signal in each pixel, where the signal is the sum of its datas_-pixel fluxes. \
These pixel-signals are used to compute the effective regularization weight of each pixel.
The pixel signals ar... | def weighted_pixel_signals_from_images(pixels, signal_scale, regular_to_pix, galaxy_image):
"""Compute the (scaled) signal in each pixel, where the signal is the sum of its datas_-pixel fluxes. \
These pixel-signals are used to compute the effective regularization weight of each pixel.
The pixel signals ar... | [
"Compute",
"the",
"(",
"scaled",
")",
"signal",
"in",
"each",
"pixel",
"where",
"the",
"signal",
"is",
"the",
"sum",
"of",
"its",
"datas_",
"-",
"pixel",
"fluxes",
".",
"\\",
"These",
"pixel",
"-",
"signals",
"are",
"used",
"to",
"compute",
"the",
"eff... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/util/regularization_util.py#L36-L74 | [
"def",
"weighted_pixel_signals_from_images",
"(",
"pixels",
",",
"signal_scale",
",",
"regular_to_pix",
",",
"galaxy_image",
")",
":",
"pixel_signals",
"=",
"np",
".",
"zeros",
"(",
"(",
"pixels",
",",
")",
")",
"pixel_sizes",
"=",
"np",
".",
"zeros",
"(",
"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | weighted_regularization_matrix_from_pixel_neighbors | From the pixel-neighbors, setup the regularization matrix using the weighted regularization scheme.
Parameters
----------
regularization_weights : ndarray
The regularization_ weight of each pixel, which governs how much smoothing is applied to that individual pixel.
pixel_neighbors : ndarray
... | autolens/model/inversion/util/regularization_util.py | def weighted_regularization_matrix_from_pixel_neighbors(regularization_weights, pixel_neighbors,
pixel_neighbors_size):
"""From the pixel-neighbors, setup the regularization matrix using the weighted regularization scheme.
Parameters
----------
re... | def weighted_regularization_matrix_from_pixel_neighbors(regularization_weights, pixel_neighbors,
pixel_neighbors_size):
"""From the pixel-neighbors, setup the regularization matrix using the weighted regularization scheme.
Parameters
----------
re... | [
"From",
"the",
"pixel",
"-",
"neighbors",
"setup",
"the",
"regularization",
"matrix",
"using",
"the",
"weighted",
"regularization",
"scheme",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/util/regularization_util.py#L97-L127 | [
"def",
"weighted_regularization_matrix_from_pixel_neighbors",
"(",
"regularization_weights",
",",
"pixel_neighbors",
",",
"pixel_neighbors_size",
")",
":",
"pixels",
"=",
"len",
"(",
"regularization_weights",
")",
"regularization_matrix",
"=",
"np",
".",
"zeros",
"(",
"sh... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_array | Plot an array of data as a figure.
Parameters
-----------
array : data.array.scaled_array.ScaledArray
The 2D array of data which is plotted.
origin : (float, float).
The origin of the coordinate system of the array, which is plotted as an 'x' on the image if input.
mask : data.array... | autolens/plotters/array_plotters.py | def plot_array(array, origin=None, mask=None, extract_array_from_mask=False, zoom_around_mask=False,
should_plot_border=False, positions=None, centres=None, axis_ratios=None, phis=None, grid=None,
as_subplot=False,
units='arcsec', kpc_per_arcsec=None, figsize=(7, 7), aspect=... | def plot_array(array, origin=None, mask=None, extract_array_from_mask=False, zoom_around_mask=False,
should_plot_border=False, positions=None, centres=None, axis_ratios=None, phis=None, grid=None,
as_subplot=False,
units='arcsec', kpc_per_arcsec=None, figsize=(7, 7), aspect=... | [
"Plot",
"an",
"array",
"of",
"data",
"as",
"a",
"figure",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L10-L164 | [
"def",
"plot_array",
"(",
"array",
",",
"origin",
"=",
"None",
",",
"mask",
"=",
"None",
",",
"extract_array_from_mask",
"=",
"False",
",",
"zoom_around_mask",
"=",
"False",
",",
"should_plot_border",
"=",
"False",
",",
"positions",
"=",
"None",
",",
"centre... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_figure | Open a matplotlib figure and plot the array of data on it.
Parameters
-----------
array : data.array.scaled_array.ScaledArray
The 2D array of data which is plotted.
as_subplot : bool
Whether the array is plotted as part of a subplot, in which case the grid figure is not opened / closed.... | autolens/plotters/array_plotters.py | def plot_figure(array, as_subplot, units, kpc_per_arcsec, figsize, aspect, cmap, norm, norm_min, norm_max,
linthresh, linscale, xticks_manual, yticks_manual):
"""Open a matplotlib figure and plot the array of data on it.
Parameters
-----------
array : data.array.scaled_array.ScaledArray... | def plot_figure(array, as_subplot, units, kpc_per_arcsec, figsize, aspect, cmap, norm, norm_min, norm_max,
linthresh, linscale, xticks_manual, yticks_manual):
"""Open a matplotlib figure and plot the array of data on it.
Parameters
-----------
array : data.array.scaled_array.ScaledArray... | [
"Open",
"a",
"matplotlib",
"figure",
"and",
"plot",
"the",
"array",
"of",
"data",
"on",
"it",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L166-L216 | [
"def",
"plot_figure",
"(",
"array",
",",
"as_subplot",
",",
"units",
",",
"kpc_per_arcsec",
",",
"figsize",
",",
"aspect",
",",
"cmap",
",",
"norm",
",",
"norm_min",
",",
"norm_max",
",",
"linthresh",
",",
"linscale",
",",
"xticks_manual",
",",
"yticks_manua... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | get_extent | Get the extent of the dimensions of the array in the units of the figure (e.g. arc-seconds or kpc).
This is used to set the extent of the array and thus the y / x axis limits.
Parameters
-----------
array : data.array.scaled_array.ScaledArray
The 2D array of data which is plotted.
units : ... | autolens/plotters/array_plotters.py | def get_extent(array, units, kpc_per_arcsec, xticks_manual, yticks_manual):
"""Get the extent of the dimensions of the array in the units of the figure (e.g. arc-seconds or kpc).
This is used to set the extent of the array and thus the y / x axis limits.
Parameters
-----------
array : data.array.s... | def get_extent(array, units, kpc_per_arcsec, xticks_manual, yticks_manual):
"""Get the extent of the dimensions of the array in the units of the figure (e.g. arc-seconds or kpc).
This is used to set the extent of the array and thus the y / x axis limits.
Parameters
-----------
array : data.array.s... | [
"Get",
"the",
"extent",
"of",
"the",
"dimensions",
"of",
"the",
"array",
"in",
"the",
"units",
"of",
"the",
"figure",
"(",
"e",
".",
"g",
".",
"arc",
"-",
"seconds",
"or",
"kpc",
")",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L218-L250 | [
"def",
"get_extent",
"(",
"array",
",",
"units",
",",
"kpc_per_arcsec",
",",
"xticks_manual",
",",
"yticks_manual",
")",
":",
"if",
"xticks_manual",
"is",
"not",
"None",
"and",
"yticks_manual",
"is",
"not",
"None",
":",
"return",
"np",
".",
"asarray",
"(",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | get_normalization_min_max | Get the minimum and maximum of the normalization of the array, which sets the lower and upper limits of the \
colormap.
If norm_min / norm_max are not supplied, the minimum / maximum values of the array of data are used.
Parameters
-----------
array : data.array.scaled_array.ScaledArray
Th... | autolens/plotters/array_plotters.py | def get_normalization_min_max(array, norm_min, norm_max):
"""Get the minimum and maximum of the normalization of the array, which sets the lower and upper limits of the \
colormap.
If norm_min / norm_max are not supplied, the minimum / maximum values of the array of data are used.
Parameters
-----... | def get_normalization_min_max(array, norm_min, norm_max):
"""Get the minimum and maximum of the normalization of the array, which sets the lower and upper limits of the \
colormap.
If norm_min / norm_max are not supplied, the minimum / maximum values of the array of data are used.
Parameters
-----... | [
"Get",
"the",
"minimum",
"and",
"maximum",
"of",
"the",
"normalization",
"of",
"the",
"array",
"which",
"sets",
"the",
"lower",
"and",
"upper",
"limits",
"of",
"the",
"\\",
"colormap",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L252-L272 | [
"def",
"get_normalization_min_max",
"(",
"array",
",",
"norm_min",
",",
"norm_max",
")",
":",
"if",
"norm_min",
"is",
"None",
":",
"norm_min",
"=",
"array",
".",
"min",
"(",
")",
"if",
"norm_max",
"is",
"None",
":",
"norm_max",
"=",
"array",
".",
"max",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | get_normalization_scale | Get the normalization scale of the colormap. This will be scaled based on the input min / max normalization \
values.
For a 'symmetric_log' colormap, linthesh and linscale also change the colormap.
If norm_min / norm_max are not supplied, the minimum / maximum values of the array of data are used.
Pa... | autolens/plotters/array_plotters.py | def get_normalization_scale(norm, norm_min, norm_max, linthresh, linscale):
"""Get the normalization scale of the colormap. This will be scaled based on the input min / max normalization \
values.
For a 'symmetric_log' colormap, linthesh and linscale also change the colormap.
If norm_min / norm_max ar... | def get_normalization_scale(norm, norm_min, norm_max, linthresh, linscale):
"""Get the normalization scale of the colormap. This will be scaled based on the input min / max normalization \
values.
For a 'symmetric_log' colormap, linthesh and linscale also change the colormap.
If norm_min / norm_max ar... | [
"Get",
"the",
"normalization",
"scale",
"of",
"the",
"colormap",
".",
"This",
"will",
"be",
"scaled",
"based",
"on",
"the",
"input",
"min",
"/",
"max",
"normalization",
"\\",
"values",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L274-L307 | [
"def",
"get_normalization_scale",
"(",
"norm",
",",
"norm_min",
",",
"norm_max",
",",
"linthresh",
",",
"linscale",
")",
":",
"if",
"norm",
"is",
"'linear'",
":",
"return",
"colors",
".",
"Normalize",
"(",
"vmin",
"=",
"norm_min",
",",
"vmax",
"=",
"norm_m... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | set_colorbar | Setup the colorbar of the figure, specifically its ticksize and the size is appears relative to the figure.
Parameters
-----------
cb_ticksize : int
The size of the tick labels on the colorbar.
cb_fraction : float
The fraction of the figure that the colorbar takes up, which resizes the ... | autolens/plotters/array_plotters.py | def set_colorbar(cb_ticksize, cb_fraction, cb_pad, cb_tick_values, cb_tick_labels):
"""Setup the colorbar of the figure, specifically its ticksize and the size is appears relative to the figure.
Parameters
-----------
cb_ticksize : int
The size of the tick labels on the colorbar.
cb_fractio... | def set_colorbar(cb_ticksize, cb_fraction, cb_pad, cb_tick_values, cb_tick_labels):
"""Setup the colorbar of the figure, specifically its ticksize and the size is appears relative to the figure.
Parameters
-----------
cb_ticksize : int
The size of the tick labels on the colorbar.
cb_fractio... | [
"Setup",
"the",
"colorbar",
"of",
"the",
"figure",
"specifically",
"its",
"ticksize",
"and",
"the",
"size",
"is",
"appears",
"relative",
"to",
"the",
"figure",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L350-L376 | [
"def",
"set_colorbar",
"(",
"cb_ticksize",
",",
"cb_fraction",
",",
"cb_pad",
",",
"cb_tick_values",
",",
"cb_tick_labels",
")",
":",
"if",
"cb_tick_values",
"is",
"None",
"and",
"cb_tick_labels",
"is",
"None",
":",
"cb",
"=",
"plt",
".",
"colorbar",
"(",
"f... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | convert_grid_units | Convert the grid from its input units (arc-seconds) to the input unit (e.g. retain arc-seconds) or convert to \
another set of units (pixels or kilo parsecs).
Parameters
-----------
array : data.array.scaled_array.ScaledArray
The 2D array of data which is plotted, the shape of which is used for... | autolens/plotters/array_plotters.py | def convert_grid_units(array, grid_arcsec, units, kpc_per_arcsec):
"""Convert the grid from its input units (arc-seconds) to the input unit (e.g. retain arc-seconds) or convert to \
another set of units (pixels or kilo parsecs).
Parameters
-----------
array : data.array.scaled_array.ScaledArray
... | def convert_grid_units(array, grid_arcsec, units, kpc_per_arcsec):
"""Convert the grid from its input units (arc-seconds) to the input unit (e.g. retain arc-seconds) or convert to \
another set of units (pixels or kilo parsecs).
Parameters
-----------
array : data.array.scaled_array.ScaledArray
... | [
"Convert",
"the",
"grid",
"from",
"its",
"input",
"units",
"(",
"arc",
"-",
"seconds",
")",
"to",
"the",
"input",
"unit",
"(",
"e",
".",
"g",
".",
"retain",
"arc",
"-",
"seconds",
")",
"or",
"convert",
"to",
"\\",
"another",
"set",
"of",
"units",
"... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L378-L401 | [
"def",
"convert_grid_units",
"(",
"array",
",",
"grid_arcsec",
",",
"units",
",",
"kpc_per_arcsec",
")",
":",
"if",
"units",
"in",
"'pixels'",
":",
"return",
"array",
".",
"grid_arcsec_to_grid_pixels",
"(",
"grid_arcsec",
"=",
"grid_arcsec",
")",
"elif",
"units"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_origin | Plot the (y,x) origin ofo the array's coordinates as a 'x'.
Parameters
-----------
array : data.array.scaled_array.ScaledArray
The 2D array of data which is plotted.
origin : (float, float).
The origin of the coordinate system of the array, which is plotted as an 'x' on the image if... | autolens/plotters/array_plotters.py | def plot_origin(array, origin, units, kpc_per_arcsec, zoom_offset_arcsec):
"""Plot the (y,x) origin ofo the array's coordinates as a 'x'.
Parameters
-----------
array : data.array.scaled_array.ScaledArray
The 2D array of data which is plotted.
origin : (float, float).
The origin... | def plot_origin(array, origin, units, kpc_per_arcsec, zoom_offset_arcsec):
"""Plot the (y,x) origin ofo the array's coordinates as a 'x'.
Parameters
-----------
array : data.array.scaled_array.ScaledArray
The 2D array of data which is plotted.
origin : (float, float).
The origin... | [
"Plot",
"the",
"(",
"y",
"x",
")",
"origin",
"ofo",
"the",
"array",
"s",
"coordinates",
"as",
"a",
"x",
".",
"Parameters",
"-----------",
"array",
":",
"data",
".",
"array",
".",
"scaled_array",
".",
"ScaledArray",
"The",
"2D",
"array",
"of",
"data",
"... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L403-L426 | [
"def",
"plot_origin",
"(",
"array",
",",
"origin",
",",
"units",
",",
"kpc_per_arcsec",
",",
"zoom_offset_arcsec",
")",
":",
"if",
"origin",
"is",
"not",
"None",
":",
"origin_grid",
"=",
"np",
".",
"asarray",
"(",
"origin",
")",
"if",
"zoom_offset_arcsec",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_centres | Plot the (y,x) centres (e.g. of a mass profile) on the array as an 'x'.
Parameters
-----------
array : data.array.scaled_array.ScaledArray
The 2D array of data which is plotted.
centres : [[tuple]]
The list of centres; centres in the same list entry are colored the same.
units : str... | autolens/plotters/array_plotters.py | def plot_centres(array, centres, units, kpc_per_arcsec, zoom_offset_arcsec):
"""Plot the (y,x) centres (e.g. of a mass profile) on the array as an 'x'.
Parameters
-----------
array : data.array.scaled_array.ScaledArray
The 2D array of data which is plotted.
centres : [[tuple]]
The l... | def plot_centres(array, centres, units, kpc_per_arcsec, zoom_offset_arcsec):
"""Plot the (y,x) centres (e.g. of a mass profile) on the array as an 'x'.
Parameters
-----------
array : data.array.scaled_array.ScaledArray
The 2D array of data which is plotted.
centres : [[tuple]]
The l... | [
"Plot",
"the",
"(",
"y",
"x",
")",
"centres",
"(",
"e",
".",
"g",
".",
"of",
"a",
"mass",
"profile",
")",
"on",
"the",
"array",
"as",
"an",
"x",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L428-L455 | [
"def",
"plot_centres",
"(",
"array",
",",
"centres",
",",
"units",
",",
"kpc_per_arcsec",
",",
"zoom_offset_arcsec",
")",
":",
"if",
"centres",
"is",
"not",
"None",
":",
"colors",
"=",
"itertools",
".",
"cycle",
"(",
"[",
"\"m\"",
",",
"\"y\"",
",",
"\"r... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_ellipses | Plot the (y,x) centres (e.g. of a mass profile) on the array as an 'x'.
Parameters
-----------
array : data.array.scaled_array.ScaledArray
The 2D array of data which is plotted.
centres : [[tuple]]
The list of centres; centres in the same list entry are colored the same.
units : str... | autolens/plotters/array_plotters.py | def plot_ellipses(fig, array, centres, axis_ratios, phis, units, kpc_per_arcsec, zoom_offset_arcsec):
"""Plot the (y,x) centres (e.g. of a mass profile) on the array as an 'x'.
Parameters
-----------
array : data.array.scaled_array.ScaledArray
The 2D array of data which is plotted.
centres ... | def plot_ellipses(fig, array, centres, axis_ratios, phis, units, kpc_per_arcsec, zoom_offset_arcsec):
"""Plot the (y,x) centres (e.g. of a mass profile) on the array as an 'x'.
Parameters
-----------
array : data.array.scaled_array.ScaledArray
The 2D array of data which is plotted.
centres ... | [
"Plot",
"the",
"(",
"y",
"x",
")",
"centres",
"(",
"e",
".",
"g",
".",
"of",
"a",
"mass",
"profile",
")",
"on",
"the",
"array",
"as",
"an",
"x",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L457-L493 | [
"def",
"plot_ellipses",
"(",
"fig",
",",
"array",
",",
"centres",
",",
"axis_ratios",
",",
"phis",
",",
"units",
",",
"kpc_per_arcsec",
",",
"zoom_offset_arcsec",
")",
":",
"if",
"centres",
"is",
"not",
"None",
"and",
"axis_ratios",
"is",
"not",
"None",
"a... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_mask | Plot the mask of the array on the figure.
Parameters
-----------
mask : ndarray of data.array.mask.Mask
The mask applied to the array, the edge of which is plotted as a set of points over the plotted array.
units : str
The units of the y / x axis of the plots, in arc-seconds ('arcsec') ... | autolens/plotters/array_plotters.py | def plot_mask(mask, units, kpc_per_arcsec, pointsize, zoom_offset_pixels):
"""Plot the mask of the array on the figure.
Parameters
-----------
mask : ndarray of data.array.mask.Mask
The mask applied to the array, the edge of which is plotted as a set of points over the plotted array.
units ... | def plot_mask(mask, units, kpc_per_arcsec, pointsize, zoom_offset_pixels):
"""Plot the mask of the array on the figure.
Parameters
-----------
mask : ndarray of data.array.mask.Mask
The mask applied to the array, the edge of which is plotted as a set of points over the plotted array.
units ... | [
"Plot",
"the",
"mask",
"of",
"the",
"array",
"on",
"the",
"figure",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L495-L520 | [
"def",
"plot_mask",
"(",
"mask",
",",
"units",
",",
"kpc_per_arcsec",
",",
"pointsize",
",",
"zoom_offset_pixels",
")",
":",
"if",
"mask",
"is",
"not",
"None",
":",
"plt",
".",
"gca",
"(",
")",
"edge_pixels",
"=",
"mask",
".",
"masked_grid_index_to_pixel",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_border | Plot the borders of the mask or the array on the figure.
Parameters
-----------t.
mask : ndarray of data.array.mask.Mask
The mask applied to the array, the edge of which is plotted as a set of points over the plotted array.
should_plot_border : bool
If a mask is supplied, its borders pi... | autolens/plotters/array_plotters.py | def plot_border(mask, should_plot_border, units, kpc_per_arcsec, pointsize, zoom_offset_pixels):
"""Plot the borders of the mask or the array on the figure.
Parameters
-----------t.
mask : ndarray of data.array.mask.Mask
The mask applied to the array, the edge of which is plotted as a set of po... | def plot_border(mask, should_plot_border, units, kpc_per_arcsec, pointsize, zoom_offset_pixels):
"""Plot the borders of the mask or the array on the figure.
Parameters
-----------t.
mask : ndarray of data.array.mask.Mask
The mask applied to the array, the edge of which is plotted as a set of po... | [
"Plot",
"the",
"borders",
"of",
"the",
"mask",
"or",
"the",
"array",
"on",
"the",
"figure",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L522-L550 | [
"def",
"plot_border",
"(",
"mask",
",",
"should_plot_border",
",",
"units",
",",
"kpc_per_arcsec",
",",
"pointsize",
",",
"zoom_offset_pixels",
")",
":",
"if",
"should_plot_border",
"and",
"mask",
"is",
"not",
"None",
":",
"plt",
".",
"gca",
"(",
")",
"borde... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_points | Plot a set of points over the array of data on the figure.
Parameters
-----------
positions : [[]]
Lists of (y,x) coordinates on the image which are plotted as colored dots, to highlight specific pixels.
array : data.array.scaled_array.ScaledArray
The 2D array of data which is plotted.
... | autolens/plotters/array_plotters.py | def plot_points(points_arcsec, array, units, kpc_per_arcsec, pointsize, zoom_offset_arcsec):
"""Plot a set of points over the array of data on the figure.
Parameters
-----------
positions : [[]]
Lists of (y,x) coordinates on the image which are plotted as colored dots, to highlight specific pix... | def plot_points(points_arcsec, array, units, kpc_per_arcsec, pointsize, zoom_offset_arcsec):
"""Plot a set of points over the array of data on the figure.
Parameters
-----------
positions : [[]]
Lists of (y,x) coordinates on the image which are plotted as colored dots, to highlight specific pix... | [
"Plot",
"a",
"set",
"of",
"points",
"over",
"the",
"array",
"of",
"data",
"on",
"the",
"figure",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L552-L578 | [
"def",
"plot_points",
"(",
"points_arcsec",
",",
"array",
",",
"units",
",",
"kpc_per_arcsec",
",",
"pointsize",
",",
"zoom_offset_arcsec",
")",
":",
"if",
"points_arcsec",
"is",
"not",
"None",
":",
"points_arcsec",
"=",
"list",
"(",
"map",
"(",
"lambda",
"p... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | plot_grid | Plot a grid of points over the array of data on the figure.
Parameters
-----------.
grid_arcsec : ndarray or data.array.grids.RegularGrid
A grid of (y,x) coordinates in arc-seconds which may be plotted over the array.
array : data.array.scaled_array.ScaledArray
The 2D array of data... | autolens/plotters/array_plotters.py | def plot_grid(grid_arcsec, array, units, kpc_per_arcsec, pointsize, zoom_offset_arcsec):
"""Plot a grid of points over the array of data on the figure.
Parameters
-----------.
grid_arcsec : ndarray or data.array.grids.RegularGrid
A grid of (y,x) coordinates in arc-seconds which may be plott... | def plot_grid(grid_arcsec, array, units, kpc_per_arcsec, pointsize, zoom_offset_arcsec):
"""Plot a grid of points over the array of data on the figure.
Parameters
-----------.
grid_arcsec : ndarray or data.array.grids.RegularGrid
A grid of (y,x) coordinates in arc-seconds which may be plott... | [
"Plot",
"a",
"grid",
"of",
"points",
"over",
"the",
"array",
"of",
"data",
"on",
"the",
"figure",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L580-L604 | [
"def",
"plot_grid",
"(",
"grid_arcsec",
",",
"array",
",",
"units",
",",
"kpc_per_arcsec",
",",
"pointsize",
",",
"zoom_offset_arcsec",
")",
":",
"if",
"grid_arcsec",
"is",
"not",
"None",
":",
"if",
"zoom_offset_arcsec",
"is",
"not",
"None",
":",
"grid_arcsec"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | Mapper.mapping_matrix | The mapping matrix is a matrix representing the mapping between every unmasked pixel of a grid and \
the pixels of a pixelization. Non-zero entries signify a mapping, whereas zeros signify no mapping.
For example, if the regular grid has 5 pixels and the pixelization 3 pixels, with the following mappin... | autolens/model/inversion/mappers.py | def mapping_matrix(self):
"""The mapping matrix is a matrix representing the mapping between every unmasked pixel of a grid and \
the pixels of a pixelization. Non-zero entries signify a mapping, whereas zeros signify no mapping.
For example, if the regular grid has 5 pixels and the pixelizatio... | def mapping_matrix(self):
"""The mapping matrix is a matrix representing the mapping between every unmasked pixel of a grid and \
the pixels of a pixelization. Non-zero entries signify a mapping, whereas zeros signify no mapping.
For example, if the regular grid has 5 pixels and the pixelizatio... | [
"The",
"mapping",
"matrix",
"is",
"a",
"matrix",
"representing",
"the",
"mapping",
"between",
"every",
"unmasked",
"pixel",
"of",
"a",
"grid",
"and",
"\\",
"the",
"pixels",
"of",
"a",
"pixelization",
".",
"Non",
"-",
"zero",
"entries",
"signify",
"a",
"map... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/mappers.py#L37-L84 | [
"def",
"mapping_matrix",
"(",
"self",
")",
":",
"return",
"mapper_util",
".",
"mapping_matrix_from_sub_to_pix",
"(",
"sub_to_pix",
"=",
"self",
".",
"sub_to_pix",
",",
"pixels",
"=",
"self",
".",
"pixels",
",",
"regular_pixels",
"=",
"self",
".",
"grid_stack",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | Mapper.pix_to_regular | Compute the mappings between a pixelization's pixels and the unmasked regular-grid pixels. These mappings \
are determined after the regular-grid is used to determine the pixelization.
The pixelization's pixels map to different number of regular-grid pixels, thus a list of lists is used to \
re... | autolens/model/inversion/mappers.py | def pix_to_regular(self):
"""Compute the mappings between a pixelization's pixels and the unmasked regular-grid pixels. These mappings \
are determined after the regular-grid is used to determine the pixelization.
The pixelization's pixels map to different number of regular-grid pixels, thus a ... | def pix_to_regular(self):
"""Compute the mappings between a pixelization's pixels and the unmasked regular-grid pixels. These mappings \
are determined after the regular-grid is used to determine the pixelization.
The pixelization's pixels map to different number of regular-grid pixels, thus a ... | [
"Compute",
"the",
"mappings",
"between",
"a",
"pixelization",
"s",
"pixels",
"and",
"the",
"unmasked",
"regular",
"-",
"grid",
"pixels",
".",
"These",
"mappings",
"\\",
"are",
"determined",
"after",
"the",
"regular",
"-",
"grid",
"is",
"used",
"to",
"determi... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/mappers.py#L95-L107 | [
"def",
"pix_to_regular",
"(",
"self",
")",
":",
"pix_to_regular",
"=",
"[",
"[",
"]",
"for",
"_",
"in",
"range",
"(",
"self",
".",
"pixels",
")",
"]",
"for",
"regular_pixel",
",",
"pix_pixel",
"in",
"enumerate",
"(",
"self",
".",
"regular_to_pix",
")",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | Mapper.pix_to_sub | Compute the mappings between a pixelization's pixels and the unmasked sub-grid pixels. These mappings \
are determined after the regular-grid is used to determine the pixelization.
The pixelization's pixels map to different number of sub-grid pixels, thus a list of lists is used to \
represent ... | autolens/model/inversion/mappers.py | def pix_to_sub(self):
"""Compute the mappings between a pixelization's pixels and the unmasked sub-grid pixels. These mappings \
are determined after the regular-grid is used to determine the pixelization.
The pixelization's pixels map to different number of sub-grid pixels, thus a list of list... | def pix_to_sub(self):
"""Compute the mappings between a pixelization's pixels and the unmasked sub-grid pixels. These mappings \
are determined after the regular-grid is used to determine the pixelization.
The pixelization's pixels map to different number of sub-grid pixels, thus a list of list... | [
"Compute",
"the",
"mappings",
"between",
"a",
"pixelization",
"s",
"pixels",
"and",
"the",
"unmasked",
"sub",
"-",
"grid",
"pixels",
".",
"These",
"mappings",
"\\",
"are",
"determined",
"after",
"the",
"regular",
"-",
"grid",
"is",
"used",
"to",
"determine",... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/mappers.py#L110-L121 | [
"def",
"pix_to_sub",
"(",
"self",
")",
":",
"pix_to_sub",
"=",
"[",
"[",
"]",
"for",
"_",
"in",
"range",
"(",
"self",
".",
"pixels",
")",
"]",
"for",
"regular_pixel",
",",
"pix_pixel",
"in",
"enumerate",
"(",
"self",
".",
"sub_to_pix",
")",
":",
"pix... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | RectangularMapper.reconstructed_pixelization_from_solution_vector | Given the solution vector of an inversion (see *inversions.Inversion*), determine the reconstructed \
pixelization of the rectangular pixelization by using the mapper. | autolens/model/inversion/mappers.py | def reconstructed_pixelization_from_solution_vector(self, solution_vector):
"""Given the solution vector of an inversion (see *inversions.Inversion*), determine the reconstructed \
pixelization of the rectangular pixelization by using the mapper."""
recon = mapping_util.map_unmasked_1d_array_to_... | def reconstructed_pixelization_from_solution_vector(self, solution_vector):
"""Given the solution vector of an inversion (see *inversions.Inversion*), determine the reconstructed \
pixelization of the rectangular pixelization by using the mapper."""
recon = mapping_util.map_unmasked_1d_array_to_... | [
"Given",
"the",
"solution",
"vector",
"of",
"an",
"inversion",
"(",
"see",
"*",
"inversions",
".",
"Inversion",
"*",
")",
"determine",
"the",
"reconstructed",
"\\",
"pixelization",
"of",
"the",
"rectangular",
"pixelization",
"by",
"using",
"the",
"mapper",
"."... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/mappers.py#L163-L169 | [
"def",
"reconstructed_pixelization_from_solution_vector",
"(",
"self",
",",
"solution_vector",
")",
":",
"recon",
"=",
"mapping_util",
".",
"map_unmasked_1d_array_to_2d_array_from_array_1d_and_shape",
"(",
"array_1d",
"=",
"solution_vector",
",",
"shape",
"=",
"self",
".",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | VoronoiMapper.regular_to_pix | The 1D index mappings between the regular pixels and Voronoi pixelization pixels. | autolens/model/inversion/mappers.py | def regular_to_pix(self):
"""The 1D index mappings between the regular pixels and Voronoi pixelization pixels."""
return mapper_util.voronoi_regular_to_pix_from_grids_and_geometry(regular_grid=self.grid_stack.regular,
regular_to_nearest_pix=self.grid_stack.pix.regular_to_nearest_pix,
... | def regular_to_pix(self):
"""The 1D index mappings between the regular pixels and Voronoi pixelization pixels."""
return mapper_util.voronoi_regular_to_pix_from_grids_and_geometry(regular_grid=self.grid_stack.regular,
regular_to_nearest_pix=self.grid_stack.pix.regular_to_nearest_pix,
... | [
"The",
"1D",
"index",
"mappings",
"between",
"the",
"regular",
"pixels",
"and",
"Voronoi",
"pixelization",
"pixels",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/mappers.py#L203-L208 | [
"def",
"regular_to_pix",
"(",
"self",
")",
":",
"return",
"mapper_util",
".",
"voronoi_regular_to_pix_from_grids_and_geometry",
"(",
"regular_grid",
"=",
"self",
".",
"grid_stack",
".",
"regular",
",",
"regular_to_nearest_pix",
"=",
"self",
".",
"grid_stack",
".",
"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | VoronoiMapper.sub_to_pix | The 1D index mappings between the sub pixels and Voronoi pixelization pixels. | autolens/model/inversion/mappers.py | def sub_to_pix(self):
""" The 1D index mappings between the sub pixels and Voronoi pixelization pixels. """
return mapper_util.voronoi_sub_to_pix_from_grids_and_geometry(sub_grid=self.grid_stack.sub,
regular_to_nearest_pix=self.grid_stack.pix.regular_to_nearest_pix,
sub_to... | def sub_to_pix(self):
""" The 1D index mappings between the sub pixels and Voronoi pixelization pixels. """
return mapper_util.voronoi_sub_to_pix_from_grids_and_geometry(sub_grid=self.grid_stack.sub,
regular_to_nearest_pix=self.grid_stack.pix.regular_to_nearest_pix,
sub_to... | [
"The",
"1D",
"index",
"mappings",
"between",
"the",
"sub",
"pixels",
"and",
"Voronoi",
"pixelization",
"pixels",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/model/inversion/mappers.py#L211-L217 | [
"def",
"sub_to_pix",
"(",
"self",
")",
":",
"return",
"mapper_util",
".",
"voronoi_sub_to_pix_from_grids_and_geometry",
"(",
"sub_grid",
"=",
"self",
".",
"grid_stack",
".",
"sub",
",",
"regular_to_nearest_pix",
"=",
"self",
".",
"grid_stack",
".",
"pix",
".",
"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | centres_from_shape_pixel_scales_and_origin | Determine the (y,x) arc-second central coordinates of an array from its shape, pixel-scales and origin.
The coordinate system is defined such that the positive y axis is up and positive x axis is right.
Parameters
----------
shape : (int, int)
The (y,x) shape of the 2D array the arc-second c... | autolens/data/array/util/grid_util.py | def centres_from_shape_pixel_scales_and_origin(shape, pixel_scales, origin):
"""Determine the (y,x) arc-second central coordinates of an array from its shape, pixel-scales and origin.
The coordinate system is defined such that the positive y axis is up and positive x axis is right.
Parameters
------... | def centres_from_shape_pixel_scales_and_origin(shape, pixel_scales, origin):
"""Determine the (y,x) arc-second central coordinates of an array from its shape, pixel-scales and origin.
The coordinate system is defined such that the positive y axis is up and positive x axis is right.
Parameters
------... | [
"Determine",
"the",
"(",
"y",
"x",
")",
"arc",
"-",
"second",
"central",
"coordinates",
"of",
"an",
"array",
"from",
"its",
"shape",
"pixel",
"-",
"scales",
"and",
"origin",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/grid_util.py#L9-L36 | [
"def",
"centres_from_shape_pixel_scales_and_origin",
"(",
"shape",
",",
"pixel_scales",
",",
"origin",
")",
":",
"y_centre_arcsec",
"=",
"float",
"(",
"shape",
"[",
"0",
"]",
"-",
"1",
")",
"/",
"2",
"+",
"(",
"origin",
"[",
"0",
"]",
"/",
"pixel_scales",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | regular_grid_2d_from_shape_pixel_scales_and_origin | Compute the (y,x) arc second coordinates at the centre of every pixel of an array of shape (rows, columns).
Coordinates are defined from the top-left corner, such that the first pixel at location [0, 0] has negative x \
and y values in arc seconds.
The regular grid is returned on an array of shape (total_... | autolens/data/array/util/grid_util.py | def regular_grid_2d_from_shape_pixel_scales_and_origin(shape, pixel_scales, origin=(0.0, 0.0)):
"""Compute the (y,x) arc second coordinates at the centre of every pixel of an array of shape (rows, columns).
Coordinates are defined from the top-left corner, such that the first pixel at location [0, 0] has negat... | def regular_grid_2d_from_shape_pixel_scales_and_origin(shape, pixel_scales, origin=(0.0, 0.0)):
"""Compute the (y,x) arc second coordinates at the centre of every pixel of an array of shape (rows, columns).
Coordinates are defined from the top-left corner, such that the first pixel at location [0, 0] has negat... | [
"Compute",
"the",
"(",
"y",
"x",
")",
"arc",
"second",
"coordinates",
"at",
"the",
"centre",
"of",
"every",
"pixel",
"of",
"an",
"array",
"of",
"shape",
"(",
"rows",
"columns",
")",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/grid_util.py#L39-L80 | [
"def",
"regular_grid_2d_from_shape_pixel_scales_and_origin",
"(",
"shape",
",",
"pixel_scales",
",",
"origin",
"=",
"(",
"0.0",
",",
"0.0",
")",
")",
":",
"regular_grid_2d",
"=",
"np",
".",
"zeros",
"(",
"(",
"shape",
"[",
"0",
"]",
",",
"shape",
"[",
"1",... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | regular_grid_1d_from_shape_pixel_scales_and_origin | Compute the (y,x) arc second coordinates at the centre of every pixel of an array of shape (rows, columns).
Coordinates are defined from the top-left corner, such that the first pixel at location [0, 0] has negative x \
and y values in arc seconds.
The regular grid is returned on an array of shape (total_... | autolens/data/array/util/grid_util.py | def regular_grid_1d_from_shape_pixel_scales_and_origin(shape, pixel_scales, origin=(0.0, 0.0)):
"""Compute the (y,x) arc second coordinates at the centre of every pixel of an array of shape (rows, columns).
Coordinates are defined from the top-left corner, such that the first pixel at location [0, 0] has negat... | def regular_grid_1d_from_shape_pixel_scales_and_origin(shape, pixel_scales, origin=(0.0, 0.0)):
"""Compute the (y,x) arc second coordinates at the centre of every pixel of an array of shape (rows, columns).
Coordinates are defined from the top-left corner, such that the first pixel at location [0, 0] has negat... | [
"Compute",
"the",
"(",
"y",
"x",
")",
"arc",
"second",
"coordinates",
"at",
"the",
"centre",
"of",
"every",
"pixel",
"of",
"an",
"array",
"of",
"shape",
"(",
"rows",
"columns",
")",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/grid_util.py#L83-L126 | [
"def",
"regular_grid_1d_from_shape_pixel_scales_and_origin",
"(",
"shape",
",",
"pixel_scales",
",",
"origin",
"=",
"(",
"0.0",
",",
"0.0",
")",
")",
":",
"regular_grid_1d",
"=",
"np",
".",
"zeros",
"(",
"(",
"shape",
"[",
"0",
"]",
"*",
"shape",
"[",
"1",... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | regular_grid_1d_masked_from_mask_pixel_scales_and_origin | Compute the (y,x) arc second coordinates at the centre of every pixel of a 2D mask array of shape (rows, columns).
Coordinates are defined from the top-left corner, where the first unmasked pixel corresponds to index 0. The pixel \
at the top-left of the array has negative x and y values in arc seconds.
T... | autolens/data/array/util/grid_util.py | def regular_grid_1d_masked_from_mask_pixel_scales_and_origin(mask, pixel_scales, origin=(0.0, 0.0)):
"""Compute the (y,x) arc second coordinates at the centre of every pixel of a 2D mask array of shape (rows, columns).
Coordinates are defined from the top-left corner, where the first unmasked pixel corresponds... | def regular_grid_1d_masked_from_mask_pixel_scales_and_origin(mask, pixel_scales, origin=(0.0, 0.0)):
"""Compute the (y,x) arc second coordinates at the centre of every pixel of a 2D mask array of shape (rows, columns).
Coordinates are defined from the top-left corner, where the first unmasked pixel corresponds... | [
"Compute",
"the",
"(",
"y",
"x",
")",
"arc",
"second",
"coordinates",
"at",
"the",
"centre",
"of",
"every",
"pixel",
"of",
"a",
"2D",
"mask",
"array",
"of",
"shape",
"(",
"rows",
"columns",
")",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/grid_util.py#L129-L175 | [
"def",
"regular_grid_1d_masked_from_mask_pixel_scales_and_origin",
"(",
"mask",
",",
"pixel_scales",
",",
"origin",
"=",
"(",
"0.0",
",",
"0.0",
")",
")",
":",
"grid_2d",
"=",
"regular_grid_2d_from_shape_pixel_scales_and_origin",
"(",
"mask",
".",
"shape",
",",
"pixel... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | sub_grid_1d_masked_from_mask_pixel_scales_and_sub_grid_size | For the sub-grid, every unmasked pixel of a 2D mask array of shape (rows, columns) is divided into a finer \
uniform grid of shape (sub_grid_size, sub_grid_size). This routine computes the (y,x) arc second coordinates at \
the centre of every sub-pixel defined by this grid.
Coordinates are defined from the... | autolens/data/array/util/grid_util.py | def sub_grid_1d_masked_from_mask_pixel_scales_and_sub_grid_size(mask, pixel_scales, sub_grid_size, origin=(0.0, 0.0)):
""" For the sub-grid, every unmasked pixel of a 2D mask array of shape (rows, columns) is divided into a finer \
uniform grid of shape (sub_grid_size, sub_grid_size). This routine computes the ... | def sub_grid_1d_masked_from_mask_pixel_scales_and_sub_grid_size(mask, pixel_scales, sub_grid_size, origin=(0.0, 0.0)):
""" For the sub-grid, every unmasked pixel of a 2D mask array of shape (rows, columns) is divided into a finer \
uniform grid of shape (sub_grid_size, sub_grid_size). This routine computes the ... | [
"For",
"the",
"sub",
"-",
"grid",
"every",
"unmasked",
"pixel",
"of",
"a",
"2D",
"mask",
"array",
"of",
"shape",
"(",
"rows",
"columns",
")",
"is",
"divided",
"into",
"a",
"finer",
"\\",
"uniform",
"grid",
"of",
"shape",
"(",
"sub_grid_size",
"sub_grid_s... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/grid_util.py#L178-L246 | [
"def",
"sub_grid_1d_masked_from_mask_pixel_scales_and_sub_grid_size",
"(",
"mask",
",",
"pixel_scales",
",",
"sub_grid_size",
",",
"origin",
"=",
"(",
"0.0",
",",
"0.0",
")",
")",
":",
"total_sub_pixels",
"=",
"mask_util",
".",
"total_sub_pixels_from_mask_and_sub_grid_siz... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | grid_arcsec_1d_to_grid_pixel_centres_1d | Convert a grid of (y,x) arc second coordinates to a grid of (y,x) pixel values. Pixel coordinates are \
returned as integers such that they map directly to the pixel they are contained within.
The pixel coordinate origin is at the top left corner of the grid, such that the pixel [0,0] corresponds to \
high... | autolens/data/array/util/grid_util.py | def grid_arcsec_1d_to_grid_pixel_centres_1d(grid_arcsec_1d, shape, pixel_scales, origin=(0.0, 0.0)):
""" Convert a grid of (y,x) arc second coordinates to a grid of (y,x) pixel values. Pixel coordinates are \
returned as integers such that they map directly to the pixel they are contained within.
The pixel... | def grid_arcsec_1d_to_grid_pixel_centres_1d(grid_arcsec_1d, shape, pixel_scales, origin=(0.0, 0.0)):
""" Convert a grid of (y,x) arc second coordinates to a grid of (y,x) pixel values. Pixel coordinates are \
returned as integers such that they map directly to the pixel they are contained within.
The pixel... | [
"Convert",
"a",
"grid",
"of",
"(",
"y",
"x",
")",
"arc",
"second",
"coordinates",
"to",
"a",
"grid",
"of",
"(",
"y",
"x",
")",
"pixel",
"values",
".",
"Pixel",
"coordinates",
"are",
"\\",
"returned",
"as",
"integers",
"such",
"that",
"they",
"map",
"... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/grid_util.py#L297-L341 | [
"def",
"grid_arcsec_1d_to_grid_pixel_centres_1d",
"(",
"grid_arcsec_1d",
",",
"shape",
",",
"pixel_scales",
",",
"origin",
"=",
"(",
"0.0",
",",
"0.0",
")",
")",
":",
"grid_pixels_1d",
"=",
"np",
".",
"zeros",
"(",
"(",
"grid_arcsec_1d",
".",
"shape",
"[",
"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | grid_arcsec_1d_to_grid_pixel_indexes_1d | Convert a grid of (y,x) arc second coordinates to a grid of (y,x) pixel 1D indexes. Pixel coordinates are \
returned as integers such that they are the pixel from the top-left of the 2D grid going rights and then \
downwards.
For example:
The pixel at the top-left, whose 2D index is [0,0], corresponds... | autolens/data/array/util/grid_util.py | def grid_arcsec_1d_to_grid_pixel_indexes_1d(grid_arcsec_1d, shape, pixel_scales, origin=(0.0, 0.0)):
""" Convert a grid of (y,x) arc second coordinates to a grid of (y,x) pixel 1D indexes. Pixel coordinates are \
returned as integers such that they are the pixel from the top-left of the 2D grid going rights and... | def grid_arcsec_1d_to_grid_pixel_indexes_1d(grid_arcsec_1d, shape, pixel_scales, origin=(0.0, 0.0)):
""" Convert a grid of (y,x) arc second coordinates to a grid of (y,x) pixel 1D indexes. Pixel coordinates are \
returned as integers such that they are the pixel from the top-left of the 2D grid going rights and... | [
"Convert",
"a",
"grid",
"of",
"(",
"y",
"x",
")",
"arc",
"second",
"coordinates",
"to",
"a",
"grid",
"of",
"(",
"y",
"x",
")",
"pixel",
"1D",
"indexes",
".",
"Pixel",
"coordinates",
"are",
"\\",
"returned",
"as",
"integers",
"such",
"that",
"they",
"... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/grid_util.py#L344-L392 | [
"def",
"grid_arcsec_1d_to_grid_pixel_indexes_1d",
"(",
"grid_arcsec_1d",
",",
"shape",
",",
"pixel_scales",
",",
"origin",
"=",
"(",
"0.0",
",",
"0.0",
")",
")",
":",
"grid_pixels_1d",
"=",
"grid_arcsec_1d_to_grid_pixel_centres_1d",
"(",
"grid_arcsec_1d",
"=",
"grid_a... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | grid_pixels_1d_to_grid_arcsec_1d | Convert a grid of (y,x) pixel coordinates to a grid of (y,x) arc second values.
The pixel coordinate origin is at the top left corner of the grid, such that the pixel [0,0] corresponds to \
higher y arc-second coordinate value and lowest x arc-second coordinate.
The arc-second coordinate origin is defined... | autolens/data/array/util/grid_util.py | def grid_pixels_1d_to_grid_arcsec_1d(grid_pixels_1d, shape, pixel_scales, origin=(0.0, 0.0)):
""" Convert a grid of (y,x) pixel coordinates to a grid of (y,x) arc second values.
The pixel coordinate origin is at the top left corner of the grid, such that the pixel [0,0] corresponds to \
higher y arc-second... | def grid_pixels_1d_to_grid_arcsec_1d(grid_pixels_1d, shape, pixel_scales, origin=(0.0, 0.0)):
""" Convert a grid of (y,x) pixel coordinates to a grid of (y,x) arc second values.
The pixel coordinate origin is at the top left corner of the grid, such that the pixel [0,0] corresponds to \
higher y arc-second... | [
"Convert",
"a",
"grid",
"of",
"(",
"y",
"x",
")",
"pixel",
"coordinates",
"to",
"a",
"grid",
"of",
"(",
"y",
"x",
")",
"arc",
"second",
"values",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/grid_util.py#L395-L438 | [
"def",
"grid_pixels_1d_to_grid_arcsec_1d",
"(",
"grid_pixels_1d",
",",
"shape",
",",
"pixel_scales",
",",
"origin",
"=",
"(",
"0.0",
",",
"0.0",
")",
")",
":",
"grid_arcsec_1d",
"=",
"np",
".",
"zeros",
"(",
"(",
"grid_pixels_1d",
".",
"shape",
"[",
"0",
"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | grid_arcsec_2d_to_grid_pixel_centres_2d | Convert a grid of (y,x) arc second coordinates to a grid of (y,x) pixel values. Pixel coordinates are \
returned as integers such that they map directly to the pixel they are contained within.
The pixel coordinate origin is at the top left corner of the grid, such that the pixel [0,0] corresponds to \
high... | autolens/data/array/util/grid_util.py | def grid_arcsec_2d_to_grid_pixel_centres_2d(grid_arcsec_2d, shape, pixel_scales, origin=(0.0, 0.0)):
""" Convert a grid of (y,x) arc second coordinates to a grid of (y,x) pixel values. Pixel coordinates are \
returned as integers such that they map directly to the pixel they are contained within.
The pixel... | def grid_arcsec_2d_to_grid_pixel_centres_2d(grid_arcsec_2d, shape, pixel_scales, origin=(0.0, 0.0)):
""" Convert a grid of (y,x) arc second coordinates to a grid of (y,x) pixel values. Pixel coordinates are \
returned as integers such that they map directly to the pixel they are contained within.
The pixel... | [
"Convert",
"a",
"grid",
"of",
"(",
"y",
"x",
")",
"arc",
"second",
"coordinates",
"to",
"a",
"grid",
"of",
"(",
"y",
"x",
")",
"pixel",
"values",
".",
"Pixel",
"coordinates",
"are",
"\\",
"returned",
"as",
"integers",
"such",
"that",
"they",
"map",
"... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/array/util/grid_util.py#L441-L485 | [
"def",
"grid_arcsec_2d_to_grid_pixel_centres_2d",
"(",
"grid_arcsec_2d",
",",
"shape",
",",
"pixel_scales",
",",
"origin",
"=",
"(",
"0.0",
",",
"0.0",
")",
")",
":",
"grid_pixels_2d",
"=",
"np",
".",
"zeros",
"(",
"(",
"grid_arcsec_2d",
".",
"shape",
"[",
"... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | setup_random_seed | Setup the random seed. If the input seed is -1, the code will use a random seed for every run. If it is \
positive, that seed is used for all runs, thereby giving reproducible results.
Parameters
----------
seed : int
The seed of the random number generator. | autolens/data/ccd.py | def setup_random_seed(seed):
"""Setup the random seed. If the input seed is -1, the code will use a random seed for every run. If it is \
positive, that seed is used for all runs, thereby giving reproducible results.
Parameters
----------
seed : int
The seed of the random number generator.
... | def setup_random_seed(seed):
"""Setup the random seed. If the input seed is -1, the code will use a random seed for every run. If it is \
positive, that seed is used for all runs, thereby giving reproducible results.
Parameters
----------
seed : int
The seed of the random number generator.
... | [
"Setup",
"the",
"random",
"seed",
".",
"If",
"the",
"input",
"seed",
"is",
"-",
"1",
"the",
"code",
"will",
"use",
"a",
"random",
"seed",
"for",
"every",
"run",
".",
"If",
"it",
"is",
"\\",
"positive",
"that",
"seed",
"is",
"used",
"for",
"all",
"r... | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/ccd.py#L688-L700 | [
"def",
"setup_random_seed",
"(",
"seed",
")",
":",
"if",
"seed",
"==",
"-",
"1",
":",
"seed",
"=",
"np",
".",
"random",
".",
"randint",
"(",
"0",
",",
"int",
"(",
"1e9",
")",
")",
"# Use one seed, so all regions have identical column non-uniformity.",
"np",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
valid | generate_poisson_noise | Generate a two-dimensional poisson noise_maps-mappers from an image.
Values are computed from a Poisson distribution using the image's input values in units of counts.
Parameters
----------
image : ndarray
The 2D image, whose values in counts are used to draw Poisson noise_maps values.
exp... | autolens/data/ccd.py | def generate_poisson_noise(image, exposure_time_map, seed=-1):
"""
Generate a two-dimensional poisson noise_maps-mappers from an image.
Values are computed from a Poisson distribution using the image's input values in units of counts.
Parameters
----------
image : ndarray
The 2D image,... | def generate_poisson_noise(image, exposure_time_map, seed=-1):
"""
Generate a two-dimensional poisson noise_maps-mappers from an image.
Values are computed from a Poisson distribution using the image's input values in units of counts.
Parameters
----------
image : ndarray
The 2D image,... | [
"Generate",
"a",
"two",
"-",
"dimensional",
"poisson",
"noise_maps",
"-",
"mappers",
"from",
"an",
"image",
"."
] | Jammy2211/PyAutoLens | python | https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/data/ccd.py#L703-L725 | [
"def",
"generate_poisson_noise",
"(",
"image",
",",
"exposure_time_map",
",",
"seed",
"=",
"-",
"1",
")",
":",
"setup_random_seed",
"(",
"seed",
")",
"image_counts",
"=",
"np",
".",
"multiply",
"(",
"image",
",",
"exposure_time_map",
")",
"return",
"image",
... | 91e50369c7a9c048c83d217625578b72423cd5a7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.