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 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)