pycorrelator.tests package
pycorrelator.tests.test_catalog module
- class pycorrelator.tests.test_catalog.TestCatalog_InvalidInput(methodName='runTest')[source]
Bases:
TestCase
- class pycorrelator.tests.test_catalog.TestCatalog_RandomCheckInputOutput(methodName='runTest')[source]
Bases:
TestCase
pycorrelator.tests.test_chunk module
- class pycorrelator.tests.test_chunk.TestChunkGeneratorByGrid_coor2id_boundary(methodName='runTest')[source]
Bases:
TestCase
pycorrelator.tests.test_fof module
- class pycorrelator.tests.test_fof.TestCelestialGrouping(methodName='runTest')[source]
Bases:
TestCase
- class pycorrelator.tests.test_fof.TestCelestialGrouping_Random(methodName='runTest')[source]
Bases:
TestCase
- class pycorrelator.tests.test_fof.TestCelestialGrouping_RandomGrid(methodName='runTest')[source]
Bases:
TestCase
Unit test for a celestial objects grouping method.
The purpose of this unit test is to ensure that a celestial objects grouping method works correctly. A grid on the celestial sphere is created with a size of 10 deg. Half of the grid points are randomly selected, and for each selected point, several points are created within a 1 deg circle around it using the point_offset() function. These points, with the central point, become a ‘group’. The tested function is then called, and its output is checked against the expected groups. If there’s a discrepancy, the problematic group is printed.
- pycorrelator.tests.test_fof.check_group_match(expected_groups: list[list[tuple[float, float]]], output_groups)[source]
Check if two groups match.
- Parameters:
expected_groups (list[list[tuple[float, float]]]) – List of groups that are expected to be grouped correctly.
output_groups (list[list[tuple[float, float]]]) – List of groups that are output by the tested function.
- Returns:
problematic_groups – List of groups that the tested function failed to group correctly. If the tested function works correctly, an empty list is returned.
- Return type:
list[list[tuple[float, float]]]
- pycorrelator.tests.test_fof.create_groups_from_grid(grid: list[tuple[float, float]], tolerance=1, seed=None, fraction=0.5, ring_radius=(0, 1)) tuple[list[list[tuple[float, float]]], ndarray[Any, dtype[_ScalarType_co]]] [source]
Randomly pick half of the grid points and create groups around them. For each selected grid point, use the point_offset() function to create several points within a tolerance (default 1 degree) circle around the central point. Returns a list of groups, where each group is a list of (RA, Dec) coordinates.
- pycorrelator.tests.test_fof.generate_celestial_grid(**kwargs) list[tuple[float, float]] [source]
Generate a grid on the celestial sphere with specified step sizes and bounds.
- Keyword Arguments:
ra_step (float) – Step size for Right Ascension (default: 10).
dec_step (float) – Step size for Declination (default: 10).
ra_offset (float) – Offset for RA (default: 0).
dec_offset (float) – Offset for DEC (default: 0).
ra_bounds (tuple) – A tuple containing the lower and upper bounds for RA (default: (0, 360)).
dec_bounds (tuple | float) – A tuple containing the lower and upper bounds for DEC (default: (-60, 60)). Can also be an absolute value which will be interpreted as (value, -value).
- Returns:
List of (RA, Dec) coordinates for the grid points.
- Return type:
list[tuple[float, float]]
pycorrelator.tests.test_result_xmatch module
pycorrelator.tests.test_toolbox_spherical module
- class pycorrelator.tests.test_toolbox_spherical.TestAngularDistance(methodName='runTest')[source]
Bases:
TestCase
- class pycorrelator.tests.test_toolbox_spherical.TestPointOffset(methodName='runTest')[source]
Bases:
TestCase
- class pycorrelator.tests.test_toolbox_spherical.TestPointOffsetExtremeCases(methodName='runTest')[source]
Bases:
TestCase