Пример #1
0
# -*- coding: utf8 -*-
# *****************************************************************
# **       PTS -- Python Toolkit for working with SKIRT          **
# **       © Astronomical Observatory, Ghent University          **
# *****************************************************************

# Import the relevant PTS classes and modules
from pts.modeling.config.maps import definition

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

# Subtraction factor
definition.add_optional("factor_range", "real_range", "range (min,max) of values for the factor that denotes the contribution of the old stellar population to the MIPS 24 micron emission", "0.2,0.7", convert_default=True)
definition.add_optional("factor_nvalues", "integer", "the number of values for the factor", 8)

# Remake?
definition.add_flag("remake", "remake already existing maps", False)

# Replot?
definition.add_flag("replot", "replot already existing plots", False)

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

# Plot
definition.add_flag("plot", "plotting", False)

# Clear?
definition.add_flag("clear", "clear maps", False)

# -----------------------------------------------------------------
Пример #2
0
# Import the relevant PTS classes and modules
from pts.magic.view.html import scales, colormaps, zooms
from pts.modeling.config.maps import definition

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

default_colour = "jet"
default_colormap = "viridis"
default_scale = "log"
default_zoom = "toFit"

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

# Create the configuration
definition.add_flag("show", "show the page", False)

# VIEW
definition.add_optional("colormap", "string", "color map", default_colormap, choices=colormaps)
definition.add_optional("scale", "string", "image scaling", default=default_scale, choices=scales)
definition.add_optional("zoom", "string", "zoom function", default_zoom, choices=zooms)

# Scales for different kinds of maps
definition.add_optional("colour_scale", "string", "scaling for colour maps", "histeq")
definition.add_optional("ssfr_scale", "string", "scaling for ssfr maps", "log")
definition.add_optional("tir_scale", "string", "scaling for TIR maps", "log")
definition.add_optional("attenuation_scale", "string", "scaling for attenuation maps", "log")
definition.add_optional("old_scale", "string", "scaling for old stellar maps", "log")
definition.add_optional("young_scale", "string", "scaling for young stellar maps", "log")
definition.add_optional("ionizing_scale", "string", "scaling for ionizing stellar maps", "log")
definition.add_optional("dust_scale", "string", "scaling for dust maps", "log")
Пример #3
0
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# **       PTS -- Python Toolkit for working with SKIRT          **
# **       © Astronomical Observatory, Ghent University          **
# *****************************************************************

# Import the relevant PTS classes and modules
from pts.modeling.config.maps import definition

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

# Create the configuration
definition.add_flag("show", "show the page", False)

# ADVANCED
definition.add_optional(
    "nopen_files", "positive_integer",
    "number of open files necessary to make the script work", 1024)

# Flags
definition.add_flag("thumbnails", "add map thumbnails", True)
definition.add_optional("thumbnail_height", "positive_integer",
                        "height of the thumbnails (in pixels)", 50)
definition.add_flag(
    "previews", "add previews of the maps when hovering over the thumbnails",
    True)
definition.add_flag("methods", "make a separate table for each method", True)

# -----------------------------------------------------------------
Пример #4
0
# Import the relevant PTS classes and modules
from pts.magic.view.html import scales, colormaps, zooms
from pts.modeling.config.maps import definition

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

default_colour = "jet"
default_colormap = "viridis"
default_scale = "log"
default_zoom = "toFit;x2"

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

# Create the configuration
definition.add_flag("show", "show the page", False)

# VIEW
definition.add_optional("colormap", "string", "color map", default_colormap, choices=colormaps)
definition.add_optional("scale", "string", "image scaling", default=default_scale, choices=scales)
definition.add_optional("zoom", "string", "zoom function", default_zoom, choices=zooms)

definition.add_optional("softening_start", "real", "relative radius for softening to start (relative to truncation ellipse)", 0.75)
definition.add_flag("view_png", "use the pngs for viewing instead of the original data", False)
definition.add_optional("cropping_factor", "positive_real", "multiply the cropping box with this factor", 1.3)

# Exclusively for the views
definition.add_flag("menubar", "add menubars", True)
definition.add_flag("colorbar", "add colorbars", True)

# Flags
Пример #5
0
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# **       PTS -- Python Toolkit for working with SKIRT          **
# **       © Astronomical Observatory, Ghent University          **
# *****************************************************************

# Import the relevant PTS classes and modules
from pts.modeling.config.maps import definition

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

# Create the configuration
definition.add_flag("show", "show the page", False)

# ADVANCED
definition.add_optional("nopen_files", "positive_integer", "number of open files necessary to make the script work", 1024)

# Flags
definition.add_flag("thumbnails", "add map thumbnails", True)
definition.add_optional("thumbnail_height", "positive_integer", "height of the thumbnails (in pixels)", 50)
definition.add_flag("previews", "add previews of the maps when hovering over the thumbnails", True)
definition.add_flag("methods", "make a separate table for each method", True)

# -----------------------------------------------------------------
Пример #6
0
# Get map names
old_map_names = old_map_paths.keys()
young_map_names = young_map_paths.keys()
ionizing_map_names = ionizing_map_paths.keys()
dust_map_names = dust_map_paths.keys()

# Get number of maps
nold_maps = len(old_map_names)
nyoung_maps = len(young_map_names)
nionizing_maps = len(ionizing_map_names)
ndust_maps = len(dust_map_names)

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

# Create the configuration
definition.add_flag("show", "show the page", False)

# Remote
definition.add_optional("remote",
                        "string",
                        "remote host to use for creating the clip masks",
                        choices=find_host_ids(schedulers=False))

# Flags
definition.add_flag(
    "convolve", "perform convolution during the creation of the clip masks",
    False)

# CROPPING
definition.add_optional("cropping_factor", "positive_real",
                        "multiply the cropping box with this factor", 1.3)
Пример #7
0
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# **       PTS -- Python Toolkit for working with SKIRT          **
# **       © Astronomical Observatory, Ghent University          **
# *****************************************************************

# Import the relevant PTS classes and modules
from pts.modeling.config.maps import definition

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

# Remake?
definition.add_flag("remake", "remake already existing maps", False)

# REplot?
definition.add_flag("replot", "remake already existing plots", False)

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

# Smoothing
definition.add_flag("smooth", "smooth the maps by convolving them with a gaussian kernel", True)
definition.add_optional("smoothing_factor", "positive_real", "factor that determines the smoothing kernel FWHM based on the original FWHMs of the maps", 2.)

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

# Plot
definition.add_flag("plot", "plotting", False)

# -----------------------------------------------------------------
Пример #8
0
nold_maps = len(old_map_names)
nyoung_maps = len(young_map_names)
nionizing_maps = len(ionizing_map_names)
ndust_maps = len(dust_map_names)

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

maps_path = fs.join(modeling_path, "maps")
maps_components_path = fs.join(maps_path, "components")

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

# SELECTION

# AUTO-SELECT??
definition.add_flag("auto", "make selections automatically based on the preferred modeling guidelines", False)

# Auto selection options
default_max_nnegatives = 0.1
definition.add_optional("hot_dust_max_nnegatives", "positive_real", "maximum relative number of negatives in a central ellipse for selection of hot dust map", default_max_nnegatives)
definition.add_optional("young_max_nnegatives", "positive_real", "maximum relative number of negatives in a central ellipse for selection of young stellar map", default_max_nnegatives)

# Selections
definition.add_optional("old", "string_list", "selected old stellar maps", choices=old_map_names)
definition.add_optional("young", "string_list", "selected young stellar maps", choices=young_map_names)
definition.add_optional("ionizing", "string_list", "selected ionizing stellar maps", choices=ionizing_map_names)
definition.add_optional("dust", "string_list", "selected dust maps", choices=dust_map_names)

# Selections with indices
definition.add_optional("old_indices", "integer_list", "selected old stellar maps", choices=range(nold_maps))
definition.add_optional("young_indices", "integer_list", "selected young stellar maps", choices=range(nyoung_maps))
Пример #9
0
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# **       PTS -- Python Toolkit for working with SKIRT          **
# **       © Astronomical Observatory, Ghent University          **
# *****************************************************************

# Import the relevant PTS classes and modules
from pts.modeling.config.maps import definition
from pts.modeling.maps.attenuation import methods

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

# Remake?
definition.add_flag("remake", "remake already existing maps", False)

# Remake?
definition.add_flag("replot", "replot already existing plots", False)

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

# Select specific input maps
definition.add_flag("select_ssfr", "select specific sSFR maps", False)
definition.add_flag("select_tir", "select specific TIR maps", False)

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

# Sepcific input maps
definition.add_optional("ssfrs", "string_list", "names of the sSFR maps to use")
definition.add_optional("tirs", "string_list", "names of the TIR maps to use")
Пример #10
0
# **       © Astronomical Observatory, Ghent University          **
# *****************************************************************

# Import the relevant PTS classes and modules
from pts.modeling.config.maps import definition

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

# The significance level
definition.add_optional(
    "fuv_significance", "real",
    "the significance level of the FUV image below which to cut-off the stellar map",
    3.0)

# Remove holes from the cutoff mask
definition.add_flag("remove_holes", "remove holes from the total cutoff mask",
                    True)

definition.add_optional(
    "factor_range",
    "real_range",
    "range (min,max) of values for the factor that denotes the contribution of the old stellar population to the FUV emission",
    "0.1,0.4",
    convert_default=True)
definition.add_optional("factor_nvalues", "integer",
                        "the number of values for the factor", 4)
#definition.add_optional("best_factor", "real", "the best estimate for the value of the factor", 0.1) # WAS 0.2, then 0.15. 0.1 SEEMS BEST WHEN LOOKING AT HISTOGRAMS!

definition.add_optional(
    "histograms_annulus_range",
    "real_range",
    "range (min,max) of the radius (relative to the scalelength) of the area for to make histograms of the pixel values of the corrected FUV maps",
Пример #11
0
from pts.modeling.config.maps import definition

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

# The significance level
#definition.add_optional("fuv_significance", "real", "significance level of the FUV image below which to cut-off the dust map", 2.5)
#definition.add_optional("mips24_significance", "real", "significance level of the MIPS 24 micron image below which to cut-off the dust map", 2.0)
#definition.add_optional("pacs70_significance", "real", "significance level of the Pacs 70 micron image below which to cut-off the dust map", 1.0)
#definition.add_optional("pacs160_significance", "real", "significance level of the Pacs 160 micron image below which to cut-off the dust map", 2.0)
#definition.add_optional("h_significance", "real", "significance level of the 2MASS H image below which to cut-off the dust map", 0.0) # used for SSFR

# Remove holes from the cutoff mask
#definition.add_flag("remove_holes", "remove holes from the total cutoff mask", True)

# Flags for enabling/disabling different methods
definition.add_flag("make_black_body",
                    "make dust map based on black-body fitting", True)
definition.add_flag("make_emission", "make dust map based on emission", True)
definition.add_flag("make_attenuation", "make dust map based on attenuation",
                    True)
definition.add_flag("make_hot", "make map of hot dust", True)

definition.add_optional("hot_factor_range",
                        "real_range",
                        "range of factor to create the hot dust maps",
                        "0.2>0.7",
                        convert_default=True)
definition.add_optional("factor_nvalues", "positive_integer",
                        "number of factors", 8)

# Best method
#definition.add_optional("best_method", "string", "the method of which to use the resul as the final dust map", "cortese")
Пример #12
0
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# **       PTS -- Python Toolkit for working with SKIRT          **
# **       © Astronomical Observatory, Ghent University          **
# *****************************************************************

# Import the relevant PTS classes and modules
from pts.modeling.config.maps import definition
from pts.modeling.maps.component import default_central_ellipse_factor

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

# Show
definition.add_flag("show", "show the page", False)

# ADVANCED
definition.add_optional("nopen_files", "positive_integer", "number of open files necessary to make the script work", 1024)

# Flags
definition.add_flag("thumbnails", "add map thumbnails", True)
definition.add_optional("thumbnail_height", "positive_integer", "height of the thumbnails (in pixels)", 50)
definition.add_flag("previews", "add previews of the maps when hovering over the thumbnails", True)
definition.add_flag("methods", "make a separate table for each method", True)

# Filtering maps
definition.add_flag("filter", "filter the maps", True)
definition.add_optional("central_ellipse_factor", "real", "central ellipse factor for filtering", default_central_ellipse_factor)
definition.add_optional("ninvalid_pixels_tolerance", "percentage", "number of invalid pixels tolerated within central ellipse", "10", convert_default=True)
definition.add_optional("nzero_pixels_tolerance", "percentage", "number of zero pixels tolerated within central ellipse", "40", convert_default=True)
definition.add_optional("nnegative_pixels_tolerance", "percentage", "number of negative pixels tolerated within central ellipse", "20", convert_default=True)
Пример #13
0
maps_components_path = fs.join(maps_path, "components")

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

# Get selection indices
indices = fs.files_in_path(maps_components_path, extension="dat", returns="name", startswith="selection", convert=int, sort=int, convert_split_index=1, convert_split_pattern="_")

# Add the setting
if len(indices) == 0: raise RuntimeError("Could not find any selection file")
elif len(indices) == 1: definition.add_fixed("selection", "selection to use", indices[0])
else: definition.add_optional("selection", "positive_integer", "selection to use", choices=indices)

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

# Show?
definition.add_flag("show", "show the page", False)

# Remote
definition.add_optional("remote", "string", "remote host to use for creating the clip masks", choices=find_host_ids(schedulers=False))

# Flags
definition.add_flag("convolve", "perform convolution during the creation of the clip masks", False)

# CROPPING
definition.add_optional("cropping_factor", "positive_real", "multiply the cropping box with this factor", 1.3)

# REBINNING
definition.add_optional("rebin_remote_threshold", "data_quantity", "data size threshold for remote rebinning", "0.5 GB", convert_default=True)

# Flags
definition.add_flag("add_old", "add old stellar maps", True)
Пример #14
0
# Get map names
old_map_names = old_map_paths.keys()
young_map_names = young_map_paths.keys()
ionizing_map_names = ionizing_map_paths.keys()
dust_map_names = dust_map_paths.keys()

# Get number of maps
nold_maps = len(old_map_names)
nyoung_maps = len(young_map_names)
nionizing_maps = len(ionizing_map_names)
ndust_maps = len(dust_map_names)

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

# Steps
definition.add_flag("steps", "save the results of intermediate steps", True)

# Remote
definition.add_optional("remote",
                        "string",
                        "remote host to use for creating the clip masks",
                        choices=find_host_ids(schedulers=False))

# CONVOLUTION
definition.add_flag(
    "convolve", "perform convolution during the creation of the clip masks",
    True)

# REBINNING
definition.add_optional("rebin_remote_threshold",
                        "data_quantity",
Пример #15
0
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# **       PTS -- Python Toolkit for working with SKIRT          **
# **       © Astronomical Observatory, Ghent University          **
# *****************************************************************

# Import the relevant PTS classes and modules
from pts.modeling.config.maps import definition

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

# Show
definition.add_flag("show", "show the page", False)

# ADVANCED
definition.add_optional(
    "nopen_files", "positive_integer",
    "number of open files necessary to make the script work", 1024)

# Flags
definition.add_flag("thumbnails", "add map thumbnails", True)
definition.add_optional("thumbnail_height", "positive_integer",
                        "height of the thumbnails (in pixels)", 50)
definition.add_flag(
    "previews", "add previews of the maps when hovering over the thumbnails",
    True)
definition.add_flag("methods", "make a separate table for each method", True)

# Filtering maps
definition.add_flag("filter", "filter the maps", True)
Пример #16
0
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# **       PTS -- Python Toolkit for working with SKIRT          **
# **       © Astronomical Observatory, Ghent University          **
# *****************************************************************

# Import the relevant PTS classes and modules
from pts.modeling.config.maps import definition

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

# Remake?
definition.add_flag("remake", "remake already existing maps", False)

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