Beispiel #1
0
definition.add_flag("calculate_calibration_uncertainties",
                    "calculate calibration uncertainties", True)

# Source extraction
definition.add_flag("extract_sources", "extract sources", True)
definition.import_section("extraction", "star extraction options",
                          extraction_definition)

# Galactic extinction
definition.add_flag("correct_for_extinction",
                    "correct for galactic extinction", True)
definition.add_optional("attenuation", "real", "the galactic attenuation")

# Unit conversion
definition.add_flag("convert_unit", "convert unit", True)
definition.add_section("unit_conversion", "unit conversion")
definition.sections["unit_conversion"].add_optional("to_unit", "unit",
                                                    "target unit", "MJy/sr")

# Convolution
definition.add_flag("convolve", "convolve")
definition.add_section("convolution", "convolution")
definition.sections["convolution"].add_optional("kernel_path", "file_path",
                                                "kernel path")
definition.sections["convolution"].add_optional("kernel_fwhm", "real",
                                                "kernel FWHM")
definition.sections["convolution"].add_optional("remote", "string",
                                                "remote host")

# Rebinning
definition.add_flag("rebin", "rebin")
Beispiel #2
0
definition.add_optional("width", "length_quantity", "maximum width before/behind center vertical plane for the edgeon projection")

# Output directory
definition.add_optional("output", "directory_path", "output directory")

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

# Spacing of the maps
definition.add_optional("spacing", "string", "method of determining the grid cell spacing", default_spacing_measure, choices=spacing_measures)
definition.add_optional("spacing_factor", "positive_real", "factor by which to multiply the grid cells spacing measure to become the actual map spacing", default_spacing_factor)

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

# Do interpolation on the maps
definition.add_flag("interpolate", "do interpolation", False)

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

# Do plot
definition.add_flag("plot", "do plotting", True)

# Plotting sections
definition.add_section("plotting", "plotting options")
definition.sections["plotting"].add_optional("interval", "string", "interval", "minmax")
definition.sections["plotting"].add_flag("contours", "show contours", False)
definition.sections["plotting"].add_optional("ncontours", "positive_integer", "number of contour levels", 5)
definition.sections["plotting"].add_optional("contours_color", "string", "color for the contour lines", "white")
definition.sections["plotting"].add_optional("minmax", "real_pair", "plotting minimum and maximum value")

# -----------------------------------------------------------------
Beispiel #3
0
    "If possible, avoid the fitting procedure and use the FWHM defined by the frame",
    True)
definition.add_optional("input_path", "directory_path",
                        "path to the input directory")
definition.add_optional("output_path", "directory_path",
                        "path to the output directory")
definition.add_flag("track_record", "track record", False)
definition.add_flag("plot_track_record_if_exception", True)
definition.add_optional("manual_region", "file_path", "manual star region")
definition.add_flag("remove", "remove stars from the frame", True)
definition.add_flag("find_saturation", "find saturated stars", True)

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

# Settings for fetching the catalogs
definition.add_section("fetching", "fetching")

# THE CATALOGS
default_catalogs = ["2MASS"]
definition.sections["fetching"].add_optional("catalogs", "string_list",
                                             "catalogs for point sources",
                                             default_catalogs,
                                             stellar_catalog_descriptions)

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

definition.sections["fetching"].add_flag("use_statistics_file",
                                         "use statistics file")
definition.sections["fetching"].add_optional("statistics_path", "file_path",
                                             "statistics file path")
Beispiel #4
0
# -----------------------------------------------------------------

# TeX rendering of text
definition.add_flag("tex", "enable TeX rendering", True)

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

# Axis positions
definition.add_optional("xaxis_position", "string", "position of x axis ticks and label", "bottom", choices=["bottom", "top"])
definition.add_optional("yaxis_position", "string", "position of y axis ticks and label", "left", choices=["left", "right"])

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

# Legends positions
definition.add_section("legends", "legend options")

# Add?
definition.sections["legends"].add_flag("instruments", "add instruments legend", True)
definition.sections["legends"].add_flag("observations", "add observations legend", True)
definition.sections["legends"].add_flag("models", "add models legend", True)
definition.sections["legends"].add_flag("residuals", "add residuals legends", True)

# LOC
definition.sections["legends"].add_optional("instruments_location", "string", "location of instruments legend", default_instruments_loc, choices=locations)
definition.sections["legends"].add_optional("observations_location", "string", "location of observations legend", default_observations_loc, choices=locations)
definition.sections["legends"].add_optional("models_location", "string", "location of models legend", default_models_loc, choices=locations)

# Residuals
definition.sections["legends"].add_optional("observations_residuals_location", "string", "location of observations legend on residuals panels", default_observations_loc, choices=locations)
definition.sections["legends"].add_optional("models_residuals_location", "string", "location of models legend on residuals panels", default_models_loc, choices=locations)
Beispiel #5
0
                        "aperture FWHM factor", 3.0)

definition.add_optional("galaxy_central_flux", "real",
                        "central flux of galaxy", 100.)
definition.add_optional("galaxy_sersic_index", "real", "sersic index", 1.5)
definition.add_optional("galaxy_position",
                        "pixelcoordinate",
                        "galaxy position",
                        "250,150",
                        convert_default=True)
definition.add_optional("galaxy_effective_radius", "positive_real",
                        "galaxy effective radius in pixels", 30.)
definition.add_optional("galaxy_angle",
                        "angle",
                        "galaxy angle",
                        "52 deg",
                        convert_default=True)
definition.add_optional("galaxy_axial_ratio", "positive_real", "axial ratio",
                        2.0)
definition.add_optional(
    "galaxy_relative_asymptotic_radius", "positive_real",
    "radius of the galaxy mask relative to the effective radius", 4.)

definition.add_optional("polynomial_degree", "positive_integer",
                        "degree of polynomial", 2)

definition.add_section("plotting", "plotting options")
definition.sections["plotting"].add_flag("meshes", "plot meshes")

# -----------------------------------------------------------------
Beispiel #6
0
# Flags
definition.add_flag(
    "relative",
    "treats the given input and output paths as being relative to the ski/fski file"
)
definition.add_flag("brief", "enable brief console logging", letter="b")
definition.add_flag("verbose", "enable verbose logging", letter="v")
definition.add_flag("memory", "enable memory logging", letter="m")
definition.add_flag("allocation",
                    "enable memory (de)allocation logging",
                    letter="a")
definition.add_flag("emulate",
                    "emulate the simulation while limiting computation",
                    letter="e")

definition.add_section("extraction")

definition.add_section("plotting")

definition.add_section("misc")

#reader = ConfigurationReader("launch")
#config = reader.read(definition)

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

# Create the command-line parser
parser = argparse.ArgumentParser()
parser.add_argument("file", type=str, help="the name of the ski/fski file")
parser.add_argument("-i",
                    "--input",
Beispiel #7
0
# Perform sigma-clipping step
definition.add_flag("sigma_clip_mask", "sigma-clipping", True)

# Estimate the sky (obviously)
definition.add_flag("estimate", "estimate the sky", True)

# Set zero outside of the principal galaxy
definition.add_flag("set_zero_outside", "set zero outside of principal galaxy",
                    True)

# Eliminate negative values (replace them by zero)
definition.add_flag("eliminate_negatives", "replace negative pixels by zero",
                    False)

# Creation of the sky mask
definition.add_section("mask", "creation of sky mask")
definition.sections["mask"].add_optional(
    "annulus_inner_factor", "real",
    "sky annulus inner factor (based on principal galaxy ellipse", 1.2)
definition.sections["mask"].add_optional(
    "annulus_outer_factor", "real",
    "sky annulus outer factor (based on principal galaxy ellipse", 4.0)
definition.sections["mask"].add_optional(
    "saturation_expansion_factor", "real",
    "expansion factor for saturation regions", 1.5)
definition.sections["mask"].add_optional("stars_expansion_factor", "real",
                                         "expansion factor for star regions",
                                         1.5)

# Sigma clipping
definition.add_section("sigma_clipping", "sigma clipping")
Beispiel #8
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.core.basics.configuration import ConfigurationDefinition

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

# Create the configuration
definition = ConfigurationDefinition(log_path="log", config_path="config")

# Add settings
definition.add_section("database", "options for the DustPedia database connection")
definition.sections["database"].add_optional("username", "string", "the username")
definition.sections["database"].add_optional("password", "string", "the password")

# -----------------------------------------------------------------
Beispiel #9
0
    "x_quantity",
    "string",
    "quantity to be used for the x axis (not for hybridization mode)",
    choices=["cores", "processes", "threads"],
    default="cores")

# Sigma level for plotting error bars
definition.add_optional("sigma_level", "real",
                        "sigma level for plotting error bars", 1.0)

# Make fit and plot fit
definition.add_flag("fit", "fit theoretical curves to timing and memory data",
                    True)

# Fitting options
definition.add_section("fitting", "fitting options")
definition.sections["fitting"].add_flag("plot_fit",
                                        "plot the fitted relations", True)

# Pure scaling behaviour
definition.sections["fitting"].add_section("pure_scaling_behaviour",
                                           "pure scaling behaviour")
for phase in pure_scaling_behaviour:
    definition.sections["fitting"].sections[
        "pure_scaling_behaviour"].add_optional(
            phase,
            "mixed_list",
            "scaling behaviour for the " + phase_names[phase],
            default=pure_scaling_behaviour[phase])

# Composite scaling behaviour
Beispiel #10
0
# -----------------------------------------------------------------

default_npackages = 1e7
default_parallelization = "2:1:2" # 2 cores, 1 process, 2 threads per core

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

# Create the configuration definition
definition = ConfigurationDefinition()

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

# SKIRT options
definition.add_optional("npackages", "positive_integer", "number of photon packages", default_npackages)
definition.add_optional("parallelization", "parallelization", "parallelization scheme for the simulations", default_parallelization, convert_default=True)

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

# DUST GRIDS
# Settings for the dust grid
definition.add_section("dg", "options for the dust grid")
definition.sections["dg"].add_optional("grid_type", "string", "the type of dust grid", "bintree", choices=["cartesian", "bintree", "octtree"])
definition.sections["dg"].add_optional("rel_scale", "real", "the number of image pixels to take as the minimum scale in the model (can also be a certain fraction of a pixel)", 10.) #1.)
definition.sections["dg"].add_optional("max_mass_fraction", "real", "the maximum mass fraction per cell", 1e-5) #1e-6)
definition.sections["dg"].add_optional("scale_heights", "real", "number of times to take the dust scale height as the vertical radius of the dust grid", 10.)
definition.sections["dg"].add_optional("bintree_min_level", "integer", "minimum depth level for binary trees", 9)
definition.sections["dg"].add_optional("octtree_min_level", "integer", "minimum depth level for octrees", 3)

# -----------------------------------------------------------------
Beispiel #11
0
# -*- coding: utf8 -*-
# *****************************************************************
# **       PTS -- Python Toolkit for working with SKIRT          **
# **       © Astronomical Observatory, Ghent University          **
# *****************************************************************

# Import the relevant PTS classes and modules
from pts.core.basics.configuration import ConfigurationDefinition

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

# Create the configuration
definition = ConfigurationDefinition()

# Add input section
definition.add_section("input", "the names of the input files")
definition.sections["input"].add_required("cutout", "file_path", "name of the cutout FITS file on which the photometry is performed")
definition.sections["input"].add_required("psf", "file_path", "the name of the FITS file with the PSF of the image on which the photometry is performed")

# Add required settings
definition.add_required("pix_arcsec", "real", "The width, in arscec, of the pixels in the map photometry is being performed upon (this is needed in case there is a pixel size mismatch with PSF)")
definition.add_required("semimaj_pix", "real", "Semi-major axis of photometric aperture, in pixels")
definition.add_required("axial_ratio", "real", "Axial ratio of photometric aperture")
definition.add_required("angle", "real", "Position angle of photometric aperture, in degrees")
definition.add_required("centre_i", "real", "Zero-indexed, 0th-axis coordinate (equivalent to y-axis one-indexed coordinates in FITS terms) of centre position of photometric aperture")
definition.add_required("centre_j", "real", "Zero-indexed, 1st-axis coordinate (equivalent to x-axis one-indexed coordinates in FITS terms) of centre position of photometric aperture")
definition.add_required("semimaj_pix_annulus_outer", "real", "Semi-major axis length of the outer annulus ellipse")
definition.add_required("semimaj_pix_annulus_inner", "real", "Semi-major axis length of the inner annulus ellipse")
definition.add_required("axial_ratio_annulus", "real", "Axial ratio of annulus ellipses")
definition.add_required("annulus_angle", "real", "Position angle of annulus, in degrees")
definition.add_required("annulus_centre_i", "real", "0th-axis coordinate (y) of centre position of annulus ellipses")
Beispiel #12
0
definition.add_optional("output", "absolute_path", "the simulation output directory", letter="o")
definition.add_optional("cluster", str, "the name of the cluster", letter="c")
definition.add_optional("parallel", "int_tuple", "the parallelization scheme (processes, threads)", letter="p")
definition.add_optional(
    "walltime", "duration", "an estimate for the walltime of the simulation for the specified parallelization scheme"
)

# Flags
definition.add_flag("relative", "treats the given input and output paths as being relative to the ski/fski file")
definition.add_flag("brief", "enable brief console logging", letter="b")
definition.add_flag("verbose", "enable verbose logging", letter="v")
definition.add_flag("memory", "enable memory logging", letter="m")
definition.add_flag("allocation", "enable memory (de)allocation logging", letter="a")
definition.add_flag("emulate", "emulate the simulation while limiting computation", letter="e")

definition.add_section("extraction")

definition.add_section("plotting")

definition.add_section("misc")

# reader = ConfigurationReader("launch")
# config = reader.read(definition)

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

# Create the command-line parser
parser = argparse.ArgumentParser()
parser.add_argument("file", type=str, help="the name of the ski/fski file")
parser.add_argument("-i", "--input", type=str, help="the simulation input path")
parser.add_argument("-o", "--output", type=str, help="the simulation output path")
Beispiel #13
0
# Create the configuration definition
definition = ConfigurationDefinition()

definition.add_optional("input_path", "directory_path", "path to the input directory")
definition.add_optional("output_path", "directory_path", "path to the output directory")

definition.add_flag("track_record", "track record")
definition.add_flag("plot_track_record_if_exception", "plot track record if exception", True)

definition.add_flag("find_apertures", "find apertures", True)

definition.add_optional("principal_region", "file_path", "path to a region file with a contour for the principal galaxy")

definition.add_flag("remove_apertures", "remove apertures")

definition.add_section("aperture_removal", "aperture removal")

definition.sections["aperture_removal"].add_optional("expansion_factor", "real", 1.0)

definition.add_section("fetching", "fetching")
#definition.sections["fetching"].add_flag("use_catalog_file", "use catalog file")
#definition.sections["fetching"].add_optional("catalog_path", "file_path", "catalog path")

definition.add_section("detection", "detection")

definition.sections["detection"].add_flag("use_d25", "use D25")
definition.sections["detection"].add_optional("d25_expansion_factor", "real", "D25 expansion factor", 1.2)

definition.sections["detection"].add_optional("initial_radius", "real", 20.0)
definition.sections["detection"].add_optional("detection_method", "string", "detection method", "segmentation")
Beispiel #14
0
definition.import_section("plot", "plotting options", plot_definition)

definition.add_flag("xlog", "log scale for x axis", True)
definition.add_flag("ylog", "log scale for y axis", True)

# The quantity to be used for the x axis
definition.add_optional("x_quantity", "string", "quantity to be used for the x axis (not for hybridization mode)", choices=["cores", "processes", "threads"], default="cores")

# Sigma level for plotting error bars
definition.add_optional("sigma_level", "real", "sigma level for plotting error bars", 1.0)

# Make fit and plot fit
definition.add_flag("fit", "fit theoretical curves to timing and memory data", True)

# Fitting options
definition.add_section("fitting", "fitting options")
definition.sections["fitting"].add_flag("plot_fit", "plot the fitted relations", True)

# Pure scaling behaviour
definition.sections["fitting"].add_section("pure_scaling_behaviour", "pure scaling behaviour")
for phase in pure_scaling_behaviour:
    definition.sections["fitting"].sections["pure_scaling_behaviour"].add_optional(phase, "mixed_list", "scaling behaviour for the " + phase_names[phase], default=pure_scaling_behaviour[phase])

# Composite scaling behaviour
definition.sections["fitting"].add_section("composite_scaling_behaviour", "composite scaling behaviour")
for phase in composite_scaling_behaviour:
    definition.sections["fitting"].sections["composite_scaling_behaviour"].add_optional(phase, "string_list", "scaling behaviour for the " + phase_names[phase], default=composite_scaling_behaviour[phase])

# Normalize runtimes and memory usages
definition.add_flag("normalize_runtimes", "normalize runtimes for plotting")
definition.add_flag("normalize_memory", "normalize memory usage for plotting")
Beispiel #15
0
definition.add_optional("sky_region", "file_path", "region file for the sky estimation")

# Perform sigma-clipping step
definition.add_flag("sigma_clip_mask", "sigma-clipping", True)

# Estimate the sky (obviously)
definition.add_flag("estimate", "estimate the sky", True)

# Set zero outside of the principal galaxy
definition.add_flag("set_zero_outside", "set zero outside of principal galaxy", True)

# Eliminate negative values (replace them by zero)
definition.add_flag("eliminate_negatives", "replace negative pixels by zero", False)

# Creation of the sky mask
definition.add_section("mask", "creation of sky mask")
definition.sections["mask"].add_optional("annulus_inner_factor", "real", "sky annulus inner factor (based on principal galaxy ellipse", 1.2)
definition.sections["mask"].add_optional("annulus_outer_factor", "real", "sky annulus outer factor (based on principal galaxy ellipse", 4.0)
definition.sections["mask"].add_optional("saturation_expansion_factor", "real", "expansion factor for saturation regions", 1.5)
definition.sections["mask"].add_optional("stars_expansion_factor", "real", "expansion factor for star regions", 1.5)

# Sigma clipping
definition.add_section("sigma_clipping", "sigma clipping")
definition.sections["sigma_clipping"].add_optional("sigma_level", "positive_real", "sigma level", 3.0)
definition.sections["sigma_clipping"].add_optional("niterations", "positive_integer", "number of iterations", 5)

# Histogram
definition.add_section("histogram", "histogram")
definition.sections["histogram"].add_flag("log_scale", "log scale", True)

# -----------------------------------------------------------------
Beispiel #16
0
# Optional settings
definition.add_optional("remote",
                        "string",
                        "remote host on which to launch the simulations",
                        "nancy",
                        choices=find_host_ids())
definition.add_flag("group", "group simulations in larger jobs")
definition.add_optional("walltime", "real",
                        "the preferred walltime per job (for schedulers)")

# Simulation options
definition.add_optional("npackages", "real",
                        "the number of photon packages per wavelength", 1e7)

# Settings for the wavelength grid
definition.add_section("wg", "options for the wavelength grid")
definition.sections["wg"].add_optional("range",
                                       "quantity_range",
                                       "the wavelength range",
                                       "0.1 micron>10micron",
                                       convert_default=True)
definition.sections["wg"].add_optional("npoints", "integer",
                                       "the number of wavelength points", 25)

# Settings for the dust grid
definition.add_section("dg", "options for the dust grid")
definition.sections["dg"].add_optional(
    "grid_type",
    "string",
    "the type of dust grid",
    "bintree",
Beispiel #17
0
definition.add_optional("binary_mutation_method", "string", "mutation method for binary string genome representations", default_binary_mutation_method, binary_mutation_methods)

# Other
definition.add_optional("output", "directory_path", "output directory")

# Flags
definition.add_flag("elitism", "enable elitism", default_elitism)
definition.add_flag("show", "show results", True)
definition.add_flag("write", "write results", True)
definition.add_flag("plot", "plot results", False)
definition.add_flag("finish", "finish the evolution: set the scores of the last generation but don't generate a new population", False)
definition.add_flag("heterogeneous", "genomes use heterogeneous quantities (parameter minima and maxima - or centers and sigmas for gaussian initializers and mutators - must be specified as input to the 'run' function")
definition.add_flag("named_individuals", "use named individuals", False)

# Writing options
definition.add_section("writing", "writing options")
definition.sections["writing"].add_optional("input_path", "string", "directory path for the input data to be saved")
definition.sections["writing"].add_optional("engine_path", "string", "path for the genetic engine")
definition.sections["writing"].add_optional("prng_path", "string", "path for the prng")
definition.sections["writing"].add_optional("config_path", "string", "path for the configuration file")
definition.sections["writing"].add_optional("statistics_path", "string", "path for the statistics file")
definition.sections["writing"].add_optional("database_path", "string", "path for the database")
definition.sections["writing"].add_optional("populations_path", "string", "path for the populations data file")
definition.sections["writing"].add_optional("newborns_path", "string", "path for the newborns population data file")
definition.sections["writing"].add_optional("parents_path", "string", "path for the parents population data file")
definition.sections["writing"].add_optional("crossover_table_path", "string", "path for the crossover data file")
definition.sections["writing"].add_optional("scores_table_path", "string", "path for the scores table file")
definition.sections["writing"].add_optional("elitism_table_path", "string", "path for the elitism table")
definition.sections["writing"].add_optional("recurrent_path", "string", "path for the recurrency data")

# Advanced
Beispiel #18
0
# -----------------------------------------------------------------

# Create the configuration definition
definition = ConfigurationDefinition()

# Input and output
definition.add_optional("input", "directory_path", "input directory")
definition.add_optional("output", "directory_path", "output directory")

# Flags
definition.add_flag("remove", "remove ...", True)
definition.add_flag("find_apertures", "find apertures", False)
definition.add_flag("remove_apertures", "remove apertures", False)
#definition.add_flag("classify", "classify", True)

definition.add_section("detection", "source detection")

definition.sections["detection"].add_optional(
    "method",
    "string",
    "detection method",
    "segmentation",
    choices=["segmentation", "peaks", "sextractor"])

definition.sections["detection"].add_section("peaks",
                                             "options for peak detection")

definition.sections["detection"].add_section("segmentation",
                                             "options for segmentation")

definition.sections["detection"].sections["segmentation"].add_optional(
Beispiel #19
0
# Import the relevant PTS classes and modules
from pts.core.basics.configuration import ConfigurationDefinition

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

default_downsample_factor = 2.
default_npackages = 1e7
default_parallelization = "2:1:2"  # 2 cores, 1 process, 2 threads per core

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

# Create the configuration
definition = ConfigurationDefinition(log_path="log", config_path="config")

# Writing
definition.add_section("writing", "writing options")
definition.sections["writing"].add_flag("projections", "write the projections",
                                        True)

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

# Faceon, edgeon?
definition.add_flag("faceon", "create faceon projections", True)
definition.add_flag("edgeon", "create edgeon projections", True)

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

# Properties of the projection
definition.add_required("distance", "length_quantity",
                        "distance to the object")
definition.add_required("center", "pixelcoordinate",
Beispiel #20
0
Datei: view.py Projekt: SKIRT/PTS
# View settings
definition.add_optional("scale", "string", "scale", default_scale, choices=scales)
definition.add_optional("colormap", "string", "color map", default_colormap, choices=colormaps)
definition.add_optional("zoom", "string", "zoom function", default_zoom, choices=zooms)

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

# Make page?
definition.add_flag("page", "generate the page", True)

# Show?
definition.add_flag("show", "show the view", True)

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

# Regions settings
definition.add_section("regions", "regions settings")

# Color of the regions
definition.sections["regions"].add_optional("color", "string", "color to render all regions (None means default of the regions)")

# Other settings
definition.sections["regions"].add_flag("changeable", "changeable", False)
definition.sections["regions"].add_flag("movable", "movable", False)
definition.sections["regions"].add_flag("rotatable", "rotatable", False)
definition.sections["regions"].add_flag("removable", "removable", False)
definition.sections["regions"].add_flag("resizable", "resizable", True)

# -----------------------------------------------------------------
Beispiel #21
0
# **       PTS -- Python Toolkit for working with SKIRT          **
# **       © Astronomical Observatory, Ghent University          **
# *****************************************************************

# Import the relevant PTS classes and modules
from pts.core.basics.configuration import ConfigurationDefinition

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

# Create the configuration
definition = ConfigurationDefinition()

# Add optional settings
definition.add_optional("map", str, "the map to be made (dust, old, NIY, IY)")

definition.add_section("cutoff")
definition.sections["cutoff"].add_optional("reference_path", str, "...", None)
definition.sections["cutoff"].add_optional(
    "level", float, "cutoff when signal < level * uncertainty (ilse: 5)", 3.0)
definition.sections["cutoff"].add_optional(
    "remove_holes", bool, "remove holes from the cutoff mask", True)

definition.add_section("dust")
definition.sections["dust"].add_section("ssfr")
definition.sections["dust"].sections["ssfr"].add_optional(
    "mask_low_fuv_snr", bool, "...", True)
definition.sections["dust"].sections["ssfr"].add_optional(
    "fuv_snr_level", float,
    "cut-off when signal(FUV) < fuv_snr_level * uncertainty(FUV)  (Ilse: 10.0)",
    0.0)
Beispiel #22
0
# -----------------------------------------------------------------

# Create the configuration definition
definition = ConfigurationDefinition()

# Input and output
definition.add_optional("input", "directory_path", "input directory")
definition.add_optional("output", "directory_path", "output directory")

# Flags
definition.add_flag("remove", "remove ...", True)
definition.add_flag("find_apertures", "find apertures", False)
definition.add_flag("remove_apertures", "remove apertures", False)
#definition.add_flag("classify", "classify", True)

definition.add_section("detection", "source detection")

definition.sections["detection"].add_optional("method", "string", "detection method", "segmentation", choices=["segmentation", "peaks", "sextractor"])

definition.sections["detection"].add_section("peaks", "options for peak detection")

definition.sections["detection"].add_section("segmentation", "options for segmentation")

definition.sections["detection"].sections["segmentation"].add_optional("clipping_sigma_level", "real", "sigma level for sigma-clipping", 3.0)
definition.sections["detection"].sections["segmentation"].add_optional("sigma_level", "real", "sigma level of detection", 3.0)

definition.sections["detection"].add_section("sextractor", "options for SExtractor")

definition.sections["detection"].sections["sextractor"].add_optional("zero_point", "real", "zero point in mag arcsec^-2", 20.0)
definition.sections["detection"].sections["sextractor"].add_optional("gain", "real", "gain in [e-/ADU]", 4.0)
definition.sections["detection"].sections["sextractor"].add_optional("pixelscale", "real", "pixelscale in [arcsec/pix]", 1.0)
Beispiel #23
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.core.basics.configuration import ConfigurationDefinition
from pts.dustpedia.data.images import instruments

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

# Configuration
definition = ConfigurationDefinition()

# Galaxy name
definition.add_required("galaxy_name", "string", "the name of the galaxy")

# Database
definition.add_section("database", "DustPedia database credentials")
definition.add_optional("username", "string", "username")
definition.add_optional("password", "string", "password")

# Other options
definition.add_positional_optional("instruments", "string_list", "instruments for which to download the images", choices=instruments, default=instruments)

# -----------------------------------------------------------------
Beispiel #24
0
# NEW: FITTING METHOD
definition.add_optional("fitting_method", "string", "fitting method",
                        default_fitting_method, fitting_methods)

# Add optional
definition.add_optional(
    "parameters", "string_list",
    "parameters to be used as free parameters during the fitting")
definition.add_optional("descriptions", "string_string_dictionary",
                        "parameter descriptions")
definition.add_optional("types", "string_string_dictionary", "parameter types")
definition.add_optional("units", "string_unit_dictionary", "parameter units")
definition.add_optional("ndigits", "string_integer_dictionary",
                        "number of significant digits of the parameters")
definition.add_optional("filters", "string_list",
                        "fit to the observed data of these filters")
definition.add_optional("genetic", "dictionary",
                        "options for the genetic algorithm")
definition.add_optional("grid", "dictionary", "options for the grid fitting")

# Sections
definition.add_section("ranges", "parameter ranges")

# The default number of significant digits
definition.add_optional("default_ndigits", "positive_integer",
                        "default value for the number of significant digits",
                        default_ndigits)

# -----------------------------------------------------------------
Beispiel #25
0
                        "string",
                        "origin of the analysis model",
                        choices=origins)

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

# Give the analysis run a custom name
definition.add_optional("name",
                        "string",
                        "name for the analysis run",
                        forbidden=run_names)

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

# Settings for the wavelength grid generation
definition.add_section("wg", "settings for the wavelength grids")
definition.sections["wg"].add_optional("npoints", "positive_integer",
                                       "range of the wavelength grid size",
                                       450)
definition.sections["wg"].add_flag(
    "add_emission_lines", "add emission lines to the wavelength grids", True)
definition.sections["wg"].add_optional("range",
                                       "quantity_range",
                                       "range of wavelengths",
                                       "0.1 micron > 2000 micron",
                                       convert_default=True)

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

# Dust grid properties
definition.add_section("dg", "settings for the dust grid")
Beispiel #26
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.core.basics.configuration import ConfigurationDefinition

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

# Create the configuration
definition = ConfigurationDefinition()

# Add settings
definition.add_section("database")
definition.sections["database"].add_optional("username", str, "the username")
definition.sections["database"].add_optional("password", str, "the password")

# -----------------------------------------------------------------
Beispiel #27
0
dust_grid_types = ["cartesian", "bintree", "octtree"]
default_dust_grid_type = "bintree"

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

# Create the configuration
definition = ConfigurationDefinition(log_path="log", config_path="config")

# Name of the representation
if suite.has_representations: definition.add_required("name", "string", "name for the representation", forbidden=suite.representation_names)
else: definition.add_optional("name", "string", "name for the representation", default="highres")

# Name of the model for which to create the representation
if suite.no_models: raise RuntimeError("No models found: first run build_model to create a new model")
elif suite.has_single_model: definition.add_fixed("model_name", "name of the model", suite.single_model_name)
else: definition.add_required("model_name", "string", "name of the model", choices=suite.model_names)

# Dust grid properties
definition.add_section("dg", "settings for the dust grid")
definition.sections["dg"].add_optional("grid_type", "string", "type of dust grid", default_dust_grid_type, choices=dust_grid_types)
definition.sections["dg"].add_optional("scale", "real", "number of image pixels to take as the minimum scale in the model (can also be a certain fraction of a pixel)", 0.5)
definition.sections["dg"].add_optional("bintree_min_level", "integer", "minimum depth level for binary trees", 9)
definition.sections["dg"].add_optional("octtree_min_level", "integer", "minimum depth level for octrees", 3)
definition.sections["dg"].add_optional("max_mass_fraction", "real", "maximum mass fraction in each cell", 0.5e-6)
definition.sections["dg"].add_optional("scale_heights", "real", "number of times to take the dust scale height as the vertical radius of the dust grid", 10.)

# Whether quality has to be calculated
definition.add_flag("check_dust_grid_quality", "check the quality of the dust grid in various ways", True)

# -----------------------------------------------------------------
Beispiel #28
0
# **       PTS -- Python Toolkit for working with SKIRT          **
# **       © Astronomical Observatory, Ghent University          **
# *****************************************************************

# Import the relevant PTS classes and modules
from pts.core.basics.configuration import ConfigurationDefinition

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

# Create the configuration
definition = ConfigurationDefinition()

# Add optional settings
definition.add_optional("map", str, "the map to be made (dust, old, NIY, IY)")

definition.add_section("cutoff")
definition.sections["cutoff"].add_optional("reference_path", str, "...", None)
definition.sections["cutoff"].add_optional("level", float, "cutoff when signal < level * uncertainty (ilse: 5)", 3.0)
definition.sections["cutoff"].add_optional("remove_holes", bool, "remove holes from the cutoff mask", True)

definition.add_section("dust")
definition.sections["dust"].add_section("ssfr")
definition.sections["dust"].sections["ssfr"].add_optional("mask_low_fuv_snr", bool, "...", True)
definition.sections["dust"].sections["ssfr"].add_optional("fuv_snr_level", float, "cut-off when signal(FUV) < fuv_snr_level * uncertainty(FUV)  (Ilse: 10.0)", 0.0)

definition.add_section("old_stars")
definition.sections["old_stars"].add_optional("irac_snr_level", float, "cut-off when signal(IRAC) < irac_snr_level * uncertainty(IRAC) (Ilse: 10.0)", 0.0)

definition.add_section("ionizing_stars")
definition.sections["ionizing_stars"].add_section("mips_young_stars")
definition.sections["ionizing_stars"].sections["mips_young_stars"].add_optional("mips_snr_level", float, "cut-off when signal(MIPS) < mips_snr_level * uncertainty(MIPS)  (Ilse: 10.0)", 0.0)
Beispiel #29
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.core.basics.configuration import ConfigurationDefinition

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

# Create the configuration
definition = ConfigurationDefinition()

# Add optional arguments
definition.add_section("wavelengths")
definition.sections["wavelengths"].add_optional("unit", str, "the unit of the wavelengths", "micron")
definition.sections["wavelengths"].add_optional("min", float, "the minimum wavelength", 0.09)
definition.sections["wavelengths"].add_optional("max", float, "the maximum wavelength", 2000)
definition.sections["wavelengths"].add_optional("npoints", int, "the number of wavelength points", 100)
definition.sections["wavelengths"].add_optional("min_zoom", float, "the minimum wavelength of the zoomed-in grid", 1)
definition.sections["wavelengths"].add_optional("max_zoom", float, "the maximum wavelength of the zoomed-in grid", 30)
definition.sections["wavelengths"].add_optional("npoints_zoom", int, "the number of wavelength points in the zoomed-in grid", 100)

definition.add_optional("packages", float, "the number of photon packages per wavelength", 2e5)
definition.add_flag("selfabsorption", "enable dust self-absorption")
definition.add_optional("dust_grid", str, "the type of dust grid to use (bintree, octtree or cartesian)", "bintree")

# -----------------------------------------------------------------
Beispiel #30
0
# Create configuration definition
definition = ConfigurationDefinition()

# Grids
definition.add_positional_optional("grids", "filepath_list", "wavelength grids to be plotted")
definition.add_flag("load_subgrids", "plot from the output of subgrid wavelength grid generation in the working directory")
definition.add_flag("create_subgrids", "generate subgrid wavelength grid")
definition.add_optional("subgrids", "string_list", "subgrids to load", default=subgrids, choices=subgrids)
definition.add_optional("subgrids_path", "directory_path", "path of the directory containing the subgrids files")

# Set adjust wavelengths
adjust_wavelengths = [fltr.wavelength for fltr in default_filters]

# Settings for the wavelength grid generation
definition.add_section("wg", "settings for the wavelength grids")
definition.sections["wg"].add_optional("npoints", "positive_integer", "range of the wavelength grid size", default_npoints)
definition.sections["wg"].add_flag("add_emission_lines", "add emission lines to the wavelength grids", True)
definition.sections["wg"].add_optional("emission_lines", "string_list", "emission lines for the wavelength grid generation", default=default_lines, choices=all_lines)
definition.sections["wg"].add_optional("range", "quantity_range", "range of wavelengths", "0.02 micron > 2000 micron", convert_default=True)
definition.sections["wg"].add_optional("fixed", "length_quantity_list", "fixed wavelengths")
definition.sections["wg"].add_optional("filters", "filter_list", "resample for these filters")
definition.sections["wg"].add_optional("adjust_to", "length_quantity_list", "adjust wavelength points to these exact wavelengths", adjust_wavelengths)
definition.sections["wg"].add_optional("check_filters", "filter_list", "check coverage for these filters")

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

definition.add_optional("min_wavelength", "length_quantity", "minimum plot wavelength", default_min_wavelength, convert_default=True)
definition.add_optional("max_wavelength", "length_quantity", "maximum plot wavelength", default_max_wavelength, convert_default=True)

# -----------------------------------------------------------------
Beispiel #31
0
# Method
definition.add_optional("method",
                        "string",
                        "method for deprojection",
                        default_method,
                        choices=methods)

# Downsample
definition.add_optional(
    "downsample_factor", "positive_real",
    "downsample factor of the deprojected map w.r.t the original map",
    default_downsample_factor)

# Writing
definition.add_section("writing", "writing options")
definition.sections["writing"].add_flag("deprojections",
                                        "write the deprojections", True)
definition.sections["writing"].add_flag(
    "maps", "write the maps (or don't clear them)", True)

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

# DUST GRIDS
# Settings for the dust grid
definition.add_section("dg", "options for the dust grid")
definition.sections["dg"].add_optional(
    "grid_type",
    "string",
    "the type of dust grid",
    "bintree",
Beispiel #32
0
definition.add_optional("output_path", "directory_path",
                        "path to the output directory")

definition.add_flag("track_record", "track record")
definition.add_flag("plot_track_record_if_exception",
                    "plot track record if exception", True)

definition.add_flag("find_apertures", "find apertures", True)

definition.add_optional(
    "principal_region", "file_path",
    "path to a region file with a contour for the principal galaxy")

definition.add_flag("remove_apertures", "remove apertures")

definition.add_section("aperture_removal", "aperture removal")

definition.sections["aperture_removal"].add_optional("expansion_factor",
                                                     "real", 1.0)

definition.add_section("fetching", "fetching")
#definition.sections["fetching"].add_flag("use_catalog_file", "use catalog file")
#definition.sections["fetching"].add_optional("catalog_path", "file_path", "catalog path")

definition.add_section("detection", "detection")

definition.sections["detection"].add_flag("use_d25", "use D25")
definition.sections["detection"].add_optional("d25_expansion_factor", "real",
                                              "D25 expansion factor", 1.2)

definition.sections["detection"].add_optional("initial_radius", "real", 20.0)