Beispiel #1
0
def completed_or_archived_runids_in_range(runidspec):
    runids = sorted(runids_in_range(runidspec))
    db = Database()
    runids = filter(
        lambda runid: db.select("runid=" + str(runid))[0]['runstatus'] in
        ('completed', 'archived'), runids)
    db.close()
    return runids
Beispiel #2
0
if len(sys.argv) != 3:
    raise ValueError("This script expects exactly two command-line arguments")

vistype = sys.argv[1].lower()
found = False
for knowntype in filenames_for_vistype.keys():
    if knowntype.startswith(vistype):
        vistype = knowntype
        found = True
        break
if not found: raise ValueError("Unknown visualization type: " + vistype)

buildrange = sys.argv[2].lower()
update = "update".startswith(buildrange)
rebuild = "rebuild".startswith(buildrange)
runidrange = runids_in_range(buildrange)
if not update and not rebuild and not runidrange:
    raise ValueError("Unknown build range: " + buildrange)

# -----------------------------------------------------------------

# get a list of relevant filename endings depending on the visualization type
filenames = filenames_for_vistype[vistype]

# construct the list of SKIRT-runs to be processed
if runidrange:
    skirtruns = [SkirtRun(runid) for runid in runidrange]
else:
    skirtruns = completed_skirtruns(filenames if update else None)

# =================================================================
Beispiel #3
0
if not stage in ("extract", "simulate", "observe", "store"):
    raise ValueError("First argument must be 'extract', 'simulate', 'observe', or 'store'")
mode = sys.argv[2]
if not mode in ("loop", "force"):
    raise ValueError("Second argument must be 'loop' or 'force'")
argum = sys.argv[3]

# parse and verify third argument according to requested mode
if mode == "loop":
    numjobs = int(argum)
    if numjobs<1 or numjobs>99: raise ValueError("Number of jobs must be in range [1,99]")
    print "Preparing {} {} jobs in loop mode".format(numjobs, stage)
if mode == "force":
    numjobs = 1
    runidspec = argum
    numruns = len(runids_in_range(runidspec))
    if numruns<1 or numruns>20: raise ValueError("Can't schedule more than 20 SKIRT-runs in single job")
    print "Preparing {} job with {} SKIRT-runs in force mode".format(stage, numruns)

# set some parameters according to requested stage
wallhours = 72
if stage=="simulate":
    tasks = 2
    cpuspertask = 8
    cpuspernode = 16
    memorypernode = 120  # can usually be lower for simulations without IFU
else:
    tasks = 1
    cpuspertask = 1
    cpuspernode = 1
    memorypernode = 30
Beispiel #4
0
def completed_or_archived_runids_in_range(runidspec):
    runids = sorted(runids_in_range(runidspec))
    db = Database()
    runids = filter(lambda runid: db.select("runid=" + str(runid))[0]["runstatus"] in ("completed", "archived"), runids)
    db.close()
    return runids
Beispiel #5
0
        "This script expects exactly two command-line arguments: outputtype runidspec"
    )

vistypes = ('bandimages', 'densities', 'fastimages', 'greybodyfit', 'infofile',
            'particles', 'seds', 'temperature', 'wavemovie')
inputtype = sys.argv[1].lower()
found = False
for knowntype in vistypes:
    if knowntype.startswith(inputtype):
        vistype = knowntype
        found = True
        break
if not found: raise ValueError("Unknown visualization type: " + inputtype)

runidspec = sys.argv[2]
runids = runids_in_range(runidspec)

# construct a list of SKIRT-runs to be processed
skirtruns = [SkirtRun(runid) for runid in runids]

# =================================================================

# build band-integrated images
if vistype == 'bandimages':
    from pts.core.plot.rgbimages import makeintegratedrgbimages
    from pts.core.filter.broad import BroadBandFilter
    print "Building band-integrated images for {} SKIRT-runs".format(
        len(skirtruns))
    filterR = BroadBandFilter('SDSS.i')
    filterG = BroadBandFilter('SDSS.r')
    filterB = BroadBandFilter('SDSS.g')
Beispiel #6
0
# get and parse the command-line arguments
if len(sys.argv) != 3: raise ValueError("This script expects exactly two command-line arguments")

vistype = sys.argv[1].lower()
found = False
for knowntype in filenames_for_vistype.keys():
    if knowntype.startswith(vistype):
        vistype = knowntype
        found = True
        break
if not found: raise ValueError("Unknown visualization type: " + vistype)

buildrange = sys.argv[2].lower()
update =  "update".startswith(buildrange)
rebuild = "rebuild".startswith(buildrange)
runidrange = runids_in_range(buildrange)
if not update and not rebuild and not runidrange: raise ValueError("Unknown build range: " + buildrange)

# -----------------------------------------------------------------

# get a list of relevant filename endings depending on the visualization type
filenames = filenames_for_vistype[vistype]

# construct the list of SKIRT-runs to be processed
if runidrange:
    skirtruns = [ SkirtRun(runid) for runid in runidrange ]
else:
    skirtruns = completed_skirtruns(filenames if update else None)

# =================================================================
Beispiel #7
0
if len(sys.argv) != 3:
    raise ValueError("This script expects exactly two command-line arguments: outputtype runidspec")

vistypes = ('gepimages', 'bandimages', 'densities', 'fastimages', 'greybodyfit', 'infofile',
            'particles', 'seds', 'temperature', 'wavemovie')
inputtype = sys.argv[1].lower()
found = False
for knowntype in vistypes:
    if knowntype.startswith(inputtype):
        vistype = knowntype
        found = True
        break
if not found: raise ValueError("Unknown visualization type: " + inputtype)

runidspec = sys.argv[2]
runids = runids_in_range(runidspec)

# construct a list of SKIRT-runs to be processed
skirtruns = [ SkirtRun(runid) for runid in runids ]

# =================================================================

# build GEP-band-integrated gray-scale images
if vistype=='gepimages':
    from pts.core.plot.rgbimages import makeintegratedrgbimages
    from pts.core.filter.broad import BroadBandFilter
    print "Building GEP-band-integrated gray-scale images for {} SKIRT-runs".format(len(skirtruns))
    # List of filter objects
    bandedges = (
    ( 1,  10.00,  11.33),
    ( 2,  11.33,  12.84),