Example #1
0
apm_files = glob(opts.apm_files)
assert(len(apm_files)>0)
print "found",len(apm_files),"apm files"
#load the apm data
positiontimes,positions,angletimes,angles,cmdtimes,CMDnums = read_apm_logs(apm_files)



#load the receiver data
rx_files = glob(opts.rx_files)
assert(len(rx_files)>0)
if rx_files[0].find('satpower')!=-1:#we're in orbcomm town
    pol = opts.pol.split('_')[1]
    rxtimes,freqs,rxspectrum = read_orbcomm_spectrum(rx_files,opts.rxant,pol)
else: #read the default echo rx spectrum
    rxtimes,freqs,rxspectrum = read_echo_spectrum(rx_files)

#get the power in our current channel
rx_power = channel_select(freqs,rxspectrum,opts.freq)
freqs = np.array([opts.freq])

#interpolate the rx data down to match the gps times
rx_interp = interp_rx(positiontimes,rxtimes,rx_power)


#flag based on yaws
print "flagging based on yaw"
yawmask,badyawtimes = flag_angles(angletimes,angles,2)
posmask = apply_flagtimes(positiontimes,badyawtimes,1.0)
rx_interp = np.ma.masked_where(posmask,rx_interp)
print "total flags after yaw flagging:",np.sum(rx_interp.mask)
Example #2
0
#! /usr/bin/env python
from ECHO.read_utils import read_apm_log,apm_version,read_echo_spectrum
import sys
from pytz import timezone
TZ = 'US/Arizona'
tz = timezone(TZ)


for filename in sys.argv[1:]:
    print filename

    apm_times,freqs,data =read_echo_spectrum([filename])
    print "GPS start (UTC):",apm_times[0].iso
    print "GPS end (UTC):",apm_times[-1].iso

    print "GPS start ({z}):".format(z=TZ),apm_times[0].to_datetime(timezone=tz)
    print "GPS end ({z}):".format(z=TZ),apm_times[-1].to_datetime(timezone=tz)

    print "freqs (min,max) [MHz]:",freqs.min(),freqs.max()