SEP
===
Python and C library for Source Extraction and Photometry
[![Build Status](http://img.shields.io/travis/kbarbary/sep.svg?style=flat-square&label=linux)](https://travis-ci.org/kbarbary/sep)
[![Build status](https://img.shields.io/appveyor/ci/kbarbary/sep.svg?style=flat-square&label=windows)](https://ci.appveyor.com/project/kbarbary/sep/branch/master)
[![PyPI](https://img.shields.io/pypi/v/sep.svg?style=flat-square)](https://pypi.python.org/pypi/sep)
*"... [it's] an SEP: Somebody Else's Problem."
"Oh, good. I can relax then."*
About
-----
[Source Extractor](http://www.astromatic.net/software/sextractor)
(Bertin & Arnouts 1996) is a widely used
command-line program for segmentation and analysis of astronomical
images. It reads in FITS format files, performs a configurable series
of tasks, including background estimation, source detection,
deblending and a wide array of source measurements, and finally
outputs a FITS format catalog file.
While Source Extractor is highly useful, the fact that it can only be
used as an executable can limit its applicability or lead to awkward
workflows. There is often a desire to have programmatic access to
perform one or more of the above tasks on in-memory images as part of
a larger custom analysis.
**SEP makes the core algorithms of Source Extractor available as a
library of stand-alone functions and classes.** These operate directly
on in-memory arrays (no FITS files or configuration files). The code
is derived from the Source Extractor code base (written in C) and aims
to produce results compatible with Source Extractor whenever possible.
SEP consists of a C library with no dependencies outside the standard
library, and a Python module that wraps the C library in a Pythonic
API. The Python wrapper operates on NumPy arrays with NumPy as its
only dependency. See below for language-specfic build and usage
instructions.
Python
------
**Documentation:** http://sep.readthedocs.io
**Requirements:**
- Tested on Python 2.6, 2.7, 3.3, 3.4, 3.5
- numpy
**Install release version:**
SEP can be installed with [pip](https://pip.pypa.io). After ensuring
that numpy is installed, run
```
pip install --no-deps sep
```
If you get an error about permissions, you are probably using your
system Python. In this case, I recommend using [pip's "user
install"](https://pip.pypa.io/en/latest/user_guide/#user-installs)
option to install sep into your user directory:
```
pip install --no-deps --user sep
```
Do **not** install sep or other third-party Python packages using
`sudo` unless you are fully aware of the risks.
**Install development version:**
Building the development version (from github) requires Cython (v0.16 or
higher). Build and install in the usual place:
```
./setup.py install
```
**Run tests:** Tests require the [pytest](http://pytest.org) Python
package. To run the tests, execute `./test.py` in the top-level
directory. Some tests require a FITS reader (either fitsio or astropy)
and will be skipped if neither is present.
C Library
---------
_Note: The build process only works on Linux and OS X._
**Build:** To build the C library from source:
```
make
```
**Run tests:**
```
make test
```
**Install** The static library and header can be installed with
```
make install
make PREFIX=/path/to/prefix install
```
This will install the shared and static library in `/path/to/prefix/lib`
and header file in `/path/to/prefix/include`. The default prefix is
`/usr/local`.
**API:** The C library API is documented in the header file
[sep.h](src/sep.h).
Contributing
------------
Report a bug or documentation issue: http://github.com/kbarbary/sep/issues
Development of SEP takes place on GitHub at
http://github.com/kbarbary/sep. Contributions of bug fixes,
documentation improvements and minor feature additions are welcome via
GitHub pull requests. For major features, it is best to open an issue
discussing the change first.
Citation
--------
If you use SEP in a publication, please cite the following DOI. The
link provides a variety of citation styles and BibTeX export.
[![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.61658.svg)](http://dx.doi.org/10.5281/zenodo.61658)
Please also cite the original Source Extractor paper ([Bertin & Arouts
1996](http://adsabs.harvard.edu/abs/1996A%26AS..117..393B)).
License
-------
The license for all parts of the code derived from Source Extractor is
LGPLv3. The license for code derived from photutils (`src/overlap.h`)
is BSD 3-clause. Finally, the license for the Python wrapper
(`sep.pyx`) is MIT. The license for the library as a whole is
therefore LGPLv3. The license for each file is explicitly stated at
the top of the file and the full text of each license can be found in
`licenses`.
FAQ
---
**Why isn't the C library part of Source Extractor?**
Source Extractor is *not* designed as a library with an
executable built on top of the library. In Source Extractor, background
estimation, object detection and photometry are deeply integrated into the
Source Extractor executable. Many changes to the code were necessary in
order to put the functionality in stand-alone C functions. It's too much
to ask of the Source Extractor developer to rewrite large parts of the
core of the Source Extractor program with little gain for the executable.
**What sort of changes?**
- Source Extractor reads in only a small portion of each image at a
time. This allows it to keep its memory footprint extremely low and
to operate on images that are much larger than the system's physical
memory. It also means that a FITS reader is deeply integrated into
the code. SEP operates on images in memory, so all the FITS I/O
machinery in Source Extractor is not used here.
- Error handling: When it encounters a problem, Source Extractor
immediately exits with an error message. This is fine for an
executable, but a library function doesn't have that luxury. Instead
it must ensure that allocated memory is freed and return an error
code.
- Options: Source Extractor has many options that affect its behavior. These
are stored in a global structure used throughout the executable. In SEP,
options for a particular function are passed as function parameters.
- Array types: Source Extractor can operate on FITS images containing various
types of data (float, double, int, etc). Internally, it does this by
converting all data to `float` immediately when reading from disk.
SEP does something similar, but in memory: SEP functions typically convert
input arrays to float on the fly within each function, then perform
all operations as floating point.
**Is SEP as fast as Source Extractor?**
It's fast. It should be similar to Source Extractor as a lot of the code
is identical. Source Extractor has the advantage of doing all the
operations (detection and analysis) simultaneously on each image
section, which may confer CPU cache advantages, but this hasn't been
tested at all. On the other hand, depending on your usage SEP might
let you avoid writing files to disk, which is likely to be a bigger
win.
**What happens when Source Extractor is updated in the future?**
SEP can be considered a fork of the Source Extractor code base: it's
development will not track that of Source Extractor in any automated
way. However, the algorithms implemented so far in SEP are stable in
Source Extractor: the SEP code was forked from v2.18.11, yet it is tested
against the results of v2.8.6. This indicates that the algorithms have
not changed in Source Extractor over the last few years.
**In the Python interface, why do I have to byte swap data when using
astropy.io.fits?**
This occurs because FITS files have big-endian [byte
order](http://en.wikipedia.org/wiki/Endianness), whereas most widely
used CPUs have little-endian byte order. In order for the CPU to
operate on the data, it must be byte swapped at *some point.* Some
FITS readers such as [fitsio](http://github.com/esheldon/fitsio) do
the
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共32个文件
c:9个
rst:4个
h:4个
资源分类:Python库 所属语言:Python 资源全名:sep-1.0.0.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
sep-1.0.0.tar.gz (32个子文件)
sep-1.0.0
PKG-INFO 639B
sep.c 1.46MB
AUTHORS.md 345B
docs
filter.rst 5KB
reference.rst 2KB
tutorial.ipynb 11KB
conf.py 9KB
apertures.rst 7KB
matched_filter_example.png 12KB
rtd-pip-requirements 56B
Makefile 7KB
.ipynb_checkpoints
tutorial-checkpoint.ipynb 11KB
index.rst 4KB
licenses
LGPL_LICENSE.txt 7KB
MIT_LICENSE.txt 1KB
BSD_LICENSE.txt 1KB
src
analyse.c 8KB
aperture.i 4KB
extract.c 33KB
overlap.h 15KB
extract.h 6KB
lutz.c 9KB
background.c 26KB
sepcore.h 3KB
util.c 7KB
sep.h 15KB
deblend.c 11KB
aperture.c 28KB
convolve.c 6KB
CHANGES.md 3KB
setup.py 1KB
README.md 9KB
共 32 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功