Exemple #1
0
def test__parallel_eper_size_to_array_edge():

    layout = ac.ci.Layout2DCI(
        shape_2d=(5, 100), region_list=[ac.Region2D(region=(0, 3, 0, 3))]
    )

    assert layout.parallel_rows_to_array_edge == 2

    layout = ac.ci.Layout2DCI(
        shape_2d=(7, 100), region_list=[ac.Region2D(region=(0, 3, 0, 3))]
    )

    assert layout.parallel_rows_to_array_edge == 4

    layout = ac.ci.Layout2DCI(
        shape_2d=(15, 100),
        region_list=[
            ac.Region2D(region=(0, 2, 0, 3)),
            ac.Region2D(region=(5, 8, 0, 3)),
            ac.Region2D(region=(11, 14, 0, 3)),
        ],
    )

    assert layout.parallel_rows_to_array_edge == 1

    layout = ac.ci.Layout2DCI(
        shape_2d=(20, 100),
        region_list=[
            ac.Region2D(region=(0, 2, 0, 3)),
            ac.Region2D(region=(5, 8, 0, 3)),
            ac.Region2D(region=(11, 14, 0, 3)),
        ],
    )

    assert layout.parallel_rows_to_array_edge == 6
Exemple #2
0
def test__with_extracted_regions__region_list_are_extracted_correctly():

    layout = ac.ci.Layout2DCI(shape_2d=(5, 3), region_list=[(0, 2, 0, 2)])

    layout_extracted = layout.with_extracted_regions(
        extraction_region=ac.Region2D((0, 2, 0, 2))
    )

    assert layout_extracted.region_list == [(0, 2, 0, 2)]

    layout_extracted = layout.with_extracted_regions(
        extraction_region=ac.Region2D((0, 1, 0, 1))
    )

    assert layout_extracted.region_list == [(0, 1, 0, 1)]

    layout = ac.ci.Layout2DCI(
        shape_2d=(10, 5), region_list=[(2, 4, 2, 4), (0, 1, 0, 1)]
    )

    layout_extracted = layout.with_extracted_regions(
        extraction_region=ac.Region2D((0, 3, 0, 3))
    )

    assert layout_extracted.region_list == [(2, 3, 2, 3), (0, 1, 0, 1)]

    layout_extracted = layout.with_extracted_regions(
        extraction_region=ac.Region2D((2, 5, 2, 5))
    )

    assert layout_extracted.region_list == [(0, 2, 0, 2)]

    layout_extracted = layout.with_extracted_regions(
        extraction_region=ac.Region2D((8, 9, 8, 9))
    )

    assert layout_extracted.region_list == None
Exemple #3
0
def test__serial_trails_pixels(layout_ci_7x7):

    layout = ac.ci.Layout2DCI(
        shape_2d=(10, 10),
        region_list=[(1, 2, 1, 2)],
        serial_overscan=ac.Region2D((0, 1, 0, 10)),
        serial_prescan=ac.Region2D((0, 1, 0, 1)),
        parallel_overscan=ac.Region2D((0, 1, 0, 1)),
    )

    assert layout.serial_eper_pixels == 10

    layout = ac.ci.Layout2DCI(
        shape_2d=(50, 50),
        region_list=[(1, 2, 1, 2)],
        serial_overscan=ac.Region2D((0, 1, 0, 50)),
        serial_prescan=ac.Region2D((0, 1, 0, 1)),
        parallel_overscan=ac.Region2D((0, 1, 0, 1)),
    )

    assert layout.serial_eper_pixels == 50
dataset_name = "serial_x3"
"""
Returns the path where the dataset will be output, which in this case is
'/autocti_workspace/dataset/imaging_ci/uniform/serial_x3'
"""
dataset_path = path.join("dataset", dataset_type, dataset_label, dataset_name)
"""
__Layout__

The 2D shape of the image.
"""
shape_native = (2000, 100)
"""
The locations (using NumPy array indexes) of the parallel overscan, serial prescan and serial overscan on the image.
"""
parallel_overscan = ac.Region2D((1980, 2000, 5, 95))
serial_prescan = ac.Region2D((0, 2000, 0, 5))
serial_overscan = ac.Region2D((0, 1980, 95, 100))
"""
Specify the charge injection regions on the CCD, which in this case is 5 equally spaced rectangular blocks.
"""
regions_list = [
    (0, 200, serial_prescan[3], serial_overscan[2]),
    (400, 600, serial_prescan[3], serial_overscan[2]),
    (800, 1000, serial_prescan[3], serial_overscan[2]),
    (1200, 1400, serial_prescan[3], serial_overscan[2]),
    (1600, 1800, serial_prescan[3], serial_overscan[2]),
]
"""
The normalization of every charge injection image, which determines how many images are simulated.
"""