From bb41c2d1416cb2fa1137f58643ddd9400a3092b9 Mon Sep 17 00:00:00 2001 From: Simon Torres Date: Fri, 2 Aug 2019 13:01:55 -0400 Subject: [PATCH] created empty identify_target function to start discussion on specreduce --- astropy_helpers | 2 +- specreduce/target_identify.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 specreduce/target_identify.py diff --git a/astropy_helpers b/astropy_helpers index 6d5020f3..c55cb6da 160000 --- a/astropy_helpers +++ b/astropy_helpers @@ -1 +1 @@ -Subproject commit 6d5020f367d4956bb614e08b64ab44ef53d54dcd +Subproject commit c55cb6dae107c3a15e93887c76b673678de81e1a diff --git a/specreduce/target_identify.py b/specreduce/target_identify.py new file mode 100644 index 00000000..bdb18688 --- /dev/null +++ b/specreduce/target_identify.py @@ -0,0 +1,30 @@ +from __future__ import (absolute_import, division, print_function, + unicode_literals) + + +import logging +import numpy as np +from scipy.stats import sigma_clip + + + +def identify_targets(data, nfind=1, axis=1, background_threshold=3, model_name='gaussian'): + + # assuming target is relatively well aligned with the spatial axis + spatial_profile = np.median(data, axis=axis) + + + # remove background + clipped_spatial_profile = sigma_clip() + + # identify peaks + + + # filter peaks + + + # construct model and fit + + + # return model or set of parameters such as target center, width. +