hexsha stringlengths 40 40 | repo stringlengths 7 114 | path stringlengths 4 124 | license listlengths 1 9 | language stringclasses 1
value | identifier stringlengths 1 71 | return_type stringlengths 1 749 ⌀ | original_string stringlengths 76 22.7k | original_docstring stringlengths 16 7.61k | docstring stringlengths 16 2.47k | docstring_tokens listlengths 6 477 | code stringlengths 14 10.2k | code_tokens listlengths 6 996 | short_docstring stringlengths 2 644 | short_docstring_tokens listlengths 1 116 | comment listlengths 1 89 | parameters listlengths 0 64 | docstring_params dict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c4f78f10dd8454302a8ea44e768ff3ff43e26f6c | ska-telescope/algorithm-reference-library | processing_components/image/operations.py | [
"Apache-2.0"
] | Python | smooth_image | <not_specific> | def smooth_image(model: Image, width=1.0, normalise=True):
""" Smooth an image with a kernel
:param model: Image
:param width: Kernel in pixels
:param normalise: Normalise kernel peak to unity
"""
assert isinstance(model, Image), model
from astropy.convolution.kernels import G... | Smooth an image with a kernel
:param model: Image
:param width: Kernel in pixels
:param normalise: Normalise kernel peak to unity
| Smooth an image with a kernel | [
"Smooth",
"an",
"image",
"with",
"a",
"kernel"
] | def smooth_image(model: Image, width=1.0, normalise=True):
assert isinstance(model, Image), model
from astropy.convolution.kernels import Gaussian2DKernel
from astropy.convolution import convolve_fft
kernel = Gaussian2DKernel(width)
cmodel = create_empty_image_like(model)
nchan, npol, _, _ = mod... | [
"def",
"smooth_image",
"(",
"model",
":",
"Image",
",",
"width",
"=",
"1.0",
",",
"normalise",
"=",
"True",
")",
":",
"assert",
"isinstance",
"(",
"model",
",",
"Image",
")",
",",
"model",
"from",
"astropy",
".",
"convolution",
".",
"kernels",
"import",
... | Smooth an image with a kernel | [
"Smooth",
"an",
"image",
"with",
"a",
"kernel"
] | [
"\"\"\" Smooth an image with a kernel\n \n :param model: Image\n :param width: Kernel in pixels\n :param normalise: Normalise kernel peak to unity\n \n \"\"\""
] | [
{
"param": "model",
"type": "Image"
},
{
"param": "width",
"type": null
},
{
"param": "normalise",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "model",
"type": "Image",
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
"is_optional": null
},
{
"identifier": "width",
"type": null,
"docstring": "Kerne... |
c4f78f10dd8454302a8ea44e768ff3ff43e26f6c | ska-telescope/algorithm-reference-library | processing_components/image/operations.py | [
"Apache-2.0"
] | Python | calculate_image_frequency_moments | Image | def calculate_image_frequency_moments(im: Image, reference_frequency=None, nmoment=1) -> Image:
"""Calculate frequency weighted moments
Weights are ((freq-reference_frequency)/reference_frequency)**moment
Note that the spectral axis is replaced by a MOMENT axis.
For example, to find the m... | Calculate frequency weighted moments
Weights are ((freq-reference_frequency)/reference_frequency)**moment
Note that the spectral axis is replaced by a MOMENT axis.
For example, to find the moments and then reconstruct from just the moments::
moment_cube = calculate_image_frequenc... | Calculate frequency weighted moments
Weights are ((freq-reference_frequency)/reference_frequency)**moment
Note that the spectral axis is replaced by a MOMENT axis.
For example, to find the moments and then reconstruct from just the moments:.
| [
"Calculate",
"frequency",
"weighted",
"moments",
"Weights",
"are",
"((",
"freq",
"-",
"reference_frequency",
")",
"/",
"reference_frequency",
")",
"**",
"moment",
"Note",
"that",
"the",
"spectral",
"axis",
"is",
"replaced",
"by",
"a",
"MOMENT",
"axis",
".",
"F... | def calculate_image_frequency_moments(im: Image, reference_frequency=None, nmoment=1) -> Image:
assert isinstance(im, Image)
assert nmoment > 0
nchan, npol, ny, nx = im.shape
channels = numpy.arange(nchan)
freq = im.wcs.sub(['spectral']).wcs_pix2world(channels, 0)[0]
assert nmoment <= nchan, "Nu... | [
"def",
"calculate_image_frequency_moments",
"(",
"im",
":",
"Image",
",",
"reference_frequency",
"=",
"None",
",",
"nmoment",
"=",
"1",
")",
"->",
"Image",
":",
"assert",
"isinstance",
"(",
"im",
",",
"Image",
")",
"assert",
"nmoment",
">",
"0",
"nchan",
"... | Calculate frequency weighted moments
Weights are ((freq-reference_frequency)/reference_frequency)**moment | [
"Calculate",
"frequency",
"weighted",
"moments",
"Weights",
"are",
"((",
"freq",
"-",
"reference_frequency",
")",
"/",
"reference_frequency",
")",
"**",
"moment"
] | [
"\"\"\"Calculate frequency weighted moments\n \n Weights are ((freq-reference_frequency)/reference_frequency)**moment\n \n Note that the spectral axis is replaced by a MOMENT axis.\n \n For example, to find the moments and then reconstruct from just the moments::\n \n moment_cube = calcu... | [
{
"param": "im",
"type": "Image"
},
{
"param": "reference_frequency",
"type": null
},
{
"param": "nmoment",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "im",
"type": "Image",
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
... |
c4f78f10dd8454302a8ea44e768ff3ff43e26f6c | ska-telescope/algorithm-reference-library | processing_components/image/operations.py | [
"Apache-2.0"
] | Python | calculate_image_from_frequency_moments | Image | def calculate_image_from_frequency_moments(im: Image, moment_image: Image, reference_frequency=None) -> Image:
"""Calculate image from frequency weighted moments
Weights are ((freq-reference_frequency)/reference_frequency)**moment
Note that a new image is created
For example, to find the moments ... | Calculate image from frequency weighted moments
Weights are ((freq-reference_frequency)/reference_frequency)**moment
Note that a new image is created
For example, to find the moments and then reconstruct from just the moments::
moment_cube = calculate_image_frequency_moments(model_multic... | Calculate image from frequency weighted moments
Weights are ((freq-reference_frequency)/reference_frequency)**moment
Note that a new image is created
For example, to find the moments and then reconstruct from just the moments:.
| [
"Calculate",
"image",
"from",
"frequency",
"weighted",
"moments",
"Weights",
"are",
"((",
"freq",
"-",
"reference_frequency",
")",
"/",
"reference_frequency",
")",
"**",
"moment",
"Note",
"that",
"a",
"new",
"image",
"is",
"created",
"For",
"example",
"to",
"f... | def calculate_image_from_frequency_moments(im: Image, moment_image: Image, reference_frequency=None) -> Image:
assert isinstance(im, Image)
nchan, npol, ny, nx = im.shape
nmoment, mnpol, mny, mnx = moment_image.shape
assert nmoment > 0
assert npol == mnpol
assert ny == mny
assert nx == mnx
... | [
"def",
"calculate_image_from_frequency_moments",
"(",
"im",
":",
"Image",
",",
"moment_image",
":",
"Image",
",",
"reference_frequency",
"=",
"None",
")",
"->",
"Image",
":",
"assert",
"isinstance",
"(",
"im",
",",
"Image",
")",
"nchan",
",",
"npol",
",",
"n... | Calculate image from frequency weighted moments
Weights are ((freq-reference_frequency)/reference_frequency)**moment | [
"Calculate",
"image",
"from",
"frequency",
"weighted",
"moments",
"Weights",
"are",
"((",
"freq",
"-",
"reference_frequency",
")",
"/",
"reference_frequency",
")",
"**",
"moment"
] | [
"\"\"\"Calculate image from frequency weighted moments\n\n Weights are ((freq-reference_frequency)/reference_frequency)**moment\n\n Note that a new image is created\n \n For example, to find the moments and then reconstruct from just the moments::\n \n moment_cube = calculate_image_frequency_m... | [
{
"param": "im",
"type": "Image"
},
{
"param": "moment_image",
"type": "Image"
},
{
"param": "reference_frequency",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "im",
"type": "Image",
"docstring": "Image cube to be reconstructed",
"docstring_tokens": [
"Image",
... |
c4f78f10dd8454302a8ea44e768ff3ff43e26f6c | ska-telescope/algorithm-reference-library | processing_components/image/operations.py | [
"Apache-2.0"
] | Python | remove_continuum_image | <not_specific> | def remove_continuum_image(im: Image, degree=1, mask=None):
""" Fit and remove continuum visibility in place
Fit a polynomial in frequency of the specified degree where mask is True
:param im:
:param degree: 1 is a constant, 2 is a slope, etc.
:param mask:
:return:
"""
assert isins... | Fit and remove continuum visibility in place
Fit a polynomial in frequency of the specified degree where mask is True
:param im:
:param degree: 1 is a constant, 2 is a slope, etc.
:param mask:
:return:
| Fit and remove continuum visibility in place
Fit a polynomial in frequency of the specified degree where mask is True | [
"Fit",
"and",
"remove",
"continuum",
"visibility",
"in",
"place",
"Fit",
"a",
"polynomial",
"in",
"frequency",
"of",
"the",
"specified",
"degree",
"where",
"mask",
"is",
"True"
] | def remove_continuum_image(im: Image, degree=1, mask=None):
assert isinstance(im, Image)
if mask is not None:
assert numpy.sum(mask) > 2 * degree, "Insufficient channels for fit"
nchan, npol, ny, nx = im.shape
channels = numpy.arange(nchan)
frequency = im.wcs.sub(['spectral']).wcs_pix2world(... | [
"def",
"remove_continuum_image",
"(",
"im",
":",
"Image",
",",
"degree",
"=",
"1",
",",
"mask",
"=",
"None",
")",
":",
"assert",
"isinstance",
"(",
"im",
",",
"Image",
")",
"if",
"mask",
"is",
"not",
"None",
":",
"assert",
"numpy",
".",
"sum",
"(",
... | Fit and remove continuum visibility in place
Fit a polynomial in frequency of the specified degree where mask is True | [
"Fit",
"and",
"remove",
"continuum",
"visibility",
"in",
"place",
"Fit",
"a",
"polynomial",
"in",
"frequency",
"of",
"the",
"specified",
"degree",
"where",
"mask",
"is",
"True"
] | [
"\"\"\" Fit and remove continuum visibility in place\n \n Fit a polynomial in frequency of the specified degree where mask is True\n\n :param im:\n :param degree: 1 is a constant, 2 is a slope, etc.\n :param mask:\n :return:\n \"\"\""
] | [
{
"param": "im",
"type": "Image"
},
{
"param": "degree",
"type": null
},
{
"param": "mask",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "im",
"type": "Image",
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
... |
c4f78f10dd8454302a8ea44e768ff3ff43e26f6c | ska-telescope/algorithm-reference-library | processing_components/image/operations.py | [
"Apache-2.0"
] | Python | convert_stokes_to_polimage | <not_specific> | def convert_stokes_to_polimage(im: Image, polarisation_frame: PolarisationFrame):
"""Convert a stokes image to polarisation_frame
"""
assert isinstance(im, Image)
assert isinstance(polarisation_frame, PolarisationFrame)
if polarisation_frame == PolarisationFrame('linear'):
cimarr ... | Convert a stokes image to polarisation_frame
| Convert a stokes image to polarisation_frame | [
"Convert",
"a",
"stokes",
"image",
"to",
"polarisation_frame"
] | def convert_stokes_to_polimage(im: Image, polarisation_frame: PolarisationFrame):
assert isinstance(im, Image)
assert isinstance(polarisation_frame, PolarisationFrame)
if polarisation_frame == PolarisationFrame('linear'):
cimarr = convert_stokes_to_linear(im.data)
return create_image_from_ar... | [
"def",
"convert_stokes_to_polimage",
"(",
"im",
":",
"Image",
",",
"polarisation_frame",
":",
"PolarisationFrame",
")",
":",
"assert",
"isinstance",
"(",
"im",
",",
"Image",
")",
"assert",
"isinstance",
"(",
"polarisation_frame",
",",
"PolarisationFrame",
")",
"if... | Convert a stokes image to polarisation_frame | [
"Convert",
"a",
"stokes",
"image",
"to",
"polarisation_frame"
] | [
"\"\"\"Convert a stokes image to polarisation_frame\n\n \"\"\""
] | [
{
"param": "im",
"type": "Image"
},
{
"param": "polarisation_frame",
"type": "PolarisationFrame"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "im",
"type": "Image",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "polarisation_frame",
"type": "PolarisationFrame",
"docstring": nul... |
c4f78f10dd8454302a8ea44e768ff3ff43e26f6c | ska-telescope/algorithm-reference-library | processing_components/image/operations.py | [
"Apache-2.0"
] | Python | convert_polimage_to_stokes | <not_specific> | def convert_polimage_to_stokes(im: Image):
"""Convert a polarisation image to stokes (complex)
"""
assert isinstance(im, Image)
assert im.data.dtype == 'complex'
if im.polarisation_frame == PolarisationFrame('linear'):
cimarr = convert_linear_to_stokes(im.data)
return creat... | Convert a polarisation image to stokes (complex)
| Convert a polarisation image to stokes (complex) | [
"Convert",
"a",
"polarisation",
"image",
"to",
"stokes",
"(",
"complex",
")"
] | def convert_polimage_to_stokes(im: Image):
assert isinstance(im, Image)
assert im.data.dtype == 'complex'
if im.polarisation_frame == PolarisationFrame('linear'):
cimarr = convert_linear_to_stokes(im.data)
return create_image_from_array(cimarr, im.wcs, PolarisationFrame('stokesIQUV'))
el... | [
"def",
"convert_polimage_to_stokes",
"(",
"im",
":",
"Image",
")",
":",
"assert",
"isinstance",
"(",
"im",
",",
"Image",
")",
"assert",
"im",
".",
"data",
".",
"dtype",
"==",
"'complex'",
"if",
"im",
".",
"polarisation_frame",
"==",
"PolarisationFrame",
"(",... | Convert a polarisation image to stokes (complex) | [
"Convert",
"a",
"polarisation",
"image",
"to",
"stokes",
"(",
"complex",
")"
] | [
"\"\"\"Convert a polarisation image to stokes (complex)\n \n \"\"\""
] | [
{
"param": "im",
"type": "Image"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "im",
"type": "Image",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
7b3246fe6b4164ed40ccd03f5069ca42524d05f6 | ska-telescope/algorithm-reference-library | processing_components/visibility/msv2supp.py | [
"Apache-2.0"
] | Python | cmp_to_total | <not_specific> | def cmp_to_total(cls):
"""
Decorator to define the six comparison operators that are needed
for total ordering that can be used in all versions of Python
from the __cmp__() method.
"""
names = ['__lt__', '__le__', '__gt__', '__ge__', '__eq__', '__ne__']
funcs = [_cmp_to_lt, _cmp_to_le, _cmp... |
Decorator to define the six comparison operators that are needed
for total ordering that can be used in all versions of Python
from the __cmp__() method.
| Decorator to define the six comparison operators that are needed
for total ordering that can be used in all versions of Python
from the __cmp__() method. | [
"Decorator",
"to",
"define",
"the",
"six",
"comparison",
"operators",
"that",
"are",
"needed",
"for",
"total",
"ordering",
"that",
"can",
"be",
"used",
"in",
"all",
"versions",
"of",
"Python",
"from",
"the",
"__cmp__",
"()",
"method",
"."
] | def cmp_to_total(cls):
names = ['__lt__', '__le__', '__gt__', '__ge__', '__eq__', '__ne__']
funcs = [_cmp_to_lt, _cmp_to_le, _cmp_to_gt, _cmp_to_ge, _cmp_to_eq, _cmp_to_ne]
for name, func in zip(names, funcs):
if name not in dir(cls):
func.__name__ = name
setattr(cls, name, f... | [
"def",
"cmp_to_total",
"(",
"cls",
")",
":",
"names",
"=",
"[",
"'__lt__'",
",",
"'__le__'",
",",
"'__gt__'",
",",
"'__ge__'",
",",
"'__eq__'",
",",
"'__ne__'",
"]",
"funcs",
"=",
"[",
"_cmp_to_lt",
",",
"_cmp_to_le",
",",
"_cmp_to_gt",
",",
"_cmp_to_ge",
... | Decorator to define the six comparison operators that are needed
for total ordering that can be used in all versions of Python
from the __cmp__() method. | [
"Decorator",
"to",
"define",
"the",
"six",
"comparison",
"operators",
"that",
"are",
"needed",
"for",
"total",
"ordering",
"that",
"can",
"be",
"used",
"in",
"all",
"versions",
"of",
"Python",
"from",
"the",
"__cmp__",
"()",
"method",
"."
] | [
"\"\"\"\n Decorator to define the six comparison operators that are needed\n for total ordering that can be used in all versions of Python\n from the __cmp__() method.\n \"\"\"",
"# Is it defined?"
] | [
{
"param": "cls",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
7b3246fe6b4164ed40ccd03f5069ca42524d05f6 | ska-telescope/algorithm-reference-library | processing_components/visibility/msv2supp.py | [
"Apache-2.0"
] | Python | merge_baseline | <not_specific> | def merge_baseline(ant1, ant2, shift=16):
"""
Merge two stand ID numbers into a single baseline using the specified bit
shift size.
"""
return (ant1 << shift) | ant2 |
Merge two stand ID numbers into a single baseline using the specified bit
shift size.
| Merge two stand ID numbers into a single baseline using the specified bit
shift size. | [
"Merge",
"two",
"stand",
"ID",
"numbers",
"into",
"a",
"single",
"baseline",
"using",
"the",
"specified",
"bit",
"shift",
"size",
"."
] | def merge_baseline(ant1, ant2, shift=16):
return (ant1 << shift) | ant2 | [
"def",
"merge_baseline",
"(",
"ant1",
",",
"ant2",
",",
"shift",
"=",
"16",
")",
":",
"return",
"(",
"ant1",
"<<",
"shift",
")",
"|",
"ant2"
] | Merge two stand ID numbers into a single baseline using the specified bit
shift size. | [
"Merge",
"two",
"stand",
"ID",
"numbers",
"into",
"a",
"single",
"baseline",
"using",
"the",
"specified",
"bit",
"shift",
"size",
"."
] | [
"\"\"\"\n Merge two stand ID numbers into a single baseline using the specified bit\n shift size.\n \"\"\""
] | [
{
"param": "ant1",
"type": null
},
{
"param": "ant2",
"type": null
},
{
"param": "shift",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ant1",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ant2",
"type": null,
"docstring": null,
"docstring_tokens": [... |
7b3246fe6b4164ed40ccd03f5069ca42524d05f6 | ska-telescope/algorithm-reference-library | processing_components/visibility/msv2supp.py | [
"Apache-2.0"
] | Python | split_baseline | <not_specific> | def split_baseline(baseline, shift=16):
"""
Given a baseline, split it into it consistent stand ID numbers.
"""
part = 2 ** shift - 1
return (baseline >> shift) & part, baseline & part |
Given a baseline, split it into it consistent stand ID numbers.
| Given a baseline, split it into it consistent stand ID numbers. | [
"Given",
"a",
"baseline",
"split",
"it",
"into",
"it",
"consistent",
"stand",
"ID",
"numbers",
"."
] | def split_baseline(baseline, shift=16):
part = 2 ** shift - 1
return (baseline >> shift) & part, baseline & part | [
"def",
"split_baseline",
"(",
"baseline",
",",
"shift",
"=",
"16",
")",
":",
"part",
"=",
"2",
"**",
"shift",
"-",
"1",
"return",
"(",
"baseline",
">>",
"shift",
")",
"&",
"part",
",",
"baseline",
"&",
"part"
] | Given a baseline, split it into it consistent stand ID numbers. | [
"Given",
"a",
"baseline",
"split",
"it",
"into",
"it",
"consistent",
"stand",
"ID",
"numbers",
"."
] | [
"\"\"\"\n Given a baseline, split it into it consistent stand ID numbers.\n \"\"\""
] | [
{
"param": "baseline",
"type": null
},
{
"param": "shift",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "baseline",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "shift",
"type": null,
"docstring": null,
"docstring_token... |
acbc93589e363ea43743bdded45fb468e6f903a7 | ska-telescope/algorithm-reference-library | tests/workflows/test_pipelines_mpc_arlexecute.py | [
"Apache-2.0"
] | Python | progress | <not_specific> | def progress(self, res, tl_list, gt_list, it):
"""Write progress information
Cannot use this if using Dask
:param res: Residual image
:param tl_list: Theta list
:param gt_list: Gaintable list
:param it: iteration
:return:
"""
... | Write progress information
Cannot use this if using Dask
:param res: Residual image
:param tl_list: Theta list
:param gt_list: Gaintable list
:param it: iteration
:return:
| Write progress information
Cannot use this if using Dask | [
"Write",
"progress",
"information",
"Cannot",
"use",
"this",
"if",
"using",
"Dask"
] | def progress(self, res, tl_list, gt_list, it):
import matplotlib.pyplot as plt
plt.clf()
for i in range(len(tl_list)):
plt.plot(numpy.angle(tl_list[i].gaintable.gain[:, :, 0, 0, 0]).flatten(),
numpy.angle(gt_list[i]['T'].gain[:, :, 0, 0, 0]).flatten(),
... | [
"def",
"progress",
"(",
"self",
",",
"res",
",",
"tl_list",
",",
"gt_list",
",",
"it",
")",
":",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"plt",
".",
"clf",
"(",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"tl_list",
")",
")",
":"... | Write progress information
Cannot use this if using Dask | [
"Write",
"progress",
"information",
"Cannot",
"use",
"this",
"if",
"using",
"Dask"
] | [
"\"\"\"Write progress information\n \n Cannot use this if using Dask\n \n :param res: Residual image\n :param tl_list: Theta list\n :param gt_list: Gaintable list\n :param it: iteration\n :return:\n \"\"\"",
"# plt.xlim([-numpy.pi, numpy.pi])",
"# p... | [
{
"param": "self",
"type": null
},
{
"param": "res",
"type": null
},
{
"param": "tl_list",
"type": null
},
{
"param": "gt_list",
"type": null
},
{
"param": "it",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
231ca58527b189a6fcb429c13358d7e4a548d74f | ska-telescope/algorithm-reference-library | processing_components/simulation/ionospheric_screen.py | [
"Apache-2.0"
] | Python | find_pierce_points | <not_specific> | def find_pierce_points(station_locations, ha, dec, phasecentre, height):
"""Find the pierce points for a flat screen at specified height
:param station_locations: All station locations [:3]
:param ha: Hour angle
:param dec: Declination
:param phasecentre: Phase centre
:param height: Height ... | Find the pierce points for a flat screen at specified height
:param station_locations: All station locations [:3]
:param ha: Hour angle
:param dec: Declination
:param phasecentre: Phase centre
:param height: Height of screen
:return:
| Find the pierce points for a flat screen at specified height | [
"Find",
"the",
"pierce",
"points",
"for",
"a",
"flat",
"screen",
"at",
"specified",
"height"
] | def find_pierce_points(station_locations, ha, dec, phasecentre, height):
source_direction = SkyCoord(ra=ha, dec=dec, frame='icrs', equinox='J2000')
local_locations = xyz_to_uvw(station_locations, ha, dec)
local_locations -= numpy.average(local_locations, axis=0)
lmn = numpy.array(skycoord_to_lmn(source_... | [
"def",
"find_pierce_points",
"(",
"station_locations",
",",
"ha",
",",
"dec",
",",
"phasecentre",
",",
"height",
")",
":",
"source_direction",
"=",
"SkyCoord",
"(",
"ra",
"=",
"ha",
",",
"dec",
"=",
"dec",
",",
"frame",
"=",
"'icrs'",
",",
"equinox",
"="... | Find the pierce points for a flat screen at specified height | [
"Find",
"the",
"pierce",
"points",
"for",
"a",
"flat",
"screen",
"at",
"specified",
"height"
] | [
"\"\"\"Find the pierce points for a flat screen at specified height\n \n :param station_locations: All station locations [:3]\n :param ha: Hour angle\n :param dec: Declination\n :param phasecentre: Phase centre\n :param height: Height of screen\n :return:\n \"\"\""
] | [
{
"param": "station_locations",
"type": null
},
{
"param": "ha",
"type": null
},
{
"param": "dec",
"type": null
},
{
"param": "phasecentre",
"type": null
},
{
"param": "height",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "station_locations",
"type": null,
"docstring": "All station locations [:3]",
"docstring_tokens": [
"All",
... |
231ca58527b189a6fcb429c13358d7e4a548d74f | ska-telescope/algorithm-reference-library | processing_components/simulation/ionospheric_screen.py | [
"Apache-2.0"
] | Python | create_gaintable_from_screen | <not_specific> | def create_gaintable_from_screen(vis, sc, screen, height=3e5, vis_slices=None, scale=1.0, **kwargs):
""" Create gaintables from a screen calculated using ARatmospy
:param vis:
:param sc: Sky components for which pierce points are needed
:param screen:
:param height: Height (in m) of screen above te... | Create gaintables from a screen calculated using ARatmospy
:param vis:
:param sc: Sky components for which pierce points are needed
:param screen:
:param height: Height (in m) of screen above telescope e.g. 3e5
:param scale: Multiply the screen by this factor
:return:
| Create gaintables from a screen calculated using ARatmospy | [
"Create",
"gaintables",
"from",
"a",
"screen",
"calculated",
"using",
"ARatmospy"
] | def create_gaintable_from_screen(vis, sc, screen, height=3e5, vis_slices=None, scale=1.0, **kwargs):
assert isinstance(vis, BlockVisibility)
station_locations = vis.configuration.xyz
nant = station_locations.shape[0]
t2r = numpy.pi / 43200.0
gaintables = [create_gaintable_from_blockvisibility(vis, *... | [
"def",
"create_gaintable_from_screen",
"(",
"vis",
",",
"sc",
",",
"screen",
",",
"height",
"=",
"3e5",
",",
"vis_slices",
"=",
"None",
",",
"scale",
"=",
"1.0",
",",
"**",
"kwargs",
")",
":",
"assert",
"isinstance",
"(",
"vis",
",",
"BlockVisibility",
"... | Create gaintables from a screen calculated using ARatmospy | [
"Create",
"gaintables",
"from",
"a",
"screen",
"calculated",
"using",
"ARatmospy"
] | [
"\"\"\" Create gaintables from a screen calculated using ARatmospy\n\n :param vis:\n :param sc: Sky components for which pierce points are needed\n :param screen:\n :param height: Height (in m) of screen above telescope e.g. 3e5\n :param scale: Multiply the screen by this factor\n :return:\n \"... | [
{
"param": "vis",
"type": null
},
{
"param": "sc",
"type": null
},
{
"param": "screen",
"type": null
},
{
"param": "height",
"type": null
},
{
"param": "vis_slices",
"type": null
},
{
"param": "scale",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
"... |
231ca58527b189a6fcb429c13358d7e4a548d74f | ska-telescope/algorithm-reference-library | processing_components/simulation/ionospheric_screen.py | [
"Apache-2.0"
] | Python | grid_gaintable_to_screen | <not_specific> | def grid_gaintable_to_screen(vis, gaintables, screen, height=3e5, gaintable_slices=None, scale=1.0, **kwargs):
""" Grid a gaintable to a screen image
The phases are just average per grid cell, no phase unwrapping is performed.
:param vis:
:param gaintables: input gaintables
:param screen:
... | Grid a gaintable to a screen image
The phases are just average per grid cell, no phase unwrapping is performed.
:param vis:
:param gaintables: input gaintables
:param screen:
:param height: Height (in m) of screen above telescope e.g. 3e5
:param scale: Multiply the screen by this factor
... | Grid a gaintable to a screen image
The phases are just average per grid cell, no phase unwrapping is performed. | [
"Grid",
"a",
"gaintable",
"to",
"a",
"screen",
"image",
"The",
"phases",
"are",
"just",
"average",
"per",
"grid",
"cell",
"no",
"phase",
"unwrapping",
"is",
"performed",
"."
] | def grid_gaintable_to_screen(vis, gaintables, screen, height=3e5, gaintable_slices=None, scale=1.0, **kwargs):
assert isinstance(vis, BlockVisibility)
station_locations = vis.configuration.xyz
nant = station_locations.shape[0]
t2r = numpy.pi / 43200.0
newscreen = create_empty_image_like(screen)
... | [
"def",
"grid_gaintable_to_screen",
"(",
"vis",
",",
"gaintables",
",",
"screen",
",",
"height",
"=",
"3e5",
",",
"gaintable_slices",
"=",
"None",
",",
"scale",
"=",
"1.0",
",",
"**",
"kwargs",
")",
":",
"assert",
"isinstance",
"(",
"vis",
",",
"BlockVisibi... | Grid a gaintable to a screen image
The phases are just average per grid cell, no phase unwrapping is performed. | [
"Grid",
"a",
"gaintable",
"to",
"a",
"screen",
"image",
"The",
"phases",
"are",
"just",
"average",
"per",
"grid",
"cell",
"no",
"phase",
"unwrapping",
"is",
"performed",
"."
] | [
"\"\"\" Grid a gaintable to a screen image\n \n The phases are just average per grid cell, no phase unwrapping is performed.\n\n :param vis:\n :param gaintables: input gaintables\n :param screen:\n :param height: Height (in m) of screen above telescope e.g. 3e5\n :param scale: Multiply the scre... | [
{
"param": "vis",
"type": null
},
{
"param": "gaintables",
"type": null
},
{
"param": "screen",
"type": null
},
{
"param": "height",
"type": null
},
{
"param": "gaintable_slices",
"type": null
},
{
"param": "scale",
"type": null
}
] | {
"returns": [
{
"docstring": "gridded screen image, weights image",
"docstring_tokens": [
"gridded",
"screen",
"image",
"weights",
"image"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis",
"type": null,
... |
231ca58527b189a6fcb429c13358d7e4a548d74f | ska-telescope/algorithm-reference-library | processing_components/simulation/ionospheric_screen.py | [
"Apache-2.0"
] | Python | plot_gaintable_on_screen | null | def plot_gaintable_on_screen(vis, gaintables, height=3e5, gaintable_slices=None, plotfile=None):
""" Plot a gaintable on an ionospheric screen
:param vis:
:param sc: Sky components for which pierce points are needed
:param height: Height (in m) of screen above telescope e.g. 3e5
:param scale: Multi... | Plot a gaintable on an ionospheric screen
:param vis:
:param sc: Sky components for which pierce points are needed
:param height: Height (in m) of screen above telescope e.g. 3e5
:param scale: Multiply the screen by this factor
:return: gridded screen image, weights image
| Plot a gaintable on an ionospheric screen | [
"Plot",
"a",
"gaintable",
"on",
"an",
"ionospheric",
"screen"
] | def plot_gaintable_on_screen(vis, gaintables, height=3e5, gaintable_slices=None, plotfile=None):
import matplotlib.pyplot as plt
assert isinstance(vis, BlockVisibility)
station_locations = vis.configuration.xyz
t2r = numpy.pi / 43200.0
plt.clf()
for gaintable in gaintables:
for iha, rows... | [
"def",
"plot_gaintable_on_screen",
"(",
"vis",
",",
"gaintables",
",",
"height",
"=",
"3e5",
",",
"gaintable_slices",
"=",
"None",
",",
"plotfile",
"=",
"None",
")",
":",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"assert",
"isinstance",
"(",
"vis",... | Plot a gaintable on an ionospheric screen | [
"Plot",
"a",
"gaintable",
"on",
"an",
"ionospheric",
"screen"
] | [
"\"\"\" Plot a gaintable on an ionospheric screen\n\n :param vis:\n :param sc: Sky components for which pierce points are needed\n :param height: Height (in m) of screen above telescope e.g. 3e5\n :param scale: Multiply the screen by this factor\n :return: gridded screen image, weights image\n \"\... | [
{
"param": "vis",
"type": null
},
{
"param": "gaintables",
"type": null
},
{
"param": "height",
"type": null
},
{
"param": "gaintable_slices",
"type": null
},
{
"param": "plotfile",
"type": null
}
] | {
"returns": [
{
"docstring": "gridded screen image, weights image",
"docstring_tokens": [
"gridded",
"screen",
"image",
"weights",
"image"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis",
"type": null,
... |
f9554c7675beb46a1d5a9d2b3e73cfb18dd6fce8 | ska-telescope/algorithm-reference-library | processing_components/griddata/kernels.py | [
"Apache-2.0"
] | Python | create_box_convolutionfunction | <not_specific> | def create_box_convolutionfunction(im, oversampling=1, support=1):
""" Fill a box car function into a ConvolutionFunction
Also returns the griddata correction function as an image
:param im: Image template
:param oversampling: Oversampling of the convolution function in uv space
:return: griddata ... | Fill a box car function into a ConvolutionFunction
Also returns the griddata correction function as an image
:param im: Image template
:param oversampling: Oversampling of the convolution function in uv space
:return: griddata correction Image, griddata kernel as ConvolutionFunction
| Fill a box car function into a ConvolutionFunction
Also returns the griddata correction function as an image | [
"Fill",
"a",
"box",
"car",
"function",
"into",
"a",
"ConvolutionFunction",
"Also",
"returns",
"the",
"griddata",
"correction",
"function",
"as",
"an",
"image"
] | def create_box_convolutionfunction(im, oversampling=1, support=1):
assert isinstance(im, Image)
cf = create_convolutionfunction_from_image(im, oversampling=1, support=4)
nchan, npol, _, _ = im.shape
cf.data[...] = 0.0 + 0.0j
cf.data[..., 2, 2] = 1.0 + 0.0j
nchan, npol, ny, nx = im.data.shape
... | [
"def",
"create_box_convolutionfunction",
"(",
"im",
",",
"oversampling",
"=",
"1",
",",
"support",
"=",
"1",
")",
":",
"assert",
"isinstance",
"(",
"im",
",",
"Image",
")",
"cf",
"=",
"create_convolutionfunction_from_image",
"(",
"im",
",",
"oversampling",
"="... | Fill a box car function into a ConvolutionFunction
Also returns the griddata correction function as an image | [
"Fill",
"a",
"box",
"car",
"function",
"into",
"a",
"ConvolutionFunction",
"Also",
"returns",
"the",
"griddata",
"correction",
"function",
"as",
"an",
"image"
] | [
"\"\"\" Fill a box car function into a ConvolutionFunction\n\n Also returns the griddata correction function as an image\n\n :param im: Image template\n :param oversampling: Oversampling of the convolution function in uv space\n :return: griddata correction Image, griddata kernel as ConvolutionFunction\... | [
{
"param": "im",
"type": null
},
{
"param": "oversampling",
"type": null
},
{
"param": "support",
"type": null
}
] | {
"returns": [
{
"docstring": "griddata correction Image, griddata kernel as ConvolutionFunction",
"docstring_tokens": [
"griddata",
"correction",
"Image",
"griddata",
"kernel",
"as",
"ConvolutionFunction"
],
"type": null
}
],
... |
f9554c7675beb46a1d5a9d2b3e73cfb18dd6fce8 | ska-telescope/algorithm-reference-library | processing_components/griddata/kernels.py | [
"Apache-2.0"
] | Python | create_pswf_convolutionfunction | <not_specific> | def create_pswf_convolutionfunction(im, oversampling=8, support=6):
""" Fill an Anti-Aliasing filter into a ConvolutionFunction
Fill the Prolate Spheroidal Wave Function into a GriData with the specified oversampling. Only the inner
non-zero part is retained
Also returns the griddata correction functi... | Fill an Anti-Aliasing filter into a ConvolutionFunction
Fill the Prolate Spheroidal Wave Function into a GriData with the specified oversampling. Only the inner
non-zero part is retained
Also returns the griddata correction function as an image
:param im: Image template
:param oversampling: Over... | Fill an Anti-Aliasing filter into a ConvolutionFunction
Fill the Prolate Spheroidal Wave Function into a GriData with the specified oversampling. Only the inner
non-zero part is retained
Also returns the griddata correction function as an image | [
"Fill",
"an",
"Anti",
"-",
"Aliasing",
"filter",
"into",
"a",
"ConvolutionFunction",
"Fill",
"the",
"Prolate",
"Spheroidal",
"Wave",
"Function",
"into",
"a",
"GriData",
"with",
"the",
"specified",
"oversampling",
".",
"Only",
"the",
"inner",
"non",
"-",
"zero"... | def create_pswf_convolutionfunction(im, oversampling=8, support=6):
assert isinstance(im, Image), im
cf = create_convolutionfunction_from_image(im, oversampling=oversampling, support=support)
kernel = numpy.zeros([oversampling, support])
for grid in range(support):
for subsample in range(oversam... | [
"def",
"create_pswf_convolutionfunction",
"(",
"im",
",",
"oversampling",
"=",
"8",
",",
"support",
"=",
"6",
")",
":",
"assert",
"isinstance",
"(",
"im",
",",
"Image",
")",
",",
"im",
"cf",
"=",
"create_convolutionfunction_from_image",
"(",
"im",
",",
"over... | Fill an Anti-Aliasing filter into a ConvolutionFunction
Fill the Prolate Spheroidal Wave Function into a GriData with the specified oversampling. | [
"Fill",
"an",
"Anti",
"-",
"Aliasing",
"filter",
"into",
"a",
"ConvolutionFunction",
"Fill",
"the",
"Prolate",
"Spheroidal",
"Wave",
"Function",
"into",
"a",
"GriData",
"with",
"the",
"specified",
"oversampling",
"."
] | [
"\"\"\" Fill an Anti-Aliasing filter into a ConvolutionFunction\n\n Fill the Prolate Spheroidal Wave Function into a GriData with the specified oversampling. Only the inner\n non-zero part is retained\n\n Also returns the griddata correction function as an image\n\n :param im: Image template\n :param... | [
{
"param": "im",
"type": null
},
{
"param": "oversampling",
"type": null
},
{
"param": "support",
"type": null
}
] | {
"returns": [
{
"docstring": "griddata correction Image, griddata kernel as ConvolutionFunction",
"docstring_tokens": [
"griddata",
"correction",
"Image",
"griddata",
"kernel",
"as",
"ConvolutionFunction"
],
"type": null
}
],
... |
f9554c7675beb46a1d5a9d2b3e73cfb18dd6fce8 | ska-telescope/algorithm-reference-library | processing_components/griddata/kernels.py | [
"Apache-2.0"
] | Python | create_awterm_convolutionfunction | <not_specific> | def create_awterm_convolutionfunction(im, make_pb=None, nw=1, wstep=1e15, oversampling=8, support=6, use_aaf=True,
maxsupport=512):
""" Fill AW projection kernel into a GridData.
:param im: Image template
:param make_pb: Function to make the primary beam model image (h... | Fill AW projection kernel into a GridData.
:param im: Image template
:param make_pb: Function to make the primary beam model image (hint: use a partial)
:param nw: Number of w planes
:param wstep: Step in w (wavelengths)
:param oversampling: Oversampling of the convolution function in uv space
... | Fill AW projection kernel into a GridData. | [
"Fill",
"AW",
"projection",
"kernel",
"into",
"a",
"GridData",
"."
] | def create_awterm_convolutionfunction(im, make_pb=None, nw=1, wstep=1e15, oversampling=8, support=6, use_aaf=True,
maxsupport=512):
d2r = numpy.pi / 180.0
nchan, npol, ony, onx = im.data.shape
assert isinstance(im, Image)
cf = create_convolutionfunction_from_image(i... | [
"def",
"create_awterm_convolutionfunction",
"(",
"im",
",",
"make_pb",
"=",
"None",
",",
"nw",
"=",
"1",
",",
"wstep",
"=",
"1e15",
",",
"oversampling",
"=",
"8",
",",
"support",
"=",
"6",
",",
"use_aaf",
"=",
"True",
",",
"maxsupport",
"=",
"512",
")"... | Fill AW projection kernel into a GridData. | [
"Fill",
"AW",
"projection",
"kernel",
"into",
"a",
"GridData",
"."
] | [
"\"\"\" Fill AW projection kernel into a GridData.\n\n :param im: Image template\n :param make_pb: Function to make the primary beam model image (hint: use a partial)\n :param nw: Number of w planes\n :param wstep: Step in w (wavelengths)\n :param oversampling: Oversampling of the convolution functio... | [
{
"param": "im",
"type": null
},
{
"param": "make_pb",
"type": null
},
{
"param": "nw",
"type": null
},
{
"param": "wstep",
"type": null
},
{
"param": "oversampling",
"type": null
},
{
"param": "support",
"type": null
},
{
"param": "use_aaf... | {
"returns": [
{
"docstring": "griddata correction Image, griddata kernel as GridData",
"docstring_tokens": [
"griddata",
"correction",
"Image",
"griddata",
"kernel",
"as",
"GridData"
],
"type": null
}
],
"raises": [],
"para... |
90234a6f24eac0d5a4df1b43fbb95b73111dd2b9 | ska-telescope/algorithm-reference-library | processing_components/image/gradients.py | [
"Apache-2.0"
] | Python | image_gradients | <not_specific> | def image_gradients(im: Image):
"""Calculate image gradients numerically
Gradient units are (incoming unit)/pixel e.g. Jy/beam/pixel
:param im: Image
:return: Gradient images
"""
assert isinstance(im, Image)
nchan, npol, ny, nx = im.shape
gradientx = create_empty_image_lik... | Calculate image gradients numerically
Gradient units are (incoming unit)/pixel e.g. Jy/beam/pixel
:param im: Image
:return: Gradient images
| Calculate image gradients numerically
Gradient units are (incoming unit)/pixel e.g. Jy/beam/pixel | [
"Calculate",
"image",
"gradients",
"numerically",
"Gradient",
"units",
"are",
"(",
"incoming",
"unit",
")",
"/",
"pixel",
"e",
".",
"g",
".",
"Jy",
"/",
"beam",
"/",
"pixel"
] | def image_gradients(im: Image):
assert isinstance(im, Image)
nchan, npol, ny, nx = im.shape
gradientx = create_empty_image_like(im)
gradientx.data[..., :, 1:nx] = im.data[..., :, 1:nx] - im.data[..., :, 0:(nx - 1)]
gradienty = create_empty_image_like(im)
gradienty.data[..., 1:ny, :] = im.data[..... | [
"def",
"image_gradients",
"(",
"im",
":",
"Image",
")",
":",
"assert",
"isinstance",
"(",
"im",
",",
"Image",
")",
"nchan",
",",
"npol",
",",
"ny",
",",
"nx",
"=",
"im",
".",
"shape",
"gradientx",
"=",
"create_empty_image_like",
"(",
"im",
")",
"gradie... | Calculate image gradients numerically
Gradient units are (incoming unit)/pixel e.g. | [
"Calculate",
"image",
"gradients",
"numerically",
"Gradient",
"units",
"are",
"(",
"incoming",
"unit",
")",
"/",
"pixel",
"e",
".",
"g",
"."
] | [
"\"\"\"Calculate image gradients numerically\n \n Gradient units are (incoming unit)/pixel e.g. Jy/beam/pixel\n \n :param im: Image\n :return: Gradient images\n \"\"\""
] | [
{
"param": "im",
"type": "Image"
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "im",
"type": "Image",
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
... |
a3a499b86c5dfa224f1ccb2081b26e4d6c76d44a | ska-telescope/algorithm-reference-library | processing_components/griddata/gridding.py | [
"Apache-2.0"
] | Python | convolution_mapping | <not_specific> | def convolution_mapping(vis, griddata, cf, channel_tolerance=1e-8):
"""Find the mappings between visibility, griddata, and convolution function
:param vis:
:param griddata:
:param cf_griddata:
:return:
"""
assert isinstance(vis, Visibility), vis
numpy.testing.assert_almost... | Find the mappings between visibility, griddata, and convolution function
:param vis:
:param griddata:
:param cf_griddata:
:return:
| Find the mappings between visibility, griddata, and convolution function | [
"Find",
"the",
"mappings",
"between",
"visibility",
"griddata",
"and",
"convolution",
"function"
] | def convolution_mapping(vis, griddata, cf, channel_tolerance=1e-8):
assert isinstance(vis, Visibility), vis
numpy.testing.assert_almost_equal(griddata.grid_wcs.wcs.cdelt[0], cf.grid_wcs.wcs.cdelt[0], 7)
numpy.testing.assert_almost_equal(griddata.grid_wcs.wcs.cdelt[1], cf.grid_wcs.wcs.cdelt[1], 7)
pu_gri... | [
"def",
"convolution_mapping",
"(",
"vis",
",",
"griddata",
",",
"cf",
",",
"channel_tolerance",
"=",
"1e-8",
")",
":",
"assert",
"isinstance",
"(",
"vis",
",",
"Visibility",
")",
",",
"vis",
"numpy",
".",
"testing",
".",
"assert_almost_equal",
"(",
"griddata... | Find the mappings between visibility, griddata, and convolution function | [
"Find",
"the",
"mappings",
"between",
"visibility",
"griddata",
"and",
"convolution",
"function"
] | [
"\"\"\"Find the mappings between visibility, griddata, and convolution function\n \n :param vis:\n :param griddata:\n :param cf_griddata:\n :return:\n \"\"\"",
"####### UV mapping",
"# We use the grid_wcs's to do the coordinate conversion",
"# Find the nearest grid points",
"# We now have ... | [
{
"param": "vis",
"type": null
},
{
"param": "griddata",
"type": null
},
{
"param": "cf",
"type": null
},
{
"param": "channel_tolerance",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
"... |
a3a499b86c5dfa224f1ccb2081b26e4d6c76d44a | ska-telescope/algorithm-reference-library | processing_components/griddata/gridding.py | [
"Apache-2.0"
] | Python | grid_weight_to_griddata | <not_specific> | def grid_weight_to_griddata(vis, griddata, cf):
"""Grid Visibility weight onto a GridData
:param vis: Visibility to be gridded
:param griddata: GridData
:param kwargs:
:return: GridData
"""
assert isinstance(vis, Visibility), vis
nchan, npol, nz, ny, nx = griddata.shape
sumwt =... | Grid Visibility weight onto a GridData
:param vis: Visibility to be gridded
:param griddata: GridData
:param kwargs:
:return: GridData
| Grid Visibility weight onto a GridData | [
"Grid",
"Visibility",
"weight",
"onto",
"a",
"GridData"
] | def grid_weight_to_griddata(vis, griddata, cf):
assert isinstance(vis, Visibility), vis
nchan, npol, nz, ny, nx = griddata.shape
sumwt = numpy.zeros([nchan, npol])
pu_grid, pu_offset, pv_grid, pv_offset, pwg_grid, pwg_fraction, pwc_grid, pwc_fraction, pfreq_grid = \
convolution_mapping(vis, grid... | [
"def",
"grid_weight_to_griddata",
"(",
"vis",
",",
"griddata",
",",
"cf",
")",
":",
"assert",
"isinstance",
"(",
"vis",
",",
"Visibility",
")",
",",
"vis",
"nchan",
",",
"npol",
",",
"nz",
",",
"ny",
",",
"nx",
"=",
"griddata",
".",
"shape",
"sumwt",
... | Grid Visibility weight onto a GridData | [
"Grid",
"Visibility",
"weight",
"onto",
"a",
"GridData"
] | [
"\"\"\"Grid Visibility weight onto a GridData\n\n :param vis: Visibility to be gridded\n :param griddata: GridData\n :param kwargs:\n :return: GridData\n \"\"\""
] | [
{
"param": "vis",
"type": null
},
{
"param": "griddata",
"type": null
},
{
"param": "cf",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis",
"type": null,
"docstring": "Visibility to be gridded",
"docstring_tokens": [
"Visibility",
"t... |
a3a499b86c5dfa224f1ccb2081b26e4d6c76d44a | ska-telescope/algorithm-reference-library | processing_components/griddata/gridding.py | [
"Apache-2.0"
] | Python | griddata_reweight | <not_specific> | def griddata_reweight(vis, griddata, cf):
"""Reweight Grid Visibility weight using the weights in griddata
:param vis: Visibility to be reweighted
:param griddata: GridData, sumwt
:param kwargs:
:return: GridData
"""
pu_grid, pu_offset, pv_grid, pv_offset, pwg_grid, pwg_fraction, pwc_grid, ... | Reweight Grid Visibility weight using the weights in griddata
:param vis: Visibility to be reweighted
:param griddata: GridData, sumwt
:param kwargs:
:return: GridData
| Reweight Grid Visibility weight using the weights in griddata | [
"Reweight",
"Grid",
"Visibility",
"weight",
"using",
"the",
"weights",
"in",
"griddata"
] | def griddata_reweight(vis, griddata, cf):
pu_grid, pu_offset, pv_grid, pv_offset, pwg_grid, pwg_fraction, pwc_grid, pwc_fraction, pfreq_grid = \
convolution_mapping(vis, griddata, cf)
_, _, _, _, _, gv, gu = cf.shape
coords = zip(vis.imaging_weight, pfreq_grid, pu_grid, pv_grid, pwg_grid)
for vw... | [
"def",
"griddata_reweight",
"(",
"vis",
",",
"griddata",
",",
"cf",
")",
":",
"pu_grid",
",",
"pu_offset",
",",
"pv_grid",
",",
"pv_offset",
",",
"pwg_grid",
",",
"pwg_fraction",
",",
"pwc_grid",
",",
"pwc_fraction",
",",
"pfreq_grid",
"=",
"convolution_mappin... | Reweight Grid Visibility weight using the weights in griddata | [
"Reweight",
"Grid",
"Visibility",
"weight",
"using",
"the",
"weights",
"in",
"griddata"
] | [
"\"\"\"Reweight Grid Visibility weight using the weights in griddata\n\n :param vis: Visibility to be reweighted\n :param griddata: GridData, sumwt\n :param kwargs:\n :return: GridData\n \"\"\""
] | [
{
"param": "vis",
"type": null
},
{
"param": "griddata",
"type": null
},
{
"param": "cf",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis",
"type": null,
"docstring": "Visibility to be reweighted",
"docstring_tokens": [
"Visibility",
... |
a3a499b86c5dfa224f1ccb2081b26e4d6c76d44a | ska-telescope/algorithm-reference-library | processing_components/griddata/gridding.py | [
"Apache-2.0"
] | Python | fft_image_to_griddata | <not_specific> | def fft_image_to_griddata(im, griddata, gcf):
"""Fill griddata with transform of im
:param griddata:
:param gcf: Grid correction image
:return:
"""
# chan, pol, z, u, v, w
griddata.data[:, :, :, ...] = fft(im.data * gcf.data)[:, :, numpy.newaxis, ...]
return griddata | Fill griddata with transform of im
:param griddata:
:param gcf: Grid correction image
:return:
| Fill griddata with transform of im | [
"Fill",
"griddata",
"with",
"transform",
"of",
"im"
] | def fft_image_to_griddata(im, griddata, gcf):
griddata.data[:, :, :, ...] = fft(im.data * gcf.data)[:, :, numpy.newaxis, ...]
return griddata | [
"def",
"fft_image_to_griddata",
"(",
"im",
",",
"griddata",
",",
"gcf",
")",
":",
"griddata",
".",
"data",
"[",
":",
",",
":",
",",
":",
",",
"...",
"]",
"=",
"fft",
"(",
"im",
".",
"data",
"*",
"gcf",
".",
"data",
")",
"[",
":",
",",
":",
",... | Fill griddata with transform of im | [
"Fill",
"griddata",
"with",
"transform",
"of",
"im"
] | [
"\"\"\"Fill griddata with transform of im\n\n :param griddata:\n :param gcf: Grid correction image\n :return:\n \"\"\"",
"# chan, pol, z, u, v, w"
] | [
{
"param": "im",
"type": null
},
{
"param": "griddata",
"type": null
},
{
"param": "gcf",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "im",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
b9095ff0be33ce2a3d1134ca385b39fdb8286e41 | ska-telescope/algorithm-reference-library | processing_components/simulation/noise.py | [
"Apache-2.0"
] | Python | addnoise_visibility | <not_specific> | def addnoise_visibility(vis, t_sys=None, eta=None):
""" Add noise to a visibility
TODO: Obtain sensitivity values from vis as a function of frequency
:param vis:
:param t_sys: System temperature
:param eta: Efficiency
:return:
"""
assert isinstance(vis, Visibility) or isinstanc... | Add noise to a visibility
TODO: Obtain sensitivity values from vis as a function of frequency
:param vis:
:param t_sys: System temperature
:param eta: Efficiency
:return:
| Add noise to a visibility
TODO: Obtain sensitivity values from vis as a function of frequency | [
"Add",
"noise",
"to",
"a",
"visibility",
"TODO",
":",
"Obtain",
"sensitivity",
"values",
"from",
"vis",
"as",
"a",
"function",
"of",
"frequency"
] | def addnoise_visibility(vis, t_sys=None, eta=None):
assert isinstance(vis, Visibility) or isinstance(vis, BlockVisibility), vis
if t_sys is None:
t_sys = 20.0
if eta is None:
eta = 0.78
if isinstance(vis, Visibility):
sigma = calculate_noise_visibility(vis.data['channel_bandwidth... | [
"def",
"addnoise_visibility",
"(",
"vis",
",",
"t_sys",
"=",
"None",
",",
"eta",
"=",
"None",
")",
":",
"assert",
"isinstance",
"(",
"vis",
",",
"Visibility",
")",
"or",
"isinstance",
"(",
"vis",
",",
"BlockVisibility",
")",
",",
"vis",
"if",
"t_sys",
... | Add noise to a visibility
TODO: Obtain sensitivity values from vis as a function of frequency | [
"Add",
"noise",
"to",
"a",
"visibility",
"TODO",
":",
"Obtain",
"sensitivity",
"values",
"from",
"vis",
"as",
"a",
"function",
"of",
"frequency"
] | [
"\"\"\" Add noise to a visibility\n \n TODO: Obtain sensitivity values from vis as a function of frequency\n \n :param vis:\n :param t_sys: System temperature\n :param eta: Efficiency\n :return:\n \"\"\"",
"# We need to handle Visibility and BlockVisibility separately since time and bandwi... | [
{
"param": "vis",
"type": null
},
{
"param": "t_sys",
"type": null
},
{
"param": "eta",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
"... |
c6c377631d0daaca89ae2a55fa354406b9482e81 | ska-telescope/algorithm-reference-library | wrappers/arlexecute/execution_support/arlexecutebase.py | [
"Apache-2.0"
] | Python | execute | <not_specific> | def execute(self, func, *args, **kwargs):
""" Wrap for immediate or deferred execution
Passes through if dask is not being used
:param args:
:param kwargs:
:return: delayed func or func
"""
if self._using_dask:
return delayed(func, *a... | Wrap for immediate or deferred execution
Passes through if dask is not being used
:param args:
:param kwargs:
:return: delayed func or func
| Wrap for immediate or deferred execution
Passes through if dask is not being used | [
"Wrap",
"for",
"immediate",
"or",
"deferred",
"execution",
"Passes",
"through",
"if",
"dask",
"is",
"not",
"being",
"used"
] | def execute(self, func, *args, **kwargs):
if self._using_dask:
return delayed(func, *args, **kwargs)
elif self._using_dlg:
return dlg_delayed(func, *args, **kwargs)
else:
return func | [
"def",
"execute",
"(",
"self",
",",
"func",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"if",
"self",
".",
"_using_dask",
":",
"return",
"delayed",
"(",
"func",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
"elif",
"self",
".",
"_using_dlg",
":"... | Wrap for immediate or deferred execution
Passes through if dask is not being used | [
"Wrap",
"for",
"immediate",
"or",
"deferred",
"execution",
"Passes",
"through",
"if",
"dask",
"is",
"not",
"being",
"used"
] | [
"\"\"\" Wrap for immediate or deferred execution\n \n Passes through if dask is not being used\n \n :param args:\n :param kwargs:\n :return: delayed func or func\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "func",
"type": null
}
] | {
"returns": [
{
"docstring": "delayed func or func",
"docstring_tokens": [
"delayed",
"func",
"or",
"func"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstri... |
c6c377631d0daaca89ae2a55fa354406b9482e81 | ska-telescope/algorithm-reference-library | wrappers/arlexecute/execution_support/arlexecutebase.py | [
"Apache-2.0"
] | Python | type | <not_specific> | def type(self):
""" Get the type of the execution system
:return:
"""
if self._using_dask:
return 'dask'
elif self._using_dlg:
return 'daliuge'
else:
return 'function' | Get the type of the execution system
:return:
| Get the type of the execution system | [
"Get",
"the",
"type",
"of",
"the",
"execution",
"system"
] | def type(self):
if self._using_dask:
return 'dask'
elif self._using_dlg:
return 'daliuge'
else:
return 'function' | [
"def",
"type",
"(",
"self",
")",
":",
"if",
"self",
".",
"_using_dask",
":",
"return",
"'dask'",
"elif",
"self",
".",
"_using_dlg",
":",
"return",
"'daliuge'",
"else",
":",
"return",
"'function'"
] | Get the type of the execution system | [
"Get",
"the",
"type",
"of",
"the",
"execution",
"system"
] | [
"\"\"\" Get the type of the execution system\n \n :return:\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
c6c377631d0daaca89ae2a55fa354406b9482e81 | ska-telescope/algorithm-reference-library | wrappers/arlexecute/execution_support/arlexecutebase.py | [
"Apache-2.0"
] | Python | compute | <not_specific> | def compute(self, value, sync=False):
"""Get the actual value
If not using dask then this returns the value directly since it already is computed
If using dask and sync=True then this waits and resturns the actual wait.
If using dask and sync=False then this returns a future, on... | Get the actual value
If not using dask then this returns the value directly since it already is computed
If using dask and sync=True then this waits and resturns the actual wait.
If using dask and sync=False then this returns a future, on which you will need to call .result()
... | Get the actual value
If not using dask then this returns the value directly since it already is computed
If using dask and sync=True then this waits and resturns the actual wait.
If using dask and sync=False then this returns a future, on which you will need to call .result() | [
"Get",
"the",
"actual",
"value",
"If",
"not",
"using",
"dask",
"then",
"this",
"returns",
"the",
"value",
"directly",
"since",
"it",
"already",
"is",
"computed",
"If",
"using",
"dask",
"and",
"sync",
"=",
"True",
"then",
"this",
"waits",
"and",
"resturns",... | def compute(self, value, sync=False):
if self._using_dask:
start = time.time()
if self.client is None:
return value.compute()
else:
future = self.client.compute(value, sync=sync)
wait(future)
if self._verbose:
... | [
"def",
"compute",
"(",
"self",
",",
"value",
",",
"sync",
"=",
"False",
")",
":",
"if",
"self",
".",
"_using_dask",
":",
"start",
"=",
"time",
".",
"time",
"(",
")",
"if",
"self",
".",
"client",
"is",
"None",
":",
"return",
"value",
".",
"compute",... | Get the actual value
If not using dask then this returns the value directly since it already is computed
If using dask and sync=True then this waits and resturns the actual wait. | [
"Get",
"the",
"actual",
"value",
"If",
"not",
"using",
"dask",
"then",
"this",
"returns",
"the",
"value",
"directly",
"since",
"it",
"already",
"is",
"computed",
"If",
"using",
"dask",
"and",
"sync",
"=",
"True",
"then",
"this",
"waits",
"and",
"resturns",... | [
"\"\"\"Get the actual value\n \n If not using dask then this returns the value directly since it already is computed\n If using dask and sync=True then this waits and resturns the actual wait.\n If using dask and sync=False then this returns a future, on which you will need to call .resu... | [
{
"param": "self",
"type": null
},
{
"param": "value",
"type": null
},
{
"param": "sync",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
c6c377631d0daaca89ae2a55fa354406b9482e81 | ska-telescope/algorithm-reference-library | wrappers/arlexecute/execution_support/arlexecutebase.py | [
"Apache-2.0"
] | Python | persist | <not_specific> | def persist(self, graph, **kwargs):
"""Persist graph data on workers
No-op if using_dask is False
:param graph:
:return:
"""
if self.using_dask and self.client is not None:
return self.client.persist(graph, **kwargs)
else:
return graph | Persist graph data on workers
No-op if using_dask is False
:param graph:
:return:
| Persist graph data on workers
No-op if using_dask is False | [
"Persist",
"graph",
"data",
"on",
"workers",
"No",
"-",
"op",
"if",
"using_dask",
"is",
"False"
] | def persist(self, graph, **kwargs):
if self.using_dask and self.client is not None:
return self.client.persist(graph, **kwargs)
else:
return graph | [
"def",
"persist",
"(",
"self",
",",
"graph",
",",
"**",
"kwargs",
")",
":",
"if",
"self",
".",
"using_dask",
"and",
"self",
".",
"client",
"is",
"not",
"None",
":",
"return",
"self",
".",
"client",
".",
"persist",
"(",
"graph",
",",
"**",
"kwargs",
... | Persist graph data on workers
No-op if using_dask is False | [
"Persist",
"graph",
"data",
"on",
"workers",
"No",
"-",
"op",
"if",
"using_dask",
"is",
"False"
] | [
"\"\"\"Persist graph data on workers\n\n No-op if using_dask is False\n :param graph:\n :return:\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "graph",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
c6c377631d0daaca89ae2a55fa354406b9482e81 | ska-telescope/algorithm-reference-library | wrappers/arlexecute/execution_support/arlexecutebase.py | [
"Apache-2.0"
] | Python | scatter | <not_specific> | def scatter(self, graph, **kwargs):
"""Scatter graph data to workers
No-op if using_dask is False
:param graph:
:return:
"""
if self.using_dask and self.client is not None:
return self.client.scatter(graph, **kwargs)
else:
return graph | Scatter graph data to workers
No-op if using_dask is False
:param graph:
:return:
| Scatter graph data to workers
No-op if using_dask is False | [
"Scatter",
"graph",
"data",
"to",
"workers",
"No",
"-",
"op",
"if",
"using_dask",
"is",
"False"
] | def scatter(self, graph, **kwargs):
if self.using_dask and self.client is not None:
return self.client.scatter(graph, **kwargs)
else:
return graph | [
"def",
"scatter",
"(",
"self",
",",
"graph",
",",
"**",
"kwargs",
")",
":",
"if",
"self",
".",
"using_dask",
"and",
"self",
".",
"client",
"is",
"not",
"None",
":",
"return",
"self",
".",
"client",
".",
"scatter",
"(",
"graph",
",",
"**",
"kwargs",
... | Scatter graph data to workers
No-op if using_dask is False | [
"Scatter",
"graph",
"data",
"to",
"workers",
"No",
"-",
"op",
"if",
"using_dask",
"is",
"False"
] | [
"\"\"\"Scatter graph data to workers\n\n No-op if using_dask is False\n :param graph:\n :return:\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "graph",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
c6c377631d0daaca89ae2a55fa354406b9482e81 | ska-telescope/algorithm-reference-library | wrappers/arlexecute/execution_support/arlexecutebase.py | [
"Apache-2.0"
] | Python | gather | <not_specific> | def gather(self, graph):
"""Gather graph from workers
No-op if using_dask is False
:param graph:
:return:
"""
if self.using_dask and self.client is not None:
return self.client.gather(graph)
else:
return graph | Gather graph from workers
No-op if using_dask is False
:param graph:
:return:
| Gather graph from workers
No-op if using_dask is False | [
"Gather",
"graph",
"from",
"workers",
"No",
"-",
"op",
"if",
"using_dask",
"is",
"False"
] | def gather(self, graph):
if self.using_dask and self.client is not None:
return self.client.gather(graph)
else:
return graph | [
"def",
"gather",
"(",
"self",
",",
"graph",
")",
":",
"if",
"self",
".",
"using_dask",
"and",
"self",
".",
"client",
"is",
"not",
"None",
":",
"return",
"self",
".",
"client",
".",
"gather",
"(",
"graph",
")",
"else",
":",
"return",
"graph"
] | Gather graph from workers
No-op if using_dask is False | [
"Gather",
"graph",
"from",
"workers",
"No",
"-",
"op",
"if",
"using_dask",
"is",
"False"
] | [
"\"\"\"Gather graph from workers\n\n No-op if using_dask is False\n :param graph:\n :return:\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "graph",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
c6c377631d0daaca89ae2a55fa354406b9482e81 | ska-telescope/algorithm-reference-library | wrappers/arlexecute/execution_support/arlexecutebase.py | [
"Apache-2.0"
] | Python | run | <not_specific> | def run(self, func, *args, **kwargs):
""" Run a function on the client
:param func:
:return:
"""
if self.using_dask:
return self.client.run(func, *args, **kwargs)
else:
return func | Run a function on the client
:param func:
:return:
| Run a function on the client | [
"Run",
"a",
"function",
"on",
"the",
"client"
] | def run(self, func, *args, **kwargs):
if self.using_dask:
return self.client.run(func, *args, **kwargs)
else:
return func | [
"def",
"run",
"(",
"self",
",",
"func",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"if",
"self",
".",
"using_dask",
":",
"return",
"self",
".",
"client",
".",
"run",
"(",
"func",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
"else",
":",
"r... | Run a function on the client | [
"Run",
"a",
"function",
"on",
"the",
"client"
] | [
"\"\"\" Run a function on the client\n \n :param func:\n :return:\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "func",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
c6c377631d0daaca89ae2a55fa354406b9482e81 | ska-telescope/algorithm-reference-library | wrappers/arlexecute/execution_support/arlexecutebase.py | [
"Apache-2.0"
] | Python | optimize | <not_specific> | def optimize(self, *args, **kwargs):
""" Run optimisation of graphs
Only does something when using dask
:param args:
:param kwargs:
:return:
"""
if self.using_dask and self._optimize:
return optimize(*args, **kwargs)[0]
else:
... | Run optimisation of graphs
Only does something when using dask
:param args:
:param kwargs:
:return:
| Run optimisation of graphs
Only does something when using dask | [
"Run",
"optimisation",
"of",
"graphs",
"Only",
"does",
"something",
"when",
"using",
"dask"
] | def optimize(self, *args, **kwargs):
if self.using_dask and self._optimize:
return optimize(*args, **kwargs)[0]
else:
return args[0] | [
"def",
"optimize",
"(",
"self",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"if",
"self",
".",
"using_dask",
"and",
"self",
".",
"_optimize",
":",
"return",
"optimize",
"(",
"*",
"args",
",",
"**",
"kwargs",
")",
"[",
"0",
"]",
"else",
":",
... | Run optimisation of graphs
Only does something when using dask | [
"Run",
"optimisation",
"of",
"graphs",
"Only",
"does",
"something",
"when",
"using",
"dask"
] | [
"\"\"\" Run optimisation of graphs\n \n Only does something when using dask\n \n :param args:\n :param kwargs:\n :return:\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
c6c377631d0daaca89ae2a55fa354406b9482e81 | ska-telescope/algorithm-reference-library | wrappers/arlexecute/execution_support/arlexecutebase.py | [
"Apache-2.0"
] | Python | init_statistics | null | def init_statistics(self):
"""
Initialise the profile and task stream info
:return:
"""
self.start_time = time.time()
if self._using_dask:
self._client.profile()
self._client.get_task_stream() |
Initialise the profile and task stream info
:return:
| Initialise the profile and task stream info | [
"Initialise",
"the",
"profile",
"and",
"task",
"stream",
"info"
] | def init_statistics(self):
self.start_time = time.time()
if self._using_dask:
self._client.profile()
self._client.get_task_stream() | [
"def",
"init_statistics",
"(",
"self",
")",
":",
"self",
".",
"start_time",
"=",
"time",
".",
"time",
"(",
")",
"if",
"self",
".",
"_using_dask",
":",
"self",
".",
"_client",
".",
"profile",
"(",
")",
"self",
".",
"_client",
".",
"get_task_stream",
"("... | Initialise the profile and task stream info | [
"Initialise",
"the",
"profile",
"and",
"task",
"stream",
"info"
] | [
"\"\"\"\n Initialise the profile and task stream info\n :return:\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
44777f8d7853d8e59ab46a7be54bc468c492f2d2 | ska-telescope/algorithm-reference-library | processing_library/image/operations.py | [
"Apache-2.0"
] | Python | create_image | Image | def create_image(npixel=512, cellsize=0.000015, polarisation_frame=PolarisationFrame("stokesI"),
frequency=numpy.array([1e8]), channel_bandwidth=numpy.array([1e6]),
phasecentre=None, nchan=None) -> Image:
"""Create an empty template image consistent with the inputs.
:param npi... | Create an empty template image consistent with the inputs.
:param npixel: Number of pixels
:param polarisation_frame: Polarisation frame (default PolarisationFrame("stokesI"))
:param cellsize: cellsize in radians
:param frequency:
:param channel_bandwidth: Channel width (Hz)
:param phasecentre:... | Create an empty template image consistent with the inputs. | [
"Create",
"an",
"empty",
"template",
"image",
"consistent",
"with",
"the",
"inputs",
"."
] | def create_image(npixel=512, cellsize=0.000015, polarisation_frame=PolarisationFrame("stokesI"),
frequency=numpy.array([1e8]), channel_bandwidth=numpy.array([1e6]),
phasecentre=None, nchan=None) -> Image:
if phasecentre is None:
phasecentre = SkyCoord(ra=+15.0 * u.deg, dec=... | [
"def",
"create_image",
"(",
"npixel",
"=",
"512",
",",
"cellsize",
"=",
"0.000015",
",",
"polarisation_frame",
"=",
"PolarisationFrame",
"(",
"\"stokesI\"",
")",
",",
"frequency",
"=",
"numpy",
".",
"array",
"(",
"[",
"1e8",
"]",
")",
",",
"channel_bandwidth... | Create an empty template image consistent with the inputs. | [
"Create",
"an",
"empty",
"template",
"image",
"consistent",
"with",
"the",
"inputs",
"."
] | [
"\"\"\"Create an empty template image consistent with the inputs.\n\n :param npixel: Number of pixels\n :param polarisation_frame: Polarisation frame (default PolarisationFrame(\"stokesI\"))\n :param cellsize: cellsize in radians\n :param frequency:\n :param channel_bandwidth: Channel width (Hz)\n ... | [
{
"param": "npixel",
"type": null
},
{
"param": "cellsize",
"type": null
},
{
"param": "polarisation_frame",
"type": null
},
{
"param": "frequency",
"type": null
},
{
"param": "channel_bandwidth",
"type": null
},
{
"param": "phasecentre",
"type": n... | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "npixel",
"type": null,
"docstring": "Number of pixels",
"docstring_tokens": [
"Number",
"of",
... |
44777f8d7853d8e59ab46a7be54bc468c492f2d2 | ska-telescope/algorithm-reference-library | processing_library/image/operations.py | [
"Apache-2.0"
] | Python | create_image_from_array | Image | def create_image_from_array(data: numpy.array, wcs: WCS, polarisation_frame: PolarisationFrame) -> Image:
""" Create an image from an array and optional wcs
The output image preserves a reference to the input array.
:param data: Numpy.array
:param wcs: World coordinate system
:param polarisati... | Create an image from an array and optional wcs
The output image preserves a reference to the input array.
:param data: Numpy.array
:param wcs: World coordinate system
:param polarisation_frame: Polarisation Frame
:return: Image
| Create an image from an array and optional wcs
The output image preserves a reference to the input array. | [
"Create",
"an",
"image",
"from",
"an",
"array",
"and",
"optional",
"wcs",
"The",
"output",
"image",
"preserves",
"a",
"reference",
"to",
"the",
"input",
"array",
"."
] | def create_image_from_array(data: numpy.array, wcs: WCS, polarisation_frame: PolarisationFrame) -> Image:
fim = Image()
fim.polarisation_frame = polarisation_frame
fim.data = data
if wcs is None:
fim.wcs = None
else:
fim.wcs = wcs.deepcopy()
if image_sizeof(fim) >= 1.0:
l... | [
"def",
"create_image_from_array",
"(",
"data",
":",
"numpy",
".",
"array",
",",
"wcs",
":",
"WCS",
",",
"polarisation_frame",
":",
"PolarisationFrame",
")",
"->",
"Image",
":",
"fim",
"=",
"Image",
"(",
")",
"fim",
".",
"polarisation_frame",
"=",
"polarisati... | Create an image from an array and optional wcs
The output image preserves a reference to the input array. | [
"Create",
"an",
"image",
"from",
"an",
"array",
"and",
"optional",
"wcs",
"The",
"output",
"image",
"preserves",
"a",
"reference",
"to",
"the",
"input",
"array",
"."
] | [
"\"\"\" Create an image from an array and optional wcs\n \n The output image preserves a reference to the input array.\n\n :param data: Numpy.array\n :param wcs: World coordinate system\n :param polarisation_frame: Polarisation Frame\n :return: Image\n \n \"\"\""
] | [
{
"param": "data",
"type": "numpy.array"
},
{
"param": "wcs",
"type": "WCS"
},
{
"param": "polarisation_frame",
"type": "PolarisationFrame"
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "data",
"type": "numpy.array",
"docstring": null,
"docstring_tokens": [
"None"
],
"default": nul... |
44777f8d7853d8e59ab46a7be54bc468c492f2d2 | ska-telescope/algorithm-reference-library | processing_library/image/operations.py | [
"Apache-2.0"
] | Python | convert_image_to_kernel | <not_specific> | def convert_image_to_kernel(im: Image, oversampling, kernelwidth):
""" Convert an image to a griddata kernel
:param im: Image to be converted
:param oversampling: Oversampling of Image spatially
:param kernelwidth: Kernel width to be extracted
:return: numpy.ndarray[nchan, npol, oversampling, o... | Convert an image to a griddata kernel
:param im: Image to be converted
:param oversampling: Oversampling of Image spatially
:param kernelwidth: Kernel width to be extracted
:return: numpy.ndarray[nchan, npol, oversampling, oversampling, kernelwidth, kernelwidth]
| Convert an image to a griddata kernel | [
"Convert",
"an",
"image",
"to",
"a",
"griddata",
"kernel"
] | def convert_image_to_kernel(im: Image, oversampling, kernelwidth):
naxis = len(im.shape)
assert naxis == 4
assert numpy.max(numpy.abs(im.data)) > 0.0, "Image is empty"
nchan, npol, ny, nx = im.shape
assert nx % oversampling == 0, "Oversampling must be even"
assert ny % oversampling == 0, "Oversa... | [
"def",
"convert_image_to_kernel",
"(",
"im",
":",
"Image",
",",
"oversampling",
",",
"kernelwidth",
")",
":",
"naxis",
"=",
"len",
"(",
"im",
".",
"shape",
")",
"assert",
"naxis",
"==",
"4",
"assert",
"numpy",
".",
"max",
"(",
"numpy",
".",
"abs",
"(",... | Convert an image to a griddata kernel | [
"Convert",
"an",
"image",
"to",
"a",
"griddata",
"kernel"
] | [
"\"\"\" Convert an image to a griddata kernel\n \n :param im: Image to be converted\n :param oversampling: Oversampling of Image spatially\n :param kernelwidth: Kernel width to be extracted\n :return: numpy.ndarray[nchan, npol, oversampling, oversampling, kernelwidth, kernelwidth]\n \"\"\"",
"# ... | [
{
"param": "im",
"type": "Image"
},
{
"param": "oversampling",
"type": null
},
{
"param": "kernelwidth",
"type": null
}
] | {
"returns": [
{
"docstring": "numpy.ndarray[nchan, npol, oversampling, oversampling, kernelwidth, kernelwidth]",
"docstring_tokens": [
"numpy",
".",
"ndarray",
"[",
"nchan",
"npol",
"oversampling",
"oversampling",
"kernelwidth",
... |
44777f8d7853d8e59ab46a7be54bc468c492f2d2 | ska-telescope/algorithm-reference-library | processing_library/image/operations.py | [
"Apache-2.0"
] | Python | copy_image | <not_specific> | def copy_image(im: Image):
""" Create an image from an array
Performs deepcopy of data_models, breaking reference semantics
:param im:
:return: Image
"""
if im is None:
return im
assert isinstance(im, Image), im
fim = Image()
fim.polarisation_frame = im.p... | Create an image from an array
Performs deepcopy of data_models, breaking reference semantics
:param im:
:return: Image
| Create an image from an array
Performs deepcopy of data_models, breaking reference semantics | [
"Create",
"an",
"image",
"from",
"an",
"array",
"Performs",
"deepcopy",
"of",
"data_models",
"breaking",
"reference",
"semantics"
] | def copy_image(im: Image):
if im is None:
return im
assert isinstance(im, Image), im
fim = Image()
fim.polarisation_frame = im.polarisation_frame
fim.data = copy.deepcopy(im.data)
if im.wcs is None:
fim.wcs = None
else:
fim.wcs = copy.deepcopy(im.wcs)
if image_siz... | [
"def",
"copy_image",
"(",
"im",
":",
"Image",
")",
":",
"if",
"im",
"is",
"None",
":",
"return",
"im",
"assert",
"isinstance",
"(",
"im",
",",
"Image",
")",
",",
"im",
"fim",
"=",
"Image",
"(",
")",
"fim",
".",
"polarisation_frame",
"=",
"im",
".",... | Create an image from an array
Performs deepcopy of data_models, breaking reference semantics | [
"Create",
"an",
"image",
"from",
"an",
"array",
"Performs",
"deepcopy",
"of",
"data_models",
"breaking",
"reference",
"semantics"
] | [
"\"\"\" Create an image from an array\n \n Performs deepcopy of data_models, breaking reference semantics\n\n :param im:\n :return: Image\n \n \"\"\""
] | [
{
"param": "im",
"type": "Image"
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "im",
"type": "Image",
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
... |
44777f8d7853d8e59ab46a7be54bc468c492f2d2 | ska-telescope/algorithm-reference-library | processing_library/image/operations.py | [
"Apache-2.0"
] | Python | create_empty_image_like | Image | def create_empty_image_like(im: Image) -> Image:
""" Create an empty image like another in shape and wcs
:param im:
:return: Image
"""
assert isinstance(im, Image), im
fim = Image()
fim.polarisation_frame = im.polarisation_frame
fim.data = numpy.zeros_like(im.data)
if im.wcs is... | Create an empty image like another in shape and wcs
:param im:
:return: Image
| Create an empty image like another in shape and wcs | [
"Create",
"an",
"empty",
"image",
"like",
"another",
"in",
"shape",
"and",
"wcs"
] | def create_empty_image_like(im: Image) -> Image:
assert isinstance(im, Image), im
fim = Image()
fim.polarisation_frame = im.polarisation_frame
fim.data = numpy.zeros_like(im.data)
if im.wcs is None:
fim.wcs = None
else:
fim.wcs = copy.deepcopy(im.wcs)
if image_sizeof(im) >= 1... | [
"def",
"create_empty_image_like",
"(",
"im",
":",
"Image",
")",
"->",
"Image",
":",
"assert",
"isinstance",
"(",
"im",
",",
"Image",
")",
",",
"im",
"fim",
"=",
"Image",
"(",
")",
"fim",
".",
"polarisation_frame",
"=",
"im",
".",
"polarisation_frame",
"f... | Create an empty image like another in shape and wcs | [
"Create",
"an",
"empty",
"image",
"like",
"another",
"in",
"shape",
"and",
"wcs"
] | [
"\"\"\" Create an empty image like another in shape and wcs\n\n :param im:\n :return: Image\n \n \"\"\""
] | [
{
"param": "im",
"type": "Image"
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "im",
"type": "Image",
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
... |
44777f8d7853d8e59ab46a7be54bc468c492f2d2 | ska-telescope/algorithm-reference-library | processing_library/image/operations.py | [
"Apache-2.0"
] | Python | pad_image | <not_specific> | def pad_image(im: Image, shape):
"""Pad an image to desired shape
The wcs crpix is adjusted appropriately
:param im:
:param shape:
:return:
"""
if im.shape == shape:
return im
else:
newwcs = copy.deepcopy(im.wcs)
newwcs.wcs.crpix[0] = im.wcs.wcs.crpix[0]... | Pad an image to desired shape
The wcs crpix is adjusted appropriately
:param im:
:param shape:
:return:
| Pad an image to desired shape
The wcs crpix is adjusted appropriately | [
"Pad",
"an",
"image",
"to",
"desired",
"shape",
"The",
"wcs",
"crpix",
"is",
"adjusted",
"appropriately"
] | def pad_image(im: Image, shape):
if im.shape == shape:
return im
else:
newwcs = copy.deepcopy(im.wcs)
newwcs.wcs.crpix[0] = im.wcs.wcs.crpix[0] + shape[3] // 2 - im.shape[3] // 2
newwcs.wcs.crpix[1] = im.wcs.wcs.crpix[1] + shape[2] // 2 - im.shape[2] // 2
for axis, _ in e... | [
"def",
"pad_image",
"(",
"im",
":",
"Image",
",",
"shape",
")",
":",
"if",
"im",
".",
"shape",
"==",
"shape",
":",
"return",
"im",
"else",
":",
"newwcs",
"=",
"copy",
".",
"deepcopy",
"(",
"im",
".",
"wcs",
")",
"newwcs",
".",
"wcs",
".",
"crpix"... | Pad an image to desired shape
The wcs crpix is adjusted appropriately | [
"Pad",
"an",
"image",
"to",
"desired",
"shape",
"The",
"wcs",
"crpix",
"is",
"adjusted",
"appropriately"
] | [
"\"\"\"Pad an image to desired shape\n \n The wcs crpix is adjusted appropriately\n \n :param im:\n :param shape:\n :return:\n \"\"\""
] | [
{
"param": "im",
"type": "Image"
},
{
"param": "shape",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "im",
"type": "Image",
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
... |
44777f8d7853d8e59ab46a7be54bc468c492f2d2 | ska-telescope/algorithm-reference-library | processing_library/image/operations.py | [
"Apache-2.0"
] | Python | create_w_term_like | Image | def create_w_term_like(im: Image, w, phasecentre=None, remove_shift=False, dopol=False) -> Image:
"""Create an image with a w term phase term in it:
.. math::
I(l,m) = e^{-2 \\pi j (w(\\sqrt{1-l^2-m^2}-1)}
The vis phasecentre is used as the delay centre for the w term (i.e. where n==0)
... | Create an image with a w term phase term in it:
.. math::
I(l,m) = e^{-2 \\pi j (w(\\sqrt{1-l^2-m^2}-1)}
The vis phasecentre is used as the delay centre for the w term (i.e. where n==0)
:param phasecentre:
:param im: template image
:param w: w value to evaluate (default is median ab... | Create an image with a w term phase term in it:
math:.
The vis phasecentre is used as the delay centre for the w term | [
"Create",
"an",
"image",
"with",
"a",
"w",
"term",
"phase",
"term",
"in",
"it",
":",
"math",
":",
".",
"The",
"vis",
"phasecentre",
"is",
"used",
"as",
"the",
"delay",
"centre",
"for",
"the",
"w",
"term"
] | def create_w_term_like(im: Image, w, phasecentre=None, remove_shift=False, dopol=False) -> Image:
fim_shape = list(im.shape)
if not dopol:
fim_shape[1] = 1
fim_array = numpy.zeros(fim_shape, dtype='complex')
fim = create_image_from_array(fim_array, wcs=im.wcs, polarisation_frame=im.polarisation_... | [
"def",
"create_w_term_like",
"(",
"im",
":",
"Image",
",",
"w",
",",
"phasecentre",
"=",
"None",
",",
"remove_shift",
"=",
"False",
",",
"dopol",
"=",
"False",
")",
"->",
"Image",
":",
"fim_shape",
"=",
"list",
"(",
"im",
".",
"shape",
")",
"if",
"no... | Create an image with a w term phase term in it:
.. math:: | [
"Create",
"an",
"image",
"with",
"a",
"w",
"term",
"phase",
"term",
"in",
"it",
":",
"..",
"math",
"::"
] | [
"\"\"\"Create an image with a w term phase term in it:\n \n .. math::\n\n I(l,m) = e^{-2 \\\\pi j (w(\\\\sqrt{1-l^2-m^2}-1)}\n\n \n The vis phasecentre is used as the delay centre for the w term (i.e. where n==0)\n\n :param phasecentre:\n :param im: template image\n :param w: w value to eval... | [
{
"param": "im",
"type": "Image"
},
{
"param": "w",
"type": null
},
{
"param": "phasecentre",
"type": null
},
{
"param": "remove_shift",
"type": null
},
{
"param": "dopol",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "im",
"type": "Image",
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
... |
c688acc22cae85d63a07bf4e430b59749dbfd5fc | ska-telescope/algorithm-reference-library | processing_components/visibility/msv2.py | [
"Apache-2.0"
] | Python | add_data_set | null | def add_data_set(self, obstime, inttime, baselines, visibilities, pol='XX', source=None, phasecentre=None, uvw=None):
"""
Create a UVData object to store a collection of visibilities.
"""
if type(pol) == str:
numericPol = self._STOKES_CODES[pol.upper()]
... |
Create a UVData object to store a collection of visibilities.
| Create a UVData object to store a collection of visibilities. | [
"Create",
"a",
"UVData",
"object",
"to",
"store",
"a",
"collection",
"of",
"visibilities",
"."
] | def add_data_set(self, obstime, inttime, baselines, visibilities, pol='XX', source=None, phasecentre=None, uvw=None):
if type(pol) == str:
numericPol = self._STOKES_CODES[pol.upper()]
else:
numericPol = pol
self.data.append(
MS_UVData(o... | [
"def",
"add_data_set",
"(",
"self",
",",
"obstime",
",",
"inttime",
",",
"baselines",
",",
"visibilities",
",",
"pol",
"=",
"'XX'",
",",
"source",
"=",
"None",
",",
"phasecentre",
"=",
"None",
",",
"uvw",
"=",
"None",
")",
":",
"if",
"type",
"(",
"po... | Create a UVData object to store a collection of visibilities. | [
"Create",
"a",
"UVData",
"object",
"to",
"store",
"a",
"collection",
"of",
"visibilities",
"."
] | [
"\"\"\"\n Create a UVData object to store a collection of visibilities.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "obstime",
"type": null
},
{
"param": "inttime",
"type": null
},
{
"param": "baselines",
"type": null
},
{
"param": "visibilities",
"type": null
},
{
"param": "pol",
"type": null
},
{
"param": "... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "obstime",
"type": null,
"docstring": null,
"docstring_tokens"... |
c688acc22cae85d63a07bf4e430b59749dbfd5fc | ska-telescope/algorithm-reference-library | processing_components/visibility/msv2.py | [
"Apache-2.0"
] | Python | write | null | def write(self):
"""
Fill in the Measurement Sets file with correct order.
"""
# Validate
if self.nStokes == 0:
raise RuntimeError("No polarization setups defined")
if len(self.freq) == 0:
raise RuntimeError("No fre... |
Fill in the Measurement Sets file with correct order.
| Fill in the Measurement Sets file with correct order. | [
"Fill",
"in",
"the",
"Measurement",
"Sets",
"file",
"with",
"correct",
"order",
"."
] | def write(self):
if self.nStokes == 0:
raise RuntimeError("No polarization setups defined")
if len(self.freq) == 0:
raise RuntimeError("No frequency setups defined")
if self.nant == 0:
raise RuntimeError("No array geometry defined")
... | [
"def",
"write",
"(",
"self",
")",
":",
"if",
"self",
".",
"nStokes",
"==",
"0",
":",
"raise",
"RuntimeError",
"(",
"\"No polarization setups defined\"",
")",
"if",
"len",
"(",
"self",
".",
"freq",
")",
"==",
"0",
":",
"raise",
"RuntimeError",
"(",
"\"No ... | Fill in the Measurement Sets file with correct order. | [
"Fill",
"in",
"the",
"Measurement",
"Sets",
"file",
"with",
"correct",
"order",
"."
] | [
"\"\"\"\n Fill in the Measurement Sets file with correct order.\n \"\"\"",
"# Validate",
"# Sort the data set",
"# Write the tables",
"# Fixup the info and keywords for the main table",
"# Clear out the data section"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
c688acc22cae85d63a07bf4e430b59749dbfd5fc | ska-telescope/algorithm-reference-library | processing_components/visibility/msv2.py | [
"Apache-2.0"
] | Python | _write_spectralwindow_table | null | def _write_spectralwindow_table(self):
"""
Write the spectral window table.
"""
# Spectral Window
nBand = len(self.freq)
col1 = tableutil.makescacoldesc('MEAS_FREQ_REF', 0,
comment='Frequency Measure r... |
Write the spectral window table.
| Write the spectral window table. | [
"Write",
"the",
"spectral",
"window",
"table",
"."
] | def _write_spectralwindow_table(self):
nBand = len(self.freq)
col1 = tableutil.makescacoldesc('MEAS_FREQ_REF', 0,
comment='Frequency Measure reference')
col2 = tableutil.makearrcoldesc('CHAN_FREQ', 0.0, 1,
... | [
"def",
"_write_spectralwindow_table",
"(",
"self",
")",
":",
"nBand",
"=",
"len",
"(",
"self",
".",
"freq",
")",
"col1",
"=",
"tableutil",
".",
"makescacoldesc",
"(",
"'MEAS_FREQ_REF'",
",",
"0",
",",
"comment",
"=",
"'Frequency Measure reference'",
")",
"col2... | Write the spectral window table. | [
"Write",
"the",
"spectral",
"window",
"table",
"."
] | [
"\"\"\"\n Write the spectral window table.\n \"\"\"",
"# Spectral Window",
"#https://github.com/ska-sa/pyxis/issues/27"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
c688acc22cae85d63a07bf4e430b59749dbfd5fc | ska-telescope/algorithm-reference-library | processing_components/visibility/msv2.py | [
"Apache-2.0"
] | Python | _write_misc_required_tables | null | def _write_misc_required_tables(self):
"""
Write the other tables that are part of the measurement set but
don't contain anything by default.
"""
# Flag command
col1 = tableutil.makescacoldesc('TIME', 0.0,
... |
Write the other tables that are part of the measurement set but
don't contain anything by default.
| Write the other tables that are part of the measurement set but
don't contain anything by default. | [
"Write",
"the",
"other",
"tables",
"that",
"are",
"part",
"of",
"the",
"measurement",
"set",
"but",
"don",
"'",
"t",
"contain",
"anything",
"by",
"default",
"."
] | def _write_misc_required_tables(self):
col1 = tableutil.makescacoldesc('TIME', 0.0,
comment='Midpoint of interval for which this flag is valid',
keywords={'QuantumUnits': ['s', ],
... | [
"def",
"_write_misc_required_tables",
"(",
"self",
")",
":",
"col1",
"=",
"tableutil",
".",
"makescacoldesc",
"(",
"'TIME'",
",",
"0.0",
",",
"comment",
"=",
"'Midpoint of interval for which this flag is valid'",
",",
"keywords",
"=",
"{",
"'QuantumUnits'",
":",
"["... | Write the other tables that are part of the measurement set but
don't contain anything by default. | [
"Write",
"the",
"other",
"tables",
"that",
"are",
"part",
"of",
"the",
"measurement",
"set",
"but",
"don",
"'",
"t",
"contain",
"anything",
"by",
"default",
"."
] | [
"\"\"\"\n Write the other tables that are part of the measurement set but\n don't contain anything by default.\n \"\"\"",
"# Flag command",
"# History",
"# POINTING",
"# Processor",
"# State"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
18d00f840d970b18d48abe8cb45732be016ed75b | ska-telescope/algorithm-reference-library | processing_components/imaging/ng.py | [
"Apache-2.0"
] | Python | predict_ng | Union[BlockVisibility, Visibility] | def predict_ng(bvis: Union[BlockVisibility, Visibility], model: Image, **kwargs) -> \
Union[BlockVisibility, Visibility]:
""" Predict using convolutional degridding.
Nifty-gridder version. https://gitlab.mpcdf.mpg.de/ift/nifty_gridder
:param bvis: BlockVisibility to be ... | Predict using convolutional degridding.
Nifty-gridder version. https://gitlab.mpcdf.mpg.de/ift/nifty_gridder
:param bvis: BlockVisibility to be predicted
:param model: model image
:return: resulting BlockVisibility (in place works)
| Predict using convolutional degridding.
Nifty-gridder version. | [
"Predict",
"using",
"convolutional",
"degridding",
".",
"Nifty",
"-",
"gridder",
"version",
"."
] | def predict_ng(bvis: Union[BlockVisibility, Visibility], model: Image, **kwargs) -> \
Union[BlockVisibility, Visibility]:
assert isinstance(bvis, BlockVisibility), bvis
if model is None:
return bvis
nthreads = get_parameter(kwargs, "threads", 4)
epsilon = get_para... | [
"def",
"predict_ng",
"(",
"bvis",
":",
"Union",
"[",
"BlockVisibility",
",",
"Visibility",
"]",
",",
"model",
":",
"Image",
",",
"**",
"kwargs",
")",
"->",
"Union",
"[",
"BlockVisibility",
",",
"Visibility",
"]",
":",
"assert",
"isinstance",
"(",
"bvis",
... | Predict using convolutional degridding. | [
"Predict",
"using",
"convolutional",
"degridding",
"."
] | [
"\"\"\" Predict using convolutional degridding.\n \n Nifty-gridder version. https://gitlab.mpcdf.mpg.de/ift/nifty_gridder\n \n :param bvis: BlockVisibility to be predicted\n :param model: model image\n :return: resulting BlockVisibility (in place works)\n \"\"\"",
"# E... | [
{
"param": "bvis",
"type": "Union[BlockVisibility, Visibility]"
},
{
"param": "model",
"type": "Image"
}
] | {
"returns": [
{
"docstring": "resulting BlockVisibility (in place works)",
"docstring_tokens": [
"resulting",
"BlockVisibility",
"(",
"in",
"place",
"works",
")"
],
"type": null
}
],
"raises": [],
"params": [
{
"i... |
18d00f840d970b18d48abe8cb45732be016ed75b | ska-telescope/algorithm-reference-library | processing_components/imaging/ng.py | [
"Apache-2.0"
] | Python | invert_ng | (Image, numpy.ndarray) | def invert_ng(bvis: BlockVisibility, model: Image, dopsf: bool = False, normalize: bool = True,
**kwargs) -> (Image, numpy.ndarray):
""" Invert using nifty-gridder module
https://gitlab.mpcdf.mpg.de/ift/nifty_gridder
Use the image im as a template. Do PSF in a sep... | Invert using nifty-gridder module
https://gitlab.mpcdf.mpg.de/ift/nifty_gridder
Use the image im as a template. Do PSF in a separate call.
This is at the bottom of the layering i.e. all transforms are eventually expressed in terms
of this function. . Any shifting need... |
Use the image im as a template. Do PSF in a separate call.
This is at the bottom of the layering i.e. all transforms are eventually expressed in terms
of this function. | [
"Use",
"the",
"image",
"im",
"as",
"a",
"template",
".",
"Do",
"PSF",
"in",
"a",
"separate",
"call",
".",
"This",
"is",
"at",
"the",
"bottom",
"of",
"the",
"layering",
"i",
".",
"e",
".",
"all",
"transforms",
"are",
"eventually",
"expressed",
"in",
"... | def invert_ng(bvis: BlockVisibility, model: Image, dopsf: bool = False, normalize: bool = True,
**kwargs) -> (Image, numpy.ndarray):
assert isinstance(bvis, BlockVisibility), bvis
im = copy_image(model)
nthreads = get_parameter(kwargs, "threads", 4)
epsilon = get_parame... | [
"def",
"invert_ng",
"(",
"bvis",
":",
"BlockVisibility",
",",
"model",
":",
"Image",
",",
"dopsf",
":",
"bool",
"=",
"False",
",",
"normalize",
":",
"bool",
"=",
"True",
",",
"**",
"kwargs",
")",
"->",
"(",
"Image",
",",
"numpy",
".",
"ndarray",
")",... | Invert using nifty-gridder module
https://gitlab.mpcdf.mpg.de/ift/nifty_gridder | [
"Invert",
"using",
"nifty",
"-",
"gridder",
"module",
"https",
":",
"//",
"gitlab",
".",
"mpcdf",
".",
"mpg",
".",
"de",
"/",
"ift",
"/",
"nifty_gridder"
] | [
"\"\"\" Invert using nifty-gridder module\n \n https://gitlab.mpcdf.mpg.de/ift/nifty_gridder\n \n Use the image im as a template. Do PSF in a separate call.\n \n This is at the bottom of the layering i.e. all transforms are eventually expressed in terms\n of this function. .... | [
{
"param": "bvis",
"type": "BlockVisibility"
},
{
"param": "model",
"type": "Image"
},
{
"param": "dopsf",
"type": "bool"
},
{
"param": "normalize",
"type": "bool"
}
] | {
"returns": [
{
"docstring": "(resulting image, sum of the weights for each frequency and polarization)",
"docstring_tokens": [
"(",
"resulting",
"image",
"sum",
"of",
"the",
"weights",
"for",
"each",
"frequency",
... |
11ceab6c7d4974e7e3bb2bb852426749157aeb63 | ska-telescope/algorithm-reference-library | processing_components/simulation/rfi.py | [
"Apache-2.0"
] | Python | simulate_DTV | <not_specific> | def simulate_DTV(frequency, times, power=50e3, timevariable=False, frequency_variable=False):
""" Calculate DTV sqrt(power) as a function of time and frequency
:param frequency: (sample frequencies)
:param times: sample times (s)
:param power: DTV emitted power W
:return: Complex array [ntimes, nch... | Calculate DTV sqrt(power) as a function of time and frequency
:param frequency: (sample frequencies)
:param times: sample times (s)
:param power: DTV emitted power W
:return: Complex array [ntimes, nchan]
| Calculate DTV sqrt(power) as a function of time and frequency | [
"Calculate",
"DTV",
"sqrt",
"(",
"power",
")",
"as",
"a",
"function",
"of",
"time",
"and",
"frequency"
] | def simulate_DTV(frequency, times, power=50e3, timevariable=False, frequency_variable=False):
nchan = len(frequency)
ntimes = len(times)
shape = [ntimes, nchan]
bchan = nchan // 4
echan = 3 * nchan // 4
amp = power / (max(frequency) - min(frequency))
signal = numpy.zeros(shape, dtype='comple... | [
"def",
"simulate_DTV",
"(",
"frequency",
",",
"times",
",",
"power",
"=",
"50e3",
",",
"timevariable",
"=",
"False",
",",
"frequency_variable",
"=",
"False",
")",
":",
"nchan",
"=",
"len",
"(",
"frequency",
")",
"ntimes",
"=",
"len",
"(",
"times",
")",
... | Calculate DTV sqrt(power) as a function of time and frequency | [
"Calculate",
"DTV",
"sqrt",
"(",
"power",
")",
"as",
"a",
"function",
"of",
"time",
"and",
"frequency"
] | [
"\"\"\" Calculate DTV sqrt(power) as a function of time and frequency\n\n :param frequency: (sample frequencies)\n :param times: sample times (s)\n :param power: DTV emitted power W\n :return: Complex array [ntimes, nchan]\n \"\"\""
] | [
{
"param": "frequency",
"type": null
},
{
"param": "times",
"type": null
},
{
"param": "power",
"type": null
},
{
"param": "timevariable",
"type": null
},
{
"param": "frequency_variable",
"type": null
}
] | {
"returns": [
{
"docstring": "Complex array [ntimes, nchan]",
"docstring_tokens": [
"Complex",
"array",
"[",
"ntimes",
"nchan",
"]"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "frequency",
"type":... |
11ceab6c7d4974e7e3bb2bb852426749157aeb63 | ska-telescope/algorithm-reference-library | processing_components/simulation/rfi.py | [
"Apache-2.0"
] | Python | calculate_rfi_at_station | <not_specific> | def calculate_rfi_at_station(propagators, emitter):
""" Calculate the rfi at each station
:param propagators: [nstations, nchannels]
:param emitter: [ntimes, nchannels]
:return: Complex array [nstations, ntimes, nchannels]
"""
rfi_at_station = emitter[:, numpy.newaxis, ...] * propagators[numpy.... | Calculate the rfi at each station
:param propagators: [nstations, nchannels]
:param emitter: [ntimes, nchannels]
:return: Complex array [nstations, ntimes, nchannels]
| Calculate the rfi at each station | [
"Calculate",
"the",
"rfi",
"at",
"each",
"station"
] | def calculate_rfi_at_station(propagators, emitter):
rfi_at_station = emitter[:, numpy.newaxis, ...] * propagators[numpy.newaxis, ...]
rfi_at_station[numpy.abs(rfi_at_station)<1e-15] = 0.
return rfi_at_station | [
"def",
"calculate_rfi_at_station",
"(",
"propagators",
",",
"emitter",
")",
":",
"rfi_at_station",
"=",
"emitter",
"[",
":",
",",
"numpy",
".",
"newaxis",
",",
"...",
"]",
"*",
"propagators",
"[",
"numpy",
".",
"newaxis",
",",
"...",
"]",
"rfi_at_station",
... | Calculate the rfi at each station | [
"Calculate",
"the",
"rfi",
"at",
"each",
"station"
] | [
"\"\"\" Calculate the rfi at each station\n\n :param propagators: [nstations, nchannels]\n :param emitter: [ntimes, nchannels]\n :return: Complex array [nstations, ntimes, nchannels]\n \"\"\""
] | [
{
"param": "propagators",
"type": null
},
{
"param": "emitter",
"type": null
}
] | {
"returns": [
{
"docstring": "Complex array [nstations, ntimes, nchannels]",
"docstring_tokens": [
"Complex",
"array",
"[",
"nstations",
"ntimes",
"nchannels",
"]"
],
"type": null
}
],
"raises": [],
"params": [
{
... |
11ceab6c7d4974e7e3bb2bb852426749157aeb63 | ska-telescope/algorithm-reference-library | processing_components/simulation/rfi.py | [
"Apache-2.0"
] | Python | calculate_station_correlation_rfi | <not_specific> | def calculate_station_correlation_rfi(rfi_at_station):
""" Form the correlation from the rfi at the station
:param rfi_at_station:
:return: Correlation(nant, nants, ntimes, nchan] in Jy
"""
ntimes, nants, nchan = rfi_at_station.shape
correlation = numpy.zeros([ntimes, nants, nants, nchan], ... | Form the correlation from the rfi at the station
:param rfi_at_station:
:return: Correlation(nant, nants, ntimes, nchan] in Jy
| Form the correlation from the rfi at the station | [
"Form",
"the",
"correlation",
"from",
"the",
"rfi",
"at",
"the",
"station"
] | def calculate_station_correlation_rfi(rfi_at_station):
ntimes, nants, nchan = rfi_at_station.shape
correlation = numpy.zeros([ntimes, nants, nants, nchan], dtype='complex')
for itime in range(ntimes):
for chan in range(nchan):
correlation[itime, ..., chan] = numpy.outer(rfi_at_station[it... | [
"def",
"calculate_station_correlation_rfi",
"(",
"rfi_at_station",
")",
":",
"ntimes",
",",
"nants",
",",
"nchan",
"=",
"rfi_at_station",
".",
"shape",
"correlation",
"=",
"numpy",
".",
"zeros",
"(",
"[",
"ntimes",
",",
"nants",
",",
"nants",
",",
"nchan",
"... | Form the correlation from the rfi at the station | [
"Form",
"the",
"correlation",
"from",
"the",
"rfi",
"at",
"the",
"station"
] | [
"\"\"\" Form the correlation from the rfi at the station\n \n :param rfi_at_station:\n :return: Correlation(nant, nants, ntimes, nchan] in Jy\n \"\"\""
] | [
{
"param": "rfi_at_station",
"type": null
}
] | {
"returns": [
{
"docstring": "Correlation(nant, nants, ntimes, nchan] in Jy",
"docstring_tokens": [
"Correlation",
"(",
"nant",
"nants",
"ntimes",
"nchan",
"]",
"in",
"Jy"
],
"type": null
}
],
"raises": [],
... |
11ceab6c7d4974e7e3bb2bb852426749157aeb63 | ska-telescope/algorithm-reference-library | processing_components/simulation/rfi.py | [
"Apache-2.0"
] | Python | calculate_averaged_correlation | <not_specific> | def calculate_averaged_correlation(correlation, time_width, channel_width):
""" Average the correlation in time and frequency
:param correlation: Correlation(nant, nants, ntimes, nchan]
:param channel_width: Number of channels to average
:param time_width: Number of integrations to average
:ret... | Average the correlation in time and frequency
:param correlation: Correlation(nant, nants, ntimes, nchan]
:param channel_width: Number of channels to average
:param time_width: Number of integrations to average
:return:
| Average the correlation in time and frequency | [
"Average",
"the",
"correlation",
"in",
"time",
"and",
"frequency"
] | def calculate_averaged_correlation(correlation, time_width, channel_width):
wts = numpy.ones(correlation.shape, dtype='float')
return average_chunks2(correlation, wts, (time_width, channel_width))[0] | [
"def",
"calculate_averaged_correlation",
"(",
"correlation",
",",
"time_width",
",",
"channel_width",
")",
":",
"wts",
"=",
"numpy",
".",
"ones",
"(",
"correlation",
".",
"shape",
",",
"dtype",
"=",
"'float'",
")",
"return",
"average_chunks2",
"(",
"correlation"... | Average the correlation in time and frequency | [
"Average",
"the",
"correlation",
"in",
"time",
"and",
"frequency"
] | [
"\"\"\" Average the correlation in time and frequency\n \n :param correlation: Correlation(nant, nants, ntimes, nchan]\n :param channel_width: Number of channels to average\n :param time_width: Number of integrations to average\n :return:\n \"\"\""
] | [
{
"param": "correlation",
"type": null
},
{
"param": "time_width",
"type": null
},
{
"param": "channel_width",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "correlation",
"type": null,
"docstring": "Correlation(nant, nants, ntimes, nchan]",
"docstring_tokens": [
"... |
629659a5cf40af70b49b385be7cadf80030e9617 | ska-telescope/algorithm-reference-library | processing_library/util/coordinate_support.py | [
"Apache-2.0"
] | Python | xyz_at_latitude | <not_specific> | def xyz_at_latitude(local_xyz, lat):
"""
Rotate local XYZ coordinates into celestial XYZ coordinates. These
coordinate systems are very similar, with X pointing towards the
geographical east in both cases. However, before the rotation Z
points towards the zenith, whereas afterwards it will point tow... |
Rotate local XYZ coordinates into celestial XYZ coordinates. These
coordinate systems are very similar, with X pointing towards the
geographical east in both cases. However, before the rotation Z
points towards the zenith, whereas afterwards it will point towards
celestial north (parallel to the ea... | Rotate local XYZ coordinates into celestial XYZ coordinates. These
coordinate systems are very similar, with X pointing towards the
geographical east in both cases. However, before the rotation Z
points towards the zenith, whereas afterwards it will point towards
celestial north (parallel to the earth axis). | [
"Rotate",
"local",
"XYZ",
"coordinates",
"into",
"celestial",
"XYZ",
"coordinates",
".",
"These",
"coordinate",
"systems",
"are",
"very",
"similar",
"with",
"X",
"pointing",
"towards",
"the",
"geographical",
"east",
"in",
"both",
"cases",
".",
"However",
"before... | def xyz_at_latitude(local_xyz, lat):
x, y, z = numpy.hsplit(local_xyz, 3)
lat2 = numpy.pi / 2 - lat
y2 = -z * numpy.sin(lat2) + y * numpy.cos(lat2)
z2 = z * numpy.cos(lat2) + y * numpy.sin(lat2)
return numpy.hstack([x, y2, z2]) | [
"def",
"xyz_at_latitude",
"(",
"local_xyz",
",",
"lat",
")",
":",
"x",
",",
"y",
",",
"z",
"=",
"numpy",
".",
"hsplit",
"(",
"local_xyz",
",",
"3",
")",
"lat2",
"=",
"numpy",
".",
"pi",
"/",
"2",
"-",
"lat",
"y2",
"=",
"-",
"z",
"*",
"numpy",
... | Rotate local XYZ coordinates into celestial XYZ coordinates. | [
"Rotate",
"local",
"XYZ",
"coordinates",
"into",
"celestial",
"XYZ",
"coordinates",
"."
] | [
"\"\"\"\n Rotate local XYZ coordinates into celestial XYZ coordinates. These\n coordinate systems are very similar, with X pointing towards the\n geographical east in both cases. However, before the rotation Z\n points towards the zenith, whereas afterwards it will point towards\n celestial north (pa... | [
{
"param": "local_xyz",
"type": null
},
{
"param": "lat",
"type": null
}
] | {
"returns": [
{
"docstring": "Celestial XYZ coordinates",
"docstring_tokens": [
"Celestial",
"XYZ",
"coordinates"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "local_xyz",
"type": null,
"docstring": "Array of local ... |
629659a5cf40af70b49b385be7cadf80030e9617 | ska-telescope/algorithm-reference-library | processing_library/util/coordinate_support.py | [
"Apache-2.0"
] | Python | baselines | <not_specific> | def baselines(ants_uvw):
"""
Compute baselines in uvw co-ordinate system from
uvw co-ordinate system station positions
:param ants_uvw: `(u,v,w)` co-ordinates of antennas in array
"""
res = []
nants = ants_uvw.shape[0]
for a1 in range(nants):
for a2 in range(a1 + 1, nants):... |
Compute baselines in uvw co-ordinate system from
uvw co-ordinate system station positions
:param ants_uvw: `(u,v,w)` co-ordinates of antennas in array
| Compute baselines in uvw co-ordinate system from
uvw co-ordinate system station positions | [
"Compute",
"baselines",
"in",
"uvw",
"co",
"-",
"ordinate",
"system",
"from",
"uvw",
"co",
"-",
"ordinate",
"system",
"station",
"positions"
] | def baselines(ants_uvw):
res = []
nants = ants_uvw.shape[0]
for a1 in range(nants):
for a2 in range(a1 + 1, nants):
res.append(ants_uvw[a2] - ants_uvw[a1])
basel_uvw = numpy.array(res)
return basel_uvw | [
"def",
"baselines",
"(",
"ants_uvw",
")",
":",
"res",
"=",
"[",
"]",
"nants",
"=",
"ants_uvw",
".",
"shape",
"[",
"0",
"]",
"for",
"a1",
"in",
"range",
"(",
"nants",
")",
":",
"for",
"a2",
"in",
"range",
"(",
"a1",
"+",
"1",
",",
"nants",
")",
... | Compute baselines in uvw co-ordinate system from
uvw co-ordinate system station positions | [
"Compute",
"baselines",
"in",
"uvw",
"co",
"-",
"ordinate",
"system",
"from",
"uvw",
"co",
"-",
"ordinate",
"system",
"station",
"positions"
] | [
"\"\"\"\n Compute baselines in uvw co-ordinate system from\n uvw co-ordinate system station positions\n\n :param ants_uvw: `(u,v,w)` co-ordinates of antennas in array\n \"\"\""
] | [
{
"param": "ants_uvw",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ants_uvw",
"type": null,
"docstring": "`(u,v,w)` co-ordinates of antennas in array",
"docstring_tokens": [
"`",
"(",
"u",
"v",
"w",
")",
"`",
"co",
"-",
... |
629659a5cf40af70b49b385be7cadf80030e9617 | ska-telescope/algorithm-reference-library | processing_library/util/coordinate_support.py | [
"Apache-2.0"
] | Python | skycoord_to_lmn | <not_specific> | def skycoord_to_lmn(pos: SkyCoord, phasecentre: SkyCoord):
"""
Convert astropy sky coordinates into the l,m,n coordinate system
relative to a phase centre.
The l,m,n is a RHS coordinate system with
* its origin on the sky sphere
* m,n and the celestial north on the same plane
* l,m a tangen... |
Convert astropy sky coordinates into the l,m,n coordinate system
relative to a phase centre.
The l,m,n is a RHS coordinate system with
* its origin on the sky sphere
* m,n and the celestial north on the same plane
* l,m a tangential plane of the sky sphere
Note that this means that l incr... | Convert astropy sky coordinates into the l,m,n coordinate system
relative to a phase centre.
The l,m,n is a RHS coordinate system with
its origin on the sky sphere
m,n and the celestial north on the same plane
l,m a tangential plane of the sky sphere
Note that this means that l increases east-wards | [
"Convert",
"astropy",
"sky",
"coordinates",
"into",
"the",
"l",
"m",
"n",
"coordinate",
"system",
"relative",
"to",
"a",
"phase",
"centre",
".",
"The",
"l",
"m",
"n",
"is",
"a",
"RHS",
"coordinate",
"system",
"with",
"its",
"origin",
"on",
"the",
"sky",
... | def skycoord_to_lmn(pos: SkyCoord, phasecentre: SkyCoord):
todc = pos.transform_to(phasecentre.skyoffset_frame())
dc = todc.represent_as(CartesianRepresentation)
return dc.y.value, dc.z.value, dc.x.value - 1 | [
"def",
"skycoord_to_lmn",
"(",
"pos",
":",
"SkyCoord",
",",
"phasecentre",
":",
"SkyCoord",
")",
":",
"todc",
"=",
"pos",
".",
"transform_to",
"(",
"phasecentre",
".",
"skyoffset_frame",
"(",
")",
")",
"dc",
"=",
"todc",
".",
"represent_as",
"(",
"Cartesia... | Convert astropy sky coordinates into the l,m,n coordinate system
relative to a phase centre. | [
"Convert",
"astropy",
"sky",
"coordinates",
"into",
"the",
"l",
"m",
"n",
"coordinate",
"system",
"relative",
"to",
"a",
"phase",
"centre",
"."
] | [
"\"\"\"\n Convert astropy sky coordinates into the l,m,n coordinate system\n relative to a phase centre.\n\n The l,m,n is a RHS coordinate system with\n * its origin on the sky sphere\n * m,n and the celestial north on the same plane\n * l,m a tangential plane of the sky sphere\n\n Note that th... | [
{
"param": "pos",
"type": "SkyCoord"
},
{
"param": "phasecentre",
"type": "SkyCoord"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "pos",
"type": "SkyCoord",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "phasecentre",
"type": "SkyCoord",
"docstring": null,
"do... |
629659a5cf40af70b49b385be7cadf80030e9617 | ska-telescope/algorithm-reference-library | processing_library/util/coordinate_support.py | [
"Apache-2.0"
] | Python | lmn_to_skycoord | <not_specific> | def lmn_to_skycoord(lmn, phasecentre: SkyCoord):
"""
Convert l,m,n coordinate system + phascentre to astropy sky coordinate
relative to a phase centre.
The l,m,n is a RHS coordinate system with
* its origin on the sky sphere
* m,n and the celestial north on the same plane
* l,m a tangential... |
Convert l,m,n coordinate system + phascentre to astropy sky coordinate
relative to a phase centre.
The l,m,n is a RHS coordinate system with
* its origin on the sky sphere
* m,n and the celestial north on the same plane
* l,m a tangential plane of the sky sphere
Note that this means that ... | Convert l,m,n coordinate system + phascentre to astropy sky coordinate
relative to a phase centre.
The l,m,n is a RHS coordinate system with
its origin on the sky sphere
m,n and the celestial north on the same plane
l,m a tangential plane of the sky sphere
Note that this means that l increases east-wards | [
"Convert",
"l",
"m",
"n",
"coordinate",
"system",
"+",
"phascentre",
"to",
"astropy",
"sky",
"coordinate",
"relative",
"to",
"a",
"phase",
"centre",
".",
"The",
"l",
"m",
"n",
"is",
"a",
"RHS",
"coordinate",
"system",
"with",
"its",
"origin",
"on",
"the"... | def lmn_to_skycoord(lmn, phasecentre: SkyCoord):
n = numpy.sqrt(1 - lmn[0] ** 2 - lmn[1] ** 2) - 1.0
dc = n + 1, lmn[0], lmn[1]
target = SkyCoord(x=dc[0], y=dc[1], z=dc[2], representation_type='cartesian', frame=phasecentre.skyoffset_frame())
return target.transform_to(phasecentre.frame) | [
"def",
"lmn_to_skycoord",
"(",
"lmn",
",",
"phasecentre",
":",
"SkyCoord",
")",
":",
"n",
"=",
"numpy",
".",
"sqrt",
"(",
"1",
"-",
"lmn",
"[",
"0",
"]",
"**",
"2",
"-",
"lmn",
"[",
"1",
"]",
"**",
"2",
")",
"-",
"1.0",
"dc",
"=",
"n",
"+",
... | Convert l,m,n coordinate system + phascentre to astropy sky coordinate
relative to a phase centre. | [
"Convert",
"l",
"m",
"n",
"coordinate",
"system",
"+",
"phascentre",
"to",
"astropy",
"sky",
"coordinate",
"relative",
"to",
"a",
"phase",
"centre",
"."
] | [
"\"\"\"\n Convert l,m,n coordinate system + phascentre to astropy sky coordinate\n relative to a phase centre.\n\n The l,m,n is a RHS coordinate system with\n * its origin on the sky sphere\n * m,n and the celestial north on the same plane\n * l,m a tangential plane of the sky sphere\n\n Note t... | [
{
"param": "lmn",
"type": null
},
{
"param": "phasecentre",
"type": "SkyCoord"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "lmn",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "phasecentre",
"type": "SkyCoord",
"docstring": null,
"docstrin... |
629659a5cf40af70b49b385be7cadf80030e9617 | ska-telescope/algorithm-reference-library | processing_library/util/coordinate_support.py | [
"Apache-2.0"
] | Python | simulate_point | <not_specific> | def simulate_point(dist_uvw, l, m):
"""
Simulate visibilities for unit amplitude point source at
direction cosines (l,m) relative to the phase centre.
This includes phase tracking to the centre of the field (hence the minus 1
in the exponent.)
Note that point source is delta function, therefor... |
Simulate visibilities for unit amplitude point source at
direction cosines (l,m) relative to the phase centre.
This includes phase tracking to the centre of the field (hence the minus 1
in the exponent.)
Note that point source is delta function, therefore the
FT relationship becomes an expone... | Simulate visibilities for unit amplitude point source at
direction cosines (l,m) relative to the phase centre.
This includes phase tracking to the centre of the field (hence the minus 1
in the exponent.)
Note that point source is delta function, therefore the
FT relationship becomes an exponential, evaluated at
(uvw.... | [
"Simulate",
"visibilities",
"for",
"unit",
"amplitude",
"point",
"source",
"at",
"direction",
"cosines",
"(",
"l",
"m",
")",
"relative",
"to",
"the",
"phase",
"centre",
".",
"This",
"includes",
"phase",
"tracking",
"to",
"the",
"centre",
"of",
"the",
"field"... | def simulate_point(dist_uvw, l, m):
s = numpy.array([l, m, numpy.sqrt(1 - l ** 2 - m ** 2) - 1.0])
return numpy.exp(-2j * numpy.pi * numpy.dot(dist_uvw, s)) | [
"def",
"simulate_point",
"(",
"dist_uvw",
",",
"l",
",",
"m",
")",
":",
"s",
"=",
"numpy",
".",
"array",
"(",
"[",
"l",
",",
"m",
",",
"numpy",
".",
"sqrt",
"(",
"1",
"-",
"l",
"**",
"2",
"-",
"m",
"**",
"2",
")",
"-",
"1.0",
"]",
")",
"r... | Simulate visibilities for unit amplitude point source at
direction cosines (l,m) relative to the phase centre. | [
"Simulate",
"visibilities",
"for",
"unit",
"amplitude",
"point",
"source",
"at",
"direction",
"cosines",
"(",
"l",
"m",
")",
"relative",
"to",
"the",
"phase",
"centre",
"."
] | [
"\"\"\"\n Simulate visibilities for unit amplitude point source at\n direction cosines (l,m) relative to the phase centre.\n\n This includes phase tracking to the centre of the field (hence the minus 1\n in the exponent.)\n\n Note that point source is delta function, therefore the\n FT relationshi... | [
{
"param": "dist_uvw",
"type": null
},
{
"param": "l",
"type": null
},
{
"param": "m",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "dist_uvw",
"type": null,
"docstring": ":math:`(u,v,w)` distribution of projected baselines (in wavelengths)",
"docstring_tokens": [
":",
"math",
":",
"`",
"(",
"u",
"v",
... |
629659a5cf40af70b49b385be7cadf80030e9617 | ska-telescope/algorithm-reference-library | processing_library/util/coordinate_support.py | [
"Apache-2.0"
] | Python | visibility_shift | <not_specific> | def visibility_shift(uvw, vis, dl, dm):
"""
Shift visibilities by the given image-space distance. This is
based on simple FFT laws. It will require kernels to be suitably
shifted as well to work correctly.
:param uvw:
:param vis: :math:`(u,v,w)` distribution of projected baselines (in wavelengt... |
Shift visibilities by the given image-space distance. This is
based on simple FFT laws. It will require kernels to be suitably
shifted as well to work correctly.
:param uvw:
:param vis: :math:`(u,v,w)` distribution of projected baselines (in wavelengths)
:param vis: Input visibilities
:par... | Shift visibilities by the given image-space distance. This is
based on simple FFT laws. It will require kernels to be suitably
shifted as well to work correctly. | [
"Shift",
"visibilities",
"by",
"the",
"given",
"image",
"-",
"space",
"distance",
".",
"This",
"is",
"based",
"on",
"simple",
"FFT",
"laws",
".",
"It",
"will",
"require",
"kernels",
"to",
"be",
"suitably",
"shifted",
"as",
"well",
"to",
"work",
"correctly"... | def visibility_shift(uvw, vis, dl, dm):
s = numpy.array([dl, dm])
return vis * numpy.exp(-2j * numpy.pi * numpy.dot(uvw[:, 0:2], s)) | [
"def",
"visibility_shift",
"(",
"uvw",
",",
"vis",
",",
"dl",
",",
"dm",
")",
":",
"s",
"=",
"numpy",
".",
"array",
"(",
"[",
"dl",
",",
"dm",
"]",
")",
"return",
"vis",
"*",
"numpy",
".",
"exp",
"(",
"-",
"2j",
"*",
"numpy",
".",
"pi",
"*",
... | Shift visibilities by the given image-space distance. | [
"Shift",
"visibilities",
"by",
"the",
"given",
"image",
"-",
"space",
"distance",
"."
] | [
"\"\"\"\n Shift visibilities by the given image-space distance. This is\n based on simple FFT laws. It will require kernels to be suitably\n shifted as well to work correctly.\n\n :param uvw:\n :param vis: :math:`(u,v,w)` distribution of projected baselines (in wavelengths)\n :param vis: Input vis... | [
{
"param": "uvw",
"type": null
},
{
"param": "vis",
"type": null
},
{
"param": "dl",
"type": null
},
{
"param": "dm",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "uvw",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
"... |
629659a5cf40af70b49b385be7cadf80030e9617 | ska-telescope/algorithm-reference-library | processing_library/util/coordinate_support.py | [
"Apache-2.0"
] | Python | uvw_transform | <not_specific> | def uvw_transform(uvw, transform_matrix):
"""
Transforms UVW baseline coordinates such that the image is
transformed with the given matrix. Will require kernels to be
suitably transformed to work correctly.
Reference: Sault, R. J., L. Staveley-Smith, and W. N. Brouw. "An
approach to interferome... |
Transforms UVW baseline coordinates such that the image is
transformed with the given matrix. Will require kernels to be
suitably transformed to work correctly.
Reference: Sault, R. J., L. Staveley-Smith, and W. N. Brouw. "An
approach to interferometric mosaicing." Astronomy and Astrophysics
S... | Transforms UVW baseline coordinates such that the image is
transformed with the given matrix. Will require kernels to be
suitably transformed to work correctly.
Sault, R. J., L. Staveley-Smith, and W. N. Brouw. "An
approach to interferometric mosaicing." Astronomy and Astrophysics
Supplement Series 120 (1996): 375-384... | [
"Transforms",
"UVW",
"baseline",
"coordinates",
"such",
"that",
"the",
"image",
"is",
"transformed",
"with",
"the",
"given",
"matrix",
".",
"Will",
"require",
"kernels",
"to",
"be",
"suitably",
"transformed",
"to",
"work",
"correctly",
".",
"Sault",
"R",
".",
... | def uvw_transform(uvw, transform_matrix):
uv1 = numpy.dot(uvw[:, 0:2], transform_matrix)
return numpy.hstack([uv1, uvw[:, 2:3]]) | [
"def",
"uvw_transform",
"(",
"uvw",
",",
"transform_matrix",
")",
":",
"uv1",
"=",
"numpy",
".",
"dot",
"(",
"uvw",
"[",
":",
",",
"0",
":",
"2",
"]",
",",
"transform_matrix",
")",
"return",
"numpy",
".",
"hstack",
"(",
"[",
"uv1",
",",
"uvw",
"[",... | Transforms UVW baseline coordinates such that the image is
transformed with the given matrix. | [
"Transforms",
"UVW",
"baseline",
"coordinates",
"such",
"that",
"the",
"image",
"is",
"transformed",
"with",
"the",
"given",
"matrix",
"."
] | [
"\"\"\"\n Transforms UVW baseline coordinates such that the image is\n transformed with the given matrix. Will require kernels to be\n suitably transformed to work correctly.\n\n Reference: Sault, R. J., L. Staveley-Smith, and W. N. Brouw. \"An\n approach to interferometric mosaicing.\" Astronomy and... | [
{
"param": "uvw",
"type": null
},
{
"param": "transform_matrix",
"type": null
}
] | {
"returns": [
{
"docstring": "New baseline coordinates",
"docstring_tokens": [
"New",
"baseline",
"coordinates"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "uvw",
"type": null,
"docstring": ":math:`(u,v,w)` distrib... |
629659a5cf40af70b49b385be7cadf80030e9617 | ska-telescope/algorithm-reference-library | processing_library/util/coordinate_support.py | [
"Apache-2.0"
] | Python | hadec_to_azel | <not_specific> | def hadec_to_azel(ha, dec, latitude):
""" Convert HA Dec to Az El
TMS Appendix 4.1
sinel = sinlat sindec + coslat cosdec cosha
cosel cosaz = coslat sindec - sinlat cosdec cosha
cosel sinaz = - cosdec sinha
:param ha:
:param dec:
:param latitude:
:return: az, el
"""... | Convert HA Dec to Az El
TMS Appendix 4.1
sinel = sinlat sindec + coslat cosdec cosha
cosel cosaz = coslat sindec - sinlat cosdec cosha
cosel sinaz = - cosdec sinha
:param ha:
:param dec:
:param latitude:
:return: az, el
| Convert HA Dec to Az El
TMS Appendix 4.1
sinel = sinlat sindec + coslat cosdec cosha
cosel cosaz = coslat sindec - sinlat cosdec cosha
cosel sinaz = - cosdec sinha | [
"Convert",
"HA",
"Dec",
"to",
"Az",
"El",
"TMS",
"Appendix",
"4",
".",
"1",
"sinel",
"=",
"sinlat",
"sindec",
"+",
"coslat",
"cosdec",
"cosha",
"cosel",
"cosaz",
"=",
"coslat",
"sindec",
"-",
"sinlat",
"cosdec",
"cosha",
"cosel",
"sinaz",
"=",
"-",
"co... | def hadec_to_azel(ha, dec, latitude):
coslat = numpy.cos(latitude)
sinlat = numpy.sin(latitude)
cosdec = numpy.cos(dec)
sindec = numpy.sin(dec)
cosha = numpy.cos(ha)
sinha = numpy.sin(ha)
az = numpy.arctan2(- cosdec * sinha, (coslat * sindec - sinlat * cosdec * cosha))
el = numpy.arcsin(... | [
"def",
"hadec_to_azel",
"(",
"ha",
",",
"dec",
",",
"latitude",
")",
":",
"coslat",
"=",
"numpy",
".",
"cos",
"(",
"latitude",
")",
"sinlat",
"=",
"numpy",
".",
"sin",
"(",
"latitude",
")",
"cosdec",
"=",
"numpy",
".",
"cos",
"(",
"dec",
")",
"sind... | Convert HA Dec to Az El
TMS Appendix 4.1 | [
"Convert",
"HA",
"Dec",
"to",
"Az",
"El",
"TMS",
"Appendix",
"4",
".",
"1"
] | [
"\"\"\" Convert HA Dec to Az El\n \n TMS Appendix 4.1\n \n sinel = sinlat sindec + coslat cosdec cosha\n cosel cosaz = coslat sindec - sinlat cosdec cosha\n cosel sinaz = - cosdec sinha\n \n :param ha:\n :param dec:\n :param latitude:\n :return: az, el\n \"\"\""
] | [
{
"param": "ha",
"type": null
},
{
"param": "dec",
"type": null
},
{
"param": "latitude",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "ha",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
"i... |
629659a5cf40af70b49b385be7cadf80030e9617 | ska-telescope/algorithm-reference-library | processing_library/util/coordinate_support.py | [
"Apache-2.0"
] | Python | azel_to_hadec | <not_specific> | def azel_to_hadec(az, el, latitude):
"""Converting Az El to HA Dec
TMS Appendix 4.1
sindec = sinlat sinel + coslat cosel cosaz
cosdec cosha = coslat sinel - sinlat cosel cosaz
cosdec sinha = -cosel sinaz
:param az:
:param el:
:param latitude:
:return: ha, dec
"""
... | Converting Az El to HA Dec
TMS Appendix 4.1
sindec = sinlat sinel + coslat cosel cosaz
cosdec cosha = coslat sinel - sinlat cosel cosaz
cosdec sinha = -cosel sinaz
:param az:
:param el:
:param latitude:
:return: ha, dec
| Converting Az El to HA Dec
TMS Appendix 4.1
sindec = sinlat sinel + coslat cosel cosaz
cosdec cosha = coslat sinel - sinlat cosel cosaz
cosdec sinha = -cosel sinaz | [
"Converting",
"Az",
"El",
"to",
"HA",
"Dec",
"TMS",
"Appendix",
"4",
".",
"1",
"sindec",
"=",
"sinlat",
"sinel",
"+",
"coslat",
"cosel",
"cosaz",
"cosdec",
"cosha",
"=",
"coslat",
"sinel",
"-",
"sinlat",
"cosel",
"cosaz",
"cosdec",
"sinha",
"=",
"-",
"... | def azel_to_hadec(az, el, latitude):
cosel = numpy.cos(el)
sinel = numpy.sin(el)
coslat = numpy.cos(latitude)
sinlat = numpy.sin(latitude)
cosaz = numpy.cos(az)
sinaz = numpy.sin(az)
ha = numpy.arctan2(-cosel * sinaz, coslat * sinel - sinlat * cosel * cosaz)
dec = numpy.arcsin(sinlat * s... | [
"def",
"azel_to_hadec",
"(",
"az",
",",
"el",
",",
"latitude",
")",
":",
"cosel",
"=",
"numpy",
".",
"cos",
"(",
"el",
")",
"sinel",
"=",
"numpy",
".",
"sin",
"(",
"el",
")",
"coslat",
"=",
"numpy",
".",
"cos",
"(",
"latitude",
")",
"sinlat",
"="... | Converting Az El to HA Dec
TMS Appendix 4.1 | [
"Converting",
"Az",
"El",
"to",
"HA",
"Dec",
"TMS",
"Appendix",
"4",
".",
"1"
] | [
"\"\"\"Converting Az El to HA Dec\n \n TMS Appendix 4.1\n \n sindec = sinlat sinel + coslat cosel cosaz\n cosdec cosha = coslat sinel - sinlat cosel cosaz\n cosdec sinha = -cosel sinaz\n \n :param az:\n :param el:\n :param latitude:\n :return: ha, dec\n \"\"\""
] | [
{
"param": "az",
"type": null
},
{
"param": "el",
"type": null
},
{
"param": "latitude",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "az",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
"i... |
202f07cbf038f93af9f67f0749188a0225533743 | ska-telescope/algorithm-reference-library | workflows/serial/imaging/imaging_serial.py | [
"Apache-2.0"
] | Python | predict_list_serial_workflow | <not_specific> | def predict_list_serial_workflow(vis_list, model_imagelist, context, vis_slices=1, facets=1,
gcfcf=None, **kwargs):
"""Predict, iterating over both the scattered vis_list and image
The visibility and image are scattered, the visibility is predicted on each part, and then the
... | Predict, iterating over both the scattered vis_list and image
The visibility and image are scattered, the visibility is predicted on each part, and then the
parts are assembled.
:param vis_list:
:param model_imagelist: Model used to determine image parameters
:param vis_slices: Number of vis slice... | Predict, iterating over both the scattered vis_list and image
The visibility and image are scattered, the visibility is predicted on each part, and then the
parts are assembled. | [
"Predict",
"iterating",
"over",
"both",
"the",
"scattered",
"vis_list",
"and",
"image",
"The",
"visibility",
"and",
"image",
"are",
"scattered",
"the",
"visibility",
"is",
"predicted",
"on",
"each",
"part",
"and",
"then",
"the",
"parts",
"are",
"assembled",
".... | def predict_list_serial_workflow(vis_list, model_imagelist, context, vis_slices=1, facets=1,
gcfcf=None, **kwargs):
assert len(vis_list) == len(model_imagelist), "Model must be the same length as the vis_list"
vis_list = zero_list_serial_workflow(vis_list)
c = imaging_contex... | [
"def",
"predict_list_serial_workflow",
"(",
"vis_list",
",",
"model_imagelist",
",",
"context",
",",
"vis_slices",
"=",
"1",
",",
"facets",
"=",
"1",
",",
"gcfcf",
"=",
"None",
",",
"**",
"kwargs",
")",
":",
"assert",
"len",
"(",
"vis_list",
")",
"==",
"... | Predict, iterating over both the scattered vis_list and image
The visibility and image are scattered, the visibility is predicted on each part, and then the
parts are assembled. | [
"Predict",
"iterating",
"over",
"both",
"the",
"scattered",
"vis_list",
"and",
"image",
"The",
"visibility",
"and",
"image",
"are",
"scattered",
"the",
"visibility",
"is",
"predicted",
"on",
"each",
"part",
"and",
"then",
"the",
"parts",
"are",
"assembled",
".... | [
"\"\"\"Predict, iterating over both the scattered vis_list and image\n\n The visibility and image are scattered, the visibility is predicted on each part, and then the\n parts are assembled.\n\n :param vis_list:\n :param model_imagelist: Model used to determine image parameters\n :param vis_slices: N... | [
{
"param": "vis_list",
"type": null
},
{
"param": "model_imagelist",
"type": null
},
{
"param": "context",
"type": null
},
{
"param": "vis_slices",
"type": null
},
{
"param": "facets",
"type": null
},
{
"param": "gcfcf",
"type": null
}
] | {
"returns": [
{
"docstring": "List of vis_lists",
"docstring_tokens": [
"List",
"of",
"vis_lists"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis_list",
"type": null,
"docstring": null,
"docstring_tokens": [... |
202f07cbf038f93af9f67f0749188a0225533743 | ska-telescope/algorithm-reference-library | workflows/serial/imaging/imaging_serial.py | [
"Apache-2.0"
] | Python | invert_list_serial_workflow | <not_specific> | def invert_list_serial_workflow(vis_list, template_model_imagelist, dopsf=False, normalize=True,
facets=1, vis_slices=1, context='2d', gcfcf=None, **kwargs):
""" Sum results from invert, iterating over the scattered image and vis_list
:param vis_list:
:param template_model_i... | Sum results from invert, iterating over the scattered image and vis_list
:param vis_list:
:param template_model_imagelist: Model used to determine image parameters
:param dopsf: Make the PSF instead of the dirty image
:param facets: Number of facets
:param normalize: Normalize by sumwt
:param ... | Sum results from invert, iterating over the scattered image and vis_list | [
"Sum",
"results",
"from",
"invert",
"iterating",
"over",
"the",
"scattered",
"image",
"and",
"vis_list"
] | def invert_list_serial_workflow(vis_list, template_model_imagelist, dopsf=False, normalize=True,
facets=1, vis_slices=1, context='2d', gcfcf=None, **kwargs):
if not isinstance(template_model_imagelist, collections.Iterable):
template_model_imagelist = [template_model_imagelis... | [
"def",
"invert_list_serial_workflow",
"(",
"vis_list",
",",
"template_model_imagelist",
",",
"dopsf",
"=",
"False",
",",
"normalize",
"=",
"True",
",",
"facets",
"=",
"1",
",",
"vis_slices",
"=",
"1",
",",
"context",
"=",
"'2d'",
",",
"gcfcf",
"=",
"None",
... | Sum results from invert, iterating over the scattered image and vis_list | [
"Sum",
"results",
"from",
"invert",
"iterating",
"over",
"the",
"scattered",
"image",
"and",
"vis_list"
] | [
"\"\"\" Sum results from invert, iterating over the scattered image and vis_list\n\n :param vis_list:\n :param template_model_imagelist: Model used to determine image parameters\n :param dopsf: Make the PSF instead of the dirty image\n :param facets: Number of facets\n :param normalize: Normalize by ... | [
{
"param": "vis_list",
"type": null
},
{
"param": "template_model_imagelist",
"type": null
},
{
"param": "dopsf",
"type": null
},
{
"param": "normalize",
"type": null
},
{
"param": "facets",
"type": null
},
{
"param": "vis_slices",
"type": null
}... | {
"returns": [
{
"docstring": "List of (image, sumwt) tuple",
"docstring_tokens": [
"List",
"of",
"(",
"image",
"sumwt",
")",
"tuple"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis_list",
... |
202f07cbf038f93af9f67f0749188a0225533743 | ska-telescope/algorithm-reference-library | workflows/serial/imaging/imaging_serial.py | [
"Apache-2.0"
] | Python | residual_list_serial_workflow | <not_specific> | def residual_list_serial_workflow(vis, model_imagelist, context='2d', gcfcf=None, **kwargs):
""" Create a graph to calculate residual image
:param vis:
:param model_imagelist: Model used to determine image parameters
:param context:
:param gcfcg: tuple containing grid correction and convolution fun... | Create a graph to calculate residual image
:param vis:
:param model_imagelist: Model used to determine image parameters
:param context:
:param gcfcg: tuple containing grid correction and convolution function
:param kwargs: Parameters for functions in components
:return:
| Create a graph to calculate residual image | [
"Create",
"a",
"graph",
"to",
"calculate",
"residual",
"image"
] | def residual_list_serial_workflow(vis, model_imagelist, context='2d', gcfcf=None, **kwargs):
model_vis = zero_list_serial_workflow(vis)
model_vis = predict_list_serial_workflow(model_vis, model_imagelist, context=context,
gcfcf=gcfcf, **kwargs)
residual_vis = sub... | [
"def",
"residual_list_serial_workflow",
"(",
"vis",
",",
"model_imagelist",
",",
"context",
"=",
"'2d'",
",",
"gcfcf",
"=",
"None",
",",
"**",
"kwargs",
")",
":",
"model_vis",
"=",
"zero_list_serial_workflow",
"(",
"vis",
")",
"model_vis",
"=",
"predict_list_ser... | Create a graph to calculate residual image | [
"Create",
"a",
"graph",
"to",
"calculate",
"residual",
"image"
] | [
"\"\"\" Create a graph to calculate residual image\n\n :param vis:\n :param model_imagelist: Model used to determine image parameters\n :param context:\n :param gcfcg: tuple containing grid correction and convolution function\n :param kwargs: Parameters for functions in components\n :return:\n ... | [
{
"param": "vis",
"type": null
},
{
"param": "model_imagelist",
"type": null
},
{
"param": "context",
"type": null
},
{
"param": "gcfcf",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
"... |
202f07cbf038f93af9f67f0749188a0225533743 | ska-telescope/algorithm-reference-library | workflows/serial/imaging/imaging_serial.py | [
"Apache-2.0"
] | Python | restore_list_serial_workflow | <not_specific> | def restore_list_serial_workflow(model_imagelist, psf_imagelist, residual_imagelist=None, **kwargs):
""" Create a graph to calculate the restored image
:param model_imagelist: Model list
:param psf_imagelist: PSF list
:param residual_imagelist: Residual list
:param kwargs: Parameters for functions ... | Create a graph to calculate the restored image
:param model_imagelist: Model list
:param psf_imagelist: PSF list
:param residual_imagelist: Residual list
:param kwargs: Parameters for functions in components
:return:
| Create a graph to calculate the restored image | [
"Create",
"a",
"graph",
"to",
"calculate",
"the",
"restored",
"image"
] | def restore_list_serial_workflow(model_imagelist, psf_imagelist, residual_imagelist=None, **kwargs):
if residual_imagelist is None:
residual_imagelist = []
if len(residual_imagelist) > 0:
return [restore_cube(model_imagelist[i], psf_imagelist[i][0],
residual_imagelis... | [
"def",
"restore_list_serial_workflow",
"(",
"model_imagelist",
",",
"psf_imagelist",
",",
"residual_imagelist",
"=",
"None",
",",
"**",
"kwargs",
")",
":",
"if",
"residual_imagelist",
"is",
"None",
":",
"residual_imagelist",
"=",
"[",
"]",
"if",
"len",
"(",
"res... | Create a graph to calculate the restored image | [
"Create",
"a",
"graph",
"to",
"calculate",
"the",
"restored",
"image"
] | [
"\"\"\" Create a graph to calculate the restored image\n\n :param model_imagelist: Model list\n :param psf_imagelist: PSF list\n :param residual_imagelist: Residual list\n :param kwargs: Parameters for functions in components\n :return:\n \"\"\""
] | [
{
"param": "model_imagelist",
"type": null
},
{
"param": "psf_imagelist",
"type": null
},
{
"param": "residual_imagelist",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "model_imagelist",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": n... |
202f07cbf038f93af9f67f0749188a0225533743 | ska-telescope/algorithm-reference-library | workflows/serial/imaging/imaging_serial.py | [
"Apache-2.0"
] | Python | restore_list_serial_workflow_nosumwt | <not_specific> | def restore_list_serial_workflow_nosumwt(model_imagelist, psf_imagelist, residual_imagelist=None, **kwargs):
""" Create a graph to calculate the restored image
:param model_imagelist: Model list
:param psf_imagelist: PSF list (without the sumwt term)
:param residual_imagelist: Residual list (without th... | Create a graph to calculate the restored image
:param model_imagelist: Model list
:param psf_imagelist: PSF list (without the sumwt term)
:param residual_imagelist: Residual list (without the sumwt term)
:param kwargs: Parameters for functions in components
:return:
| Create a graph to calculate the restored image | [
"Create",
"a",
"graph",
"to",
"calculate",
"the",
"restored",
"image"
] | def restore_list_serial_workflow_nosumwt(model_imagelist, psf_imagelist, residual_imagelist=None, **kwargs):
if residual_imagelist is None:
residual_imagelist = []
if len(residual_imagelist) > 0:
return [restore_cube(model_imagelist[i], psf_imagelist[i],
residual_ima... | [
"def",
"restore_list_serial_workflow_nosumwt",
"(",
"model_imagelist",
",",
"psf_imagelist",
",",
"residual_imagelist",
"=",
"None",
",",
"**",
"kwargs",
")",
":",
"if",
"residual_imagelist",
"is",
"None",
":",
"residual_imagelist",
"=",
"[",
"]",
"if",
"len",
"("... | Create a graph to calculate the restored image | [
"Create",
"a",
"graph",
"to",
"calculate",
"the",
"restored",
"image"
] | [
"\"\"\" Create a graph to calculate the restored image\n\n :param model_imagelist: Model list\n :param psf_imagelist: PSF list (without the sumwt term)\n :param residual_imagelist: Residual list (without the sumwt term)\n :param kwargs: Parameters for functions in components\n :return:\n \"\"\""
] | [
{
"param": "model_imagelist",
"type": null
},
{
"param": "psf_imagelist",
"type": null
},
{
"param": "residual_imagelist",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "model_imagelist",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": n... |
202f07cbf038f93af9f67f0749188a0225533743 | ska-telescope/algorithm-reference-library | workflows/serial/imaging/imaging_serial.py | [
"Apache-2.0"
] | Python | deconvolve_list_serial_workflow | <not_specific> | def deconvolve_list_serial_workflow(dirty_list, psf_list, model_imagelist, prefix='', mask=None, **kwargs):
"""Create a graph for deconvolution, adding to the model
:param dirty_list:
:param psf_list:
:param model_imagelist:
:param prefix: Informative prefix to log messages
:param mask: Mask fo... | Create a graph for deconvolution, adding to the model
:param dirty_list:
:param psf_list:
:param model_imagelist:
:param prefix: Informative prefix to log messages
:param mask: Mask for deconvolution
:param kwargs: Parameters for functions in components
:return: (graph for the deconvolution... | Create a graph for deconvolution, adding to the model | [
"Create",
"a",
"graph",
"for",
"deconvolution",
"adding",
"to",
"the",
"model"
] | def deconvolve_list_serial_workflow(dirty_list, psf_list, model_imagelist, prefix='', mask=None, **kwargs):
nchan = len(dirty_list)
nmoment = get_parameter(kwargs, "nmoment", 0)
assert isinstance(dirty_list, list), dirty_list
assert isinstance(psf_list, list), psf_list
assert isinstance(model_imagel... | [
"def",
"deconvolve_list_serial_workflow",
"(",
"dirty_list",
",",
"psf_list",
",",
"model_imagelist",
",",
"prefix",
"=",
"''",
",",
"mask",
"=",
"None",
",",
"**",
"kwargs",
")",
":",
"nchan",
"=",
"len",
"(",
"dirty_list",
")",
"nmoment",
"=",
"get_paramet... | Create a graph for deconvolution, adding to the model | [
"Create",
"a",
"graph",
"for",
"deconvolution",
"adding",
"to",
"the",
"model"
] | [
"\"\"\"Create a graph for deconvolution, adding to the model\n\n :param dirty_list:\n :param psf_list:\n :param model_imagelist:\n :param prefix: Informative prefix to log messages\n :param mask: Mask for deconvolution\n :param kwargs: Parameters for functions in components\n :return: (graph fo... | [
{
"param": "dirty_list",
"type": null
},
{
"param": "psf_list",
"type": null
},
{
"param": "model_imagelist",
"type": null
},
{
"param": "prefix",
"type": null
},
{
"param": "mask",
"type": null
}
] | {
"returns": [
{
"docstring": "(graph for the deconvolution, graph for the flat)",
"docstring_tokens": [
"(",
"graph",
"for",
"the",
"deconvolution",
"graph",
"for",
"the",
"flat",
")"
],
"type": null
}
]... |
202f07cbf038f93af9f67f0749188a0225533743 | ska-telescope/algorithm-reference-library | workflows/serial/imaging/imaging_serial.py | [
"Apache-2.0"
] | Python | deconvolve_channel_list_serial_workflow | <not_specific> | def deconvolve_channel_list_serial_workflow(dirty_list, psf_list, model_imagelist, subimages, **kwargs):
"""Create a graph for deconvolution by channels, adding to the model
Does deconvolution channel by channel.
:param subimages:
:param dirty_list:
:param psf_list: Must be the size of a facet
... | Create a graph for deconvolution by channels, adding to the model
Does deconvolution channel by channel.
:param subimages:
:param dirty_list:
:param psf_list: Must be the size of a facet
:param model_imagelist: Current model
:param kwargs: Parameters for functions in components
:return:
... | Create a graph for deconvolution by channels, adding to the model
Does deconvolution channel by channel. | [
"Create",
"a",
"graph",
"for",
"deconvolution",
"by",
"channels",
"adding",
"to",
"the",
"model",
"Does",
"deconvolution",
"channel",
"by",
"channel",
"."
] | def deconvolve_channel_list_serial_workflow(dirty_list, psf_list, model_imagelist, subimages, **kwargs):
def deconvolve_subimage(dirty, psf):
assert isinstance(dirty, Image)
assert isinstance(psf, Image)
comp = deconvolve_cube(dirty, psf, **kwargs)
return comp[0]
def add_model(su... | [
"def",
"deconvolve_channel_list_serial_workflow",
"(",
"dirty_list",
",",
"psf_list",
",",
"model_imagelist",
",",
"subimages",
",",
"**",
"kwargs",
")",
":",
"def",
"deconvolve_subimage",
"(",
"dirty",
",",
"psf",
")",
":",
"assert",
"isinstance",
"(",
"dirty",
... | Create a graph for deconvolution by channels, adding to the model
Does deconvolution channel by channel. | [
"Create",
"a",
"graph",
"for",
"deconvolution",
"by",
"channels",
"adding",
"to",
"the",
"model",
"Does",
"deconvolution",
"channel",
"by",
"channel",
"."
] | [
"\"\"\"Create a graph for deconvolution by channels, adding to the model\n\n Does deconvolution channel by channel.\n :param subimages:\n :param dirty_list:\n :param psf_list: Must be the size of a facet\n :param model_imagelist: Current model\n :param kwargs: Parameters for functions in component... | [
{
"param": "dirty_list",
"type": null
},
{
"param": "psf_list",
"type": null
},
{
"param": "model_imagelist",
"type": null
},
{
"param": "subimages",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "dirty_list",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
... |
202f07cbf038f93af9f67f0749188a0225533743 | ska-telescope/algorithm-reference-library | workflows/serial/imaging/imaging_serial.py | [
"Apache-2.0"
] | Python | weight_list_serial_workflow | <not_specific> | def weight_list_serial_workflow(vis_list, model_imagelist, gcfcf=None, weighting='uniform', **kwargs):
""" Weight the visibility data
This is done collectively so the weights are summed over all vis_lists and then
corrected
:param vis_list:
:param model_imagelist: Model required to determine weigh... | Weight the visibility data
This is done collectively so the weights are summed over all vis_lists and then
corrected
:param vis_list:
:param model_imagelist: Model required to determine weighting parameters
:param weighting: Type of weighting
:param kwargs: Parameters for functions in graphs
... | Weight the visibility data
This is done collectively so the weights are summed over all vis_lists and then
corrected | [
"Weight",
"the",
"visibility",
"data",
"This",
"is",
"done",
"collectively",
"so",
"the",
"weights",
"are",
"summed",
"over",
"all",
"vis_lists",
"and",
"then",
"corrected"
] | def weight_list_serial_workflow(vis_list, model_imagelist, gcfcf=None, weighting='uniform', **kwargs):
centre = len(model_imagelist) // 2
if gcfcf is None:
gcfcf = [create_pswf_convolutionfunction(model_imagelist[centre])]
def grid_wt(vis, model, g):
if vis is not None:
if model ... | [
"def",
"weight_list_serial_workflow",
"(",
"vis_list",
",",
"model_imagelist",
",",
"gcfcf",
"=",
"None",
",",
"weighting",
"=",
"'uniform'",
",",
"**",
"kwargs",
")",
":",
"centre",
"=",
"len",
"(",
"model_imagelist",
")",
"//",
"2",
"if",
"gcfcf",
"is",
... | Weight the visibility data
This is done collectively so the weights are summed over all vis_lists and then
corrected | [
"Weight",
"the",
"visibility",
"data",
"This",
"is",
"done",
"collectively",
"so",
"the",
"weights",
"are",
"summed",
"over",
"all",
"vis_lists",
"and",
"then",
"corrected"
] | [
"\"\"\" Weight the visibility data\n\n This is done collectively so the weights are summed over all vis_lists and then\n corrected\n\n :param vis_list:\n :param model_imagelist: Model required to determine weighting parameters\n :param weighting: Type of weighting\n :param kwargs: Parameters for f... | [
{
"param": "vis_list",
"type": null
},
{
"param": "model_imagelist",
"type": null
},
{
"param": "gcfcf",
"type": null
},
{
"param": "weighting",
"type": null
}
] | {
"returns": [
{
"docstring": "List of vis_graphs",
"docstring_tokens": [
"List",
"of",
"vis_graphs"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis_list",
"type": null,
"docstring": null,
"docstring_tokens":... |
202f07cbf038f93af9f67f0749188a0225533743 | ska-telescope/algorithm-reference-library | workflows/serial/imaging/imaging_serial.py | [
"Apache-2.0"
] | Python | zero_list_serial_workflow | <not_specific> | def zero_list_serial_workflow(vis_list):
""" Initialise vis to zero: creates new data holders
:param vis_list:
:return: List of vis_lists
"""
def zero(vis):
if vis is not None:
zerovis = copy_visibility(vis)
zerovis.data['vis'][...] = 0.0
return zerov... | Initialise vis to zero: creates new data holders
:param vis_list:
:return: List of vis_lists
| Initialise vis to zero: creates new data holders | [
"Initialise",
"vis",
"to",
"zero",
":",
"creates",
"new",
"data",
"holders"
] | def zero_list_serial_workflow(vis_list):
def zero(vis):
if vis is not None:
zerovis = copy_visibility(vis)
zerovis.data['vis'][...] = 0.0
return zerovis
else:
return None
return [zero(v) for v in vis_list] | [
"def",
"zero_list_serial_workflow",
"(",
"vis_list",
")",
":",
"def",
"zero",
"(",
"vis",
")",
":",
"if",
"vis",
"is",
"not",
"None",
":",
"zerovis",
"=",
"copy_visibility",
"(",
"vis",
")",
"zerovis",
".",
"data",
"[",
"'vis'",
"]",
"[",
"...",
"]",
... | Initialise vis to zero: creates new data holders | [
"Initialise",
"vis",
"to",
"zero",
":",
"creates",
"new",
"data",
"holders"
] | [
"\"\"\" Initialise vis to zero: creates new data holders\n\n :param vis_list:\n :return: List of vis_lists\n \"\"\""
] | [
{
"param": "vis_list",
"type": null
}
] | {
"returns": [
{
"docstring": "List of vis_lists",
"docstring_tokens": [
"List",
"of",
"vis_lists"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis_list",
"type": null,
"docstring": null,
"docstring_tokens": [... |
daef18bdb7c86d1dc207e1f1c13e68ffd2993cc0 | ska-telescope/algorithm-reference-library | processing_components/imaging/base.py | [
"Apache-2.0"
] | Python | shift_vis_to_image | Union[Visibility, BlockVisibility] | def shift_vis_to_image(vis: Union[Visibility, BlockVisibility], im: Image, tangent: bool = True, inverse: bool = False) \
-> Union[Visibility, BlockVisibility]:
"""Shift visibility to the FFT phase centre of the image in place
:param vis: Visibility data
:param im: Image model used to determine pha... | Shift visibility to the FFT phase centre of the image in place
:param vis: Visibility data
:param im: Image model used to determine phase centre
:param tangent: Is the shift purely on the tangent plane True|False
:param inverse: Do the inverse operation True|False
:return: visibility with phase shi... | Shift visibility to the FFT phase centre of the image in place | [
"Shift",
"visibility",
"to",
"the",
"FFT",
"phase",
"centre",
"of",
"the",
"image",
"in",
"place"
] | def shift_vis_to_image(vis: Union[Visibility, BlockVisibility], im: Image, tangent: bool = True, inverse: bool = False) \
-> Union[Visibility, BlockVisibility]:
assert isinstance(vis, Visibility) or isinstance(vis, BlockVisibility), "vis is not a Visibility or " \
... | [
"def",
"shift_vis_to_image",
"(",
"vis",
":",
"Union",
"[",
"Visibility",
",",
"BlockVisibility",
"]",
",",
"im",
":",
"Image",
",",
"tangent",
":",
"bool",
"=",
"True",
",",
"inverse",
":",
"bool",
"=",
"False",
")",
"->",
"Union",
"[",
"Visibility",
... | Shift visibility to the FFT phase centre of the image in place | [
"Shift",
"visibility",
"to",
"the",
"FFT",
"phase",
"centre",
"of",
"the",
"image",
"in",
"place"
] | [
"\"\"\"Shift visibility to the FFT phase centre of the image in place\n\n :param vis: Visibility data\n :param im: Image model used to determine phase centre\n :param tangent: Is the shift purely on the tangent plane True|False\n :param inverse: Do the inverse operation True|False\n :return: visibili... | [
{
"param": "vis",
"type": "Union[Visibility, BlockVisibility]"
},
{
"param": "im",
"type": "Image"
},
{
"param": "tangent",
"type": "bool"
},
{
"param": "inverse",
"type": "bool"
}
] | {
"returns": [
{
"docstring": "visibility with phase shift applied and phasecentre updated",
"docstring_tokens": [
"visibility",
"with",
"phase",
"shift",
"applied",
"and",
"phasecentre",
"updated"
],
"type": null
}
],
... |
daef18bdb7c86d1dc207e1f1c13e68ffd2993cc0 | ska-telescope/algorithm-reference-library | processing_components/imaging/base.py | [
"Apache-2.0"
] | Python | normalize_sumwt | Image | def normalize_sumwt(im: Image, sumwt) -> Image:
"""Normalize out the sum of weights
:param im: Image, im.data has shape [nchan, npol, ny, nx]
:param sumwt: Sum of weights [nchan, npol]
"""
nchan, npol, _, _ = im.data.shape
assert isinstance(im, Image), im
assert sumwt is not None
assert... | Normalize out the sum of weights
:param im: Image, im.data has shape [nchan, npol, ny, nx]
:param sumwt: Sum of weights [nchan, npol]
| Normalize out the sum of weights | [
"Normalize",
"out",
"the",
"sum",
"of",
"weights"
] | def normalize_sumwt(im: Image, sumwt) -> Image:
nchan, npol, _, _ = im.data.shape
assert isinstance(im, Image), im
assert sumwt is not None
assert nchan == sumwt.shape[0]
assert npol == sumwt.shape[1]
for chan in range(nchan):
for pol in range(npol):
if sumwt[chan, pol] > 0.0... | [
"def",
"normalize_sumwt",
"(",
"im",
":",
"Image",
",",
"sumwt",
")",
"->",
"Image",
":",
"nchan",
",",
"npol",
",",
"_",
",",
"_",
"=",
"im",
".",
"data",
".",
"shape",
"assert",
"isinstance",
"(",
"im",
",",
"Image",
")",
",",
"im",
"assert",
"... | Normalize out the sum of weights | [
"Normalize",
"out",
"the",
"sum",
"of",
"weights"
] | [
"\"\"\"Normalize out the sum of weights\n\n :param im: Image, im.data has shape [nchan, npol, ny, nx]\n :param sumwt: Sum of weights [nchan, npol]\n \"\"\""
] | [
{
"param": "im",
"type": "Image"
},
{
"param": "sumwt",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "im",
"type": "Image",
"docstring": "Image, im.data has shape [nchan, npol, ny, nx]",
"docstring_tokens": [
"Image",
"im",
".",
"data",
"has",
"shape",
"[",
"nchan... |
daef18bdb7c86d1dc207e1f1c13e68ffd2993cc0 | ska-telescope/algorithm-reference-library | processing_components/imaging/base.py | [
"Apache-2.0"
] | Python | predict_2d | Union[BlockVisibility, Visibility] | def predict_2d(vis: Union[BlockVisibility, Visibility], model: Image, gcfcf=None,
**kwargs) -> Union[BlockVisibility, Visibility]:
""" Predict using convolutional degridding.
This is at the bottom of the layering i.e. all transforms are eventually expressed in terms of
this function. Any shi... | Predict using convolutional degridding.
This is at the bottom of the layering i.e. all transforms are eventually expressed in terms of
this function. Any shifting needed is performed here.
:param vis: Visibility to be predicted
:param model: model image
:param gcfcf: (Grid correction function i.e... | Predict using convolutional degridding.
This is at the bottom of the layering i.e. all transforms are eventually expressed in terms of
this function. Any shifting needed is performed here. | [
"Predict",
"using",
"convolutional",
"degridding",
".",
"This",
"is",
"at",
"the",
"bottom",
"of",
"the",
"layering",
"i",
".",
"e",
".",
"all",
"transforms",
"are",
"eventually",
"expressed",
"in",
"terms",
"of",
"this",
"function",
".",
"Any",
"shifting",
... | def predict_2d(vis: Union[BlockVisibility, Visibility], model: Image, gcfcf=None,
**kwargs) -> Union[BlockVisibility, Visibility]:
if model is None:
return vis
assert isinstance(vis, Visibility), vis
_, _, ny, nx = model.data.shape
if gcfcf is None:
gcf, cf = create_pswf_c... | [
"def",
"predict_2d",
"(",
"vis",
":",
"Union",
"[",
"BlockVisibility",
",",
"Visibility",
"]",
",",
"model",
":",
"Image",
",",
"gcfcf",
"=",
"None",
",",
"**",
"kwargs",
")",
"->",
"Union",
"[",
"BlockVisibility",
",",
"Visibility",
"]",
":",
"if",
"m... | Predict using convolutional degridding. | [
"Predict",
"using",
"convolutional",
"degridding",
"."
] | [
"\"\"\" Predict using convolutional degridding.\n\n This is at the bottom of the layering i.e. all transforms are eventually expressed in terms of\n this function. Any shifting needed is performed here.\n\n :param vis: Visibility to be predicted\n :param model: model image\n :param gcfcf: (Grid corre... | [
{
"param": "vis",
"type": "Union[BlockVisibility, Visibility]"
},
{
"param": "model",
"type": "Image"
},
{
"param": "gcfcf",
"type": null
}
] | {
"returns": [
{
"docstring": "resulting visibility (in place works)",
"docstring_tokens": [
"resulting",
"visibility",
"(",
"in",
"place",
"works",
")"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier"... |
daef18bdb7c86d1dc207e1f1c13e68ffd2993cc0 | ska-telescope/algorithm-reference-library | processing_components/imaging/base.py | [
"Apache-2.0"
] | Python | invert_2d | (Image, numpy.ndarray) | def invert_2d(vis: Visibility, im: Image, dopsf: bool = False, normalize: bool = True,
gcfcf=None, **kwargs) -> (Image, numpy.ndarray):
""" Invert using 2D convolution function, using the specified convolution function
Use the image im as a template. Do PSF in a separate call.
This is at the... | Invert using 2D convolution function, using the specified convolution function
Use the image im as a template. Do PSF in a separate call.
This is at the bottom of the layering i.e. all transforms are eventually expressed in terms
of this function. . Any shifting needed is performed here.
:param vis:... | Invert using 2D convolution function, using the specified convolution function
Use the image im as a template. Do PSF in a separate call.
This is at the bottom of the layering i.e. all transforms are eventually expressed in terms
of this function. | [
"Invert",
"using",
"2D",
"convolution",
"function",
"using",
"the",
"specified",
"convolution",
"function",
"Use",
"the",
"image",
"im",
"as",
"a",
"template",
".",
"Do",
"PSF",
"in",
"a",
"separate",
"call",
".",
"This",
"is",
"at",
"the",
"bottom",
"of",... | def invert_2d(vis: Visibility, im: Image, dopsf: bool = False, normalize: bool = True,
gcfcf=None, **kwargs) -> (Image, numpy.ndarray):
assert isinstance(vis, Visibility), vis
svis = copy_visibility(vis)
if dopsf:
svis.data['vis'][...] = 1.0+0.0j
svis = shift_vis_to_image(svis, im,... | [
"def",
"invert_2d",
"(",
"vis",
":",
"Visibility",
",",
"im",
":",
"Image",
",",
"dopsf",
":",
"bool",
"=",
"False",
",",
"normalize",
":",
"bool",
"=",
"True",
",",
"gcfcf",
"=",
"None",
",",
"**",
"kwargs",
")",
"->",
"(",
"Image",
",",
"numpy",
... | Invert using 2D convolution function, using the specified convolution function
Use the image im as a template. | [
"Invert",
"using",
"2D",
"convolution",
"function",
"using",
"the",
"specified",
"convolution",
"function",
"Use",
"the",
"image",
"im",
"as",
"a",
"template",
"."
] | [
"\"\"\" Invert using 2D convolution function, using the specified convolution function\n\n Use the image im as a template. Do PSF in a separate call.\n\n This is at the bottom of the layering i.e. all transforms are eventually expressed in terms\n of this function. . Any shifting needed is performed here.\... | [
{
"param": "vis",
"type": "Visibility"
},
{
"param": "im",
"type": "Image"
},
{
"param": "dopsf",
"type": "bool"
},
{
"param": "normalize",
"type": "bool"
},
{
"param": "gcfcf",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis",
"type": "Visibility",
"docstring": "Visibility to be inverted",
"docstring_tokens": [
"Visibility",
... |
daef18bdb7c86d1dc207e1f1c13e68ffd2993cc0 | ska-telescope/algorithm-reference-library | processing_components/imaging/base.py | [
"Apache-2.0"
] | Python | predict_skycomponent_visibility | Union[Visibility, BlockVisibility] | def predict_skycomponent_visibility(vis: Union[Visibility, BlockVisibility],
sc: Union[Skycomponent, List[Skycomponent]]) -> Union[Visibility, BlockVisibility]:
"""Predict the visibility from a Skycomponent, add to existing visibility, for Visibility or BlockVisibility
:para... | Predict the visibility from a Skycomponent, add to existing visibility, for Visibility or BlockVisibility
:param vis: Visibility or BlockVisibility
:param sc: Skycomponent or list of SkyComponents
:return: Visibility or BlockVisibility
| Predict the visibility from a Skycomponent, add to existing visibility, for Visibility or BlockVisibility | [
"Predict",
"the",
"visibility",
"from",
"a",
"Skycomponent",
"add",
"to",
"existing",
"visibility",
"for",
"Visibility",
"or",
"BlockVisibility"
] | def predict_skycomponent_visibility(vis: Union[Visibility, BlockVisibility],
sc: Union[Skycomponent, List[Skycomponent]]) -> Union[Visibility, BlockVisibility]:
if sc is None:
return vis
if not isinstance(sc, collections.Iterable):
sc = [sc]
if isinstance(... | [
"def",
"predict_skycomponent_visibility",
"(",
"vis",
":",
"Union",
"[",
"Visibility",
",",
"BlockVisibility",
"]",
",",
"sc",
":",
"Union",
"[",
"Skycomponent",
",",
"List",
"[",
"Skycomponent",
"]",
"]",
")",
"->",
"Union",
"[",
"Visibility",
",",
"BlockVi... | Predict the visibility from a Skycomponent, add to existing visibility, for Visibility or BlockVisibility | [
"Predict",
"the",
"visibility",
"from",
"a",
"Skycomponent",
"add",
"to",
"existing",
"visibility",
"for",
"Visibility",
"or",
"BlockVisibility"
] | [
"\"\"\"Predict the visibility from a Skycomponent, add to existing visibility, for Visibility or BlockVisibility\n\n :param vis: Visibility or BlockVisibility\n :param sc: Skycomponent or list of SkyComponents\n :return: Visibility or BlockVisibility\n \"\"\"",
"# assert isinstance(comp, Sk... | [
{
"param": "vis",
"type": "Union[Visibility, BlockVisibility]"
},
{
"param": "sc",
"type": "Union[Skycomponent, List[Skycomponent]]"
}
] | {
"returns": [
{
"docstring": "Visibility or BlockVisibility",
"docstring_tokens": [
"Visibility",
"or",
"BlockVisibility"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis",
"type": "Union[Visibility, BlockVisibility]",
... |
daef18bdb7c86d1dc207e1f1c13e68ffd2993cc0 | ska-telescope/algorithm-reference-library | processing_components/imaging/base.py | [
"Apache-2.0"
] | Python | create_image_from_visibility | Image | def create_image_from_visibility(vis: Union[BlockVisibility, Visibility], **kwargs) -> Image:
"""Make an empty image from params and Visibility
This makes an empty, template image consistent with the visibility, allowing optional overriding of select
parameters. This is a convenience function and does ... | Make an empty image from params and Visibility
This makes an empty, template image consistent with the visibility, allowing optional overriding of select
parameters. This is a convenience function and does not transform the visibilities.
:param vis:
:param phasecentre: Phasecentre (Skycoord)
:... | Make an empty image from params and Visibility
This makes an empty, template image consistent with the visibility, allowing optional overriding of select
parameters. This is a convenience function and does not transform the visibilities. | [
"Make",
"an",
"empty",
"image",
"from",
"params",
"and",
"Visibility",
"This",
"makes",
"an",
"empty",
"template",
"image",
"consistent",
"with",
"the",
"visibility",
"allowing",
"optional",
"overriding",
"of",
"select",
"parameters",
".",
"This",
"is",
"a",
"... | def create_image_from_visibility(vis: Union[BlockVisibility, Visibility], **kwargs) -> Image:
assert isinstance(vis, Visibility) or isinstance(vis, BlockVisibility), \
"vis is not a Visibility or a BlockVisibility: %r" % (vis)
log.debug("create_image_from_visibility: Parsing parameters to get definition... | [
"def",
"create_image_from_visibility",
"(",
"vis",
":",
"Union",
"[",
"BlockVisibility",
",",
"Visibility",
"]",
",",
"**",
"kwargs",
")",
"->",
"Image",
":",
"assert",
"isinstance",
"(",
"vis",
",",
"Visibility",
")",
"or",
"isinstance",
"(",
"vis",
",",
... | Make an empty image from params and Visibility
This makes an empty, template image consistent with the visibility, allowing optional overriding of select
parameters. | [
"Make",
"an",
"empty",
"image",
"from",
"params",
"and",
"Visibility",
"This",
"makes",
"an",
"empty",
"template",
"image",
"consistent",
"with",
"the",
"visibility",
"allowing",
"optional",
"overriding",
"of",
"select",
"parameters",
"."
] | [
"\"\"\"Make an empty image from params and Visibility\n \n This makes an empty, template image consistent with the visibility, allowing optional overriding of select\n parameters. This is a convenience function and does not transform the visibilities.\n\n :param vis:\n :param phasecentre: Phasecentre... | [
{
"param": "vis",
"type": "Union[BlockVisibility, Visibility]"
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis",
"type": "Union[BlockVisibility, Visibility]",
"docstring": null,
"docstring_tokens": [
"None"
]... |
daef18bdb7c86d1dc207e1f1c13e68ffd2993cc0 | ska-telescope/algorithm-reference-library | processing_components/imaging/base.py | [
"Apache-2.0"
] | Python | rad_deg_arcsec | <not_specific> | def rad_deg_arcsec(x):
""" Stringify x in radian and degress forms
"""
return "%.3g (rad) %.3g (deg) %.3g (asec)" % (x, 180.0 * x / numpy.pi, 3600.0 * 180.0 * x / numpy.pi) | Stringify x in radian and degress forms
| Stringify x in radian and degress forms | [
"Stringify",
"x",
"in",
"radian",
"and",
"degress",
"forms"
] | def rad_deg_arcsec(x):
return "%.3g (rad) %.3g (deg) %.3g (asec)" % (x, 180.0 * x / numpy.pi, 3600.0 * 180.0 * x / numpy.pi) | [
"def",
"rad_deg_arcsec",
"(",
"x",
")",
":",
"return",
"\"%.3g (rad) %.3g (deg) %.3g (asec)\"",
"%",
"(",
"x",
",",
"180.0",
"*",
"x",
"/",
"numpy",
".",
"pi",
",",
"3600.0",
"*",
"180.0",
"*",
"x",
"/",
"numpy",
".",
"pi",
")"
] | Stringify x in radian and degress forms | [
"Stringify",
"x",
"in",
"radian",
"and",
"degress",
"forms"
] | [
"\"\"\" Stringify x in radian and degress forms\n \n \"\"\""
] | [
{
"param": "x",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "x",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f7a2fe56097bff370f26ba533b61d4342ca8113d | ska-telescope/algorithm-reference-library | processing_components/visibility/base.py | [
"Apache-2.0"
] | Python | create_visibility | Visibility | def create_visibility(config: Configuration, times: numpy.array, frequency: numpy.array,
channel_bandwidth, phasecentre: SkyCoord,
weight: float, polarisation_frame=PolarisationFrame('stokesI'),
integration_time=1.0,
zerow=False, el... | Create a Visibility from Configuration, hour angles, and direction of source
Note that we keep track of the integration time for BDA purposes
:param config: Configuration of antennas
:param times: hour angles in radians
:param frequency: frequencies (Hz] [nchan]
:param weight: weight of a single ... | Create a Visibility from Configuration, hour angles, and direction of source
Note that we keep track of the integration time for BDA purposes | [
"Create",
"a",
"Visibility",
"from",
"Configuration",
"hour",
"angles",
"and",
"direction",
"of",
"source",
"Note",
"that",
"we",
"keep",
"track",
"of",
"the",
"integration",
"time",
"for",
"BDA",
"purposes"
] | def create_visibility(config: Configuration, times: numpy.array, frequency: numpy.array,
channel_bandwidth, phasecentre: SkyCoord,
weight: float, polarisation_frame=PolarisationFrame('stokesI'),
integration_time=1.0,
zerow=False, el... | [
"def",
"create_visibility",
"(",
"config",
":",
"Configuration",
",",
"times",
":",
"numpy",
".",
"array",
",",
"frequency",
":",
"numpy",
".",
"array",
",",
"channel_bandwidth",
",",
"phasecentre",
":",
"SkyCoord",
",",
"weight",
":",
"float",
",",
"polaris... | Create a Visibility from Configuration, hour angles, and direction of source
Note that we keep track of the integration time for BDA purposes | [
"Create",
"a",
"Visibility",
"from",
"Configuration",
"hour",
"angles",
"and",
"direction",
"of",
"source",
"Note",
"that",
"we",
"keep",
"track",
"of",
"the",
"integration",
"time",
"for",
"BDA",
"purposes"
] | [
"\"\"\" Create a Visibility from Configuration, hour angles, and direction of source\n\n Note that we keep track of the integration time for BDA purposes\n\n :param config: Configuration of antennas\n :param times: hour angles in radians\n :param frequency: frequencies (Hz] [nchan]\n :param weight: w... | [
{
"param": "config",
"type": "Configuration"
},
{
"param": "times",
"type": "numpy.array"
},
{
"param": "frequency",
"type": "numpy.array"
},
{
"param": "channel_bandwidth",
"type": null
},
{
"param": "phasecentre",
"type": "SkyCoord"
},
{
"param": "we... | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "config",
"type": "Configuration",
"docstring": "Configuration of antennas",
"docstring_tokens": [
"Configur... |
f7a2fe56097bff370f26ba533b61d4342ca8113d | ska-telescope/algorithm-reference-library | processing_components/visibility/base.py | [
"Apache-2.0"
] | Python | create_blockvisibility | BlockVisibility | def create_blockvisibility(config: Configuration,
times: numpy.array,
frequency: numpy.array,
phasecentre: SkyCoord,
weight: float = 1.0,
polarisation_frame: PolarisationFrame = None,
... | Create a BlockVisibility from Configuration, hour angles, and direction of source
Note that we keep track of the integration time for BDA purposes
:param config: Configuration of antennas
:param times: hour angles in radians
:param frequency: frequencies (Hz] [nchan]
:param weight: weight of a si... | Create a BlockVisibility from Configuration, hour angles, and direction of source
Note that we keep track of the integration time for BDA purposes | [
"Create",
"a",
"BlockVisibility",
"from",
"Configuration",
"hour",
"angles",
"and",
"direction",
"of",
"source",
"Note",
"that",
"we",
"keep",
"track",
"of",
"the",
"integration",
"time",
"for",
"BDA",
"purposes"
] | def create_blockvisibility(config: Configuration,
times: numpy.array,
frequency: numpy.array,
phasecentre: SkyCoord,
weight: float = 1.0,
polarisation_frame: PolarisationFrame = None,
... | [
"def",
"create_blockvisibility",
"(",
"config",
":",
"Configuration",
",",
"times",
":",
"numpy",
".",
"array",
",",
"frequency",
":",
"numpy",
".",
"array",
",",
"phasecentre",
":",
"SkyCoord",
",",
"weight",
":",
"float",
"=",
"1.0",
",",
"polarisation_fra... | Create a BlockVisibility from Configuration, hour angles, and direction of source
Note that we keep track of the integration time for BDA purposes | [
"Create",
"a",
"BlockVisibility",
"from",
"Configuration",
"hour",
"angles",
"and",
"direction",
"of",
"source",
"Note",
"that",
"we",
"keep",
"track",
"of",
"the",
"integration",
"time",
"for",
"BDA",
"purposes"
] | [
"\"\"\" Create a BlockVisibility from Configuration, hour angles, and direction of source\n\n Note that we keep track of the integration time for BDA purposes\n\n :param config: Configuration of antennas\n :param times: hour angles in radians\n :param frequency: frequencies (Hz] [nchan]\n :param weig... | [
{
"param": "config",
"type": "Configuration"
},
{
"param": "times",
"type": "numpy.array"
},
{
"param": "frequency",
"type": "numpy.array"
},
{
"param": "phasecentre",
"type": "SkyCoord"
},
{
"param": "weight",
"type": "float"
},
{
"param": "polarisati... | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "config",
"type": "Configuration",
"docstring": "Configuration of antennas",
"docstring_tokens": [
"Configur... |
f7a2fe56097bff370f26ba533b61d4342ca8113d | ska-telescope/algorithm-reference-library | processing_components/visibility/base.py | [
"Apache-2.0"
] | Python | phaserotate_visibility | Visibility | def phaserotate_visibility(vis: Visibility, newphasecentre: SkyCoord, tangent=True, inverse=False) -> Visibility:
"""
Phase rotate from the current phase centre to a new phase centre
If tangent is False the uvw are recomputed and the visibility phasecentre is updated.
Otherwise only the visibility phas... |
Phase rotate from the current phase centre to a new phase centre
If tangent is False the uvw are recomputed and the visibility phasecentre is updated.
Otherwise only the visibility phases are adjusted
:param vis: Visibility to be rotated
:param newphasecentre:
:param tangent: Stay on the same... | Phase rotate from the current phase centre to a new phase centre
If tangent is False the uvw are recomputed and the visibility phasecentre is updated.
Otherwise only the visibility phases are adjusted | [
"Phase",
"rotate",
"from",
"the",
"current",
"phase",
"centre",
"to",
"a",
"new",
"phase",
"centre",
"If",
"tangent",
"is",
"False",
"the",
"uvw",
"are",
"recomputed",
"and",
"the",
"visibility",
"phasecentre",
"is",
"updated",
".",
"Otherwise",
"only",
"the... | def phaserotate_visibility(vis: Visibility, newphasecentre: SkyCoord, tangent=True, inverse=False) -> Visibility:
l, m, n = skycoord_to_lmn(newphasecentre, vis.phasecentre)
if numpy.abs(n) < 1e-15:
return vis
newvis = copy_visibility(vis)
if isinstance(vis, Visibility):
phasor = simulate... | [
"def",
"phaserotate_visibility",
"(",
"vis",
":",
"Visibility",
",",
"newphasecentre",
":",
"SkyCoord",
",",
"tangent",
"=",
"True",
",",
"inverse",
"=",
"False",
")",
"->",
"Visibility",
":",
"l",
",",
"m",
",",
"n",
"=",
"skycoord_to_lmn",
"(",
"newphase... | Phase rotate from the current phase centre to a new phase centre
If tangent is False the uvw are recomputed and the visibility phasecentre is updated. | [
"Phase",
"rotate",
"from",
"the",
"current",
"phase",
"centre",
"to",
"a",
"new",
"phase",
"centre",
"If",
"tangent",
"is",
"False",
"the",
"uvw",
"are",
"recomputed",
"and",
"the",
"visibility",
"phasecentre",
"is",
"updated",
"."
] | [
"\"\"\"\n Phase rotate from the current phase centre to a new phase centre\n\n If tangent is False the uvw are recomputed and the visibility phasecentre is updated.\n Otherwise only the visibility phases are adjusted\n\n :param vis: Visibility to be rotated\n :param newphasecentre:\n :param tangen... | [
{
"param": "vis",
"type": "Visibility"
},
{
"param": "newphasecentre",
"type": "SkyCoord"
},
{
"param": "tangent",
"type": null
},
{
"param": "inverse",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis",
"type": "Visibility",
"docstring": "Visibility to be rotated",
"docstring_tokens": [
"Visibility",
... |
f7a2fe56097bff370f26ba533b61d4342ca8113d | ska-telescope/algorithm-reference-library | processing_components/visibility/base.py | [
"Apache-2.0"
] | Python | export_blockvisibility_to_ms | null | def export_blockvisibility_to_ms(msname, vis_list, source_name=None, ack=False):
""" Minimal BlockVisibility to MS converter
The MS format is much more general than the ARL BlockVisibility so we cut many corners. This requires casacore to be
installed. If not an exception ModuleNotFoundError is raised.
... | Minimal BlockVisibility to MS converter
The MS format is much more general than the ARL BlockVisibility so we cut many corners. This requires casacore to be
installed. If not an exception ModuleNotFoundError is raised.
Write a list of BlockVisibility's to a MS file, split by field and spectral window
... | Minimal BlockVisibility to MS converter
The MS format is much more general than the ARL BlockVisibility so we cut many corners. This requires casacore to be
installed. If not an exception ModuleNotFoundError is raised.
Write a list of BlockVisibility's to a MS file, split by field and spectral window | [
"Minimal",
"BlockVisibility",
"to",
"MS",
"converter",
"The",
"MS",
"format",
"is",
"much",
"more",
"general",
"than",
"the",
"ARL",
"BlockVisibility",
"so",
"we",
"cut",
"many",
"corners",
".",
"This",
"requires",
"casacore",
"to",
"be",
"installed",
".",
"... | def export_blockvisibility_to_ms(msname, vis_list, source_name=None, ack=False):
try:
import casacore.tables.tableutil as pt
from casacore.tables import (makescacoldesc, makearrcoldesc, table, maketabdesc, tableexists, tableiswritable,
tableinfo, tablefromascii, tabledel... | [
"def",
"export_blockvisibility_to_ms",
"(",
"msname",
",",
"vis_list",
",",
"source_name",
"=",
"None",
",",
"ack",
"=",
"False",
")",
":",
"try",
":",
"import",
"casacore",
".",
"tables",
".",
"tableutil",
"as",
"pt",
"from",
"casacore",
".",
"tables",
"i... | Minimal BlockVisibility to MS converter
The MS format is much more general than the ARL BlockVisibility so we cut many corners. | [
"Minimal",
"BlockVisibility",
"to",
"MS",
"converter",
"The",
"MS",
"format",
"is",
"much",
"more",
"general",
"than",
"the",
"ARL",
"BlockVisibility",
"so",
"we",
"cut",
"many",
"corners",
"."
] | [
"\"\"\" Minimal BlockVisibility to MS converter\n\n The MS format is much more general than the ARL BlockVisibility so we cut many corners. This requires casacore to be\n installed. If not an exception ModuleNotFoundError is raised.\n\n Write a list of BlockVisibility's to a MS file, split by field and spe... | [
{
"param": "msname",
"type": null
},
{
"param": "vis_list",
"type": null
},
{
"param": "source_name",
"type": null
},
{
"param": "ack",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "msname",
"type": null,
"docstring": "File name of MS",
"docstring_tokens": [
"File",
"name",
... |
f7a2fe56097bff370f26ba533b61d4342ca8113d | ska-telescope/algorithm-reference-library | processing_components/visibility/base.py | [
"Apache-2.0"
] | Python | list_ms | <not_specific> | def list_ms(msname, ack=False):
""" List sources and data descriptors in a MeasurementSet
:param msname: File name of MS
:return:
"""
try:
from casacore.tables import table # pylint: disable=import-error
except ModuleNotFoundError:
raise ModuleNotFoundError("casacore is not ins... | List sources and data descriptors in a MeasurementSet
:param msname: File name of MS
:return:
| List sources and data descriptors in a MeasurementSet | [
"List",
"sources",
"and",
"data",
"descriptors",
"in",
"a",
"MeasurementSet"
] | def list_ms(msname, ack=False):
try:
from casacore.tables import table
except ModuleNotFoundError:
raise ModuleNotFoundError("casacore is not installed")
try:
from processing_components.visibility import msv2
except ModuleNotFoundError:
raise ModuleNotFoundError("cannot... | [
"def",
"list_ms",
"(",
"msname",
",",
"ack",
"=",
"False",
")",
":",
"try",
":",
"from",
"casacore",
".",
"tables",
"import",
"table",
"except",
"ModuleNotFoundError",
":",
"raise",
"ModuleNotFoundError",
"(",
"\"casacore is not installed\"",
")",
"try",
":",
... | List sources and data descriptors in a MeasurementSet | [
"List",
"sources",
"and",
"data",
"descriptors",
"in",
"a",
"MeasurementSet"
] | [
"\"\"\" List sources and data descriptors in a MeasurementSet\n\n :param msname: File name of MS\n :return:\n \"\"\"",
"# pylint: disable=import-error"
] | [
{
"param": "msname",
"type": null
},
{
"param": "ack",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "msname",
"type": null,
"docstring": "File name of MS",
"docstring_tokens": [
"File",
"name",
... |
f7a2fe56097bff370f26ba533b61d4342ca8113d | ska-telescope/algorithm-reference-library | processing_components/visibility/base.py | [
"Apache-2.0"
] | Python | create_visibility_from_ms | <not_specific> | def create_visibility_from_ms(msname, channum=None, start_chan=None, end_chan=None, ack=False):
""" Minimal MS to BlockVisibility converter
The MS format is much more general than the ARL BlockVisibility so we cut many corners. This requires casacore to be
installed. If not an exception ModuleNotFoundErro... | Minimal MS to BlockVisibility converter
The MS format is much more general than the ARL BlockVisibility so we cut many corners. This requires casacore to be
installed. If not an exception ModuleNotFoundError is raised.
Creates a list of BlockVisibility's, split by field and spectral window
Reading o... | Minimal MS to BlockVisibility converter
The MS format is much more general than the ARL BlockVisibility so we cut many corners. This requires casacore to be
installed. If not an exception ModuleNotFoundError is raised.
Creates a list of BlockVisibility's, split by field and spectral window
Reading of a subset of chan... | [
"Minimal",
"MS",
"to",
"BlockVisibility",
"converter",
"The",
"MS",
"format",
"is",
"much",
"more",
"general",
"than",
"the",
"ARL",
"BlockVisibility",
"so",
"we",
"cut",
"many",
"corners",
".",
"This",
"requires",
"casacore",
"to",
"be",
"installed",
".",
"... | def create_visibility_from_ms(msname, channum=None, start_chan=None, end_chan=None, ack=False):
from processing_components.visibility.coalesce import convert_blockvisibility_to_visibility
return [convert_blockvisibility_to_visibility(v)
for v in create_blockvisibility_from_ms(msname=msname, channum... | [
"def",
"create_visibility_from_ms",
"(",
"msname",
",",
"channum",
"=",
"None",
",",
"start_chan",
"=",
"None",
",",
"end_chan",
"=",
"None",
",",
"ack",
"=",
"False",
")",
":",
"from",
"processing_components",
".",
"visibility",
".",
"coalesce",
"import",
"... | Minimal MS to BlockVisibility converter
The MS format is much more general than the ARL BlockVisibility so we cut many corners. | [
"Minimal",
"MS",
"to",
"BlockVisibility",
"converter",
"The",
"MS",
"format",
"is",
"much",
"more",
"general",
"than",
"the",
"ARL",
"BlockVisibility",
"so",
"we",
"cut",
"many",
"corners",
"."
] | [
"\"\"\" Minimal MS to BlockVisibility converter\n\n The MS format is much more general than the ARL BlockVisibility so we cut many corners. This requires casacore to be\n installed. If not an exception ModuleNotFoundError is raised.\n\n Creates a list of BlockVisibility's, split by field and spectral windo... | [
{
"param": "msname",
"type": null
},
{
"param": "channum",
"type": null
},
{
"param": "start_chan",
"type": null
},
{
"param": "end_chan",
"type": null
},
{
"param": "ack",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "msname",
"type": null,
"docstring": "File name of MS",
"docstring_tokens": [
"File",
"name",
... |
f7a2fe56097bff370f26ba533b61d4342ca8113d | ska-telescope/algorithm-reference-library | processing_components/visibility/base.py | [
"Apache-2.0"
] | Python | ParamDict | <not_specific> | def ParamDict(hdul):
"Return the dictionary of the random parameters"
"""
The keys of the dictionary are the parameter names uppercased for
consistency. The values are the column numbers.
If multiple parameters have the same name (e.g., DATE) their
columns are entered a... | Return the dictionary of the random parameters | Return the dictionary of the random parameters | [
"Return",
"the",
"dictionary",
"of",
"the",
"random",
"parameters"
] | def ParamDict(hdul):
pre=re.compile(r"PTYPE(?P<i>\d+)")
res={}
for k,v in hdul.header.items():
m=pre.match(k)
if m :
vu=v.upper()
if vu in res:
res[ vu ] = [ res[vu], int(m.group("i")) ]
else:
... | [
"def",
"ParamDict",
"(",
"hdul",
")",
":",
"\"\"\"\n The keys of the dictionary are the parameter names uppercased for\n consistency. The values are the column numbers.\n\n If multiple parameters have the same name (e.g., DATE) their\n columns are entered as a list.\n ... | Return the dictionary of the random parameters | [
"Return",
"the",
"dictionary",
"of",
"the",
"random",
"parameters"
] | [
"\"Return the dictionary of the random parameters\"",
"\"\"\"\n The keys of the dictionary are the parameter names uppercased for\n consistency. The values are the column numbers.\n\n If multiple parameters have the same name (e.g., DATE) their\n columns are entered as a list.\n ... | [
{
"param": "hdul",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "hdul",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f7a2fe56097bff370f26ba533b61d4342ca8113d | ska-telescope/algorithm-reference-library | processing_components/visibility/base.py | [
"Apache-2.0"
] | Python | create_visibility_from_uvfits | <not_specific> | def create_visibility_from_uvfits(fitsname, channum=None, ack=False, antnum=None):
""" Minimal UVFITS to BlockVisibility converter
Creates a list of BlockVisibility's, split by field and spectral window
:param fitsname: File name of UVFITS file
:param channum: range of channels e.g. range(17,32), defa... | Minimal UVFITS to BlockVisibility converter
Creates a list of BlockVisibility's, split by field and spectral window
:param fitsname: File name of UVFITS file
:param channum: range of channels e.g. range(17,32), default is None meaning all
:param antnum: the number of antenna
:return:
| Minimal UVFITS to BlockVisibility converter
Creates a list of BlockVisibility's, split by field and spectral window | [
"Minimal",
"UVFITS",
"to",
"BlockVisibility",
"converter",
"Creates",
"a",
"list",
"of",
"BlockVisibility",
"'",
"s",
"split",
"by",
"field",
"and",
"spectral",
"window"
] | def create_visibility_from_uvfits(fitsname, channum=None, ack=False, antnum=None):
from processing_components.visibility.coalesce import convert_blockvisibility_to_visibility
return [convert_blockvisibility_to_visibility(v)
for v in create_blockvisibility_from_uvfits(fitsname=fitsname, channum=chann... | [
"def",
"create_visibility_from_uvfits",
"(",
"fitsname",
",",
"channum",
"=",
"None",
",",
"ack",
"=",
"False",
",",
"antnum",
"=",
"None",
")",
":",
"from",
"processing_components",
".",
"visibility",
".",
"coalesce",
"import",
"convert_blockvisibility_to_visibilit... | Minimal UVFITS to BlockVisibility converter
Creates a list of BlockVisibility's, split by field and spectral window | [
"Minimal",
"UVFITS",
"to",
"BlockVisibility",
"converter",
"Creates",
"a",
"list",
"of",
"BlockVisibility",
"'",
"s",
"split",
"by",
"field",
"and",
"spectral",
"window"
] | [
"\"\"\" Minimal UVFITS to BlockVisibility converter\n\n Creates a list of BlockVisibility's, split by field and spectral window\n\n :param fitsname: File name of UVFITS file\n :param channum: range of channels e.g. range(17,32), default is None meaning all\n :param antnum: the number of antenna\n :re... | [
{
"param": "fitsname",
"type": null
},
{
"param": "channum",
"type": null
},
{
"param": "ack",
"type": null
},
{
"param": "antnum",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "fitsname",
"type": null,
"docstring": "File name of UVFITS file",
"docstring_tokens": [
"File",
"na... |
f294748dd27ccd7655d5220c07ad0acc586d389a | ska-telescope/algorithm-reference-library | workflows/arlexecute/simulation/simulation_arlexecute.py | [
"Apache-2.0"
] | Python | simulate_list_arlexecute_workflow | <not_specific> | def simulate_list_arlexecute_workflow(config='LOWBD2',
phasecentre=SkyCoord(ra=+15.0 * u.deg, dec=-60.0 * u.deg, frame='icrs',
equinox='J2000'),
frequency=None, channel_bandwidth=None, ... | A component to simulate an observation
The simulation step can generate a single BlockVisibility or a list of BlockVisibility's.
The parameter keyword determines the way that the list is constructed.
If order='frequency' then len(frequency) BlockVisibility's with all times are created.
If order='time'... | A component to simulate an observation
The simulation step can generate a single BlockVisibility or a list of BlockVisibility's.
The parameter keyword determines the way that the list is constructed.
If order='frequency' then len(frequency) BlockVisibility's with all times are created.
If order='time' then len(times) ... | [
"A",
"component",
"to",
"simulate",
"an",
"observation",
"The",
"simulation",
"step",
"can",
"generate",
"a",
"single",
"BlockVisibility",
"or",
"a",
"list",
"of",
"BlockVisibility",
"'",
"s",
".",
"The",
"parameter",
"keyword",
"determines",
"the",
"way",
"th... | def simulate_list_arlexecute_workflow(config='LOWBD2',
phasecentre=SkyCoord(ra=+15.0 * u.deg, dec=-60.0 * u.deg, frame='icrs',
equinox='J2000'),
frequency=None, channel_bandwidth=None, ... | [
"def",
"simulate_list_arlexecute_workflow",
"(",
"config",
"=",
"'LOWBD2'",
",",
"phasecentre",
"=",
"SkyCoord",
"(",
"ra",
"=",
"+",
"15.0",
"*",
"u",
".",
"deg",
",",
"dec",
"=",
"-",
"60.0",
"*",
"u",
".",
"deg",
",",
"frame",
"=",
"'icrs'",
",",
... | A component to simulate an observation
The simulation step can generate a single BlockVisibility or a list of BlockVisibility's. | [
"A",
"component",
"to",
"simulate",
"an",
"observation",
"The",
"simulation",
"step",
"can",
"generate",
"a",
"single",
"BlockVisibility",
"or",
"a",
"list",
"of",
"BlockVisibility",
"'",
"s",
"."
] | [
"\"\"\" A component to simulate an observation\n\n The simulation step can generate a single BlockVisibility or a list of BlockVisibility's.\n The parameter keyword determines the way that the list is constructed.\n If order='frequency' then len(frequency) BlockVisibility's with all times are created.\n ... | [
{
"param": "config",
"type": null
},
{
"param": "phasecentre",
"type": null
},
{
"param": "frequency",
"type": null
},
{
"param": "channel_bandwidth",
"type": null
},
{
"param": "times",
"type": null
},
{
"param": "polarisation_frame",
"type": null... | {
"returns": [
{
"docstring": "vis_list with different frequencies in different elements",
"docstring_tokens": [
"vis_list",
"with",
"different",
"frequencies",
"in",
"different",
"elements"
],
"type": null
}
],
"raises": [],
... |
f294748dd27ccd7655d5220c07ad0acc586d389a | ska-telescope/algorithm-reference-library | workflows/arlexecute/simulation/simulation_arlexecute.py | [
"Apache-2.0"
] | Python | corrupt_list_arlexecute_workflow | <not_specific> | def corrupt_list_arlexecute_workflow(vis_list, gt_list=None, seed=None, **kwargs):
""" Create a graph to apply gain errors to a vis_list
:param vis_list:
:param gt_list: Optional gain table graph
:param kwargs:
:return:
"""
def corrupt_vis(vis, gt, **kwargs):
if isinstance(vis,... | Create a graph to apply gain errors to a vis_list
:param vis_list:
:param gt_list: Optional gain table graph
:param kwargs:
:return:
| Create a graph to apply gain errors to a vis_list | [
"Create",
"a",
"graph",
"to",
"apply",
"gain",
"errors",
"to",
"a",
"vis_list"
] | def corrupt_list_arlexecute_workflow(vis_list, gt_list=None, seed=None, **kwargs):
def corrupt_vis(vis, gt, **kwargs):
if isinstance(vis, Visibility):
bv = convert_visibility_to_blockvisibility(vis)
else:
bv = vis
if gt is None:
gt = create_gaintable_from_... | [
"def",
"corrupt_list_arlexecute_workflow",
"(",
"vis_list",
",",
"gt_list",
"=",
"None",
",",
"seed",
"=",
"None",
",",
"**",
"kwargs",
")",
":",
"def",
"corrupt_vis",
"(",
"vis",
",",
"gt",
",",
"**",
"kwargs",
")",
":",
"if",
"isinstance",
"(",
"vis",
... | Create a graph to apply gain errors to a vis_list | [
"Create",
"a",
"graph",
"to",
"apply",
"gain",
"errors",
"to",
"a",
"vis_list"
] | [
"\"\"\" Create a graph to apply gain errors to a vis_list\n\n :param vis_list:\n :param gt_list: Optional gain table graph\n :param kwargs:\n :return:\n \"\"\""
] | [
{
"param": "vis_list",
"type": null
},
{
"param": "gt_list",
"type": null
},
{
"param": "seed",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis_list",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
... |
f294748dd27ccd7655d5220c07ad0acc586d389a | ska-telescope/algorithm-reference-library | workflows/arlexecute/simulation/simulation_arlexecute.py | [
"Apache-2.0"
] | Python | calculate_residual_from_gaintables_arlexecute_workflow | <not_specific> | def calculate_residual_from_gaintables_arlexecute_workflow(sub_bvis_list, sub_components, sub_model_list,
no_error_gt_list, error_gt_list):
"""Calculate residual image corresponding to a set of gaintables
The visibility difference for a set of componen... | Calculate residual image corresponding to a set of gaintables
The visibility difference for a set of components for error and no error gaintables
are calculated and the residual images constructed
:param sub_bvis_list:
:param sub_components:
:param sub_model_list:
:param no_error_gt_list:
... | Calculate residual image corresponding to a set of gaintables
The visibility difference for a set of components for error and no error gaintables
are calculated and the residual images constructed | [
"Calculate",
"residual",
"image",
"corresponding",
"to",
"a",
"set",
"of",
"gaintables",
"The",
"visibility",
"difference",
"for",
"a",
"set",
"of",
"components",
"for",
"error",
"and",
"no",
"error",
"gaintables",
"are",
"calculated",
"and",
"the",
"residual",
... | def calculate_residual_from_gaintables_arlexecute_workflow(sub_bvis_list, sub_components, sub_model_list,
no_error_gt_list, error_gt_list):
error_sm_list = [[
arlexecute.execute(SkyModel, nout=1)(components=[sub_components[i]], gaintable=error_gt_li... | [
"def",
"calculate_residual_from_gaintables_arlexecute_workflow",
"(",
"sub_bvis_list",
",",
"sub_components",
",",
"sub_model_list",
",",
"no_error_gt_list",
",",
"error_gt_list",
")",
":",
"error_sm_list",
"=",
"[",
"[",
"arlexecute",
".",
"execute",
"(",
"SkyModel",
"... | Calculate residual image corresponding to a set of gaintables
The visibility difference for a set of components for error and no error gaintables
are calculated and the residual images constructed | [
"Calculate",
"residual",
"image",
"corresponding",
"to",
"a",
"set",
"of",
"gaintables",
"The",
"visibility",
"difference",
"for",
"a",
"set",
"of",
"components",
"for",
"error",
"and",
"no",
"error",
"gaintables",
"are",
"calculated",
"and",
"the",
"residual",
... | [
"\"\"\"Calculate residual image corresponding to a set of gaintables\n\n The visibility difference for a set of components for error and no error gaintables\n are calculated and the residual images constructed\n\n :param sub_bvis_list:\n :param sub_components:\n :param sub_model_list:\n :param no_... | [
{
"param": "sub_bvis_list",
"type": null
},
{
"param": "sub_components",
"type": null
},
{
"param": "sub_model_list",
"type": null
},
{
"param": "no_error_gt_list",
"type": null
},
{
"param": "error_gt_list",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "sub_bvis_list",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": nul... |
e176abc7b631e653ad0a75ea83276b4fc0e8378f | ska-telescope/algorithm-reference-library | workflows/serial/skymodel/skymodel_serial.py | [
"Apache-2.0"
] | Python | predict_skymodel_list_serial_workflow | <not_specific> | def predict_skymodel_list_serial_workflow(obsvis, skymodel_list, context, vis_slices=1, facets=1,
gcfcf=None, docal=False, **kwargs):
"""Predict from a list of skymodels, producing one visibility per skymodel
:param obsvis: "Observed Visibility"
:param skymodel_lis... | Predict from a list of skymodels, producing one visibility per skymodel
:param obsvis: "Observed Visibility"
:param skymodel_list: skymodel list
:param vis_slices: Number of vis slices (w stack or timeslice)
:param facets: Number of facets (per axis)
:param context: Type of processing e.g. 2d, wsta... | Predict from a list of skymodels, producing one visibility per skymodel | [
"Predict",
"from",
"a",
"list",
"of",
"skymodels",
"producing",
"one",
"visibility",
"per",
"skymodel"
] | def predict_skymodel_list_serial_workflow(obsvis, skymodel_list, context, vis_slices=1, facets=1,
gcfcf=None, docal=False, **kwargs):
def ft_cal_sm(ov, sm, g):
assert isinstance(ov, Visibility), ov
assert isinstance(sm, SkyModel), sm
if g is not None... | [
"def",
"predict_skymodel_list_serial_workflow",
"(",
"obsvis",
",",
"skymodel_list",
",",
"context",
",",
"vis_slices",
"=",
"1",
",",
"facets",
"=",
"1",
",",
"gcfcf",
"=",
"None",
",",
"docal",
"=",
"False",
",",
"**",
"kwargs",
")",
":",
"def",
"ft_cal_... | Predict from a list of skymodels, producing one visibility per skymodel | [
"Predict",
"from",
"a",
"list",
"of",
"skymodels",
"producing",
"one",
"visibility",
"per",
"skymodel"
] | [
"\"\"\"Predict from a list of skymodels, producing one visibility per skymodel\n\n :param obsvis: \"Observed Visibility\"\n :param skymodel_list: skymodel list\n :param vis_slices: Number of vis slices (w stack or timeslice)\n :param facets: Number of facets (per axis)\n :param context: Type of proce... | [
{
"param": "obsvis",
"type": null
},
{
"param": "skymodel_list",
"type": null
},
{
"param": "context",
"type": null
},
{
"param": "vis_slices",
"type": null
},
{
"param": "facets",
"type": null
},
{
"param": "gcfcf",
"type": null
},
{
"para... | {
"returns": [
{
"docstring": "List of vis_lists",
"docstring_tokens": [
"List",
"of",
"vis_lists"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "obsvis",
"type": null,
"docstring": null,
"docstring_tokens": [
... |
e176abc7b631e653ad0a75ea83276b4fc0e8378f | ska-telescope/algorithm-reference-library | workflows/serial/skymodel/skymodel_serial.py | [
"Apache-2.0"
] | Python | invert_skymodel_list_serial_workflow | <not_specific> | def invert_skymodel_list_serial_workflow(vis_list, skymodel_list, context, vis_slices=1, facets=1,
gcfcf=None, docal=False, **kwargs):
"""Calibrate and invert from a skymodel, iterating over the skymodel
The visibility and image are scattered, the visibility is predicte... | Calibrate and invert from a skymodel, iterating over the skymodel
The visibility and image are scattered, the visibility is predicted and calibrated on each part, and then the
parts are assembled. The mask if present, is multiplied in at the end.
:param vis_list: List of Visibility data models
:param ... | Calibrate and invert from a skymodel, iterating over the skymodel
The visibility and image are scattered, the visibility is predicted and calibrated on each part, and then the
parts are assembled. The mask if present, is multiplied in at the end. | [
"Calibrate",
"and",
"invert",
"from",
"a",
"skymodel",
"iterating",
"over",
"the",
"skymodel",
"The",
"visibility",
"and",
"image",
"are",
"scattered",
"the",
"visibility",
"is",
"predicted",
"and",
"calibrated",
"on",
"each",
"part",
"and",
"then",
"the",
"pa... | def invert_skymodel_list_serial_workflow(vis_list, skymodel_list, context, vis_slices=1, facets=1,
gcfcf=None, docal=False, **kwargs):
def ift_ical_sm(v, sm, g):
assert isinstance(v, Visibility), v
assert isinstance(sm, SkyModel), sm
if g is not None:... | [
"def",
"invert_skymodel_list_serial_workflow",
"(",
"vis_list",
",",
"skymodel_list",
",",
"context",
",",
"vis_slices",
"=",
"1",
",",
"facets",
"=",
"1",
",",
"gcfcf",
"=",
"None",
",",
"docal",
"=",
"False",
",",
"**",
"kwargs",
")",
":",
"def",
"ift_ic... | Calibrate and invert from a skymodel, iterating over the skymodel
The visibility and image are scattered, the visibility is predicted and calibrated on each part, and then the
parts are assembled. | [
"Calibrate",
"and",
"invert",
"from",
"a",
"skymodel",
"iterating",
"over",
"the",
"skymodel",
"The",
"visibility",
"and",
"image",
"are",
"scattered",
"the",
"visibility",
"is",
"predicted",
"and",
"calibrated",
"on",
"each",
"part",
"and",
"then",
"the",
"pa... | [
"\"\"\"Calibrate and invert from a skymodel, iterating over the skymodel\n\n The visibility and image are scattered, the visibility is predicted and calibrated on each part, and then the\n parts are assembled. The mask if present, is multiplied in at the end.\n\n :param vis_list: List of Visibility data mo... | [
{
"param": "vis_list",
"type": null
},
{
"param": "skymodel_list",
"type": null
},
{
"param": "context",
"type": null
},
{
"param": "vis_slices",
"type": null
},
{
"param": "facets",
"type": null
},
{
"param": "gcfcf",
"type": null
},
{
"pa... | {
"returns": [
{
"docstring": "List of (image, weight) tuples)",
"docstring_tokens": [
"List",
"of",
"(",
"image",
"weight",
")",
"tuples",
")"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier":... |
e176abc7b631e653ad0a75ea83276b4fc0e8378f | ska-telescope/algorithm-reference-library | workflows/serial/skymodel/skymodel_serial.py | [
"Apache-2.0"
] | Python | crosssubtract_datamodels_skymodel_list_serial_workflow | <not_specific> | def crosssubtract_datamodels_skymodel_list_serial_workflow(obsvis, modelvis_list):
"""Form data models by subtracting sum from the observed and adding back each model in turn
vmodel[p] = vobs - sum(i!=p) modelvis[i]
This is the E step in the Expectation-Maximisation algorithm.
:param obsvis: "Observe... | Form data models by subtracting sum from the observed and adding back each model in turn
vmodel[p] = vobs - sum(i!=p) modelvis[i]
This is the E step in the Expectation-Maximisation algorithm.
:param obsvis: "Observed" visibility
:param modelvis_list: List of Visibility data model predictions
:ret... | Form data models by subtracting sum from the observed and adding back each model in turn
vmodel[p] = vobs - sum(i!=p) modelvis[i]
This is the E step in the Expectation-Maximisation algorithm. | [
"Form",
"data",
"models",
"by",
"subtracting",
"sum",
"from",
"the",
"observed",
"and",
"adding",
"back",
"each",
"model",
"in",
"turn",
"vmodel",
"[",
"p",
"]",
"=",
"vobs",
"-",
"sum",
"(",
"i!",
"=",
"p",
")",
"modelvis",
"[",
"i",
"]",
"This",
... | def crosssubtract_datamodels_skymodel_list_serial_workflow(obsvis, modelvis_list):
def vsum(ov, mv):
verr = copy_visibility(ov)
for m in mv:
verr.data['vis'] -= m.data['vis']
result = list()
for m in mv:
vr = copy_visibility(verr)
vr.data['vis'] +=... | [
"def",
"crosssubtract_datamodels_skymodel_list_serial_workflow",
"(",
"obsvis",
",",
"modelvis_list",
")",
":",
"def",
"vsum",
"(",
"ov",
",",
"mv",
")",
":",
"verr",
"=",
"copy_visibility",
"(",
"ov",
")",
"for",
"m",
"in",
"mv",
":",
"verr",
".",
"data",
... | Form data models by subtracting sum from the observed and adding back each model in turn
vmodel[p] = vobs - sum(i!=p) modelvis[i] | [
"Form",
"data",
"models",
"by",
"subtracting",
"sum",
"from",
"the",
"observed",
"and",
"adding",
"back",
"each",
"model",
"in",
"turn",
"vmodel",
"[",
"p",
"]",
"=",
"vobs",
"-",
"sum",
"(",
"i!",
"=",
"p",
")",
"modelvis",
"[",
"i",
"]"
] | [
"\"\"\"Form data models by subtracting sum from the observed and adding back each model in turn\n\n vmodel[p] = vobs - sum(i!=p) modelvis[i]\n\n This is the E step in the Expectation-Maximisation algorithm.\n\n :param obsvis: \"Observed\" visibility\n :param modelvis_list: List of Visibility data model ... | [
{
"param": "obsvis",
"type": null
},
{
"param": "modelvis_list",
"type": null
}
] | {
"returns": [
{
"docstring": "List of (image, weight) tuples)",
"docstring_tokens": [
"List",
"of",
"(",
"image",
"weight",
")",
"tuples",
")"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier":... |
e176abc7b631e653ad0a75ea83276b4fc0e8378f | ska-telescope/algorithm-reference-library | workflows/serial/skymodel/skymodel_serial.py | [
"Apache-2.0"
] | Python | convolve_skymodel_list_serial_workflow | <not_specific> | def convolve_skymodel_list_serial_workflow(obsvis, skymodel_list, context, vis_slices=1, facets=1,
gcfcf=None, **kwargs):
"""Form residual image from observed visibility and a set of skymodel without calibration
This is similar to convolving the skymodel images wi... | Form residual image from observed visibility and a set of skymodel without calibration
This is similar to convolving the skymodel images with the PSF
:param vis_list: List of Visibility data models
:param skymodel_list: skymodel list
:param vis_slices: Number of vis slices (w stack or timeslice)
:... | Form residual image from observed visibility and a set of skymodel without calibration
This is similar to convolving the skymodel images with the PSF | [
"Form",
"residual",
"image",
"from",
"observed",
"visibility",
"and",
"a",
"set",
"of",
"skymodel",
"without",
"calibration",
"This",
"is",
"similar",
"to",
"convolving",
"the",
"skymodel",
"images",
"with",
"the",
"PSF"
] | def convolve_skymodel_list_serial_workflow(obsvis, skymodel_list, context, vis_slices=1, facets=1,
gcfcf=None, **kwargs):
def ft_ift_sm(ov, sm, g):
assert isinstance(ov, Visibility), ov
assert isinstance(sm, SkyModel), sm
if g is not None:
... | [
"def",
"convolve_skymodel_list_serial_workflow",
"(",
"obsvis",
",",
"skymodel_list",
",",
"context",
",",
"vis_slices",
"=",
"1",
",",
"facets",
"=",
"1",
",",
"gcfcf",
"=",
"None",
",",
"**",
"kwargs",
")",
":",
"def",
"ft_ift_sm",
"(",
"ov",
",",
"sm",
... | Form residual image from observed visibility and a set of skymodel without calibration
This is similar to convolving the skymodel images with the PSF | [
"Form",
"residual",
"image",
"from",
"observed",
"visibility",
"and",
"a",
"set",
"of",
"skymodel",
"without",
"calibration",
"This",
"is",
"similar",
"to",
"convolving",
"the",
"skymodel",
"images",
"with",
"the",
"PSF"
] | [
"\"\"\"Form residual image from observed visibility and a set of skymodel without calibration\n\n This is similar to convolving the skymodel images with the PSF\n\n :param vis_list: List of Visibility data models\n :param skymodel_list: skymodel list\n :param vis_slices: Number of vis slices (w stack or... | [
{
"param": "obsvis",
"type": null
},
{
"param": "skymodel_list",
"type": null
},
{
"param": "context",
"type": null
},
{
"param": "vis_slices",
"type": null
},
{
"param": "facets",
"type": null
},
{
"param": "gcfcf",
"type": null
}
] | {
"returns": [
{
"docstring": "List of (image, weight) tuples)",
"docstring_tokens": [
"List",
"of",
"(",
"image",
"weight",
")",
"tuples",
")"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier":... |
097d9b8a07191009a4e2f628d61ae819299cc2f9 | ska-telescope/algorithm-reference-library | processing_library/util/array_functions.py | [
"Apache-2.0"
] | Python | average_chunks_jit | <not_specific> | def average_chunks_jit(arr, wts, chunksize):
""" Average the array arr with weights by chunks
Array len does not have to be multiple of chunksize
This is a version written for numba. When used with numba.jit, it's about 25 - 30% faster than the
numpy version without jit.
:param arr: 1D ar... | Average the array arr with weights by chunks
Array len does not have to be multiple of chunksize
This is a version written for numba. When used with numba.jit, it's about 25 - 30% faster than the
numpy version without jit.
:param arr: 1D array of values
:param wts: 1D array of weights
... | Average the array arr with weights by chunks
Array len does not have to be multiple of chunksize
This is a version written for numba. When used with numba.jit, it's about 25 - 30% faster than the
numpy version without jit. | [
"Average",
"the",
"array",
"arr",
"with",
"weights",
"by",
"chunks",
"Array",
"len",
"does",
"not",
"have",
"to",
"be",
"multiple",
"of",
"chunksize",
"This",
"is",
"a",
"version",
"written",
"for",
"numba",
".",
"When",
"used",
"with",
"numba",
".",
"ji... | def average_chunks_jit(arr, wts, chunksize):
if chunksize <= 1:
return arr, wts
nchunks = len(arr) // chunksize
extra = len(arr) % chunksize
if extra > 0:
fullsize = nchunks + 1
else:
fullsize = nchunks
chunks = numpy.empty(fullsize, dtype=arr.dtype)
weights = numpy.e... | [
"def",
"average_chunks_jit",
"(",
"arr",
",",
"wts",
",",
"chunksize",
")",
":",
"if",
"chunksize",
"<=",
"1",
":",
"return",
"arr",
",",
"wts",
"nchunks",
"=",
"len",
"(",
"arr",
")",
"//",
"chunksize",
"extra",
"=",
"len",
"(",
"arr",
")",
"%",
"... | Average the array arr with weights by chunks
Array len does not have to be multiple of chunksize | [
"Average",
"the",
"array",
"arr",
"with",
"weights",
"by",
"chunks",
"Array",
"len",
"does",
"not",
"have",
"to",
"be",
"multiple",
"of",
"chunksize"
] | [
"\"\"\" Average the array arr with weights by chunks\n\n Array len does not have to be multiple of chunksize\n \n This is a version written for numba. When used with numba.jit, it's about 25 - 30% faster than the\n numpy version without jit.\n \n :param arr: 1D array of values\n :param wts: 1D ... | [
{
"param": "arr",
"type": null
},
{
"param": "wts",
"type": null
},
{
"param": "chunksize",
"type": null
}
] | {
"returns": [
{
"docstring": "1D array of averaged data_models, 1d array of weights",
"docstring_tokens": [
"1D",
"array",
"of",
"averaged",
"data_models",
"1d",
"array",
"of",
"weights"
],
"type": null
}
],
"... |
097d9b8a07191009a4e2f628d61ae819299cc2f9 | ska-telescope/algorithm-reference-library | processing_library/util/array_functions.py | [
"Apache-2.0"
] | Python | average_chunks | <not_specific> | def average_chunks(arr, wts, chunksize):
""" Average the array arr with weights by chunks
Array len does not have to be multiple of chunksize
This version is optimised for plain numpy. It is roughly ten times faster that average_chunks_jit when used
without numba jit. It cannot (yet) be used with ... | Average the array arr with weights by chunks
Array len does not have to be multiple of chunksize
This version is optimised for plain numpy. It is roughly ten times faster that average_chunks_jit when used
without numba jit. It cannot (yet) be used with numba because the add.reduceat is not support in... | Average the array arr with weights by chunks
Array len does not have to be multiple of chunksize
This version is optimised for plain numpy. It is roughly ten times faster that average_chunks_jit when used
without numba jit. It cannot (yet) be used with numba because the add.reduceat is not support in numba
0.31 | [
"Average",
"the",
"array",
"arr",
"with",
"weights",
"by",
"chunks",
"Array",
"len",
"does",
"not",
"have",
"to",
"be",
"multiple",
"of",
"chunksize",
"This",
"version",
"is",
"optimised",
"for",
"plain",
"numpy",
".",
"It",
"is",
"roughly",
"ten",
"times"... | def average_chunks(arr, wts, chunksize):
if chunksize <= 1:
return arr, wts
mask = numpy.zeros(((len(arr)-1)//chunksize + 1, arr.shape[0]), dtype=bool)
for enumerate_id,i in enumerate(range(0, len(arr), chunksize)):
mask[enumerate_id,i:i+chunksize]=1
chunks = mask.dot(wts*arr)
weight... | [
"def",
"average_chunks",
"(",
"arr",
",",
"wts",
",",
"chunksize",
")",
":",
"if",
"chunksize",
"<=",
"1",
":",
"return",
"arr",
",",
"wts",
"mask",
"=",
"numpy",
".",
"zeros",
"(",
"(",
"(",
"len",
"(",
"arr",
")",
"-",
"1",
")",
"//",
"chunksiz... | Average the array arr with weights by chunks
Array len does not have to be multiple of chunksize | [
"Average",
"the",
"array",
"arr",
"with",
"weights",
"by",
"chunks",
"Array",
"len",
"does",
"not",
"have",
"to",
"be",
"multiple",
"of",
"chunksize"
] | [
"\"\"\" Average the array arr with weights by chunks\n\n Array len does not have to be multiple of chunksize\n \n This version is optimised for plain numpy. It is roughly ten times faster that average_chunks_jit when used\n without numba jit. It cannot (yet) be used with numba because the add.reduceat i... | [
{
"param": "arr",
"type": null
},
{
"param": "wts",
"type": null
},
{
"param": "chunksize",
"type": null
}
] | {
"returns": [
{
"docstring": "1D array of averaged data_models, 1d array of weights",
"docstring_tokens": [
"1D",
"array",
"of",
"averaged",
"data_models",
"1d",
"array",
"of",
"weights"
],
"type": null
}
],
"... |
097d9b8a07191009a4e2f628d61ae819299cc2f9 | ska-telescope/algorithm-reference-library | processing_library/util/array_functions.py | [
"Apache-2.0"
] | Python | average_chunks2 | <not_specific> | def average_chunks2(arr, wts, chunksize):
""" Average the two dimensional array arr with weights by chunks
Array len does not have to be multiple of chunksize.
:param arr: 2D array of values
:param wts: 2D array of weights
:param chunksize: 2-tuple of averaging region e.g. (2,3)
:return: 2... | Average the two dimensional array arr with weights by chunks
Array len does not have to be multiple of chunksize.
:param arr: 2D array of values
:param wts: 2D array of weights
:param chunksize: 2-tuple of averaging region e.g. (2,3)
:return: 2D array of averaged data_models, 2d array of weig... | Average the two dimensional array arr with weights by chunks
Array len does not have to be multiple of chunksize. | [
"Average",
"the",
"two",
"dimensional",
"array",
"arr",
"with",
"weights",
"by",
"chunks",
"Array",
"len",
"does",
"not",
"have",
"to",
"be",
"multiple",
"of",
"chunksize",
"."
] | def average_chunks2(arr, wts, chunksize):
wts = wts.reshape(arr.shape)
l0 = len(average_chunks(arr[:, 0], wts[:, 0], chunksize[0])[0])
l1 = len(average_chunks(arr[0, :], wts[0, :], chunksize[1])[0])
tempchunks = numpy.zeros([arr.shape[0], l1], dtype=arr.dtype)
tempwt = numpy.zeros([arr.shape[0], l1]... | [
"def",
"average_chunks2",
"(",
"arr",
",",
"wts",
",",
"chunksize",
")",
":",
"wts",
"=",
"wts",
".",
"reshape",
"(",
"arr",
".",
"shape",
")",
"l0",
"=",
"len",
"(",
"average_chunks",
"(",
"arr",
"[",
":",
",",
"0",
"]",
",",
"wts",
"[",
":",
... | Average the two dimensional array arr with weights by chunks
Array len does not have to be multiple of chunksize. | [
"Average",
"the",
"two",
"dimensional",
"array",
"arr",
"with",
"weights",
"by",
"chunks",
"Array",
"len",
"does",
"not",
"have",
"to",
"be",
"multiple",
"of",
"chunksize",
"."
] | [
"\"\"\" Average the two dimensional array arr with weights by chunks\n\n Array len does not have to be multiple of chunksize.\n \n :param arr: 2D array of values\n :param wts: 2D array of weights\n :param chunksize: 2-tuple of averaging region e.g. (2,3)\n :return: 2D array of averaged data_models... | [
{
"param": "arr",
"type": null
},
{
"param": "wts",
"type": null
},
{
"param": "chunksize",
"type": null
}
] | {
"returns": [
{
"docstring": "2D array of averaged data_models, 2d array of weights",
"docstring_tokens": [
"2D",
"array",
"of",
"averaged",
"data_models",
"2d",
"array",
"of",
"weights"
],
"type": null
}
],
"... |
097d9b8a07191009a4e2f628d61ae819299cc2f9 | ska-telescope/algorithm-reference-library | processing_library/util/array_functions.py | [
"Apache-2.0"
] | Python | insert_array | <not_specific> | def insert_array(im, x, y, flux, bandwidth=1.0, support=7, insert_function=insert_function_L):
""" Insert point into image using specified function
:param im: Image
:param x: x in float pixels
:param y: y in float pixels
:param flux: Flux[nchan, npol]
:param bandwidth: Support of data in uv... | Insert point into image using specified function
:param im: Image
:param x: x in float pixels
:param y: y in float pixels
:param flux: Flux[nchan, npol]
:param bandwidth: Support of data in uv plane
:param support: Support of function in image space
:param insert_function: insert_funct... | Insert point into image using specified function | [
"Insert",
"point",
"into",
"image",
"using",
"specified",
"function"
] | def insert_array(im, x, y, flux, bandwidth=1.0, support=7, insert_function=insert_function_L):
nchan, npol, ny, nx = im.shape
intx = int(numpy.round(x))
inty = int(numpy.round(y))
fracx = x - intx
fracy = y - inty
gridx = numpy.arange(-support, support)
gridy = numpy.arange(-support, support... | [
"def",
"insert_array",
"(",
"im",
",",
"x",
",",
"y",
",",
"flux",
",",
"bandwidth",
"=",
"1.0",
",",
"support",
"=",
"7",
",",
"insert_function",
"=",
"insert_function_L",
")",
":",
"nchan",
",",
"npol",
",",
"ny",
",",
"nx",
"=",
"im",
".",
"shap... | Insert point into image using specified function | [
"Insert",
"point",
"into",
"image",
"using",
"specified",
"function"
] | [
"\"\"\" Insert point into image using specified function\n \n :param im: Image\n :param x: x in float pixels\n :param y: y in float pixels\n :param flux: Flux[nchan, npol]\n :param bandwidth: Support of data in uv plane\n :param support: Support of function in image space\n :param insert_fun... | [
{
"param": "im",
"type": null
},
{
"param": "x",
"type": null
},
{
"param": "y",
"type": null
},
{
"param": "flux",
"type": null
},
{
"param": "bandwidth",
"type": null
},
{
"param": "support",
"type": null
},
{
"param": "insert_function",
... | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "im",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
"i... |
8fbbe2e4ee092ee6d6ab9b91cdab67c7d1d4a0db | ska-telescope/algorithm-reference-library | processing_components/calibration/pointing.py | [
"Apache-2.0"
] | Python | create_pointingtable_from_blockvisibility | PointingTable | def create_pointingtable_from_blockvisibility(vis: BlockVisibility, pointing_frame='azel', timeslice=None,
frequencyslice: float = None, **kwargs) -> PointingTable:
""" Create pointing table from visibility.
This makes an empty pointing table consistent with th... | Create pointing table from visibility.
This makes an empty pointing table consistent with the BlockVisibility.
:param vis: BlockVisibilty
:param timeslice: Time interval between solutions (s)
:param frequency_width: Frequency solution width (Hz)
:return: PointingTable
| Create pointing table from visibility.
This makes an empty pointing table consistent with the BlockVisibility. | [
"Create",
"pointing",
"table",
"from",
"visibility",
".",
"This",
"makes",
"an",
"empty",
"pointing",
"table",
"consistent",
"with",
"the",
"BlockVisibility",
"."
] | def create_pointingtable_from_blockvisibility(vis: BlockVisibility, pointing_frame='azel', timeslice=None,
frequencyslice: float = None, **kwargs) -> PointingTable:
assert isinstance(vis, BlockVisibility), "vis is not a BlockVisibility: %r" % vis
nants = vis.nants
... | [
"def",
"create_pointingtable_from_blockvisibility",
"(",
"vis",
":",
"BlockVisibility",
",",
"pointing_frame",
"=",
"'azel'",
",",
"timeslice",
"=",
"None",
",",
"frequencyslice",
":",
"float",
"=",
"None",
",",
"**",
"kwargs",
")",
"->",
"PointingTable",
":",
"... | Create pointing table from visibility. | [
"Create",
"pointing",
"table",
"from",
"visibility",
"."
] | [
"\"\"\" Create pointing table from visibility.\n \n This makes an empty pointing table consistent with the BlockVisibility.\n \n :param vis: BlockVisibilty\n :param timeslice: Time interval between solutions (s)\n :param frequency_width: Frequency solution width (Hz)\n :return: PointingTable\n ... | [
{
"param": "vis",
"type": "BlockVisibility"
},
{
"param": "pointing_frame",
"type": null
},
{
"param": "timeslice",
"type": null
},
{
"param": "frequencyslice",
"type": "float"
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "vis",
"type": "BlockVisibility",
"docstring": null,
"docstring_tokens": [
"None"
],
"default": ... |
8fbbe2e4ee092ee6d6ab9b91cdab67c7d1d4a0db | ska-telescope/algorithm-reference-library | processing_components/calibration/pointing.py | [
"Apache-2.0"
] | Python | copy_pointingtable | <not_specific> | def copy_pointingtable(pt: PointingTable, zero=False):
"""Copy a PointingTable
Performs a deepcopy of the data array
"""
if pt is None:
return pt
assert isinstance(pt, PointingTable), pt
newpt = copy.copy(pt)
newpt.data = copy.deepcopy(pt.data)
if zero:
ne... | Copy a PointingTable
Performs a deepcopy of the data array
| Copy a PointingTable
Performs a deepcopy of the data array | [
"Copy",
"a",
"PointingTable",
"Performs",
"a",
"deepcopy",
"of",
"the",
"data",
"array"
] | def copy_pointingtable(pt: PointingTable, zero=False):
if pt is None:
return pt
assert isinstance(pt, PointingTable), pt
newpt = copy.copy(pt)
newpt.data = copy.deepcopy(pt.data)
if zero:
newpt.data['pt'][...] = 0.0
return newpt | [
"def",
"copy_pointingtable",
"(",
"pt",
":",
"PointingTable",
",",
"zero",
"=",
"False",
")",
":",
"if",
"pt",
"is",
"None",
":",
"return",
"pt",
"assert",
"isinstance",
"(",
"pt",
",",
"PointingTable",
")",
",",
"pt",
"newpt",
"=",
"copy",
".",
"copy"... | Copy a PointingTable
Performs a deepcopy of the data array | [
"Copy",
"a",
"PointingTable",
"Performs",
"a",
"deepcopy",
"of",
"the",
"data",
"array"
] | [
"\"\"\"Copy a PointingTable\n\n Performs a deepcopy of the data array\n \"\"\""
] | [
{
"param": "pt",
"type": "PointingTable"
},
{
"param": "zero",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "pt",
"type": "PointingTable",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "zero",
"type": null,
"docstring": null,
"docstring_t... |
8fbbe2e4ee092ee6d6ab9b91cdab67c7d1d4a0db | ska-telescope/algorithm-reference-library | processing_components/calibration/pointing.py | [
"Apache-2.0"
] | Python | create_pointingtable_from_rows | PointingTable | def create_pointingtable_from_rows(pt: PointingTable, rows: numpy.ndarray, makecopy=True) -> PointingTable:
""" Create a PointingTable from selected rows
:param pt: PointingTable
:param rows: Boolean array of row selection
:param makecopy: Make a deep copy (True)
:return: PointingTable
"""
... | Create a PointingTable from selected rows
:param pt: PointingTable
:param rows: Boolean array of row selection
:param makecopy: Make a deep copy (True)
:return: PointingTable
| Create a PointingTable from selected rows | [
"Create",
"a",
"PointingTable",
"from",
"selected",
"rows"
] | def create_pointingtable_from_rows(pt: PointingTable, rows: numpy.ndarray, makecopy=True) -> PointingTable:
if rows is None or numpy.sum(rows) == 0:
return None
assert len(rows) == pt.ntimes, "Lenpth of rows does not agree with lenpth of PointingTable"
assert isinstance(pt, PointingTable), pt
if... | [
"def",
"create_pointingtable_from_rows",
"(",
"pt",
":",
"PointingTable",
",",
"rows",
":",
"numpy",
".",
"ndarray",
",",
"makecopy",
"=",
"True",
")",
"->",
"PointingTable",
":",
"if",
"rows",
"is",
"None",
"or",
"numpy",
".",
"sum",
"(",
"rows",
")",
"... | Create a PointingTable from selected rows | [
"Create",
"a",
"PointingTable",
"from",
"selected",
"rows"
] | [
"\"\"\" Create a PointingTable from selected rows\n\n :param pt: PointingTable\n :param rows: Boolean array of row selection\n :param makecopy: Make a deep copy (True)\n :return: PointingTable\n \"\"\""
] | [
{
"param": "pt",
"type": "PointingTable"
},
{
"param": "rows",
"type": "numpy.ndarray"
},
{
"param": "makecopy",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "pt",
"type": "PointingTable",
"docstring": null,
"docstring_tokens": [
"None"
],
"default": nul... |
8fbbe2e4ee092ee6d6ab9b91cdab67c7d1d4a0db | ska-telescope/algorithm-reference-library | processing_components/calibration/pointing.py | [
"Apache-2.0"
] | Python | qa_pointingtable | QA | def qa_pointingtable(pt: PointingTable, context=None) -> QA:
"""Assess the quality of a pointingtable
:param pt:
:return: AQ
"""
apt = numpy.abs(pt.pointing[pt.weight > 0.0])
ppt = numpy.angle(pt.pointing[pt.weight > 0.0])
data = {'shape': pt.pointing.shape,
'maxabs-amp': numpy.... | Assess the quality of a pointingtable
:param pt:
:return: AQ
| Assess the quality of a pointingtable | [
"Assess",
"the",
"quality",
"of",
"a",
"pointingtable"
] | def qa_pointingtable(pt: PointingTable, context=None) -> QA:
apt = numpy.abs(pt.pointing[pt.weight > 0.0])
ppt = numpy.angle(pt.pointing[pt.weight > 0.0])
data = {'shape': pt.pointing.shape,
'maxabs-amp': numpy.max(apt),
'minabs-amp': numpy.min(apt),
'rms-amp': numpy.std(... | [
"def",
"qa_pointingtable",
"(",
"pt",
":",
"PointingTable",
",",
"context",
"=",
"None",
")",
"->",
"QA",
":",
"apt",
"=",
"numpy",
".",
"abs",
"(",
"pt",
".",
"pointing",
"[",
"pt",
".",
"weight",
">",
"0.0",
"]",
")",
"ppt",
"=",
"numpy",
".",
... | Assess the quality of a pointingtable | [
"Assess",
"the",
"quality",
"of",
"a",
"pointingtable"
] | [
"\"\"\"Assess the quality of a pointingtable\n\n :param pt:\n :return: AQ\n \"\"\""
] | [
{
"param": "pt",
"type": "PointingTable"
},
{
"param": "context",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "pt",
"type": "PointingTable",
"docstring": null,
"docstring_tokens": [
"None"
],
"default": nul... |
47537e806e0cd733602ac736084dcfbdf77bf04b | ska-telescope/algorithm-reference-library | data_models/polarisation.py | [
"Apache-2.0"
] | Python | correlate_polarisation | <not_specific> | def correlate_polarisation(rec_frame: ReceptorFrame):
""" Gives the polarisation frame corresponding to a receptor frame
:param rec_frame: Receptor frame
:return: PolarisationFrame
"""
if rec_frame == ReceptorFrame("circular"):
correlation = PolarisationFrame("circular")
elif rec_frame ... | Gives the polarisation frame corresponding to a receptor frame
:param rec_frame: Receptor frame
:return: PolarisationFrame
| Gives the polarisation frame corresponding to a receptor frame | [
"Gives",
"the",
"polarisation",
"frame",
"corresponding",
"to",
"a",
"receptor",
"frame"
] | def correlate_polarisation(rec_frame: ReceptorFrame):
if rec_frame == ReceptorFrame("circular"):
correlation = PolarisationFrame("circular")
elif rec_frame == ReceptorFrame("linear"):
correlation = PolarisationFrame("linear")
elif rec_frame == ReceptorFrame("stokesI"):
correlation = ... | [
"def",
"correlate_polarisation",
"(",
"rec_frame",
":",
"ReceptorFrame",
")",
":",
"if",
"rec_frame",
"==",
"ReceptorFrame",
"(",
"\"circular\"",
")",
":",
"correlation",
"=",
"PolarisationFrame",
"(",
"\"circular\"",
")",
"elif",
"rec_frame",
"==",
"ReceptorFrame",... | Gives the polarisation frame corresponding to a receptor frame | [
"Gives",
"the",
"polarisation",
"frame",
"corresponding",
"to",
"a",
"receptor",
"frame"
] | [
"\"\"\" Gives the polarisation frame corresponding to a receptor frame\n\n :param rec_frame: Receptor frame\n :return: PolarisationFrame\n \"\"\""
] | [
{
"param": "rec_frame",
"type": "ReceptorFrame"
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "rec_frame",
"type": "ReceptorFrame",
"docstring": null,
"docstring_tokens": [
"None"
],
"defaul... |
9717b5aa6e4cedfc154dee72eafdcda96a005dc8 | ska-telescope/algorithm-reference-library | tests/processing_components/test_export_ms.py | [
"Apache-2.0"
] | Python | __initData | <not_specific> | def __initData(self):
"""Private function to generate a random set of data for writing a UVFITS
file. The data is returned as a dictionary with keys:
* freq - frequency array in Hz
* site - Observatory object
* stands - array of stand numbers
* bl - list of baseline ... | Private function to generate a random set of data for writing a UVFITS
file. The data is returned as a dictionary with keys:
* freq - frequency array in Hz
* site - Observatory object
* stands - array of stand numbers
* bl - list of baseline pairs in real stand numbers
... | Private function to generate a random set of data for writing a UVFITS
file. | [
"Private",
"function",
"to",
"generate",
"a",
"random",
"set",
"of",
"data",
"for",
"writing",
"a",
"UVFITS",
"file",
"."
] | def __initData(self):
if run_ms_tests == False:
return
freq = numpy.arange(0,512)*20e6/512 + 40e6
channel_width = numpy.full_like(freq,20e6/512.)
obs = EarthLocation(lon="116.76444824", lat="-26.824722084", height=300.0)
mount = numpy.array(['equat','equat','equat','e... | [
"def",
"__initData",
"(",
"self",
")",
":",
"if",
"run_ms_tests",
"==",
"False",
":",
"return",
"freq",
"=",
"numpy",
".",
"arange",
"(",
"0",
",",
"512",
")",
"*",
"20e6",
"/",
"512",
"+",
"40e6",
"channel_width",
"=",
"numpy",
".",
"full_like",
"("... | Private function to generate a random set of data for writing a UVFITS
file. | [
"Private",
"function",
"to",
"generate",
"a",
"random",
"set",
"of",
"data",
"for",
"writing",
"a",
"UVFITS",
"file",
"."
] | [
"\"\"\"Private function to generate a random set of data for writing a UVFITS\n file. The data is returned as a dictionary with keys:\n * freq - frequency array in Hz\n * site - Observatory object\n * stands - array of stand numbers\n * bl - list of baseline pairs in real sta... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
9717b5aa6e4cedfc154dee72eafdcda96a005dc8 | ska-telescope/algorithm-reference-library | tests/processing_components/test_export_ms.py | [
"Apache-2.0"
] | Python | __initData_WGS84 | <not_specific> | def __initData_WGS84(self):
"""Private function to generate a random set of data for writing a Measurements
file. The data is returned as a dictionary with keys:
* freq - frequency array in Hz
* site - observatory object
* stands - array of stand numbers
* bl - list ... | Private function to generate a random set of data for writing a Measurements
file. The data is returned as a dictionary with keys:
* freq - frequency array in Hz
* site - observatory object
* stands - array of stand numbers
* bl - list of baseline pairs in real stand numbers... | Private function to generate a random set of data for writing a Measurements
file. | [
"Private",
"function",
"to",
"generate",
"a",
"random",
"set",
"of",
"data",
"for",
"writing",
"a",
"Measurements",
"file",
"."
] | def __initData_WGS84(self):
if run_ms_tests == False:
return
freq = numpy.arange(0, 512) * 20e6 / 512 + 40e6
channel_width = numpy.full_like(freq, 20e6 / 512.)
obs = EarthLocation(lon="+116.6356824", lat="-26.70130064", height=377.0)
names = numpy.array(['A%02d' % i f... | [
"def",
"__initData_WGS84",
"(",
"self",
")",
":",
"if",
"run_ms_tests",
"==",
"False",
":",
"return",
"freq",
"=",
"numpy",
".",
"arange",
"(",
"0",
",",
"512",
")",
"*",
"20e6",
"/",
"512",
"+",
"40e6",
"channel_width",
"=",
"numpy",
".",
"full_like",... | Private function to generate a random set of data for writing a Measurements
file. | [
"Private",
"function",
"to",
"generate",
"a",
"random",
"set",
"of",
"data",
"for",
"writing",
"a",
"Measurements",
"file",
"."
] | [
"\"\"\"Private function to generate a random set of data for writing a Measurements\n file. The data is returned as a dictionary with keys:\n * freq - frequency array in Hz\n * site - observatory object\n * stands - array of stand numbers\n * bl - list of baseline pairs in re... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.