rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
if (cpt[0]-fpt[0])*(cpt[0]-fpt[0]) <= coarseres/2 and \ (cpt[1]-fpt[1])*(cpt[1]-fpt[1])*abs(sin(fpt[1])) <= coarseres/2: | if (cpt[0]-fpt[0])*(cpt[0]-fpt[0]) <= ds*ds/4 and \ (cpt[1]-fpt[1])*(cpt[1]-fpt[1])*abs(sin(fpt[1]))*abs(sin(fpt[1])) \ <= ds*ds/4: | def map_grids(coarsegrid,finegrid,coarseres=4.0): """ takes the two grids (lists of lat/lon tuples) and returns a dictionary where the points in the coarse grid are the keys and lists of tuples of points in the fine grid are the values """ fgtemp = finegrid coarsedict = {} for cpt in coarsegrid: flist = [] for fpt in f... |
fgtemp.remove(pt) return coarsedict | fgtemp.remove(rpt) return coarsedict, fgtemp | def map_grids(coarsegrid,finegrid,coarseres=4.0): """ takes the two grids (lists of lat/lon tuples) and returns a dictionary where the points in the coarse grid are the keys and lists of tuples of points in the fine grid are the values """ fgtemp = finegrid coarsedict = {} for cpt in coarsegrid: flist = [] for fpt in f... |
background_livetime[on_instruments].setdfault(key, 0) | background_livetime[on_instruments].setdefault(key, 0) | def background_livetime_ring_by_slide(connection, live_time_program, seglists, veto_segments, verbose = False): background_livetime = {} instruments = frozenset(seglists.keys()) offset_vectors = db_thinca_rings.get_background_offset_vectors(connection) # first work out time slide live time for on_instruments, livetimes... |
self.add_var_arg(p_nodes[1].outputFileName) | self.add_var_arg(p_nodes[1].localFileName) | def __init__(self, dag, job, cp, opts, ifo, time, p_nodes=[], type=""): |
input_cache_file = p_nodes[0].outputFileName | input_cache_file = p_nodes[0].localFileName | def __init__(self, dag, job, cp, opts, time, ifo, p_nodes=[], type="ht", variety="fg"): |
if cp.has_option('fu-remote-jobs','remote-jobs') and job.name in cp.get('fu-remote-jobs','remote-jobs') and cp.has_option('fu-remote-jobs','remote-ifos') and ifo in cp.get('fu-remote-jobs','remote-ifos'): self.add_var_arg('--server ldr-bologna.phys.uwm.edu') else: self.add_var_arg('') | def __init__(self, dag, job, cp, opts, ifo, sngl=None, qscan=False, trigger_time=None, data_type="hoft", p_nodes=[]): | |
qCache = lalCache.rstrip("cache") + "qcache" self.set_post_script(os.getcwd()+"/cacheconv.sh %s %s" %(lalCache,qCache) ) | qCache = lalCache.rstrip("lcf") + "qcache" if cp.has_option('fu-remote-jobs','remote-jobs') and job.name in cp.get('fu-remote-jobs','remote-jobs') and cp.has_option('fu-remote-jobs','remote-ifos') and ifo in cp.get('fu-remote-jobs','remote-ifos'): self.add_var_arg('--server ldr-bologna.phys.uwm.edu') postScriptTest = ... | def setup_qscan(self, job, cp, time, ifo, data_type): # 1s is substracted to the expected startTime to make sure the window # will be large enough. This is to be sure to handle the rouding to the # next sample done by qscan. type, channel = figure_out_type(time,ifo,data_type) self.set_type(type) self.q_time = float(cp.... |
given an instance of skypoints populate and return skylocinjtable | record injection data in a skylocinjtable | def populate_SkyLocInjTable(skylocinjtable,coinc,dt_area,rank_area, \ dtrss_inj,dDrss_inj): """ given an instance of skypoints populate and return skylocinjtable """ row = skylocinjtable.RowType() row.end_time = coinc.time rhosquared = 0.0 for ifo in coinc.ifo_list: rhosquared += coinc.snr[ifo]*coinc.snr[ifo] row.comb... |
" --segment_url https://segdb.ligo.caltech.edu"+\ | " --segment-url https://segdb.ligo.caltech.edu"+\ | def grab_segments(start,end,flag): """ Returns a segmentlist containing the segments during which the given flag was active in the given period. """ #== construct segment query segment_cmd = "ligolw_segment_query --query-segments"+\ " --segment_url https://segdb.ligo.caltech.edu"+\ " --include-segments "+flag+\ " --gp... |
" --gps-start-time "+str(start)+\ " --gps-end-time "+str(end)+\ | " --gps-start-time "+str(int(start))+\ " --gps-end-time "+str(int(end))+\ | def grab_segments(start,end,flag): """ Returns a segmentlist containing the segments during which the given flag was active in the given period. """ #== construct segment query segment_cmd = "ligolw_segment_query --query-segments"+\ " --segment_url https://segdb.ligo.caltech.edu"+\ " --include-segments "+flag+\ " --gp... |
segs = GetCommandOutput(segment_cmd) | segs,status = GetCommandOutput(segment_cmd) | def grab_segments(start,end,flag): """ Returns a segmentlist containing the segments during which the given flag was active in the given period. """ #== construct segment query segment_cmd = "ligolw_segment_query --query-segments"+\ " --segment_url https://segdb.ligo.caltech.edu"+\ " --include-segments "+flag+\ " --gp... |
segs=segs.split('\n') for seg in segs: if seg=='': continue try: [seg_start,seg_end]=seg.split(' ') seglist.append(segment(int(seg_start),int(seg_end))) except: continue | if status==0: segs=segs.split('\n') for seg in segs: if seg=='': continue try: [seg_start,seg_end]=seg.split(' ') seglist.append(segment(int(seg_start),int(seg_end))) except: continue seglist = segmentlist(seglist) else: print >>sys.stderr, "Warning: Call to ligolw_segment_query failed with "+\ "command:" print >>sys... | def grab_segments(start,end,flag): """ Returns a segmentlist containing the segments during which the given flag was active in the given period. """ #== construct segment query segment_cmd = "ligolw_segment_query --query-segments"+\ " --segment_url https://segdb.ligo.caltech.edu"+\ " --include-segments "+flag+\ " --gp... |
seglist = segmentlist([seglist]) | def grab_segments(start,end,flag): """ Returns a segmentlist containing the segments during which the given flag was active in the given period. """ #== construct segment query segment_cmd = "ligolw_segment_query --query-segments"+\ " --segment_url https://segdb.ligo.caltech.edu"+\ " --include-segments "+flag+\ " --gp... | |
plot(getinjpar(injection,0),getinjpar(injection,1),'go',scalex=False,scaley=False) | plot([getinjpar(injection,0)],[getinjpar(injection,1)],'go',scalex=False,scaley=False) | def plot2Dkernel(xdat,ydat,Nx,Ny): xax=linspace(min(xdat),max(xdat),Nx) yax=linspace(min(ydat),max(ydat),Ny) x,y=numpy.meshgrid(xax,yax) samp=array([xdat,ydat]) kde=stats.kde.gaussian_kde(samp) grid_coords = numpy.append(x.reshape(-1,1),y.reshape(-1,1),axis=1) z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/y... |
plot(getinjpar(injection,5),getinjpar(injection,6),'go',scalex=False,scaley=False) | print 'getinjpar(5),getinjpar(6) = %f,%f\n'%(getinjpar(injection,5),getinjpar(injection,6)) plot([getinjpar(injection,5)],[getinjpar(injection,6)],'go',scalex=False,scaley=False) | def plot2Dkernel(xdat,ydat,Nx,Ny): xax=linspace(min(xdat),max(xdat),Nx) yax=linspace(min(ydat),max(ydat),Ny) x,y=numpy.meshgrid(xax,yax) samp=array([xdat,ydat]) kde=stats.kde.gaussian_kde(samp) grid_coords = numpy.append(x.reshape(-1,1),y.reshape(-1,1),axis=1) z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/y... |
if injection and getinjpar(injection,7)<max(pos[:,7]) and getinjpar(injection,7)>min(pos[:,7]) and getinjpar(injection,8)<max(pos[:,8]) and getinjpar(injection,8)>min(pos[:,8]): plot(getinjpar(injection,7),getinjpar(injection,8),'go',scalex=False,scaley=False) | if injection and getinjpar(injection,7)<max(pos[:,7]) and getinjpar(injection,7)>min(pos[:,7]) and getinjpar(injection,8)<max(pos[:,8]) and getinjpar(injection,8)>min(pos[:,8]): plot([getinjpar(injection,7)],[getinjpar(injection,8)],'go',scalex=False,scaley=False) | def plot2Dkernel(xdat,ydat,Nx,Ny): xax=linspace(min(xdat),max(xdat),Nx) yax=linspace(min(ydat),max(ydat),Ny) x,y=numpy.meshgrid(xax,yax) samp=array([xdat,ydat]) kde=stats.kde.gaussian_kde(samp) grid_coords = numpy.append(x.reshape(-1,1),y.reshape(-1,1),axis=1) z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/y... |
plot(injection.mass1,injection.mass2,'go',scalex=False,scaley=False) | plot([injection.mass1],[injection.mass2],'go',scalex=False,scaley=False) | def plot2Dkernel(xdat,ydat,Nx,Ny): xax=linspace(min(xdat),max(xdat),Nx) yax=linspace(min(ydat),max(ydat),Ny) x,y=numpy.meshgrid(xax,yax) samp=array([xdat,ydat]) kde=stats.kde.gaussian_kde(samp) grid_coords = numpy.append(x.reshape(-1,1),y.reshape(-1,1),axis=1) z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/y... |
plot(injection.mass1,injection.distance,'go',scalex=False,scaley=False) | plot([injection.mass1],[injection.distance],'go',scalex=False,scaley=False) | def plot2Dkernel(xdat,ydat,Nx,Ny): xax=linspace(min(xdat),max(xdat),Nx) yax=linspace(min(ydat),max(ydat),Ny) x,y=numpy.meshgrid(xax,yax) samp=array([xdat,ydat]) kde=stats.kde.gaussian_kde(samp) grid_coords = numpy.append(x.reshape(-1,1),y.reshape(-1,1),axis=1) z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/y... |
plot(getinjpar(injection,4),getinjpar(injection,8),'go',scalex=False,scaley=False) | plot([getinjpar(injection,4)],[getinjpar(injection,8)],'go',scalex=False,scaley=False) | def plot2Dkernel(xdat,ydat,Nx,Ny): xax=linspace(min(xdat),max(xdat),Nx) yax=linspace(min(ydat),max(ydat),Ny) x,y=numpy.meshgrid(xax,yax) samp=array([xdat,ydat]) kde=stats.kde.gaussian_kde(samp) grid_coords = numpy.append(x.reshape(-1,1),y.reshape(-1,1),axis=1) z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/y... |
plot(getinjpar(injection,i),getinjpar(injection,j),'go',scalex=False,scaley=False) | plot([getinjpar(injection,i)],[getinjpar(injection,j)],'go',scalex=False,scaley=False) | def plot2Dkernel(xdat,ydat,Nx,Ny): xax=linspace(min(xdat),max(xdat),Nx) yax=linspace(min(ydat),max(ydat),Ny) x,y=numpy.meshgrid(xax,yax) samp=array([xdat,ydat]) kde=stats.kde.gaussian_kde(samp) grid_coords = numpy.append(x.reshape(-1,1),y.reshape(-1,1),axis=1) z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/y... |
htmlfile.write('<td width=30%><img width=100% src="skymap.png"></td>') htmlfile.write('<td width=30%><img width=100% src="m2dist.png"></td>') | if opts.skyres is not None: htmlfile.write('<td width=30%><img width=100% src="skymap.png"></td>') else: htmlfile.write('<td width=30%><img width=100% src="psiiota.png"></td>') htmlfile.write('<td width=30%><img width=100% src="Diota.png"></td>') | def plot2Dkernel(xdat,ydat,Nx,Ny): xax=linspace(min(xdat),max(xdat),Nx) yax=linspace(min(ydat),max(ydat),Ny) x,y=numpy.meshgrid(xax,yax) samp=array([xdat,ydat]) kde=stats.kde.gaussian_kde(samp) grid_coords = numpy.append(x.reshape(-1,1),y.reshape(-1,1),axis=1) z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/y... |
gkde=stats.gaussian_kde(pos[:,i]) ind=linspace(min(pos[:,i]),max(pos[:,i]),101) kdepdf=gkde.evaluate(ind) plot(ind,kdepdf,label='density estimate') | if size(unique(pos[:,i]))>1: gkde=stats.gaussian_kde(pos[:,i]) ind=linspace(min(pos[:,i]),max(pos[:,i]),101) kdepdf=gkde.evaluate(ind) plot(ind,kdepdf,label='density estimate') | def plot2Dkernel(xdat,ydat,Nx,Ny): xax=linspace(min(xdat),max(xdat),Nx) yax=linspace(min(ydat),max(ydat),Ny) x,y=numpy.meshgrid(xax,yax) samp=array([xdat,ydat]) kde=stats.kde.gaussian_kde(samp) grid_coords = numpy.append(x.reshape(-1,1),y.reshape(-1,1),axis=1) z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/y... |
for x in self.ifos: if x not in self.__backgroundPickle__.keys(): sys.stderr.write("Could not either open or save DQ \ background in %s.\n"%(self.__backgroundPickle__)) self.__backgroundResults__=list() self.__backgroundTimesDict__=dict() self.__backgroundDict__=dict() self.__haveBackgroundDict__=bool(False) return | if not self.__haveBackgroundDict__: sys.stderr.write("Could not either open or save DQ \ background in %s no background data available!\n"%(self.__backgroundPickle__)) self.__backgroundResults__=list() self.__backgroundTimesDict__=dict() self.__backgroundDict__=dict() self.__haveBackgroundDict__=bool(False) return | def estimateDQbackground(self): """ This method looks at the self.resultlist inside the instance. Using this and 1000 generated time stamp it tabulates a ranking of flag prevelance, binomial probability 'p' """ if len(self.resultList) < 1: self.__backgroundResults__=list() self.__backgroundTimesDict__=dict() self.__bac... |
os.stdout.write("Path information to background pickle unchanged.\n") | sys.stdout.write("Path information to background pickle unchanged.\n") | def resetPicklePointer(self,filename=None): """ If you called the class definition with the wrong pickle path. You can reset it with this method. """ if filename==None: os.stdout.write("Path information to background pickle unchanged.\n") elif filename.__contains__("~"): self.__backgroundPickle__=os.path.expanduser(fil... |
os.stdout.write("Specify trigger time please.\n") | sys.stdout.write("Specify trigger time please.\n") | def fetchInformationDualWindow(self,triggerTime=None,frontWindow=300,\ backWindow=150,ifoList='DEFAULT'): """ This method is responsible for queries to the data server. The results of the query become an internal list that can be converted into an HTML table. The arguments allow you to query with trigger time of inte... |
os.stdout.write("Problem saving pickle of DQ information.") os.stdout.write("Trying to place pickle in your home directory.") | sys.stdout.write("Problem saving pickle of DQ information.") sys.stdout.write("Trying to place pickle in your home directory.") | def createDQbackground(self,ifoEpochList=list(),pickleLocale=None): """ Two inputs a list of tuples (ifo,epochname) for each instrument. Also a place to save the potential pickle to for quick access later. """ if type(ifoEpochList) != type(list()): raise Exception, \ "Invalid input argument ifoEpochList,%s type(%s)"... |
os.stdout.write("Really ignoring pickle generation now!\n") | sys.stdout.write("Really ignoring pickle generation now!\n") | def createDQbackground(self,ifoEpochList=list(),pickleLocale=None): """ Two inputs a list of tuples (ifo,epochname) for each instrument. Also a place to save the potential pickle to for quick access later. """ if type(ifoEpochList) != type(list()): raise Exception, \ "Invalid input argument ifoEpochList,%s type(%s)"... |
coincTrigs = CoincInspiralUtils.coincInspiralTable(inspTrigs,'snr') | statistic = CoincInspiralUtils.coincStatistic('snr',None,None) coincTrigs = CoincInspiralUtils.coincInspiralTable(inspTrigs,statistic) | def get_coincs_from_coire(self,files): """ uses CoincInspiralUtils to get data from old-style (coire'd) coincs """ #coincTrigs = CoincInspiralUtils.coincInspiralTable() inspTrigs = SnglInspiralUtils.ReadSnglInspiralFromFiles(files, \ mangle_event_id = True,verbose=None) #note that it's hardcoded to use snr as the stati... |
outdir=opts.outpath | def histN(mat,N): Nd=size(N) histo=zeros(N) scale=array(map(lambda a,b:a/b,map(lambda a,b:(1*a)-b,map(max,mat),map(min,mat)),N)) axes=array(map(lambda a,N:linspace(min(a),max(a),N),mat,N)) bins=floor(map(lambda a,b:a/b , map(lambda a,b:a-b, mat, map(min,mat) ),scale*1.01)) hbins=reshape(map(int,bins.flat),bins.shape) ... | |
if debug: print "maxdx : %i , maxvalue: %f sample0 : %f sample1: %f"%(maxdx,maxvalue,sample[RAdim],sample[decdim]) | def skyhist_cart(skycarts,sky_samples): """ Histogram the list of samples into bins defined by Cartesian vectors in skycarts """ dot=np.dot N=len(skycarts) print 'operating on %d sky points'%(N) bins=np.zeros(N) for RAsample,decsample in sky_samples: sampcart=pol2cart(RAsample,decsample) maxdx=-1 maxvalue=-1 for i in x... | |
summary_fo=open('summary.ini','w') summary_file=ConfigParser() summary_file.add_section('metadata') summary_file.set('metadata','group_id','X') if opts.eventnum: summary_file.set('metadata','event_id',str(opts.eventnum)) summary_file.add_section('Confidence levels') summary_file.set('Confidence levels','confidence le... | def getinjpar(paramnames,inj,parnum): | def loadDataFile(filename): print filename infile=open(filename,'r') formatstr=infile.readline().lstrip() formatstr=formatstr.replace('#','') header=formatstr.split() llines=[] import re dec=re.compile(r'[^\d.-]+') line_count=0 for line in infile: sline=line.split() proceed=True if len(sline)<1: print 'Ignoring empty ... |
if injection: injpoint=map(lambda a: getinjpar(injection,a),range(len(paramnames))) injvals=map(str,injpoint) out=reduce(lambda a,b:a+'||'+b,injvals) print 'Injected values:' print out summary_file.add_section('Injection values') for parnum in range(len(paramnames)): summary_file.set('Injection values',paramnames[pa... | def getinjpar(inj,parnum): if paramnames[parnum]=='mchirp' or paramnames[parnum]=='mc': return inj.mchirp if paramnames[parnum]=='mass1' or paramnames[parnum]=='m1': (m1,m2)=mc2ms(inj.mchirp,inj.eta) return m1 if paramnames[parnum]=='mass2' or paramnames[parnum]=='m2': (m1,m2)=mc2ms(inj.mchirp,inj.eta) return m2 if par... | |
def plot2Dbins(toppoints,cl,par1_name,par1_bin,par2_name,par2_bin,injpoint): | def plot2Dbins(toppoints,par1_bin,par2_bin,outdir,par1name=None,par2name=None,injpoint=None): | def plot2Dbins(toppoints,cl,par1_name,par1_bin,par2_name,par2_bin,injpoint): #Work out good bin size xbins=int(ceil((max(toppoints[:,0])-min(toppoints[:,0]))/par1_bin)) ybins=int(ceil((max(toppoints[:,1])-min(toppoints[:,1]))/par2_bin)) _dpi=120 xsize_in_inches=6. xsize_points = xsize_in_inches * _dpi points_per_bin_... |
plt.title("%s-%s histogram (greedy binning)"%(par1_name,par2_name)) | plt.title("%s-%s histogram (greedy binning)"%(par1name,par2name)) | def plot2Dbins(toppoints,cl,par1_name,par1_bin,par2_name,par2_bin,injpoint): #Work out good bin size xbins=int(ceil((max(toppoints[:,0])-min(toppoints[:,0]))/par1_bin)) ybins=int(ceil((max(toppoints[:,1])-min(toppoints[:,1]))/par2_bin)) _dpi=120 xsize_in_inches=6. xsize_points = xsize_in_inches * _dpi points_per_bin_... |
myfig.savefig(os.path.join(outdir,'2Dbins',par1_name+'-'+par2_name+'.png'),dpi=_dpi) | myfig.savefig(os.path.join(outdir,'2Dbins',par1name+'-'+par2name+'.png'),dpi=_dpi) | def plot2Dbins(toppoints,cl,par1_name,par1_bin,par2_name,par2_bin,injpoint): #Work out good bin size xbins=int(ceil((max(toppoints[:,0])-min(toppoints[:,0]))/par1_bin)) ybins=int(ceil((max(toppoints[:,1])-min(toppoints[:,1]))/par2_bin)) _dpi=120 xsize_in_inches=6. xsize_points = xsize_in_inches * _dpi points_per_bin_... |
def plotSkyMap(skypos,skyres,sky_injpoint): | def plotSkyMap(skypos,skyres,sky_injpoint,confidence_levels,pos,outdir): | def plot2Dbins(toppoints,cl,par1_name,par1_bin,par2_name,par2_bin,injpoint): #Work out good bin size xbins=int(ceil((max(toppoints[:,0])-min(toppoints[:,0]))/par1_bin)) ybins=int(ceil((max(toppoints[:,1])-min(toppoints[:,1]))/par2_bin)) _dpi=120 xsize_in_inches=6. xsize_points = xsize_in_inches * _dpi points_per_bin_... |
(skyinjectionconfidence,toppoints,skyreses)=bayespputils.calculateConfidenceLevels(shist,skypoints,injbin,float(opts.skyres),confidence_levels,len(pos)) | (skyinjectionconfidence,toppoints,skyreses)=bayespputils.calculateConfidenceLevels(shist,skypoints,injbin,float(skyres),confidence_levels,len(pos)) | def plotSkyMap(skypos,skyres,sky_injpoint): from pylal import skylocutils from mpl_toolkits.basemap import Basemap skypoints=array(skylocutils.gridsky(float(skyres))) skycarts=map(lambda s: pol2cart(s[1],s[0]),skypoints) skyinjectionconfidence=None shist=bayespputils.skyhist_cart(array(skycarts),skypos) #shist=skyhi... |
min_sky_area_containing_injection=float(opts.skyres)*float(opts.skyres)*i | min_sky_area_containing_injection=float(skyres)*float(skyres)*i | def plotSkyMap(skypos,skyres,sky_injpoint): from pylal import skylocutils from mpl_toolkits.basemap import Basemap skypoints=array(skylocutils.gridsky(float(skyres))) skycarts=map(lambda s: pol2cart(s[1],s[0]),skypoints) skyinjectionconfidence=None shist=bayespputils.skyhist_cart(array(skycarts),skypos) #shist=skyhi... |
skyreses=None if opts.skyres is not None: RAvec=array(pos)[:,paramnames.index('RA')] decvec=array(pos)[:,paramnames.index('dec')] skypos=column_stack([RAvec,decvec]) | def cbcBayesSkyRes(outdir,data,oneDMenu,twoDGreedyMenu,GreedyRes,confidence_levels,twoDplots,injfile=None,eventnum=None,skyres=None): if eventnum is not None and injfile is None: print "You specified an event number but no injection file. Ignoring!" if data is None: print 'You must specify an input data file' exit(1)... | def plotSkyMap(skypos,skyres,sky_injpoint): from pylal import skylocutils from mpl_toolkits.basemap import Basemap skypoints=array(skylocutils.gridsky(float(skyres))) skycarts=map(lambda s: pol2cart(s[1],s[0]),skypoints) skyinjectionconfidence=None shist=bayespputils.skyhist_cart(array(skycarts),skypos) #shist=skyhi... |
skyreses,skyinjectionconfidence=plotSkyMap(skypos,opts.skyres,(injpoint[RAdim],injpoint[decdim])) else: skyreses,skyinjectionconfidence=plotSkyMap(skypos,opts.skyres,None) myfig=plt.figure(1,figsize=(6,4),dpi=80) plt.clf() summary_file.add_section('2D greedy cl') ncon=len(confidence_levels) pos_array=np.array(pos... | injpoint=map(lambda a: getinjpar(paramnames,injection,a),range(len(paramnames))) injvals=map(str,injpoint) out=reduce(lambda a,b:a+'||'+b,injvals) print 'Injected values:' print out summary_file.add_section('Injection values') for parnum in range(len(paramnames)): summary_file.set('Injection values',paramnames[parnu... | def plotSkyMap(skypos,skyres,sky_injpoint): from pylal import skylocutils from mpl_toolkits.basemap import Basemap skypoints=array(skylocutils.gridsky(float(skyres))) skycarts=map(lambda s: pol2cart(s[1],s[0]),skypoints) skyinjectionconfidence=None shist=bayespputils.skyhist_cart(array(skycarts),skypos) #shist=skyhi... |
for j in range(par1pos_Nbins): greedyPoints[j+par1pos_Nbins*i,0]=par1_point greedyPoints[j+par1pos_Nbins*i,1]=par2_point par1_point+=par1_bin par2_point+=par2_bin injbin=None if injection: par1_injvalue=np.array(injpoint)[par1_index] par2_injvalue=np.array(injpoint)[par2_index] if par1_injvalue is not None and par2... | par2_point=par2pos_min for i in range(par2pos_Nbins): par1_point=par1pos_min for j in range(par1pos_Nbins): greedyPoints[j+par1pos_Nbins*i,0]=par1_point greedyPoints[j+par1pos_Nbins*i,1]=par2_point par1_point+=par1_bin par2_point+=par2_bin injbin=None if injection: par1_injvalue=np.array(injpoint)[par1_index] par2_... | def plotSkyMap(skypos,skyres,sky_injpoint): from pylal import skylocutils from mpl_toolkits.basemap import Basemap skypoints=array(skylocutils.gridsky(float(skyres))) skycarts=map(lambda s: pol2cart(s[1],s[0]),skypoints) skyinjectionconfidence=None shist=bayespputils.skyhist_cart(array(skycarts),skypos) #shist=skyhi... |
greedyHist[par_binNumber]+=1 except IndexError: print "IndexError: bin number: %i total bins: %i parsamp: %f bin: %f - %f"%(par_binNumber,parpos_Nbins,par_samp,greedyPoints[par_binNumber-1,0],greedyPoints[par_binNumber-1,0]+par_bin) injbin=None if injection: par_injvalue=np.array(injpoint)[par_index] if par_injvalu... | par_index=paramnames.index(par_name) except ValueError: print "No input chain for %s, skipping binning."%par_name continue try: par_bin=GreedyRes[par_name] except KeyError: print "Bin size is not set for %s, skipping binning."%par_name continue oneDGreedyCL[par_name]={} oneDStats[par_name]={} oneDContCL[par_name]={} ... | def plotSkyMap(skypos,skyres,sky_injpoint): from pylal import skylocutils from mpl_toolkits.basemap import Basemap skypoints=array(skylocutils.gridsky(float(skyres))) skycarts=map(lambda s: pol2cart(s[1],s[0]),skypoints) skyinjectionconfidence=None shist=bayespputils.skyhist_cart(array(skycarts),skypos) #shist=skyhi... |
left+=1 right+=1 if max_frac is not None: break if max_frac is None: print "Cant determine intervals at %f confidence!"%confidence_level | else: if frac>max_frac: max_frac=frac max_left=left max_right=right left+=1 right+=1 if max_frac is not None: break if max_frac is None: print "Cant determine intervals at %f confidence!"%confidence_level else: summary_file.set('1D contigious cl',par_name,'['+str(max_left*par_bin)+','+str(max_right*par_bin)+','+str((m... | def plotSkyMap(skypos,skyres,sky_injpoint): from pylal import skylocutils from mpl_toolkits.basemap import Basemap skypoints=array(skylocutils.gridsky(float(skyres))) skycarts=map(lambda s: pol2cart(s[1],s[0]),skypoints) skyinjectionconfidence=None shist=bayespputils.skyhist_cart(array(skycarts),skypos) #shist=skyhi... |
summary_file.set('1D contigious cl',par_name,'['+str(max_left*par_bin)+','+str(max_right*par_bin)+','+str((max_right-max_left)*par_bin)+']') k=j while k+1<len(confidence_levels) : if confidence_levels[k+1]<max_frac: j+=1 k+=1 j+=1 (injectionconfidence,toppoints,reses)=bayespputils.calculateConfidenceLevels(greedyH... | htmlfile.write('<p>Injection not found in posterior bins in sky location!</p>') htmlfile.write('<h5>2D Marginal PDFs</h5><br>') htmlfile.write('<table border=1><tr>') if skyres is not None: htmlfile.write('<td width=30%><img width=100% src="skymap.png"></td>') else: htmlfile.write('<td width=30%><img width=100% src... | def plotSkyMap(skypos,skyres,sky_injpoint): from pylal import skylocutils from mpl_toolkits.basemap import Basemap skypoints=array(skylocutils.gridsky(float(skyres))) skycarts=map(lambda s: pol2cart(s[1],s[0]),skypoints) skyinjectionconfidence=None shist=bayespputils.skyhist_cart(array(skycarts),skypos) #shist=skyhi... |
z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/yax.ptp() plt.imshow(z,extent=(xax[0],xax[-1],yax[0],yax[-1]),aspect=asp,origin='lower') plt.colorbar() for par1,par2 in twoDplots: try: i=paramnames.index(par1) except ValueError: print "No input chain for %s, skipping 2D plot of %s-%s."%(par1,par1,par2) c... | cbcBayesSkyRes(opts.outpath,opts.data,oneDMenu,twoDGreedyMenu,greedyRes,confidenceLevels,twoDplots,injfile=opts.injfile,eventnum=opts.eventnum,skyres=opts.skyres) | def plot2Dkernel(xdat,ydat,Nx,Ny): xax=np.linspace(min(xdat),max(xdat),Nx) yax=np.linspace(min(ydat),max(ydat),Ny) x,y=np.meshgrid(xax,yax) samp=array([xdat,ydat]) kde=stats.kde.gaussian_kde(samp) grid_coords = np.append(x.reshape(-1,1),y.reshape(-1,1),axis=1) z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/... |
cp.add_section("condor-max-jobs","remoteScan_FG_RDS.sh_FG_RDS_full_data","30") cp.add_section("condor-max-jobs","remoteScan_FG_SEIS_RDS.sh_FG_SEIS_RDS_full_data","30") | cp.set("condor-max-jobs","remoteScan_FG_RDS.sh_FG_RDS_full_data","30") cp.set("condor-max-jobs","remoteScan_FG_SEIS_RDS.sh_FG_SEIS_RDS_full_data","30") | def __init__(self, configfile=None): cp = ConfigParser.ConfigParser() self.cp = cp self.time_now = "_".join([str(i) for i in time_method.gmtime()[0:6]]) self.ini_file=self.time_now + ".ini" home_base = home_dirs() # CONDOR SECTION NEEDED BY THINGS IN INSPIRAL.PY cp.add_section("condor") cp.set("condor","datafind",self... |
def __init__(self, options): | def __init__(self, options, ifo_times = None, ifo_tag = None, user_tag = None,\ gps_start_time = None, gps_end_time = None): | def __init__(self, options): """ Initializes this class with the options. """ self.opts = options self.fname_list = [] self.tag_list = [] self.html_footer = "" |
initialise(self.opts, os.path.basename(sys.argv[0])) def add_plot(self, plot_fig, text): """ Add a plot to the page """ | def initialize(self): """ Extract information from the option structure. Does NOT alter the information in the option structure """ if hasattr(self.opts, 'ifo_times'): self.ifo_times = self.opts.ifo_times else: self.ifo_times = None if hasattr(self.opts, 'ifo_tag'): self.ifo_tag = self.opts.ifo_tag else: self.ifo_tag... | def __init__(self, options): """ Initializes this class with the options. """ self.opts = options self.fname_list = [] self.tag_list = [] self.html_footer = "" |
fname = set_figure_name(self.opts, text) fname_thumb = savefig_pylal(fname, fig=plot_fig) self.fname_list.append(fname) self.tag_list.append(fname) def write_page(self): """ create the page | self.fname_list.append(filename) self.tag_list.append(filename) def savefig(self, filename_base, fig, doThumb=True, dpi = None, dpi_thumb=50): """ Function to create the image file. @param filename_base: basename of the filename (without the .png ending) @param fig: handle to the figure to save @param doThumb: save t... | def add_plot(self, plot_fig, text): """ Add a plot to the page """ fname = set_figure_name(self.opts, text) fname_thumb = savefig_pylal(fname, fig=plot_fig) self.fname_list.append(fname) self.tag_list.append(fname) |
html_filename = write_html_output(self.opts, sys.argv[1:],\ self.fname_list, self.tag_list,\ comment=self.html_footer or None) write_cache_output(self.opts, html_filename, self.fname_list) | html_filename = self.create_htmlname(infix, cbcweb) self.write_html_output(html_filename, doThumb = doThumb, cbcweb = cbcweb, \ map_list = map_list, coinc_summ_table = coinc_summ_table,\ comment=self.html_footer or None) self.write_cache_output(html_filename) | def write_page(self): """ create the page """ if self.opts.enable_output: html_filename = write_html_output(self.opts, sys.argv[1:],\ self.fname_list, self.tag_list,\ comment=self.html_footer or None) write_cache_output(self.opts, html_filename, self.fname_list) return html_filename |
def create_htmlname(self, infix, cbcweb): """ Create the html filename """ if infix: html_filename = self.prefix + '_'+ infix +self.suffix else: html_filename = self.prefix + self.suffix if cbcweb: html_filename += "_publish.html" else: html_filename += ".html" if self.output_path: html_filename = self.output_path... | def write(self, text): """ Write some text to the standard output AND to the page. """ print text self.html_footer+=text+'<br>' | |
def gridsky(resolution): | def gridsky(resolution,shifted=False): | def gridsky(resolution): """ grid the sky up into roughly square regions resolution is the length of a side the points get placed at the center of the squares and to first order each square has an area of resolution^2 """ latitude = 0.0 longitude = pi ds = pi*resolution/180.0 points = [(latitude-0.5*pi, longitude)] whi... |
longitude = pi | longitude = 0.0 | def gridsky(resolution): """ grid the sky up into roughly square regions resolution is the length of a side the points get placed at the center of the squares and to first order each square has an area of resolution^2 """ latitude = 0.0 longitude = pi ds = pi*resolution/180.0 points = [(latitude-0.5*pi, longitude)] whi... |
points = [(latitude-0.5*pi, longitude)] | points = [] if shifted: dlat = 0.0 else: dlat = 0.5*pi | def gridsky(resolution): """ grid the sky up into roughly square regions resolution is the length of a side the points get placed at the center of the squares and to first order each square has an area of resolution^2 """ latitude = 0.0 longitude = pi ds = pi*resolution/180.0 points = [(latitude-0.5*pi, longitude)] whi... |
points.append((latitude-0.5*pi, longitude)) | points.append((latitude-dlat, longitude)) | def gridsky(resolution): """ grid the sky up into roughly square regions resolution is the length of a side the points get placed at the center of the squares and to first order each square has an area of resolution^2 """ latitude = 0.0 longitude = pi ds = pi*resolution/180.0 points = [(latitude-0.5*pi, longitude)] whi... |
points.append((latitude-0.5*pi, longitude)) | points.append((latitude-dlat, longitude)) points.append((0.0-dlat,0.0)) | def gridsky(resolution): """ grid the sky up into roughly square regions resolution is the length of a side the points get placed at the center of the squares and to first order each square has an area of resolution^2 """ latitude = 0.0 longitude = pi ds = pi*resolution/180.0 points = [(latitude-0.5*pi, longitude)] whi... |
if pt[0] > pi/2 or pt[0] < -pi/2 \ or pt[1] > 2*pi or pt[1] < 0: | if pt[0] > latmax or pt[0] < latmin or pt[1] > 2*pi or pt[1] < 0.0: | def gridsky(resolution): """ grid the sky up into roughly square regions resolution is the length of a side the points get placed at the center of the squares and to first order each square has an area of resolution^2 """ latitude = 0.0 longitude = pi ds = pi*resolution/180.0 points = [(latitude-0.5*pi, longitude)] whi... |
takes the two grids (lists of lat/lon tuples) and returns a dictionary | takes the two grids (lists of lat/lon tuples) and returns (1) a dictionary | def map_grids(coarsegrid,finegrid,coarseres=4.0): """ takes the two grids (lists of lat/lon tuples) and returns a dictionary where the points in the coarse grid are the keys and lists of tuples of points in the fine grid are the values """ fgtemp = finegrid[:] coarsedict = {} ds = coarseres*pi/180.0 for cpt in coarsegr... |
points in the fine grid are the values | points in the fine grid are the values and (2) (for debugging purposes) returns a list of points in the fine grid that didn't make it NB: *** should work alright if the resolution isn't too coarse (because it uses the infinitesimal form of the metric); 5 is at the upper end of ok *** there is a fudge factor (epsilon) i... | def map_grids(coarsegrid,finegrid,coarseres=4.0): """ takes the two grids (lists of lat/lon tuples) and returns a dictionary where the points in the coarse grid are the keys and lists of tuples of points in the fine grid are the values """ fgtemp = finegrid[:] coarsedict = {} ds = coarseres*pi/180.0 for cpt in coarsegr... |
if (cpt[0]-fpt[0])*(cpt[0]-fpt[0]) <= ds*ds/4.0 and \ (cpt[1]-fpt[1])*(cpt[1]-fpt[1])*sin(cpt[0])*sin(cpt[0]) \ <= ds*ds/4.0: | if (cpt[0]-fpt[0])*(cpt[0]-fpt[0])-ds*ds/4.0 <= epsilon and \ (cpt[1]-fpt[1])*(cpt[1]-fpt[1])*sin(cpt[0])*sin(cpt[0])-ds*ds/4.0 <= epsilon: | def map_grids(coarsegrid,finegrid,coarseres=4.0): """ takes the two grids (lists of lat/lon tuples) and returns a dictionary where the points in the coarse grid are the keys and lists of tuples of points in the fine grid are the values """ fgtemp = finegrid[:] coarsedict = {} ds = coarseres*pi/180.0 for cpt in coarsegr... |
first_col = [pt for pt in coarsegrid if pt[1] == 0.0] for cpt in first_col: flist = [] for fpt in fgtemp: if (cpt[0]-fpt[0])*(cpt[0]-fpt[0])-ds*ds/4.0 <= epsilon and \ (2*pi-fpt[1])*(2*pi-fpt[1])*sin(cpt[0])*sin(cpt[0])-ds*ds/4.0 <= epsilon: coarsedict[cpt].append(fpt) flist.append(fpt) for rpt in flist: fgtemp.remove(... | def map_grids(coarsegrid,finegrid,coarseres=4.0): """ takes the two grids (lists of lat/lon tuples) and returns a dictionary where the points in the coarse grid are the keys and lists of tuples of points in the fine grid are the values """ fgtemp = finegrid[:] coarsedict = {} ds = coarseres*pi/180.0 for cpt in coarsegr... | |
"ISI-OMC_DISPPF_H1_IN1_DAQ",\ "PEM-LVEA2_V2",\ "OMC-ASC_POS_X_IN1_DAQ",\ "OMC-ASC_POS_Y_IN1_DAQ",\ "OMC-QPD3_SUM_IN1_DAQ",\ "OMC-QPD1_SUM_IN1_DAQ",\ "OMC-QPD2_SUM_IN1_DAQ",\ "OMC-QPD4_SUM_IN1_DAQ"\ | "XX:ISI-OMC_DISPPF_H1_IN1_DAQ",\ "XX:PEM-LVEA2_V2",\ "XX:OMC-ASC_POS_X_IN1_DAQ",\ "XX:OMC-ASC_POS_Y_IN1_DAQ",\ "XX:OMC-QPD3_SUM_IN1_DAQ",\ "XX:OMC-QPD1_SUM_IN1_DAQ",\ "XX:OMC-QPD2_SUM_IN1_DAQ",\ "XX:OMC-QPD4_SUM_IN1_DAQ"\ | def __filenameToChannelList__(self,filenameList=[]): """ This method attempts to construct a set of simplified channel names based of a list of image filenames. """ #Parsed filename channel list specialChannelList=[ "ISI-OMC_DISPPF_H1_IN1_DAQ",\ "PEM-LVEA2_V2",\ "OMC-ASC_POS_X_IN1_DAQ",\ "OMC-ASC_POS_Y_IN1_DAQ",\ "OMC-... |
return [str(x).strip() for x in finalChannelList] | return ["XX:"+str(x).strip() for x in finalChannelList] | def __filenameToChannelList__(self,filenameList=[]): """ This method attempts to construct a set of simplified channel names based of a list of image filenames. """ #Parsed filename channel list specialChannelList=[ "ISI-OMC_DISPPF_H1_IN1_DAQ",\ "PEM-LVEA2_V2",\ "OMC-ASC_POS_X_IN1_DAQ",\ "OMC-ASC_POS_Y_IN1_DAQ",\ "OMC-... |
imageDict=dict() indexDict=dict() thumbDict=dict() zValueDict=dict() imageDictAQ=dict() indexDictAQ=dict() thumbDictAQ=dict() zValueDictAQ=dict() | imageDict,indexDict,thumbDict,zValueDict = dict(),dict(),dict(),dict() imageDictAQ,indexDictAQ,thumbDictAQ,zValueDictAQ = dict(),dict(),dict(),dict() filesOmega=wikiFileFinder.get_RDS_R_L1_SEIS() filesAnalyze=wikiFileFinder.get_analyzeQscan_SEIS() | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
indexDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ | indexDict[sngl.ifo],imageDict[sngl.ifo],thumbDict[sngl.ifo],zValueDict[sngl.ifo]=list(),list(),list(),list() indexDictAQ[sngl.ifo],imageDictAQ[sngl.ifo],thumbDictAQ[sngl.ifo],zValueDictAQ[sngl.ifo]=list(),list(),list(),list() indexDict[sngl.ifo]=fnmatch.filter(filesOmega,\ | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
imageDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ | imageDict[sngl.ifo]=fnmatch.filter(filesOmega,\ | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
thumbDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ | thumbDict[sngl.ifo]=fnmatch.filter(filesOmega,\ | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... | |
if (len(zValueFiles) > 0): for zFile in zValueFiles: zValueDict[sngl.ifo].extend(wikiFileFinder.__readSummary__(zFile)) tmpList=list() for chan in zValueDict[sngl.ifo]: | for zFile in fnmatch.filter(filesOmega,\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)): for chan in wikiFileFinder.__readSummary__(zFile): | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
tmpList.append(chan) zValueDict[sngl.ifo]=tmpList else: sys.stdout.write("Omega scan summary file not for for %s. ...skipping...\n"%sngl.ifo) | zValueDict[sngl.ifo].append(chan) if len(zValueDict[sngl.ifo]) == 0: sys.stdout.write("Omega scan summary file not or empty for %s. ...continuing...\n"%sngl.ifo) | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*_%s_%s_*.txt"%(sngl.ifo,timeString)) indexDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ | indexDictAQ[sngl.ifo]=fnmatch.filter(filesAnalyze,\ | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
thumbDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ | imageDictAQ[sngl.ifo]=fnmatch.filter(filesAnalyze,\ "*%s-*_%s_*_SEI*_z_scat-unspecified-gpstime.png"\ %(sngl.ifo,timeString)) thumbDictAQ[sngl.ifo]=fnmatch.filter(filesAnalyze,\ | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
imageDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*%s-*_%s_*_SEI*_z_scat-unspecified-gpstime.png"\ %(sngl.ifo,timeString)) | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... | |
if len(zValueFiles)>0: for zFile in zValueFiles: zValueDictAQ[sngl.ifo].extend(wikiFileFinder.__readZranks__(zFile)) tmpList=list() for chan in zValueDictAQ[sngl.ifo]: | for zFile in fnmatch.filter(filesAnalyze,\ "*_%s_%s_*.txt"%(sngl.ifo,timeString)): for chan in wikiFileFinder.__readSummary__(zFile): | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
tmpList.append(chan) zValueDictAQ[sngl.ifo]=tmpList else: sys.stdout.write("Analyze Qscan Z ranking file not found for %s. ...skipping...\n"%sngl.ifo) | zValueDictAQ[sngl.ifo].append(chan) if len(zValueDictAQ[sngl.ifo]) == 0: sys.stdout.write("AnalyzeQscan summary file not or empty for %s. ...continuing...\n"%sngl.ifo) | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
imageDict=dict() indexDict=dict() thumbDict=dict() zValueDict=dict() imageDictAQ=dict() indexDictAQ=dict() thumbDictAQ=dict() zValueDictAQ=dict() | imageDict,indexDict,thumbDict,zValueDict = dict(),dict(),dict(),dict() imageDictAQ,indexDictAQ,thumbDictAQ,zValueDictAQ = dict(),dict(),dict(),dict() | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
imageDict[sngl.ifo]=list() indexDict[sngl.ifo]=list() thumbDict[sngl.ifo]=list() for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ | indexDict[sngl.ifo],imageDict[sngl.ifo],thumbDict[sngl.ifo],zValueDict[sngl.ifo]=list(),list(),list(),list() indexDictAQ[sngl.ifo],imageDictAQ[sngl.ifo],thumbDictAQ[sngl.ifo],zValueDictAQ[sngl.ifo]=list(),list(),list(),list() for myFile in fnmatch.filter(filesOmega,\ | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ | for myFile in fnmatch.filter(filesOmega,\ | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... | |
if len(zValueFiles)>0: for zFile in zValueFiles: zValueDict[sngl.ifo].extend(wikiFileFinder.__readSummary__(zFile)) tmpList=list() for chan in zValueDict[sngl.ifo]: | for zFile in fnmatch.filter(filesOmega,\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)): for chan in wikiFileFinder.__readSummary__(zFile): | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
imageDictAQ[sngl.ifo]=list() indexDictAQ[sngl.ifo]=list() thumbDictAQ[sngl.ifo]=list() | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... | |
for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*html"%(sngl.ifo,timeString)): indexDictAQ[sngl.ifo].append(myFile) zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*txt"%(sngl.ifo,timeString)) zValueDictAQ[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in z... | for myFile in fnmatch.filter(filesAnalyze,\ | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ | for myFile in fnmatch.filter(filesAnalyze,\ | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*html"%(sngl.ifo,timeString)): indexDictAQ[sngl.ifo].append(myFile) zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*txt"%(sngl.ifo,timeString)) zValueDictAQ[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in ... | for myFile in fnmatch.filter(filesAnalyze,\ | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... |
for myFile in fnmatch.filter(filesAnalyze,\ "*%s-*_%s_*html"%(sngl.ifo,timeString)): indexDictAQ[sngl.ifo].append(myFile) zValueDictAQ[sngl.ifo]=list() for zFile in fnmatch.filter(filesAnalyze,\ "*%s-*_%s_*txt"%(sngl.ifo,timeString)): for chan in wikiFileFinder.__readSummary__(zFile): if not "PEM" in chan[0] or not "SE... | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.ex... | |
sys.stdout.write("Available via browser at %s\n"%(mapFileURL.convert(myDestPath+"/"+myChecklistFilename))) | def __init__(self,type=None,ifo=None,time=None,snr=None,chisqr=None,mass1=None,mass2=None,mchirp=None): """ """ self.type=str(type) self.ifo=str(ifo) self.time=float(time) self.snr=float(snr) self.chisqr=float(chisqr) self.mass1=float(mass1) self.mass2=float(mass2) self.mchirp=float(mchirp) | |
i=list(nonzero(np.asarray(toppoints)[:,2]==injbin))[0] | i=list(np.nonzero(np.asarray(toppoints)[:,2]==injbin))[0] | def plotSkyMap(skypos,skyres,sky_injpoint): from pylal import skylocutils from mpl_toolkits.basemap import Basemap skypoints=array(skylocutils.gridsky(float(skyres))) skycarts=map(lambda s: pol2cart(s[1],s[0]),skypoints) skyinjectionconfidence=None shist=bayespputils.skyhist_cart(array(skycarts),skypos) #shist=skyhi... |
self.cp.set("fu-condor","qscan",home_dirs()+"/rgouaty/opt/omega/omega_r3270_glnxa64_binary/bin/wpipeline") | self.cp.set("fu-condor","qscan",stfu_pipe.home_dirs()+"/rgouaty/opt/omega/omega_r3270_glnxa64_binary/bin/wpipeline") | def set_qscan_executable(self): host = stfu_pipe.get_hostname() if 'phy.syr.edu' in host: self.cp.set("fu-condor","qscan",home_dirs()+"/rgouaty/opt/omega/omega_r3270_glnxa64_binary/bin/wpipeline") else: self.cp.set("fu-condor","qscan",home_dirs()+"/romain/opt/omega/omega_r3270_glnxa64_binary/bin/wpipeline") |
self.cp.set("fu-condor","qscan",home_dirs()+"/romain/opt/omega/omega_r3270_glnxa64_binary/bin/wpipeline") | self.cp.set("fu-condor","qscan",stfu_pipe.home_dirs()+"/romain/opt/omega/omega_r3270_glnxa64_binary/bin/wpipeline") def get_cp(self): return self.cp def write(self): self.get_cp().write(open(self.ini_file,"w")) | def set_qscan_executable(self): host = stfu_pipe.get_hostname() if 'phy.syr.edu' in host: self.cp.set("fu-condor","qscan",home_dirs()+"/rgouaty/opt/omega/omega_r3270_glnxa64_binary/bin/wpipeline") else: self.cp.set("fu-condor","qscan",home_dirs()+"/romain/opt/omega/omega_r3270_glnxa64_binary/bin/wpipeline") |
parser.add_option("-f", "--config-file", default="followup_pipe.ini", help="the config file, default looks for stfu_pipe.ini in path, if none is found it makes one from your environment (only provide a config file if you know you must override something)") parser.add_option("-g", "--gps-times", default='', help="Specif... | parser.add_option("-f", "--config-file", default="WOD_Bologna.ini", help="the config file, default looks for stfu_pipe.ini in path, if none is found it makes one from your environment (only provide a config file if you know you must override something)") parser.add_option("-g", "--gps-times", default='', help="Specify ... | def parse_command_line(): parser = OptionParser( version = "%prog", description = "Pipeline to setup Remote Wscans On Demand" ) parser.add_option("-v", "--verbose", action = "store_true", help = "Be verbose.") parser.add_option("-f", "--config-file", default="followup_pipe.ini", help="the config file, default looks for... |
default_cp = stfu_pipe.create_default_config_wod(options.config_file) | default_cp = create_default_config_wod(options.config_file) | def parse_command_line(): parser = OptionParser( version = "%prog", description = "Pipeline to setup Remote Wscans On Demand" ) parser.add_option("-v", "--verbose", action = "store_true", help = "Be verbose.") parser.add_option("-f", "--config-file", default="followup_pipe.ini", help="the config file, default looks for... |
gpsevents = time_only_events(options.gps_times) | if options.gps_times: gpsevents = time_only_events(options.gps_times) elif options.input_file: gpsevents = extractTimesFromFile(options.input_file) else: print >> sys.stderr, "an argument is missing in the command:\n You need to use one of the options --gps-times or --input-file" sys.exit(1) | def parse_command_line(): parser = OptionParser( version = "%prog", description = "Pipeline to setup Remote Wscans On Demand" ) parser.add_option("-v", "--verbose", action = "store_true", help = "Be verbose.") parser.add_option("-f", "--config-file", default="followup_pipe.ini", help="the config file, default looks for... |
print >>sys.stderr, "following up %s @ %s" % (ifo, event.time) | print >>sys.stdout, "following up %s @ %s" % (ifo, event.time) | def parse_command_line(): parser = OptionParser( version = "%prog", description = "Pipeline to setup Remote Wscans On Demand" ) parser.add_option("-v", "--verbose", action = "store_true", help = "Be verbose.") parser.add_option("-f", "--config-file", default="followup_pipe.ini", help="the config file, default looks for... |
injected_cols.extend(['injected_end_time', 'injected_end_time_ns', 'injected_end_time_utc__Px_click_for_daily_ihope_xP_']) | injected_cols.extend(['injected_decisive_distance','injected_end_time', 'injected_end_time_ns', 'injected_end_time_utc__Px_click_for_daily_ihope_xP_']) | def convert_duration( duration ): return sqlutils.convert_duration( duration, convert_durations ) |
from glue.lal import LIGOTimeGPS | def get_pyvalue(self): return generic_get_pyvalue(self) | |
AND rank(""", decisive_distance, """) <= """, str(limit), """ | %s""" % (limit is not None and ''.join(['AND rank(', decisive_distance, ') <= ', str(limit)]) or ''), """ | def get_decisive_distance( *args ): return sorted(args)[1] |
dag.add_node(self) | if opts.do_makeCheckList: dag.add_node(self) | def __init__(self,dag,job,cp,opts): pipeline.CondorDAGNode.__init__(self,job) #Specify pipe location self.add_var_opt('followup-directory',cp.get("makeCheckListWiki", "location").strip()) #Specify pipe ini file self.add_var_opt('ini-file',cp.get("makeCheckListWiki", "ini-file").strip()) if not opts.disable_dag_categori... |
twoDGreedyCL['ra_sb,dec_sb']=skyinjectionconfidence if min_sky_area_containing_injection: twoDGreedyInj['ra_sb,dec_sb']=min_sky_area_containing_injection | twoDGreedyInj['ra_sb,dec_sb']={} twoDGreedyInj['ra_sb,dec_sb']['confidence']=min_sky_area_containing_injection if min_sky_area_containing_injection: twoDGreedyInj['ra_sb,dec_sb']['area']=min_sky_area_containing_injection | def cbcBayesSkyRes(outdir,data,oneDMenu,twoDGreedyMenu,GreedyRes,confidence_levels,twoDplots,injfile=None,eventnum=None,skyres=None,bayesfactornoise=None,bayesfactorcoherent=None): if eventnum is not None and injfile is None: print "You specified an event number but no injection file. Ignoring!" if data is None: prin... |
while True: | while interval<len(np.asarray(toppoints)[:,3]): | def greedyBin1(par_samps,par_bin,confidence_levels,par_injvalue=None): oneDGreedyCL={} oneDGreedyInj={} parpos_min=min(par_samps) parpos_max=max(par_samps) par_point=parpos_min parpos_Nbins= int(ceil((parpos_max - parpos_min)/par_bin))+1 greedyPoints=np.zeros((parpos_Nbins,2)) #2D so it can be put through same con... |
galpt = fbins[sbin(fbins,inj_pt,fine_res)] | galpt = fbins[skylocutils.sbin(fbins,inj_pt,fine_res)] | def get_unique_filename(name): """ use this to avoid name collisions """ counter = 1 base_name, ext = os.path.splitext(name) while os.path.isfile(name): name = base_name + '_' + str(counter) + ext counter += 1 return name |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.