-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from LCOGT/feature/line-analysis-backend
Analysis Actions and Line Profile
- Loading branch information
Showing
4 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from skimage.measure import profile_line | ||
|
||
from datalab.datalab_session.util import scale_points | ||
|
||
# For creating an array of brightness along a user drawn line | ||
def line_profile(input: dict, sci_hdu: object): | ||
""" | ||
Creates an array of luminosity values and the length of the line in arcseconds | ||
""" | ||
points = scale_points(input['width'], input['height'], sci_hdu.data, [(input["x1"], input["y1"]), (input["x2"], input["y2"])]) | ||
line_profile = profile_line(sci_hdu.data, points[0], points[1], mode="constant", cval=-1) | ||
arcsec = len(line_profile) * sci_hdu.header["PIXSCALE"] | ||
|
||
return {"line_profile": line_profile, "arcsec": arcsec} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters