Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] created identify_target function #41

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion astropy_helpers
30 changes: 30 additions & 0 deletions specreduce/target_identify.py
Original file line number Diff line number Diff line change
@@ -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.