コード例 #1
0
# MOVE TRANSITION FILES
if os.path.exists('./m/axion.m.10000'):
    os.rename('./m/axion.m.10000', './axion.m.10000')
if os.path.exists('./m/axion.m.10001'):
    os.rename('./m/axion.m.10001', './axion.m.10001')

# HDF5 DATASETS TO INCLUDE FIRST AND LAST
fileMeas = pa.findmfiles('./m/')

mylist = []
sel = True
firstlast = True
firstnumber = 1

for meas in fileMeas:
    if pa.gm(meas, 'bincon?'):
        mylist.append(meas)
if len(mylist) == 0:
    print('No single file with conbin!')
    sys.exit()

# LOOK FOR ARGUMENTS OF THE FUNCTION TO COMPLETE THE SETS PLOTTED
if len(sys.argv) == 1:
    if len(mylist) == 1:
        mylist = [mylist[0]]
    elif len(mylist) > 1:
        mylist = [mylist[0], mylist[-1]]
else:
    for input in sys.argv[1:]:
        if input == 'all':
            sel = False
コード例 #2
0
ファイル: plot3Ddens.py プロジェクト: veintemillas/jaxions
    if re_contrastmap:
        an_contrastmap = False
elif len(sys.argv) == 3:
    filename = './' + sys.argv[-2]
    fileHdf5 = h5py.File(filename, "r")
    dens0redens = sys.argv[-1]
    if dens0redens == 'dens':
        an_contrastmap = 'energy/density' in fileHdf5
        re_contrastmap = False
    elif dens0redens == 'redens':
        re_contrastmap = 'energy/redensity' in fileHdf5
        an_contrastmap = False

if an_contrastmap:
    print('Contrast found')
    con = pa.gm(filename, '3Dmapefull', True)
    Lx = len(con)
    Ly = len(con)
    Lz = len(con)
    sizeL = pa.gm(filename, 'L')
    z = pa.gm(filename, 'z')
    print('Size =  (', Lx, 'x', Ly, 'x', Lz, ') in file ', filename)

if re_contrastmap:
    print('Reduced Contrast found')
    con = pa.gm(filename, '3Dmape')
    Lx = len(con)
    Ly = len(con)
    Lz = len(con)
    sizeL = pa.gm(filename, 'L')
    z = pa.gm(filename, 'z')
コード例 #3
0
fileHdf5 = h5py.File(fileMeas[0], "r")
Lx = fileHdf5["/"].attrs.get("Size")
Ly = fileHdf5["/"].attrs.get("Size")
Lz = fileHdf5["/"].attrs.get("Depth")
# z = fileHdf5["/"].attrs.get("z")

fileHdf5.close()
allData = []
zData = []
for meas in fileMeas:
    #			print(meas)
    fileHdf5 = h5py.File(meas, "r")
    zR = fileHdf5["/"].attrs.get("z")
    fl = fileHdf5["/"].attrs.get("Field type").decode()

    if (mode == 'theta') and pa.gm(meas, 'map?'):
        if fl == "Saxion":
            mTmp = fileHdf5['map']['m'].value.reshape(Ly, Lx, 2)
            aData = (np.arctan2(mTmp[:, :, 1], mTmp[:, :, 0]) +
                     2 * np.pi) / (4. * np.pi)
            # rData = np.sqrt(mTmp[:,:,0]**2 + mTmp[:,:,1]**2)
            # rMax = np.amax(rData)
            # rData = rData/zR
        elif fl == "Axion":
            aData = fileHdf5['map']['m'].value.reshape(Ly, Lx)
            aData = aData / zR
            rData = np.ones(aData.shape)
            pData = np.ones(aData.shape) * (2 * np.pi)
            aData = (aData + pData) / (4. * np.pi)
    if (mode == 'vA') and pa.gm(meas, 'map?'):
        if fl == "Saxion":
コード例 #4
0
# MOVE TRANSITION FILES
if os.path.exists('./m/axion.m.10000'):
    os.rename('./m/axion.m.10000','./axion.m.10000')
if os.path.exists('./m/axion.m.10001'):
    os.rename('./m/axion.m.10001','./axion.m.10001')

# HDF5 DATASETS TO INCLUDE FIRST AND LAST
fileMeas = pa.findmfiles('./m/')

mylist = []
sel = True
firstlast = True
firstnumber = 1

for meas in fileMeas:
    if pa.gm(meas,'psp?'):
        mylist.append(meas)
if len(mylist)==0:
    print('No single file with nSpecrum!')
    sys.exit()


# LOOK FOR ARGUMENTS OF THE FUNCTION TO COMPLETE THE SETS PLOTTED
if len(sys.argv) == 1:
    if len(mylist) == 1:
        mylist = [ mylist[0] ]
    elif len(mylist) > 1:
        mylist = [ mylist[0], mylist[-1] ]
else:
    for input in sys.argv[1:]:
        if input == 'all':
コード例 #5
0
if os.path.exists('./m/axion.m.10000'):
    os.rename('./m/axion.m.10000', './axion.m.10000')
if os.path.exists('./m/axion.m.10001'):
    os.rename('./m/axion.m.10001', './axion.m.10001')

# HDF5 DATASETS TO INCLUDE FIRST AND LAST
fileMeas = pa.findmfiles('./m/')

mylist = []
sel = True
firstlast = True
firstnumber = 1

zt = []
for meas in fileMeas:
    if pa.gm(meas, 'bintheta?'):
        mylist.append(meas)
        zt.append(pa.gm(meas, 'time'))
if len(mylist) == 0:
    print('No single file with contheta!')
    sys.exit()

ordi = np.argsort(np.array(zt))
omylist = [mylist[i] for i in ordi]
mylist = omylist

# LOOK FOR ARGUMENTS OF THE FUNCTION TO COMPLETE THE SETS PLOTTED
if len(sys.argv) == 1:
    if len(mylist) == 1:
        mylist = [mylist[0]]
    else:
コード例 #6
0
ファイル: specevol.py プロジェクト: veintemillas/jaxions
# MOVE TRANSITION FILES
if os.path.exists('./m/axion.m.10000'):
    os.rename('./m/axion.m.10000','./axion.m.10000')
if os.path.exists('./m/axion.m.10001'):
    os.rename('./m/axion.m.10001','./axion.m.10001')

# HDF5 DATASETS TO INCLUDE FIRST AND LAST
fileMeas = pa.findmfiles('./m/')

mylist = []
sel = True
firstlast = True
firstnumber = 1

for meas in fileMeas:
    if pa.gm(meas,'nsp?'):
        mylist.append(meas)
if len(mylist)==0:
    print('No single file with nSpecrum!')
    sys.exit()

# LOOK FOR ARGUMENTS OF THE FUNCTION TO COMPLETE THE SETS PLOTTED
if len(sys.argv) == 1:
    if len(mylist) == 1:
        mylist = [ mylist[0] ]
    elif len(mylist) > 1:
        mylist = [ mylist[0], mylist[-1] ]
else:
    for input in sys.argv[1:]:
        if input == 'all':
            sel = False
コード例 #7
0
# LATEX OUTPUT

from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
## for Palatino and other serif fonts use:
#rc('font',**{'family':'serif','serif':['Palatino']})
rc('text', usetex=True)
plt.rc('font', family='serif')

# HDF5 DATASETS
#fileMeas = sorted([x for x in [y for y in os.listdir("./m/")] if re.search("axion.m.[0-9]{5}$", x)])
mfiles = pa.findmfiles('./m/')

# SIMULATION DATA
sizeN = pa.gm(mfiles[0],'N')
sizeL = pa.gm(mfiles[0],'L')
nqcd  = pa.gm(mfiles[0],'nqcd')

# SIMULATION NAME?
if sys.argv[-1][-2:] != 'py':
    simname = sys.argv[-1]
else :
    simname = ''
    dirpath = os.getcwd()
    foldername = os.path.basename(dirpath)
    if len(foldername) > 4:
        simname = foldername[4:]

# ID
ups = simname+' : N'+str(sizeN)+' L'+str(sizeL)+' n'+str(nqcd)+' ('+mark+')'