天文图像线性特征检测器
lfd的Python项目详细描述
线性特征检测器
|文档
线性特征检测器(LFD)库是一个包集合,它支持 用户检测和分析天文图像上的线性特征。代码是 设计为交互运行,或在集群上按比例运行 目标SDSS测量数据和其中的流星轨迹。
LFD是一个更完整的LFD版本,包含所有从未发布的 LFD的特点。除了detecttrails中的线性特征检测码 模块中,大多数lfds代码是从头开始重新编码的,并与 python 3和opencv3.0。您可以在此处找到旧的LFDS代码。
_这里:https://github.com/dinobektesevic/lfda
安装
通过运行从pip安装
代码块::bash
pip安装lfd
或者在本地克隆它并使用requirements.txt
从
可以运行lfd
代码块::bash
git克隆https://github.com/dinobektesevic/lfd.git
进口LFD,快走。使用conda或
找不到numpy
的miniconda虚拟环境。那样的话
必须运行conda install numpy并对
正确安装LFD。
要求
主要要求如下
- 巨蟒3+
- opencv 3+
- 纽比1.11+
- scipy 0.19+
- 菲西奥0.9.7+
- SQLAlchemy 1.2.11+
- Erin Sheldon的esutil和sdsspy实用程序的部分与 提供的代码。某些代码可能已被更改
_ esutil:https://github.com/esheldon/sdsspy/ …_ sdsspy:https://github.com/esheldon/esutil
运行代码
阅读文档!它们包含许多示例。
默认情况下,lfd设置为使用sdss文件和目录结构。这个 虽然完全背离了sdss文件和 不支持现成的目录结构。
虽然数据有点少,但许多处理步骤仍然很熟练 描述于:
Bektesevic&Vinkovic,2017,MNRAS,1612.04748,天文测量线性特征检测算法-i.算法描述
要开始处理,请使用以下任一选项:
代码块::python
import lfd
lfd.setup_detecttrails("~/boss")
foo = lfd.detecttrails.DetectTrails(run=2888)
foo = lfd.detecttrails.DetectTrails(run=2888, camcol=1)
foo = lfd.detecttrails.DetectTrails(run=2888, camcol=1, filter='i')
foo = lfd.detecttrails.DetectTrails(run=2888, camcol=1, filter='i', field=139)
foo.process()
通过
代码块::python
foo.params_dim
foo.params_bright["debug"] = True
foo.params_removestars["filter_caps"]["i"] = 20
默认情况下,结果输出到文件路径results
提供的文件
设置为results.txt
。结果文件是一个csv文件,其中检测到
参数。结果模块提供了将这些csv文件解析为
为其提供sqlalchemy orm的数据库。
代码块::python
from lfd.results import Event, Frame, Point
from lfd import results
# create or connect to a database
results.connect2db("foo.db")
# populate it with data either from output of detecttrails
results.from_file("results.txt")
# or create mock data to play with
results.utils.create_test_sample()
# query on Event or Frame parameters fo a single or a collection of items
with results.session_scope() as s:
# returns all Events found on run 2888, but pick only one
e = s.query(Event).filter(Event.run=2888).first()
results.utils.deep_expunge(e)
# get a collection of frames
fquery = query.filter(Frame.t.iso > '2009-09-27 10:06:10.430')
f = fquery.all()
lfd.results.deep_expunge_all(f, s)
# create table like output
results.utils.pprint(f)
# manipulate them as OO objects and commit the changes back, f.e. move one
# of the points of the line somewhere else
e.p1 = Point(10, 10, camcol=5, filter='r')
# or just move one of P1(x1, y1), P2(x2, y2) line coordinates
e.y2 = 10
# see and work with the coordinates values in reference to the origin of
# the entire CCD array and not just individual CCDs within
e.p1.x
e.p1.switchCoordSys()
e.p1.x
# equivalent to
e.cx1 = 100
# find the points where the line corsses the individual CCD edges again and go there
e.snap2ccd()
# persist the changes to the DB
with results.session_scope() as s:
s.add(e)
s.commit()
实际上,lfd的设计目的是能够处理大量的数据。 它被用来处理整个图像的sdss数据库,使用费米 塞尔维亚贝尔格莱德天文台的星团。创造 编写了在集群easer createjobs模块上运行lfd的脚本。通过 默认情况下,它面向在特定集群上运行,但它应该 很容易适应任何太阳网格簇。
代码块::python
jobs = cj.Jobs(500)
jobs.create()
There are no runs to create jobs from.
Creating jobs for all runs in runlist.par file.
Creating:
765 jobs with 1 runs per job
Queue: standard
Wallclock: 24:00:00
Cputime: 48:00:00
Ppn: 3
Path: /home/user/Desktop/.../jobs
这当然是非常灵活的
代码块::python
运行数=[125992881447] "python3-c"将detecttrails导入为dt; x=dt.检测轨道($); x.params_bright['debug']=真; x.process()"" jobs=cj.jobs(2,runs=runs,camcol=1,filter='i',command=cmd) jobs.create()
所有重要参数被设定。LFD也 带有图形用户界面,用户可以通过该界面创建这些作业 通过mouseclicks,也可以使用提供的 特别设计的图像浏览器。
还提供了一个分析模块,通过它,理论流星廓线 可按中所述生成:
Bektesevic&Vinkovic等人2017年(arxiv:1707.07223)。
代码块::python
from lfd.analysis import profiles
point = profiles.PointSource(100)
seeing = profiles.GausKolmogorov(profiles.SDSSSEEING)
defocus = profiles.FluxPerAngle(100, *profiles.SDSS)
a = profiles.convolve(point, seeing, defocus)
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
profiles.plot_profiles(ax, (point, seeing, defocus, a))
plt.legend()
plt.show()
当然,所有这些只是对所有功能的快速概述。那里 有更多的细节描述这个和其他有用的实用程序,包括 通用功能的图形用户界面,由中的lfd提供 文档。
许可证
GNU GPLv3版权所有(c)2018 Dino Bektesevic
此程序是免费软件:您可以在 自由软件基金会公布的GNU通用公共许可证的条款, 许可证的第3版或(由您选择)任何更高版本。
这个程序的发布是希望它能有用,但是没有 保证;甚至没有对商品的适销性或适用性的暗示保证 特殊目的。有关详细信息,请参阅GNU通用公共许可证。
你应该收到一份GNU通用公共许可证的副本 程序。如果没有,请参见gnu.org/licenses
_许可证:https://www.gnu.org/licenses/gpl-3.0.en.html" rel="nofollow">https://www.gnu.org/licenses/gpl-3.0.en.html
|文档图片:https://readthedocs.org/projects/linear-feature-detector/badge/?版本=最新 :alt:文档状态 比例:100% :目标:https://linear-feature-detector.readthedocs.io/en/latest/?徽章=最新的