def runstuff(datapath,picklefilename): makestartfile(datapath) funcnamelist=['radardata','fitting'] runsim.main(funcnamelist,datapath,os.path.join(datapath,picklefilename),True) fit2geodata(os.path.join(datapath,'Fitted','fitteddata.h5')) analysisdump(datapath,os.path.join(datapath,picklefilename),'Non Maxwellian')
def main(): curpath = Path(__file__).resolve().parents[1] print(curpath) testpath = curpath/'Testdata'/'MatrixTest' origparamsdir = testpath/'Origparams' testpath.mkdir(exist_ok=True,parents=True) origparamsdir.mkdir(exist_ok=True,parents=True) # clear everything out folderlist = ['Origparams','Spectrums','Radardata','ACF','Fitted'] for ifl in folderlist: flist = (testpath/ifl).glob('*.h5') for ifile in flist: ifile.unlink() # Make Config file configname = testpath/'config.ini' if not configname.is_file(): srcfile = curpath/'SimISR'/'default.ini' shutil.copy(str(srcfile),str(configname)) # make the coordinates xvec = sp.zeros((1)) yvec = sp.zeros((1)) zvec = sp.arange(50.0,900.0,2.0) # Mesh grid is set up in this way to allow for use in MATLAB with a simple reshape command xx,zz,yy = sp.meshgrid(xvec,zvec,yvec) coords = sp.zeros((xx.size,3)) coords[:,0] = xx.flatten() coords[:,1] = yy.flatten() coords[:,2] = zz.flatten() Z_0 = 250. H_0=30. N_0=6.5e11 Icont1 = MakeTestIonoclass(testv=True,testtemp=True,N_0=N_0,z_0=Z_0,H_0=H_0,coords=coords) Icont1.saveh5(origparamsdir/'0 testiono.h5') Icont1.saveh5(testpath/'startdata.h5') funcnamelist=['spectrums','applymat','fittingmat'] runsim.main(funcnamelist,testpath,configname,True) plotdir = testpath/'AnalysisPlots' plotdir.mkdir(exist_ok=True,parents=True) f_templ = str(plotdir/'params') plotbeamparametersv2([0.],str(configname),str(testpath),fitdir = 'FittedMat',params=['Ne','Ti','Te'],filetemplate=f_templ, suptitle = 'With Mat',werrors=False,nelog=False)
def main(input_str=None): args_commd = parse_command_line(input_str) if args_commd.path is None: curloc = Path(__file__).resolve() testpath = curloc.parent.parent/'Testdata'/'Barker' else: testpath = Path(args_commd.path) origparamsdir = testpath/'Origparams' testpath.mkdir(exist_ok=True,parents=True) print("Making a path for testdata at {}".format(testpath)) origparamsdir.mkdir(exist_ok=True,parents=True) print("Making a path for testdata at {}".format(origparamsdir)) makeconfigfilebarker(testpath) if args_commd.makeorigdata: Icont1 = MakeTestIonoclass(testv=True,testtemp=False,N_0=1e12,z_0=150.0,H_0=50.0) makeinputh5(Icont1,str(testpath)) Icont1.saveh5(str(origparamsdir.joinpath('0 testiono.h5'))) funcnamelist = args_commd.funclist failflag=runsim.main(funcnamelist,testpath,str(testpath.joinpath('barkertest.yml')),True) if not failflag: analysisdump(testpath,testpath.joinpath('barkertest.yml'))
def main(): """This function will run the test simulation buy first making a simple set of ionospheric parameters based off of a Chapman function. Then it will create configuration and start files followed by running the simulation.""" curpath = Path(__file__).resolve().parent testpath = curpath.parent/'Testdata'/'Long_Pulse' origparamsdir = testpath/'Origparams' if not testpath.is_dir(): testpath.mkdir(parents=True) print("Making a path for testdata at {}".format(str(testpath))) if not origparamsdir.is_dir(): origparamsdir.mkdir(parents=True) print("Making a path for testdata at {}".format(origparamsdir)) # clear everything out folderlist = ['Origparams','Spectrums','Radardata','ACF','Fitted'] for ifl in folderlist: flist = (testpath/ifl).glob('*.h5') for ifile in flist: ifile.unlink() # Now make stuff again configsetup(testpath) Icont1 = MakeTestIonoclass(testv=True,testtemp=True) makeinputh5(MakeTestIonoclass(testv=True,testtemp=False),testpath) Icont1.saveh5(origparamsdir/'0 testiono.h5') funcnamelist=['spectrums','radardata','fitting'] failflag = runsim.main(funcnamelist,testpath, testpath/'PFISRExample.ini',True) if not failflag: analysisdump(testpath,str(testpath/'PFISRExample.ini'))
def main(): """This function will run the test simulation buy first making a simple set of ionospheric parameters based off of a Chapman function. Then it will create configuration and start files followed by running the simulation.""" curpath = Path(__file__).resolve().parent testpath = curpath.parent / "Testdata" / "Long_Pulse" origparamsdir = testpath / "Origparams" if not testpath.is_dir(): testpath.mkdir(parents=True) print("Making a path for testdata at {}".format(str(testpath))) if not origparamsdir.is_dir(): origparamsdir.mkdir(parents=True) print("Making a path for testdata at {}".format(origparamsdir)) # clear everything out folderlist = ["Origparams", "Spectrums", "Radardata", "ACF", "Fitted"] for ifl in folderlist: flist = (testpath / ifl).glob("*.h5") for ifile in flist: ifile.unlink() # Now make stuff again configsetup(testpath) Icont1 = MakeTestIonoclass(testv=True, testtemp=True) makeinputh5(MakeTestIonoclass(testv=True, testtemp=False), testpath) Icont1.saveh5(origparamsdir / "0 testiono.h5") funcnamelist = ["spectrums", "radardata", "fitting"] failflag = runsim.main(funcnamelist, testpath, testpath / "PFISRExample.ini", True) if not failflag: analysisdump(testpath, str(testpath / "PFISRExample.ini"))
def main(input_str=None): args_commd = parse_command_line(input_str) if args_commd.path is None: curloc = Path(__file__).resolve() testpath = curloc.parent.parent / 'Testdata' / 'Barker' else: testpath = Path(args_commd.path) origparamsdir = testpath / 'Origparams' testpath.mkdir(exist_ok=True, parents=True) print("Making a path for testdata at {}".format(testpath)) origparamsdir.mkdir(exist_ok=True, parents=True) print("Making a path for testdata at {}".format(origparamsdir)) makeconfigfilebarker(testpath) if args_commd.makeorigdata: Icont1 = MakeTestIonoclass(testv=True, testtemp=False, N_0=1e12, z_0=150.0, H_0=50.0) makeinputh5(Icont1, str(testpath)) Icont1.saveh5(str(origparamsdir.joinpath('0 testiono.h5'))) funcnamelist = args_commd.funclist failflag = runsim.main(funcnamelist, testpath, str(testpath.joinpath('barkertest.yml')), True) if not failflag: analysisdump(testpath, testpath.joinpath('barkertest.yml'))
def main(): curloc = Path(__file__).resolve() testpath = curloc.parent.parent / 'Testdata' / 'Barker' origparamsdir = testpath / 'Origparams' pdb.set_trace() testpath.mkdir(exist_ok=True, parents=True) print("Making a path for testdata at {}".format(testpath)) origparamsdir.mkdir(exist_ok=True, parents=True) print("Making a path for testdata at {}".format(origparamsdir)) makeconfigfilebarker(testpath) Icont1 = MakeTestIonoclass(testv=True, testtemp=False, N_0=1e12, z_0=150.0, H_0=50.0) makeinputh5(Icont1, str(testpath)) Icont1.saveh5(str(origparamsdir.joinpath('0 testiono.h5'))) funcnamelist = ['spectrums', 'radardata', 'fitting'] failflag = runsim.main(funcnamelist, testpath, str(testpath.joinpath('barkertest.ini')), True) if not failflag: analysisdump(testpath, testpath.joinpath('barkertest.ini'))
def runradarsims(testpath,funcnamelist=['spectrums','radardata','fitting'],configfile = 'planeproc2.ini',remakealldata=False,fittimes=None,invtype=''): """ This will run the radar simulations for all the selected data sets""" origparamsdir = os.path.join(testpath,'Origparams') if not os.path.exists(testpath): os.mkdir(testpath) print "Making a path for testdata at "+testpath if not os.path.exists(origparamsdir): os.mkdir(origparamsdir) print "Making a path for testdata at "+origparamsdir makeline(configfile,testpath) # clear everything out # folderlist =[] # if 'spectrums' in funcnamelist: # folderlist.append('Spectrums') # if 'radardata' in funcnamelist and remakealldata: # folderlist.append('Radardata') # folderlist.append('ACF') # if 'fitting' in funcnamelist: # folderlist.append('Fitted') ## folderlist = ['Spectrums','Radardata','ACF','Fitted'] # for ifl in folderlist: # flist = glob.glob(os.path.join(testpath,ifl,'*.h5')) # for ifile in flist: # os.remove(ifile) ismat = False for ifc in funcnamelist: if 'mat' in ifc: ismat=True break runsim.main(funcnamelist,testpath,configfile,remakealldata,fittimes,invtype=invtype) try: if ismat: plotdir = os.path.join(testpath,'AnalysisPlots') f_templ = os.path.join(plotdir,'paramsmat') plotbeamparametersv2([0.],configfile,testpath,fitdir = 'FittedMat',params=['Ne','Ti','Te'],filetemplate=f_templ, suptitle = 'With Mat',werrors=False,nelog=False) else: analysisdump(testpath,configfile,'Plane Example') except: print "Analysis dump failed somewhere"
def main(funcnamelist): """This function will run the test simulation buy first making a simple set of ionospheric parameters based off of a Chapman function. Then it will create configuration and start files followed by running the simulation.""" curpath = Path(__file__).resolve().parent testpath = curpath / 'Testdata' / 'DishMode' origparamsdir = testpath / 'Origparams' testpath.mkdir(exist_ok=True, parents=True) origparamsdir.mkdir(exist_ok=True, parents=True) if 'configupdate' in funcnamelist: configsetup(testpath) funcnamelist.remove('configupdate') # clear everything out folddict = { 'origdata': ['Origparams'], 'spectrums': ['Spectrums'], 'radardata': ['ACF', 'Radardata'], 'fitting': ['Fitted'] } folderlist = [] for i in funcnamelist: folderlist = folderlist + folddict[i] # folderlist = ['Origparams','Spectrums','Radardata','ACF','Fitted'] for ifl in folderlist: flist = (testpath / ifl).glob('*.h5') for ifile in flist: ifile.unlink() # Now make stuff again if 'origdata' in funcnamelist: Icont1 = MakeTestIonoclass(testv=True, testtemp=True) makeinputh5(MakeTestIonoclass(testv=True, testtemp=False), testpath) Icont1.saveh5(origparamsdir / '0 testiono.h5') funcnamelist.remove('origdata') # funcnamelist=['spectrums','radardata','fitting'] failflag = runsim.main(funcnamelist, testpath, testpath / 'DishExample.ini', True) if not failflag: analysisdump(testpath, testpath / 'DishExample.ini')
def main(): curloc = Path(__file__).resolve() testpath = curloc.parent.parent/'Testdata'/'Barker' origparamsdir = testpath/'Origparams' pdb.set_trace() testpath.mkdir(exist_ok=True,parents=True) print("Making a path for testdata at {}".format(testpath)) origparamsdir.mkdir(exist_ok=True,parents=True) print("Making a path for testdata at {}".format(origparamsdir)) makeconfigfilebarker(testpath) Icont1 = MakeTestIonoclass(testv=True,testtemp=False,N_0=1e12,z_0=150.0,H_0=50.0) makeinputh5(Icont1,str(testpath)) Icont1.saveh5(str(origparamsdir.joinpath('0 testiono.h5'))) funcnamelist=['spectrums','radardata','fitting'] failflag=runsim.main(funcnamelist,testpath,str(testpath.joinpath('barkertest.ini')),True) if not failflag: analysisdump(testpath,testpath.joinpath('barkertest.ini'))
def main(funcnamelist): """This function will run the test simulation buy first making a simple set of ionospheric parameters based off of a Chapman function. Then it will create configuration and start files followed by running the simulation.""" curpath = Path(__file__).resolve().parent testpath = curpath/'Testdata'/'DishMode' origparamsdir = testpath/'Origparams' testpath.mkdir(exist_ok=True,parents=True) origparamsdir.mkdir(exist_ok=True,parents=True) if 'configupdate' in funcnamelist: configsetup(testpath) funcnamelist.remove('configupdate') # clear everything out folddict = {'origdata':['Origparams'], 'spectrums':['Spectrums'], 'radardata':['ACF','Radardata'], 'fitting':['Fitted']} folderlist = [] for i in funcnamelist: folderlist=folderlist+folddict[i] # folderlist = ['Origparams','Spectrums','Radardata','ACF','Fitted'] for ifl in folderlist: flist = (testpath/ifl).glob('*.h5') for ifile in flist: ifile.unlink() # Now make stuff again if 'origdata' in funcnamelist: Icont1 = MakeTestIonoclass(testv=True,testtemp=True) makeinputh5(MakeTestIonoclass(testv=True,testtemp=False),testpath) Icont1.saveh5(origparamsdir/'0 testiono.h5') funcnamelist.remove('origdata') # funcnamelist=['spectrums','radardata','fitting'] failflag=runsim.main(funcnamelist,testpath,testpath/'DishExample.ini',True) if not failflag: analysisdump(testpath,testpath/'DishExample.ini')
def main(): curpath = Path(__file__).resolve().parents[1] print(curpath) testpath = curpath / 'Testdata' / 'MatrixTest' origparamsdir = testpath / 'Origparams' testpath.mkdir(exist_ok=True, parents=True) origparamsdir.mkdir(exist_ok=True, parents=True) # clear everything out folderlist = ['Origparams', 'Spectrums', 'Radardata', 'ACF', 'Fitted'] for ifl in folderlist: flist = (testpath / ifl).glob('*.h5') for ifile in flist: ifile.unlink() # Make Config file configname = testpath / 'config.ini' if not configname.is_file(): srcfile = curpath / 'SimISR' / 'default.ini' shutil.copy(str(srcfile), str(configname)) # make the coordinates xvec = sp.zeros((1)) yvec = sp.zeros((1)) zvec = sp.arange(50.0, 900.0, 2.0) # Mesh grid is set up in this way to allow for use in MATLAB with a simple reshape command xx, zz, yy = sp.meshgrid(xvec, zvec, yvec) coords = sp.zeros((xx.size, 3)) coords[:, 0] = xx.flatten() coords[:, 1] = yy.flatten() coords[:, 2] = zz.flatten() Z_0 = 250. H_0 = 30. N_0 = 6.5e11 Icont1 = MakeTestIonoclass(testv=True, testtemp=True, N_0=N_0, z_0=Z_0, H_0=H_0, coords=coords) Icont1.saveh5(origparamsdir / '0 testiono.h5') Icont1.saveh5(testpath / 'startdata.h5') funcnamelist = ['spectrums', 'applymat', 'fittingmat'] runsim.main(funcnamelist, testpath, configname, True) plotdir = testpath / 'AnalysisPlots' plotdir.mkdir(exist_ok=True, parents=True) f_templ = str(plotdir / 'params') plotbeamparametersv2([0.], str(configname), str(testpath), fitdir='FittedMat', params=['Ne', 'Ti', 'Te'], filetemplate=f_templ, suptitle='With Mat', werrors=False, nelog=False)