# ----------------------------------------------------------------- # Ensure Python 3 compatibility from __future__ import absolute_import, division, print_function # Import the relevant PTS classes and modules from pts.core.tools import logging from pts.magic.tools import catalogs from pts.core.tools import filesystem as fs from pts.core.basics.configuration import ConfigurationDefinition, ConfigurationReader # ----------------------------------------------------------------- # Create the configuration definition = ConfigurationDefinition() # Add required settings definition.add_required("name", str, "the name of the galaxy") # Get configuration reader = ConfigurationReader("setup") config = reader.read(definition) # ----------------------------------------------------------------- # Determine the log level level = "DEBUG" if config.debug else "INFO" # Initialize the logger log = logging.setup_log(level=level)
#!/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.core.remote.host import find_host_ids # ----------------------------------------------------------------- # Create definition definition = ConfigurationDefinition(write_config=False) # Number of frames definition.add_optional("nframes", "positive_integer", "number of frames", 2) # Size of frames definition.add_optional("npixels", "positive_integer", "number of pixels of the frames", 500) # Number of sources definition.add_optional("nrandom_sources", "positive_integer", "number of point sources", 100) # Flags definition.add_flag("vary_fwhm", "vary the FWHM", False) # PSF model
# ***************************************************************** # Import the relevant PTS classes and modules from pts.core.basics.configuration import ConfigurationDefinition # ----------------------------------------------------------------- methods = ["skirt", "pts"] default_method = "pts" default_downsample_factor = 2. default_parallelization = "2:1:2" # 2 cores, 1 process, 2 threads per core # ----------------------------------------------------------------- # Create the configuration definition = ConfigurationDefinition(log_path="log", config_path="config") # 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
#!/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("photometry", log_path="log") # -----------------------------------------------------------------