utcrossings=cPickle.load(utcf)
utcf.close()
print utcrossings
azoffdic = { 1:np.zeros(3), 3:np.zeros(3), 5:np.zeros(3) }
eltargetdic = { 1:np.zeros(3), 3:np.zeros(3), 5:np.zeros(3)}
aztargetdic = {1:np.zeros(3), 3:np.zeros(3), 5:np.zeros(3) }
utcrossdic = { 1:np.zeros(3), 3:np.zeros(3), 5:np.zeros(3) }
    
targs=['Sun','Sun','Moon']    
    
chans=[1,3,5]

for c,ch in enumerate(chans):
    for crossn, targ in enumerate(targs):
        print c,ch,crossn,targ,'now the lengths'
        azoffdic[ch][crossn],aztargetdic[ch][crossn],eltargetdic[ch][crossn],utcrossdic[ch][crossn]=util.get_cofe_crossing(ut,d10[ch+2].data['T'],gaz,lat,lon,utcrossings[ch][crossn],targ)

#fitdic = { 'offset':np.zeros(5), 'slope':np.zeros(5)  }
fitdic={}
for ch in chans:
    fitdic[ch]=util.linfit(utcrossdic[ch],azoffdic[ch])
    
f=open(wd+'azoff_10.pkl','wb')
cPickle.dump(azoffdic,f)
f.close()
f=open(wd+'eltarget_10.pkl','wb')
cPickle.dump(eltargetdic,f)
f.close()
f=open(wd+'aztarget_10.pkl','wb')
cPickle.dump(aztargetdic,f)
f.close()
Ejemplo n.º 2
0
#get the moon crossings for COFE 10 GHz roof data from august 2nd
#pointing and science data were already combined in  combineda2

import cofe_util as util

ut = combineda2['sci_data']['ut'][542800:543600]
gaz = radians(combineda2['az'][542800:543600])
centerut = 14.5118
azoffch3, moonazch3, moonelch3, fitutch3 = util.get_cofe_crossing(
    ut, -toi, gaz, lat, longi, centerut, 'Moon')
print azoffch3, moonazch3, moonelch3, fitutch3
# 192.082635101 326.807940765 55.5271839898 14.5117592593
eloffch3 = moonelch3 - mean(combineda2['el'][542800:543600])
eloffch3
# -3.1738160102228861

#so true az for ch3 = reported az+192.0826 degrees
#and true el for ch3= reported el-3.1738  degrees
#Now do ch1
gaz = radians(combineda2['az'][525150:525350])
ut = combineda2['sci_data']['ut'][525150:525350]
lat = resize(lat, len(ut))
longi = resize(longi, len(ut))
centerut = 14.3217
azoffch1, moonazch1, moonelch1, fitutch1 = util.get_cofe_crossing(
    ut, -toi, gaz, lat, longi, centerut, 'Moon')
print azoffch1, moonazch1, moonelch1, fitutch1
# 198.781031036 324.008656036 53.0092484126 14.3216872428
eloffch1 = moonelch1 - mean(combineda2['el'][525150:525350])
eloffch1
# -5.6917515873690405
Ejemplo n.º 3
0
    5: np.zeros(3),
    9: np.zeros(3),
    11: np.zeros(3),
    13: np.zeros(3)
}

targs = ['Sun', 'Sun', 'Moon']

chans = [1, 3, 5, 9, 11, 13]

for c, ch in enumerate(chans):
    for crossn, targ in enumerate(targs):
        print c, ch, crossn, targ, 'now the lengths'
        azoffdic[ch][crossn], aztargetdic[ch][crossn], eltargetdic[ch][
            crossn], utcrossdic[ch][crossn] = util.get_cofe_crossing(
                ut, d15[ch + 2].data['T'], gaz, lat, lon,
                utcrossings[ch][crossn], targ)

#fitdic = { 'offset':np.zeros(5), 'slope':np.zeros(5)  }
fitdic = {}
for ch in chans:
    for i, target in enumerate(targs):
        loncrossdic[ch][i] = lon[abs(uts15 - utcrossdic[ch][i]) == min(
            abs(uts15 - utcrossdic[ch][i]))]

for ch in chans:
    fitdic[ch] = util.linfit(loncrossdic[ch], azoffdic[ch])

f = open(wd + 'azoff_15_mag.pkl', 'wb')
cPickle.dump(azoffdic, f)
f.close()
#get the moon crossings for COFE 10 GHz roof data from august 2nd
#pointing and science data were already combined in  combineda2

import cofe_util as util

ut=combineda2['sci_data']['ut'][542800:543600]
gaz=radians(combineda2['az'][542800:543600])
centerut=14.5118
azoffch3,moonazch3,moonelch3,fitutch3=util.get_cofe_crossing(ut,-toi,gaz,lat,longi,centerut,'Moon')
print azoffch3,moonazch3,moonelch3,fitutch3
# 192.082635101 326.807940765 55.5271839898 14.5117592593
eloffch3=moonelch3-mean(combineda2['el'][542800:543600])
eloffch3
# -3.1738160102228861

#so true az for ch3 = reported az+192.0826 degrees
#and true el for ch3= reported el-3.1738  degrees
#Now do ch1
gaz=radians(combineda2['az'][525150:525350])
ut=combineda2['sci_data']['ut'][525150:525350]
lat=resize(lat,len(ut))
longi=resize(longi,len(ut))
centerut=14.3217
azoffch1,moonazch1,moonelch1,fitutch1=util.get_cofe_crossing(ut,-toi,gaz,lat,longi,centerut,'Moon')
print azoffch1,moonazch1,moonelch1,fitutch1
# 198.781031036 324.008656036 53.0092484126 14.3216872428
eloffch1=moonelch1-mean(combineda2['el'][525150:525350])
eloffch1
# -5.6917515873690405
print utcrossings
azoffdic = {1: np.zeros(3), 3: np.zeros(3), 5: np.zeros(3), 9: np.zeros(3), 11: np.zeros(3), 13: np.zeros(3)}
eltargetdic = {1: np.zeros(3), 3: np.zeros(3), 5: np.zeros(3), 9: np.zeros(3), 11: np.zeros(3), 13: np.zeros(3)}
aztargetdic = {1: np.zeros(3), 3: np.zeros(3), 5: np.zeros(3), 9: np.zeros(3), 11: np.zeros(3), 13: np.zeros(3)}
utcrossdic = {1: np.zeros(3), 3: np.zeros(3), 5: np.zeros(3), 9: np.zeros(3), 11: np.zeros(3), 13: np.zeros(3)}

targs = ["Sun", "Sun", "Moon"]

chans = [1, 3, 5, 9, 11, 13]

for c, ch in enumerate(chans):
    for crossn, targ in enumerate(targs):
        print c, ch, crossn, targ, "now the lengths"
        azoffdic[ch][crossn], aztargetdic[ch][crossn], eltargetdic[ch][crossn], utcrossdic[ch][
            crossn
        ] = util.get_cofe_crossing(ut, d15[ch + 2].data["T"], gaz, lat, lon, utcrossings[ch][crossn], targ)

# fitdic = { 'offset':np.zeros(5), 'slope':np.zeros(5)  }
fitdic = {}
for ch in chans:
    fitdic[ch] = util.linfit(utcrossdic[ch], azoffdic[ch])

f = open(wd + "azoff_15.pkl", "wb")
cPickle.dump(azoffdic, f)
f.close()
f = open(wd + "eltarget_15.pkl", "wb")
cPickle.dump(eltargetdic, f)
f.close()
f = open(wd + "aztarget_15.pkl", "wb")
cPickle.dump(aztargetdic, f)
f.close()
Ejemplo n.º 6
0
utcf.close()
print utcrossings
azoffdic = { 1:np.zeros(3), 3:np.zeros(3), 5:np.zeros(3) }
eltargetdic = { 1:np.zeros(3), 3:np.zeros(3), 5:np.zeros(3)}
aztargetdic = {1:np.zeros(3), 3:np.zeros(3), 5:np.zeros(3) }
utcrossdic = { 1:np.zeros(3), 3:np.zeros(3), 5:np.zeros(3) }
loncrossdic = { 1:np.zeros(3), 3:np.zeros(3), 5:np.zeros(3) }

targs=['Sun','Sun','Moon']    
    
chans=[1,3,5]
# this loop runs get_cofe_crossing for all three targets for all channels
for c,ch in enumerate(chans):
    for crossn, targ in enumerate(targs):
        print c,ch,crossn,targ,'now the lengths'
        azoffdic[ch][crossn],aztargetdic[ch][crossn],eltargetdic[ch][crossn],utcrossdic[ch][crossn]=util.get_cofe_crossing(ut,d10[ch+2].data['T'],gaz,lat,lon,utcrossings[ch][crossn],targ)

#fitdic = { 'offset':np.zeros(5), 'slope':np.zeros(5)  }
fitdic={}


for ch in chans:
    for i,target in enumerate(targs):
        loncrossdic[ch][i]=lon[abs(uts10-utcrossdic[ch][i])==min(abs(uts10-utcrossdic[ch][i]))]
    
for ch in chans:
    fitdic[ch]=util.linfit(loncrossdic[ch],azoffdic[ch])
    
f=open(wd+'azoff_10_mag.pkl','wb')
cPickle.dump(azoffdic,f)
f.close()