diff options
author | Aaron LI <aaronly.me@outlook.com> | 2017-02-18 22:46:43 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2017-02-18 22:46:43 +0800 |
commit | 1fb2a0eefae77e242123100e7ac43aa157064bdc (patch) | |
tree | 3c5b5adf191225d214c0a65bddd38a51b6a6238c /bin | |
parent | 4ae0e62b03444c1ad3e51e64e97664c500874c4d (diff) | |
download | atoolbox-1fb2a0eefae77e242123100e7ac43aa157064bdc.tar.bz2 |
Remove unfinished bin/img2list.py
Diffstat (limited to 'bin')
-rw-r--r-- | bin/img2list.py | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/bin/img2list.py b/bin/img2list.py deleted file mode 100644 index 48d0de4..0000000 --- a/bin/img2list.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Aaron LI -# 2015/06/23 -# - - -import numpy as np -from astropy.io import fits - - -def img2list(imgdata, mask=None): - """ - Convert a image matrix to list of point coordinates. - The input image matrix is taken as an integer matrix. - If one pixel has value n (>1), then it is repeated n times. - """ - img = imgdata.astype(int) - points = [] - ii, jj = np.nonzero(img >= 1) - while len(ii) > 0: - for i, j in zip(ii, jj): - points.append([i, j]) - img[ii, jj] -= 1 - ii, jj = np.nonzero(img >= 1) - return np.array(points) - |