Skip to content

Commit

Permalink
API Change: Size now refers to size of grid not size of square
Browse files Browse the repository at this point in the history
This makes it more intuitive as to how it works. To create a grid size of 100x100 now, pass a rebin_size parameter of 100, the square siz will be calculated automatically to cover that correctly.
  • Loading branch information
jacobbieker committed Nov 26, 2018
1 parent 47f562e commit a63dc0e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions factnn/data/preprocess/base_preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,17 @@ def generate_rebinning(self, size):
hexagon = MultiPoint([p1, p2, p3, p4, p5, p6]).convex_hull

square_start = 186
square_size = size

steps = size # Now size of 100 should make a 100x100 grid

square_size = np.abs(square_start * 2 / steps) # Now this is the size of the grid

square = Polygon([(-square_start, square_start), (-square_start + square_size, square_start),
(-square_start + square_size, square_start - square_size),
(-square_start, square_start - square_size),
(-square_start, square_start)])

list_of_squares = [square]
steps = int(np.ceil(np.abs(square_start * 2) / square_size))

pixel_index_to_grid = {}
pix_index = 0
Expand Down

0 comments on commit a63dc0e

Please sign in to comment.