Skip to content

Commit

Permalink
add tests for rotation (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
ismael-mendoza authored and thuiop committed Mar 8, 2023
1 parent a110c15 commit 53589f8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,28 @@ def test_shear_draw():
apply_shear=True,
)
next(draw_generator)


def test_rotation():
stamp_size = 24.0
seed = 0
catalog_name = "data/sample_input_catalog.fits"
catalog = btk.catalog.CatsimCatalog.from_file(catalog_name)
sampling_function_shear = btk.sampling_functions.DefaultSampling(
stamp_size=stamp_size, seed=seed, max_number=3, min_number=1
)
survey = btk.survey.get_surveys("LSST")
draw_generator = btk.draw_blends.CatsimGenerator(
catalog,
sampling_function_shear,
survey,
batch_size=10,
stamp_size=stamp_size,
cpus=1,
add_noise="all",
seed=seed,
augment_data=True,
)
blend_results = next(draw_generator)
rotation = blend_results["blend_list"][0]["btk_rotation"]
assert np.all(0 <= rotation) and np.all(rotation <= 360)

0 comments on commit 53589f8

Please sign in to comment.