当前位置: 首页>>代码示例>>Python>>正文


Python ConfigurationDefinition.add_section方法代码示例

本文整理汇总了Python中pts.core.basics.configuration.ConfigurationDefinition.add_section方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigurationDefinition.add_section方法的具体用法?Python ConfigurationDefinition.add_section怎么用?Python ConfigurationDefinition.add_section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pts.core.basics.configuration.ConfigurationDefinition的用法示例。


在下文中一共展示了ConfigurationDefinition.add_section方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1:

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
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")

# -----------------------------------------------------------------
开发者ID:SKIRT,项目名称:PTS,代码行数:32,代码来源:project_data.py

示例2: ConfigurationDefinition

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
#!/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")

# -----------------------------------------------------------------
开发者ID:Stargrazer82301,项目名称:CAAPR,代码行数:32,代码来源:initialize_fit.py

示例3:

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
# -----------------------------------------------------------------

# 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)
开发者ID:SKIRT,项目名称:PTS,代码行数:32,代码来源:plot_seds.py

示例4: ConfigurationDefinition

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
#!/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)

# -----------------------------------------------------------------
开发者ID:SKIRT,项目名称:PTS,代码行数:30,代码来源:get_images.py

示例5: ConfigurationDefinition

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
# 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)

# -----------------------------------------------------------------
开发者ID:SKIRT,项目名称:PTS,代码行数:32,代码来源:plot_wavelengths.py

示例6: quantities

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
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
开发者ID:SKIRT,项目名称:PTS,代码行数:33,代码来源:optimize.py

示例7: ConfigurationDefinition

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
#!/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")

# -----------------------------------------------------------------
开发者ID:Stargrazer82301,项目名称:CAAPR,代码行数:23,代码来源:fetch_data.py

示例8: ConfigurationDefinition

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
# **       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)
开发者ID:Stargrazer82301,项目名称:CAAPR,代码行数:33,代码来源:make_maps.py

示例9: regions

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
# 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)

# -----------------------------------------------------------------
开发者ID:SKIRT,项目名称:PTS,代码行数:31,代码来源:view.py

示例10: ConfigurationDefinition

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
# -----------------------------------------------------------------

# 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)
开发者ID:SKIRT,项目名称:PTS,代码行数:33,代码来源:find_other.py

示例11: ConfigurationDefinition

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
# -----------------------------------------------------------------

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)

# -----------------------------------------------------------------
开发者ID:SKIRT,项目名称:PTS,代码行数:31,代码来源:deproject_skirt.py

示例12: scheme

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
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")
开发者ID:Stargrazer82301,项目名称:CAAPR,代码行数:33,代码来源:launch.py

示例13: ConfigurationDefinition

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
# 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")
开发者ID:SKIRT,项目名称:PTS,代码行数:32,代码来源:find_extended.py

示例14: axis

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
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")
开发者ID:SKIRT,项目名称:PTS,代码行数:33,代码来源:plot_scaling.py

示例15: sky

# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import add_section [as 别名]
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)

# -----------------------------------------------------------------
开发者ID:SKIRT,项目名称:PTS,代码行数:33,代码来源:subtract_sky.py


注:本文中的pts.core.basics.configuration.ConfigurationDefinition.add_section方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。