示例#1
0
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 = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
    testpath = os.path.join(os.path.split(curpath)[0],'Testdata','Long_Pulse')
    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

    # clear everything out
    folderlist = ['Origparams','Spectrums','Radardata','ACF','Fitted']
    for ifl in folderlist:
        flist = glob.glob(os.path.join(testpath,ifl,'*.h5'))
        for ifile in flist:
            os.remove(ifile)
    # Now make stuff again
    configsetup(testpath)

    Icont1 = MakeTestIonoclass(testv=True,testtemp=True)
    makeinputh5(MakeTestIonoclass(testv=True,testtemp=False),testpath)
    Icont1.saveh5(os.path.join(origparamsdir,'0 testiono.h5'))
    funcnamelist=['spectrums','radardata','fitting']
    failflag = runsim.main(funcnamelist,testpath,os.path.join(testpath,'PFISRExample.ini'),True)
    if not failflag:
        analysisdump(testpath,os.path.join(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 = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
    testpath = os.path.join(os.path.split(curpath)[0],'Testdata','Long_Pulse')
    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

    # clear everything out
    folderlist = ['Origparams','Spectrums','Radardata','ACF','Fitted']
    for ifl in folderlist:
        flist = glob.glob(os.path.join(testpath,ifl,'*.h5'))
        for ifile in flist:
            os.remove(ifile)
    # Now make stuff again
    configsetup(testpath)

    Icont1 = MakeTestIonoclass(testv=True,testtemp=True)
    makeinputh5(MakeTestIonoclass(testv=True,testtemp=False),testpath)
    Icont1.saveh5(os.path.join(origparamsdir,'0 testiono.h5'))
    funcnamelist=['spectrums','radardata','fitting']
    runsim.main(funcnamelist,testpath,os.path.join(testpath,'PFISRExample.ini'),True)
    analysisdump(testpath,os.path.join(testpath,'PFISRExample.ini'))
示例#3
0
def main():
    curpath = os.path.dirname(
        os.path.abspath(inspect.getfile(inspect.currentframe())))
    testpath = os.path.join(os.path.split(curpath)[0], 'Testdata', 'Barker')
    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


#    makeconfigfile(testpath)

    Icont1 = MakeTestIonoclass(testv=True,
                               testtemp=False,
                               N_0=1e12,
                               z_0=150.0,
                               H_0=50.0)
    makeinputh5(Icont1, testpath)
    Icont1.saveh5(os.path.join(origparamsdir, '0 testiono.h5'))
    funcnamelist = ['spectrums', 'radardata', 'fitting']

    failflag = runsim.main(funcnamelist, testpath,
                           os.path.join(testpath, 'PFISRExample.pickle'), True)
    if not failflag:
        analysisdump(testpath, os.path.join(testpath, 'PFISRExample.pickle'))
示例#4
0
def main(plist=None,
         functlist=['spectrums', 'radardata', 'fitting', 'analysis', 'stats']):
    """ This function will call other functions to create the input data, config
        file and run the radar data sim. The path for the simulation will be 
        created in the Testdata directory in the RadarDataSim module. The new
        folder will be called BasicTest. The simulation is a long pulse simulation
        will the desired number of pulses from the user.
        Inputs
            npulse - Number of pulses for the integration period, default==100.
            functlist - The list of functions for the RadarDataSim to do.
    """
    if plist is None:
        plist = sp.array([50, 100, 200, 500, 1000, 2000, 5000])
    if isinstance(plist, list):
        plist = sp.array(plist)
    curloc = os.path.dirname(
        os.path.abspath(inspect.getfile(inspect.currentframe())))
    testpath = os.path.join(os.path.split(curloc)[0], 'Testdata', 'StatsTest')

    if not os.path.isdir(testpath):
        os.mkdir(testpath)
    functlist_default = ['spectrums', 'radardata', 'fitting']
    check_list = sp.array([i in functlist for i in functlist_default])
    check_run = sp.any(check_list)
    functlist_red = sp.array(functlist_default)[check_list].tolist()
    allfolds = []
    #    rsystools = []
    for ip in plist:
        foldname = 'Pulses_{:04d}'.format(ip)
        curfold = os.path.join(testpath, foldname)
        allfolds.append(curfold)
        if not os.path.isdir(curfold):
            os.mkdir(curfold)

            configfilesetup(curfold, ip)
        makedata(curfold)
        config = os.path.join(curfold, 'stats.ini')
        (sensdict, simparams) = readconfigfile(config)
        #        rtemp = RadarSys(sensdict,simparams['Rangegatesfinal'],ip)
        #        rsystools.append(rtemp.rms(sp.array([1e12]),sp.array([2.5e3]),sp.array([2.5e3])))
        if check_run:
            runsim(functlist_red, curfold, os.path.join(curfold, 'stats.ini'),
                   True)
        if 'analysis' in functlist:
            analysisdump(curfold, config)
        if 'stats' in functlist:
            makehist(curfold, ip)
示例#5
0
def main():
    curpath = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
    testpath = os.path.join(os.path.split(curpath)[0],'Testdata','Barker')
    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
#    makeconfigfile(testpath)


    Icont1 = MakeTestIonoclass(testv=True,testtemp=False,N_0=1e12,z_0=150.0,H_0=50.0)
    makeinputh5(Icont1,testpath)
    Icont1.saveh5(os.path.join(origparamsdir,'0 testiono.h5'))
    funcnamelist=['spectrums','radardata','fitting']
    runsim.main(funcnamelist,testpath,os.path.join(testpath,'PFISRExample.pickle'),True)
    analysisdump(testpath,os.path.join(testpath,'PFISRExample.pickle'))