Skip to content

Commit

Permalink
Add parameter nrings to LCB acquisition (fixes #234)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiopasra committed Feb 26, 2019
1 parent 0400606 commit c32dd68
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions megaradrp/recipes/auxiliary/acquisitionlcb.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2011-2018 Universidad Complutense de Madrid
# Copyright 2011-2019 Universidad Complutense de Madrid
#
# This file is part of Megara DRP
#
Expand All @@ -16,6 +16,7 @@
from scipy.spatial import KDTree

from numina.core import Product, Parameter
from numina.core.validator import range_validator
from numina.constants import FWHM_G

from megaradrp.recipes.scientific.base import ImageRecipe
Expand Down Expand Up @@ -65,6 +66,8 @@ class AcquireLCBRecipe(ImageRecipe):

# Requirements are defined in base class
points = Parameter([(0, 0)], "Coordinates")
nrings = Parameter(3, "Number of rings to extract the star",
validator=range_validator(minval=1))
extraction_region = Parameter(
[1000, 3000],
description='Region used to compute a mean flux',
Expand Down Expand Up @@ -130,11 +133,10 @@ def run(self, rinput):
# query using radius instead
# radius = 1.2
# kdtree.query_ball_point(points, k=7, r=radius)
self.logger.debug('adding %d nrings', rinput.nrings)
npoints = 1 + 3 * rinput.nrings * (rinput.nrings + 1)
self.logger.debug('adding %d fibers', npoints)

npoints = 19 + 18
# 1 + 6 for first ring
# 1 + 6 + 12 for second ring
# 1 + 6 + 12 + 18 for third ring
dis_p, idx_p = kdtree.query(points, k=npoints)

self.logger.info('Using %d nearest fibers', npoints)
Expand Down

0 comments on commit c32dd68

Please sign in to comment.