Select on angular velocity (minimum and maximum). Fixes #50

pull/56/head
Cees Bassa 2019-11-30 16:50:20 +01:00
parent 6eae028f5c
commit 31018e8fcb
3 changed files with 16 additions and 6 deletions

View File

@ -52,7 +52,8 @@ low_app = 18 # Arcsec per pixel low scale - Resolution of camera
high_app = 20 # Arcsec per pixel high scale - Resolution of camera
[Processing]
drdtmin = 5.0 # Minimum predicted satellite velocity (pixels/s)
drdtmin = 0.1 # Minimum predicted satellite velocity (deg/s)
drdtmin = 5.0 # Maximum predicted satellite velocity (deg/s)
trkrmin = 10.0 # Track selection region around prediction (pixels)
ntrkmin = 10 # Minimum number of points making up a track
trksig = 5.0 # Track selection sigma

View File

@ -63,6 +63,7 @@ if __name__ == "__main__":
# Extract settings
drdtmin = cfg.getfloat('Processing', 'drdtmin')
drdtmax = cfg.getfloat('Processing', 'drdtmax')
trksig = cfg.getfloat('Processing', 'trksig')
trkrmin = cfg.getfloat('Processing', 'trkrmin')
ntrkmin = cfg.getint('Processing', 'ntrkmin')
@ -141,7 +142,7 @@ if __name__ == "__main__":
# Extract tracks
if is_calibrated(ff):
extract_tracks(fname, trkrmin, drdtmin, trksig, ntrkmin, root_dir, results_dir)
extract_tracks(fname, trkrmin, drdtmin, drdtmax, trksig, ntrkmin, root_dir, results_dir)
# Stars available and used
nused = np.sum(pix_catalog.flag == 1)

View File

@ -9,6 +9,8 @@ import ppgplot as ppg
from scipy import optimize, ndimage
from termcolor import colored
import datetime
import astropy.units as u
from astropy.coordinates import SkyCoord
# Gaussian model
def model(a, nx, ny):
@ -246,8 +248,14 @@ def plot_header(fname, ff, iod_line):
ppg.pgctab(heat_l, heat_r, heat_g, heat_b, 5, 1.0, 0.5)
# Calculate angular velocity
def angular_velocity(ident, w, texp):
p = SkyCoord.from_pixel([ident.x0, ident.x1], [ident.y0, ident.y1], w, 1, mode="all")
return p[0].separation(p[1]).to(u.deg).value/texp
# Extract tracks
def extract_tracks(fname, trkrmin, drdtmin, trksig, ntrkmin, path, results_path):
def extract_tracks(fname, trkrmin, drdtmin, drdtmax, trksig, ntrkmin, path, results_path):
# Read four frame
ff = fourframe(fname)
@ -295,9 +303,9 @@ def extract_tracks(fname, trkrmin, drdtmin, trksig, ntrkmin, path, results_path)
if ident.state == "remove":
continue
# Skip slow moving objects
drdt = np.sqrt(ident.dxdt**2 + ident.dydt**2)
if drdt < drdtmin:
# Select on angular velocity
drdt = angular_velocity(ident, ff.w, ff.texp)
if (drdt < drdtmin) | (drdt > drdtmax):
continue
# Extract significant pixels along a track