Skip to content

Commit

Permalink
Modernize wcs and fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
thuiop committed Jul 15, 2021
1 parent 394523a commit 2bf6651
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion btk/draw_blends.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def get_center_in_pixels(blend_catalog, wcs):
Returns:
`astropy.table.Column`: x and y coordinates of object centroid
"""
x_peak, y_peak = wcs.all_world2pix(blend_catalog["ra"] / 3600, blend_catalog["dec"] / 3600, 0)
x_peak, y_peak = wcs.world_to_pixel_values(
blend_catalog["ra"] / 3600, blend_catalog["dec"] / 3600
)
dx_col = Column(x_peak, name="x_peak")
dy_col = Column(y_peak, name="y_peak")
return dx_col, dy_col
Expand Down
2 changes: 1 addition & 1 deletion tests/test_draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test_default(self, mock_show):
self.match_background_noise(draw_output["blend_images"])

def test_basic_sampling(self):
sampling_function = btk.sampling_functions.BasicSamplingFunction()
sampling_function = btk.sampling_functions.BasicSampling()
draw_generator = get_draw_generator(
fixed_parameters=True, sampling_function=sampling_function
)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_group_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from btk.catalog import CatsimCatalog
from btk.draw_blends import CatsimGenerator
from btk.sampling_functions import GroupSamplingFunctionNumbered
from btk.sampling_functions import GroupSamplingNumbered
from btk.survey import get_surveys


Expand All @@ -18,7 +18,7 @@ def get_group_sampling_draw_generator(batch_size=3):
pixel_scale = 0.2
shift = [0.8, -0.7]
catalog = CatsimCatalog.from_file(catalog_name)
sampling_function = GroupSamplingFunctionNumbered(
sampling_function = GroupSamplingNumbered(
max_number, wld_catalog_name, stamp_size, pixel_scale, shift=shift
)
draw_blend_generator = CatsimGenerator(
Expand Down

0 comments on commit 2bf6651

Please sign in to comment.