DataTests jiming$ lalapps_Makefakedata_v4 --outSingleSFT=TRUE --outSFTbname="parameter_test_TB100_1days3e-25.sft" --logfile="./parameter_test_TB100_1days3e-25.log" --IFO="H1" --ephemDir="/Users/jiming/mylal/share/lalpulsar" --startTime=1065789985 --duration=8640000 --Tsft=1800 --fmin=184.75 --Band=0.5 --window="tukey" --refTime=1070109985 --Alpha=2.9 --Delta=0.7 --h0=3e-25 --cosi=0.25 --psi=0.25 --phi0=0.25 --Freq=185 --noiseSqrtSh="3e-23" ### S/N=0.01 DataTests jiming$ lalapps_Makefakedata_v4 --outSingleSFT=TRUE --outSFTbname="parameter_test_TB100_1days3e-24.sft" --logfile="./parameter_test_TB100_1days3e-24.log" --IFO="H1" --ephemDir="/Users/jiming/mylal/share/lalpulsar" --startTime=1065789985 --duration=8640000 --Tsft=1800 --fmin=184.75 --Band=0.5 --window="tukey" --refTime=1070109985 --Alpha=2.9 --Delta=0.7 --h0=3e-24 --cosi=0.25 --psi=0.25 --phi0=0.25 --Freq=185 --noiseSqrtSh="3e-23" ### S/N=0.1Note: the data produced by lalapps_Makefakedata_v4 is under the current directory. Make sure the data produced into " cd /Users/jiming/uniwork/DataTests"
Comments (anyone can leave some comments, suggestions or questions here):
lalapps_ComputeFStatistic_v2 --maxEndTime=1074429985 --minStartTime=1065789985 --DataFiles="parameter_test_TB100_1days3e-25.sft" --outputFstat="outputTB100days3e-25" --outputFstatHist="outputTB100_1daysHist" --outputLoudest="outputTB100_1daysLoudest" --outputTransientStats="outputTB100_1daysTransientStats" --outputLogfile="./TB100_1days.log" --IFO="H1" --ephemDir="/Users/jiming/mylal/share/lalpulsar" --refTime=1070109985 --Alpha=2.9 --Delta=0.7 --Freq=184.95 --FreqBand=0.1 --ephemYear="00-19-DE405" --dFreq=5e-5 --NumCandidatesToKeep=2000 ##S/N=0.01 lalapps_ComputeFStatistic_v2 --maxEndTime=1074429985 --minStartTime=1065789985 --DataFiles="parameter_test_TB100_1days3e-24.sft" --outputFstat="outputTB100days3e-24" --outputFstatHist="outputTB100_1daysHist" --outputLoudest="outputTB100_1daysLoudest" --outputTransientStats="outputTB100_1daysTransientStats" --outputLogfile="./TB100_1days.log" --IFO="H1" --ephemDir="/Users/jiming/mylal/share/lalpulsar" --refTime=1070109985 --Alpha=2.9 --Delta=0.7 --Freq=184.95 --FreqBand=0.1 --ephemYear="00-19-DE405" --dFreq=5e-5 --NumCandidatesToKeep=2000 ##S/N=0.1 lalapps_ComputeFStatistic_v2 --maxEndTime=1074429985 --minStartTime=1065789985 --DataFiles="parameter_test_TB100_1days3e-24.sft" --outputFstat="outputTB100days3e-24_hr" --outputFstatHist="outputTB100_1daysHist" --outputLoudest="outputTB100_1daysLoudest" --outputTransientStats="outputTB100_1daysTransientStats" --outputLogfile="./TB100_1days.log" --IFO="H1" --ephemDir="/Users/jiming/mylal/share/lalpulsar" --refTime=1070109985 --Alpha=2.9 --Delta=0.7 --Freq=184.9995 --FreqBand=0.001 --ephemYear="00-19-DE405" --dFreq=5e-8 --NumCandidatesToKeep=2000 ##S/N=0.1 high resolutionNote: 1:use --outputFstatAtoms carefully because this command will produce a ".dat" file for each template. It is possible that you get millions of them which would make your labtop a mess. If such terrible situation happen, here is the terminal command to sovle the problem: "find . -type f -name outputTB\* -delete -print". 2: if the NumCandidatesToKeep is more than templates, --outputFstat will only have 5 highest 2F candidates. WEIRD.
Comments (anyone can leave some comments, suggestions or questions here):
c=load('/Users/jiming/uniwork/DataTests/fliename');Picture:
figure;plot(c(:,1),c(:,7),'*c');
Comments (anyone can leave some comments, suggestions or questions here):
Tsft (min) | SFT band (Hz) |
Search frequency band (Hz) |
N_templates |
Obs. mean(2F) |
Obs. max(2F) |
E[2F] |
Pred. Std(2F) |
Tspan (days) |
||
30 | 0.5 | 0.1 | 2000 | 4.0452 | 35.92 | 68.5 | 100 | |||
30 | 0.5 | 0.1 | 2000 | 6.5265 | 5034 | 6454 | 100 | |||
30 | 0.5 | 0.001 | 20000 | 5.840 | 5078 | 6454 | 100 |
Comments (anyone can leave some comments, suggestions or questions here):
import pdb import os, sys import signal, subprocess, shutil, shlex, random def run_bash_command(cmdline): # print to screen what the command line is you want to perform #print "I perform: %s" % (cmdline) # try to run command line; catch the exception in case of failure and exit with a note try: returnValue = subprocess.call(shlex.split(cmdline)) except OSError, (errno, strerror): print "I failed to run your code. Hint: %s" % (strerror) sys.exit(1) os.chdir("/Users/jiming/uniwork/simulation/") #command_line = ''' cd ~/uniwork/simulation/ ''' #run_bash_command(command_line) #command_line0 = ''' . ~/mylal/etc/lalpulsar-user-env.sh ''' #run_bash_command(command_line0) # get path to current working directory mainpath = os.getcwd() #print "%s" % (mainpath) #loop: how many times of simulation wants to do. results_predict is the results of the predict value of 2F results = list() results_predict = list() for number in range(1,1001): print "%s" % (number) tmpfile1 = 'tmpfile1' tmpfile2 = 'tmpfile2' tmpfile3 = 'tmpfile3' #frequency = random.uniform(184.9995,185.0005) # define the command line to run; it calls a lalapps_Makefakedata, a lalapps_ComputeFStatistic and a lalapps_PredictFStat command_line1 = '''lalapps_Makefakedata_v4 --outSingleSFT=TRUE --outSFTbname="%s" --IFO="H1" --ephemDir="/Users/jiming/mylal/share/lalpulsar" --startTime=1065789985 --duration=864000 --Tsft=1800 --fmin=184.75 --Band=0.5 --refTime=1066221985 --Alpha=2.9 --Delta=0.7 --h0=3e-24 --cosi=0.25 --psi=0.25 --phi0=0.25 --Freq=185 --noiseSqrtSh=3e-23''' % (tmpfile1) command_line2 = '''lalapps_ComputeFStatistic_v2 --DataFiles="%s" --outputFstat="%s" --IFO="H1" --ephemDir="/Users/jiming/mylal/share/lalpulsar" --refTime=1066221985 --Alpha=2.9 --Delta=0.7 --Freq=185 --FreqBand=0 --ephemYear="00-19-DE405" --dFreq=5e-8 --NumCandidatesToKeep=1 ''' % (tmpfile1, tmpfile2) command_line3 = '''lalapps_PredictFStat --IFO="H1" --ephemDir="/Users/jiming/mylal/share/lalpulsar" --Alpha=2.9 --Delta=0.7 --h0=3e-24 --cosi=0.25 --psi=0.25 --phi0=0.25 --DataFiles=%s -F 185 --ephemYear="00-19-DE405" --outputFstat=%s''' % (tmpfile1, tmpfile3) # run lalapps command (function defined above) run_bash_command(command_line1) run_bash_command(command_line2) run_bash_command(command_line3) os.remove(tmpfile1) # read in the tmp file to get the FSatistic(2F); remove tmp file afterwards infile = open('%s' % (tmpfile2),'r') content = infile.readlines() infile.close() os.remove(tmpfile2) # read out the 2F #F = content[13].split()[6] #print "%s" % (F) #F = content[13].split()[6] for line in content: if not line.startswith('%'): F = line.split()[6] break # read in the tmp file to get the PredictF (2F); remove tmp file afterwards infile = open('%s' % (tmpfile3),'r') content = infile.readlines() infile.close() os.remove(tmpfile3) for line in content: if line.startswith('twoF_expected'): PredictF = line.split()[2] break #print "%s" % (PredictF) #PredictF = content3[9].split()[2] # append the 2F value to list results.append(F) results_predict.append(PredictF) # define outputfilepath; open outputfile and write; close file at the end outfilename = os.path.join(mainpath,'result3') #import numpy as np #results = np.array(results) #np.savetext(outfilename,results) outfile = open(outfilename, 'w') for number in xrange(len(results)): #outfile.write(results) outfile.write('%s\n'%results[number]) outfile.close() #---------------Output the Predict_F in file which matlab can read outfilename = os.path.join(mainpath,'result_predictF') #import numpy as np #results = np.array(results) #np.savetext(outfilename,results) outfile = open(outfilename, 'w') for number in xrange(len(results_predict)): #outfile.write(results) outfile.write('%s\n'%results_predict[number]) outfile.close() #print "%s" % (results)2 : read the simulation results by matlab, then plot the hist picture of the simulation results and compare this with theoretical predict. note: 1 the noncentrality parameter λ=snr^2 used in ploting the theoretical PDF is produced by lalapps_PredictFStat. Compute the mean of 1000 *PredictFStat we get noncentral parameter 642.8-4=638.8* 2 the functions used in matlab are chi2pdf and ncx2pdf for without and with signal respectively Here is the results:
Comments (anyone can leave some comments, suggestions or questions here):After talked with Map about this inconsisitency between CFS(computerFStatistic) and PFS (predictFStatistic)gives, at first we thought this due to the f-sataistic bias described in Reinhard's note: https://dcc.ligo.org/LIGO-T1100551 but the bias due to fact that E(1/X) not equals 1/E(x) can't be used to explain why the hist shift left( this positive bias only makes the hist even right!) then we thought it might be that something in PFS is not right. therefore we tried another lalapp which don't need the specific data file, here is the command line:
hnb478:makeupoflal jiming$ lalapps_SemiAnalyticF -a 2.9 -d 0.7 -Y 0.25 -Q 0.25 -i 0.25 -s 3e-24 -N 3e-23 -n 480 -D H1 -E "/Users/jiming/mylal/share/lalpulsar" -S 1065789985We get the noncentral parameter is 627-4=623 this time we use new noncentral parameter and 10 thousands simulation results gived by CFS, and the plot is like this:
I | Attachment | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|
![]() |
2Ffor_e-24_hr.jpg | manage | 44 K | 11 Nov 2013 - 13:51 | JingMing | |
![]() |
2Ffor_e-25.eps | manage | 203 K | 11 Nov 2013 - 13:04 | JingMing | |
![]() |
2Ffor_e-25.fig | manage | 31 K | 11 Nov 2013 - 13:01 | JingMing | |
![]() |
2Ffor_e-25.jpg | manage | 54 K | 11 Nov 2013 - 13:51 | JingMing | |
![]() |
2fFfor_2-24.jpg | manage | 62 K | 11 Nov 2013 - 13:51 | JingMing | |
![]() |
simulation_nosignal.jpg | manage | 62 K | 01 Dec 2013 - 23:06 | JingMing | |
![]() |
simulation_with_signal.jpg | manage | 56 K | 01 Dec 2013 - 23:06 | JingMing | |
![]() |
simulation_with_signal_compare_with_semianalyticF.jpg | manage | 40 K | 11 Dec 2013 - 16:23 | JingMing | |
![]() |
simulation_with_signal_v2_0.jpg | manage | 66 K | 02 Dec 2013 - 21:12 | JingMing |