예제 #1
0
import module_importPlotParams
import matplotlib.pyplot as plt
plt.rcParams['text.usetex'] = True
plt.rcParams['text.latex.unicode'] = True
plt.rcParams.update(module_importPlotParams.fparams())
plt.ion()  ## optional
######

print('usage:')
print(
    'run  ', sys.argv[0],
    '   [filename]   [p_threshold_low=-1(autodetect)]   [p_threshold_high=(-)0.2]    [Nsamples=(-)100, slowWindow=?]   [fastWindow=2] '
)
filename = sys.argv[1]
rootname = module_filenamesHandler.get_rootname(filename)
suffix = module_filenamesHandler.get_suffix(filename)

p_threshold_low = -1
if len(sys.argv) > 2:
    p_threshold_low = float(sys.argv[2])

p_threshold_high = -0.2
if len(sys.argv) > 3:
    p_threshold_high = float(sys.argv[3])

slowWindow = -100
if len(sys.argv) > 4:
    slowWindow = int(sys.argv[4])
if slowWindow < 0:
    Nsamples = -slowWindow
else:
예제 #2
0
    module_filenamesHandler.filename_parser(rootname_AVA[:-4], 'ph'))
slowWindow = int(
    float(module_filenamesHandler.filename_parser(rootname_AVA[:-4], 'sW')))
fastWindow = int(
    float(module_filenamesHandler.filename_parser(rootname_AVA[:-4], 'fW')))
kind = module_filenamesHandler.filename_parser(rootname_AVA[:-4], 'kind')
curStep = int(
    float(module_filenamesHandler.filename_parser(rootname_AVA[:-4], 'cst')) /
    1e6)
recPeriod = int(
    float(module_filenamesHandler.filename_parser(rootname_AVA[:-4], 'rP')))
LL = int(
    float(module_filenamesHandler.filename_parser(rootname_AVA[:-4], 'LL')))

rootname = module_filenamesHandler.get_rootname(rootname_AVA)
suffix = module_filenamesHandler.get_suffix(rootname_AVA)
softwindowsName = rootname_AVA + "trainers-soft.dat"
hardwindowsName = rootname_AVA + "trainers-hard.dat"
trajname = rootname + "_type=FIRE-traj_" + "cst=" + str(
    curStep) + "e6_rP=" + str(recPeriod) + "_LL=" + str(LL) + ".gsd"
typeTraj = module_filenamesHandler.filename_parser(trajname[:-4], 'type')
if "FIRE" not in typeTraj or 'deco' in typeTraj:
    print(
        "error: use FIRE trajectories (in their eventsData form) OR adapt your code"
    )
    print(
        "\nNOTE: we need the full trajectory when we fish for the ebst exampes (to train our SVM), because we will use some frames that are in the middle of nowhere, and also just a few steps BEFORE events. So the 'deco'  file is not enough."
    )
    raise SystemExit

print("you selected only atoms of the kind ", kind)