Skip to content

Commit

Permalink
rename "weighting-mode" to "extraction-mode"
Browse files Browse the repository at this point in the history
  • Loading branch information
leejjoon committed Mar 2, 2017
1 parent 41ccea8 commit 414b776
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions igrins/libs/apertures.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ def get_shifted_images(self, profile_map, variance_map,

return data, variance_map, profile_map, msk1

def extract_uniform_from_shifted(self, ordermap,
profile_map, variance_map,
data):
def extract_simple_from_shifted(self, ordermap,
profile_map, variance_map,
data):
"""
It assumes that bad pixels in the data and the variance_map are filled.
"""
Expand Down
16 changes: 8 additions & 8 deletions igrins/recipes/recipe_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def extractor_factory(recipe_name):
@argh.arg("--slit-profile-mode", choices=['auto','simple', "gauss", "gauss2d"],
default="auto")
@argh.arg("--subtract-interorder-background", default=False)
@argh.arg("--weighting-mode", choices=['auto','uniform', "optimal"],
@argh.arg("--extraction-mode", choices=['auto','simple', "optimal"],
default="auto")
@argh.arg("--n-process", default=1)
@argh.arg("--basename-postfix", default=None)
Expand Down Expand Up @@ -189,7 +189,7 @@ def __init__(self, utdate, refdate, config,
subtract_interorder_background=False,
conserve_2d_flux=False,
slit_profile_mode="auto",
weighting_mode="auto",
extraction_mode="auto",
n_process=1,
basename_postfix=None):
"""
Expand All @@ -216,7 +216,7 @@ def __init__(self, utdate, refdate, config,

self.slit_profile_mode = slit_profile_mode

self.weighting_mode = weighting_mode
self.extraction_mode = extraction_mode

self.n_process = n_process
self.basename_postfix = basename_postfix
Expand Down Expand Up @@ -579,9 +579,9 @@ def _extract_spec_using_profile(self, extractor,

s_list, v_list = _

if self.weighting_mode == "uniform":
if self.extraction_mode == "simple":

print "doing uniform extraction"
print "doing simple extraction"
synth_map = extractor.make_synth_map(
ap, profile_map, s_list,
ordermap=ordermap,
Expand All @@ -599,7 +599,7 @@ def _extract_spec_using_profile(self, extractor,
slitoffset_map,
debug=False)

_ = extractor.extract_spec_uniform(ap, shifted)
_ = extractor.extract_spec_simple(ap, shifted)
s_list, v_list = _

# regenerate synth_map using the new s_list, which will be saved.
Expand All @@ -609,7 +609,7 @@ def _extract_spec_using_profile(self, extractor,
slitpos_map=slitpos_map,
slitoffset_map=slitoffset_map)

elif self.weighting_mode in ["auto", "optimal"]:
elif self.extraction_mode in ["auto", "optimal"]:
pass
else:
raise RuntimeError("")
Expand Down Expand Up @@ -861,7 +861,7 @@ def profile(o, x, slitpos):
weight_thresh = None
remove_negative = False

_ = extractor.extract_spec_uniform(ap, shifted)
_ = extractor.extract_spec_simp(ap, shifted)
# _ = extractor.extract_spec_stellar(ap, shifted,
# weight_thresh,
# remove_negative)
Expand Down
10 changes: 5 additions & 5 deletions igrins/recipes/recipe_extract_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,12 +610,12 @@ def extract_spec_stellar(self, ap, shifted,

return s_list, v_list

def extract_spec_uniform(self, ap, shifted):
def extract_spec_simple(self, ap, shifted):

_ = ap.extract_uniform_from_shifted(self.ordermap,
shifted["profile_map"],
shifted["variance_map"],
shifted["data"])
_ = ap.extract_simple_from_shifted(self.ordermap,
shifted["profile_map"],
shifted["variance_map"],
shifted["data"])
s_list, v_list = _

return s_list, v_list
Expand Down

0 comments on commit 414b776

Please sign in to comment.