Ejemplo n.º 1
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)

# -----------------------------------------------------------------
Ejemplo n.º 2
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

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

# 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)

# -----------------------------------------------------------------
Ejemplo n.º 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)

# -----------------------------------------------------------------
Ejemplo n.º 4
0
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")

# For PNG
definition.add_optional("colours", "string", "colour or colour map for plotting", default=default_colour)
Ejemplo n.º 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

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

# 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)

# -----------------------------------------------------------------
Ejemplo n.º 6
0
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
definition.add_flag("replot", "replot already existing figures", False)
definition.add_flag("info", "add info about the images", True)
Ejemplo n.º 7
0
# 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")

# Methods
definition.add_optional("tir_methods", "string_list", "only use TIR maps created with these methods")

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

definition.add_flag("debug_plots", "plot Cortese sSFR pixel masks", False)

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

# Methods
definition.add_positional_optional("methods", "string_list", "attenuation map making methods", default=methods, choices=methods)

# -----------------------------------------------------------------
Ejemplo n.º 8
0
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)

# REBINNING
definition.add_optional("rebin_remote_threshold",
                        "data_quantity",
                        "data size threshold for remote rebinning",
Ejemplo n.º 9
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")

# Sections: different dust map makers
#definition.import_section("cortese", "options for Cortese dust map maker", cortese_definition)
#definition.import_section("buat", "options for Buat dust map maker", buat_definition)
#definition.import_section("black_body", "options for black body dust map maker", bb_definition)
#definition.import_section("emission", "options for emission dust map maker", emission_definition)

# Remake?
Ejemplo n.º 10
0
# -----------------------------------------------------------------

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))
definition.add_optional("ionizing_indices", "integer_list", "selected ionizing stellar maps", choices=range(nionizing_maps))
definition.add_optional("dust_indices", "integer_list", "selected dust maps", choices=range(ndust_maps))

# Anti-selections
Ejemplo n.º 11
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

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

# 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!
Ejemplo n.º 12
0
# *****************************************************************
# **       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)

definition.add_flag("hide_invalid", "hide invalid maps", False)
Ejemplo n.º 13
0
# Set the modeling path
modeling_path = verify_modeling_cwd()

# Set paths
maps_path = fs.join(modeling_path, "maps")
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)
Ejemplo n.º 14
0
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",
                        "data size threshold for remote rebinning",
                        "0.5 GB",
                        convert_default=True)

# Selections
Ejemplo n.º 15
0
# *****************************************************************
# **       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)
definition.add_optional("central_ellipse_factor", "real",
                        "central ellipse factor for filtering", 0.5)