• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python log.info函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pts.core.basics.log.log.info函数的典型用法代码示例。如果您正苦于以下问题:Python info函数的具体用法?Python info怎么用?Python info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: set_ionizing

    def set_ionizing(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Setting the ionizing stellar disk component ...")

        # Get the title
        title = titles["ionizing"]

        # Create the new component
        self.ski.create_new_stellar_component(title)

        # Set the geometry
        self.ski.set_stellar_component_geometry(title, self.deprojections["ionizing"])

        # Set the SED
        # metallicity, compactness, pressure, covering_factor
        self.ski.set_stellar_component_mappingssed(title, ionizing_metallicity, ionizing_compactness, ionizing_pressure, ionizing_covering_factor)

        # Set the normalization
        self.ski.set_stellar_component_luminosity(title, fuv_ionizing, self.fuv_filter.pivot)
开发者ID:SKIRT,项目名称:PTS,代码行数:25,代码来源:base.py


示例2: test_dust_mass

    def test_dust_mass(self):

        """
        This function ...
        :return: 
        """

        # Inform the user
        log.info("Testing the dust mass ...")

        ndigits = 4

        nbits = numbers.binary_digits_for_significant_figures(ndigits)

        print(str(nbits) + " bits for " + str(ndigits) + " digits")

        mass_range = parsing.quantity_range("1500000.0 Msun > 300000000.0 Msun")

        unit = "Msun"

        minimum = mass_range.min
        maximum = mass_range.max

        low = minimum.to(unit).value
        high = maximum.to(unit).value

        value = parse_quantity("1.5e7 Msun").to(unit).value

        # Test : ROUNDING IN TEST BUT NOT IN BETWEEN CONVERSION!!
        if light_test_from_number_rounding(value, low, high, ndigits): log.success("Test succeeded")
        else: log.error("Test failed")
开发者ID:SKIRT,项目名称:PTS,代码行数:31,代码来源:test.py


示例3: find

    def find(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Finding the sources ...")

        # Settings
        settings = dict()
        # settings["input"] =
        settings["output"] = self.find_path
        settings["nprocesses"] = self.config.nprocesses

        # Input
        input_dict = dict()
        input_dict["dataset"] = self.dataset
        #input_dict["extended_source_catalog"] = self.extended_source_catalog
        input_dict["point_source_catalog"] = self.point_source_catalog
        input_dict["output_paths"] = self.find_paths

        # Construct the command
        command = Command("find_sources", "find sources", settings, input_dict)

        # Run the command
        self.finder = self.run_command(command)
开发者ID:SKIRT,项目名称:PTS,代码行数:28,代码来源:test.py


示例4: set_old

    def set_old(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Setting the old stellar disk component ...")

        # Get the title
        title = titles["old"]

        # Create the new component
        self.ski.create_new_stellar_component(title)

        # Set the geometry
        self.ski.set_stellar_component_geometry(title, self.deprojections["old"])

        # Set the SED
        self.ski.set_stellar_component_sed(title, disk_template, disk_age, disk_metallicity)

        # Convert the flux density into a spectral luminosity
        luminosity = old_fluxdensity.to("W/micron", fltr=self.i1_filter, distance=self.galaxy_distance)

        # Set the normalization
        self.ski.set_stellar_component_luminosity(title, luminosity, self.i1_filter.pivot)
开发者ID:SKIRT,项目名称:PTS,代码行数:27,代码来源:base.py


示例5: create_wcs

    def create_wcs(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Creating the WCS ...")

        min_pixelscale = None

        # Determine the path to the headers directory
        headers_path = fs.join(m81_data_path, "headers")

        # Loop over the header files
        for path, name in fs.files_in_path(headers_path, extension="txt", returns=["path", "name"]):

            # Get the filter
            fltr = parse_filter(name)
            filter_name = str(fltr)

            # Set the path of the file for the filter name
            self.wcs_paths[filter_name] = path

            # Get WCS
            wcs = CoordinateSystem.from_header_file(path)

            # Adjust the pixelscale
            if min_pixelscale is None:
                min_pixelscale = wcs.pixelscale
                self.wcs = wcs
            elif min_pixelscale > wcs.pixelscale:
                min_pixelscale = wcs.pixelscale
                self.wcs = wcs
开发者ID:SKIRT,项目名称:PTS,代码行数:35,代码来源:test.py


示例6: make_animation

    def make_animation(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Making animation ...")

        # Get the best
        best = self.optimizer.best

        # Determine path
        temp_path = self.optimizer.config.path
        filepath = fs.join(temp_path, "best.png")

        # Make plot of best

        # Create animated gif
        animation = Animation()

        # Open the images present in the directory
        for path in fs.files_in_path(temp_path, extension="png", exact_not_name="best"):
            # Add frame to the animation
            animation.add_frame_from_file(path)

        # Save the animation
        animation_path = fs.join(temp_path, "animation.gif")
        animation.saveto(animation_path)
开发者ID:SKIRT,项目名称:PTS,代码行数:30,代码来源:test.py


示例7: restore_chi_squared

    def restore_chi_squared(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Restoring the chi squared tables ...")

        # Loop over the generations
        for generation_name in self.generation_names:

            # Has generation?
            if not self.has_generation(generation_name): continue

            # Debugging
            log.debug("Creating backup of chi squared table for generation '" + generation_name + "' ...")

            # Get the generation
            generation = self.generations[generation_name]

            # Get the generation path
            generation_path = self.get_generation_restore_path(generation_name)

            # Determine the filepath
            filepath = fs.join(generation_path, "chi_squared.dat")

            # Copy the file
            fs.copy_file(filepath, generation.chi_squared_table_path)
开发者ID:SKIRT,项目名称:PTS,代码行数:30,代码来源:restore.py


示例8: show_luminosities

def show_luminosities(sed):

    """
    This function ...
    :param sed:
    :return:
    """

    # Get spectral luminosity density
    lum = sed.photometry_at(fltr_wavelength, unit="W/micron")
    lum2 = sed.photometry_at(fltr_wavelength, unit="W/micron", interpolate=False)

    #
    log.info("Luminosity: " + tostr(lum))
    log.info("No interpolation: " + tostr(lum2))

    # Convert to solar SPECTRAL luminosity DENSITY at wavelength
    lum_spectral_solar = lum.to("W/micron").value / solar_wavelength_density.to("W/micron").value

    # Convert to neutral
    lum_neutral = lum.to("W", density=True, wavelength=fltr_wavelength)
    lum_solar = lum.to("Lsun", density=True, wavelength=fltr_wavelength)

    # Neutral and solar
    log.info("Luminosity in spectral solar units: " + tostr(lum_spectral_solar) + " Lsun_" + fltr.band)
    log.info("Luminosity in neutral units: " + tostr(lum_neutral))
    log.info("Luminosity in solar units: " + tostr(lum_solar))
开发者ID:SKIRT,项目名称:PTS,代码行数:27,代码来源:sfr_to_lum.py


示例9: make_sky

    def make_sky(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Adding sky ...")

        # Loop over the frames
        for fltr in self.frames:

            # Get the frame
            frame = self.frames[fltr]

            # Determine random sky level
            sky_level = np.random.uniform(0.0, 10.)

            # Create sky gradient
            y, x = np.mgrid[:frame.ysize, :frame.xsize]
            sky_gradient =  x * y

            # Normalize so that the maximal sky is 20%
            sky_gradient = sky_gradient / np.max(sky_gradient) * 20

            # Add the sky
            frame += sky_level + sky_gradient

            # Mask
            frame[self.rotation_masks[fltr]] = 0.0
开发者ID:SKIRT,项目名称:PTS,代码行数:31,代码来源:test.py


示例10: setup_modelling

    def setup_modelling(self):

        """
        This fucntion ...
        :return:
        """

        # Inform the user
        log.info("Setting up the modelling ...")

        # Settings
        settings_setup = dict()
        settings_setup["type"] = "sed"
        settings_setup["name"] = self.modeling_name
        settings_setup["fitting_host_ids"] = self.moderator.host_ids_for_ensemble("fitting", none_if_none=True)

        # Create input dict for setup
        input_setup = dict()
        input_setup["sed"] = self.observed_sed
        input_setup["ski"] = self.ski_template
        #input_setup["ski_input"] = self.required_input_files
        input_setup["ski_input"] = self.all_input_files # Important so that the fittinginitializer can choose the number
        #  of wavelengths for the fitting based on what the user used as a wavelength grid file for the ski file

        # Create object config
        object_config = dict()
        # object_config["ski"] = ski_path
        input_setup["object_config"] = object_config

        # Construct the command
        stp = Command("setup", "setup the modeling", settings_setup, input_setup, cwd=".")

        # Call the command
        tool = self.run_command(stp)
开发者ID:SKIRT,项目名称:PTS,代码行数:34,代码来源:test.py


示例11: write_frame

    def write_frame(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Saving the result ...")

        # Determine the path
        path = self.output_path_file(self.image_name)

        # Check if already existing
        if fs.is_file(path):

            if self.config.replace:
                if self.config.backup: fs.backup_file(path, suffix=self.config.backup_suffix)
                fs.remove_file(path)
            else:
                #raise ValueError("The image already exists")
                path = self.output_path_file("result.fits")

        # Save
        self.frame.saveto(path, header=self.header)
开发者ID:SKIRT,项目名称:PTS,代码行数:25,代码来源:interpolator.py


示例12: _init_psf_phot_process

def _init_psf_phot_process(data, all_positions, all_amplitudes,
                           idx, nidx, psf, amplitudes, positions):
    """
    Global variables for psf photometry processes
    """
    import multiprocessing
    global gbl_data
    global gbl_all_positions
    global gbl_all_amplitudes
    global gbl_idx
    global gbl_nidx
    global gbl_psf
    global gbl_amplitudes
    global gbl_positions

    gbl_data = data
    gbl_all_positions = all_positions
    gbl_all_amplitudes = all_amplitudes
    gbl_idx = idx
    gbl_nidx = nidx
    gbl_psf = psf
    gbl_amplitudes = amplitudes
    gbl_positions = positions
    log.info("Initializing process {0}".format(
        multiprocessing.current_process().name))
开发者ID:SKIRT,项目名称:PTS,代码行数:25,代码来源:get_fwhm.py


示例13: combine_second

    def combine_second(self):

        """
        This function ...
        :return: 
        """

        # Inform the user
        log.info("Doing second combination ...")

        fltr_a, fltr_b = self.lowest_resolution_filters
        frames = self.frames[fltr_a, fltr_b]

        frames.convolve_to_highest_fwhm()
        frames.rebin_to_highest_pixelscale()
        frames.convert_to_same_unit(unit="MJy/sr") # here conversion to surface brightness, related to the pixelscale is necessary

        # Set the frames
        #self.second = frames

        frames.convert_to_same_unit(unit="Lsun", density=True, distance=self.distance) # convert to solar luminosity

        # Now do something
        self.second = np.random.random() * frames[fltr_a] + np.random.random() * frames[fltr_b]

        # Set unit
        self.second.unit = "Lsun"
开发者ID:SKIRT,项目名称:PTS,代码行数:27,代码来源:test.py


示例14: combine_first

    def combine_first(self):

        """
        This function ...
        :return: 
        """

        # Inform the user
        log.info("Doing first combination ...")

        fltr_a, fltr_b = self.highest_resolution_filters
        frames = self.frames[fltr_a, fltr_b]

        frames.convolve_to_highest_fwhm()
        frames.rebin_to_highest_pixelscale()
        frames.convert_to_same_unit(unit="W/micron/m2") # here conversion related to frequency/wavelength is necessary
        frames.convert_to_same_unit(unit="W/m2", density=True) # here conversion from spectral flux density to flux is necessary

        # Set the frames
        #self.first = frames

        # Now do something, like adding them
        self.first = np.random.random() * frames[fltr_a].get_log10() + np.random.random() * frames[fltr_b].get_log10()

        # Set the unit
        self.first.unit = "W/m2"
开发者ID:SKIRT,项目名称:PTS,代码行数:26,代码来源:test.py


示例15: test_brightness

    def test_brightness(self):

        """
        This function ...
        :return: 
        """

        # Inform the user
        log.info("Testing surface brightness units ...")

        units = [u("Jy"), u("W/micron"), u("Lsun"), u("erg/s/Hz"), u("W/sr"), u("Lsun/pc2", brightness=True), u("W/m2/micron")]

        print("")
        for unit in units:

            print(str(unit))
            print("")
            print(" - symbol: " + unit.symbol)
            print(" - physical type: " + unit.physical_type)
            print(" - base physical type: " + unit.base_physical_type)
            print(" - base unit: " + str(unit.base_unit))
            print(" - density: " + str(unit.density))
            print(" - brightness: " + str(unit.brightness))

            angular_area_unit = unit.corresponding_angular_area_unit
            #print(angular_area_unit)
            intrinsic_area_unit = unit.corresponding_intrinsic_area_unit

            print(" - corresponding angular area unit: " + str(angular_area_unit))
            print(" - corresponding intrinsic area unit: " + str(intrinsic_area_unit))
            print("")
开发者ID:SKIRT,项目名称:PTS,代码行数:31,代码来源:test.py


示例16: load_i1

    def load_i1(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Loading the IRAC 3.6 micron image ...")

        # Determine the path to the truncated 3.6 micron image
        #path = fs.join(truncation_path, "IRAC I1.fits")

        path = fs.join(self.prep_path, "IRAC I1", "result.fits")
        frame = Frame.from_file(path)

        # Convert the frame to Jy/pix
        conversion_factor = 1.0
        conversion_factor *= 1e6

        # Convert the 3.6 micron image from Jy / sr to Jy / pixel
        pixelscale = frame.average_pixelscale
        pixel_factor = (1.0/pixelscale**2).to("pix2/sr").value
        conversion_factor /= pixel_factor
        frame *= conversion_factor
        frame.unit = "Jy"

        # Set the frame
        self.i1_jy = frame
开发者ID:SKIRT,项目名称:PTS,代码行数:29,代码来源:residuals.py


示例17: create_deprojections

    def create_deprojections(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Creating the deprojections ...")

        # Set deprojection of old stars
        wcs = self.maps["old"].wcs
        if wcs is None: raise IOError("The map of old stars has no WCS information")
        self.deprojections["old"] = DeprojectionModel3D.from_wcs(wcs, self.galaxy_center, self.galaxy_distance, self.galaxy_position_angle, self.galaxy_inclination, old_filename, old_scale_height)

        # Set deprojection of young stars
        wcs = self.maps["young"].wcs
        if wcs is None: raise IOError("The map of young stars has no WCS information")
        self.deprojections["young"] = DeprojectionModel3D.from_wcs(wcs, self.galaxy_center, self.galaxy_distance, self.galaxy_position_angle, self.galaxy_inclination, young_filename, young_scale_height)

        # Set deprojection of ionizing stars
        wcs = self.maps["ionizing"].wcs
        if wcs is None: raise IOError("The map of ionizing stars has no WCS information")
        self.deprojections["ionizing"] = DeprojectionModel3D.from_wcs(wcs, self.galaxy_center, self.galaxy_distance, self.galaxy_position_angle, self.galaxy_inclination, ionizing_filename, ionizing_scale_height)

        # Set deprojection of dust map
        wcs = self.maps["dust"].wcs
        if wcs is None: raise IOError("The map of old stars has no WCS information")
        self.deprojections["dust"] = DeprojectionModel3D.from_wcs(wcs, self.galaxy_center, self.galaxy_distance, self.galaxy_position_angle, self.galaxy_inclination, dust_filename, dust_scale_height)
开发者ID:SKIRT,项目名称:PTS,代码行数:29,代码来源:base.py


示例18: deploy

    def deploy(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Deploying SKIRT and PTS ...")

        # Create the deployer
        deployer = Deployer()

        # Set the host ids
        deployer.config.hosts = [self.host]

        # Set the host id on which PTS should be installed (on the host for extra computations and the fitting hosts
        # that have a scheduling system to launch the pts run_queue command)
        #deployer.config.pts_on = self.moderator.all_host_ids

        # Set
        #deployer.config.check = self.config.check_versions

        # Set
        #deployer.config.update_dependencies = self.config.update_dependencies

        # Run the deployer
        deployer.run()
开发者ID:SKIRT,项目名称:PTS,代码行数:28,代码来源:test.py


示例19: create_wavelength_grid

    def create_wavelength_grid(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Creating the wavelength grid ...")

        # Create the wavelength generator
        generator = WavelengthGridGenerator()

        # Set input
        input_dict = dict()
        input_dict["ngrids"] = 1
        input_dict["npoints"] = self.config.nwavelengths
        input_dict["fixed"] = [self.i1_filter.pivot, self.fuv_filter.pivot]
        input_dict["add_emission_lines"] = True
        input_dict["lines"] = ["Halpha"] # only the H-alpha line is of importance
        input_dict["min_wavelength"] = self.config.wavelength_range.min
        input_dict["max_wavelength"] = self.config.wavelength_range.max
        input_dict["filters"] = [parse_filter(string) for string in fitting_filter_names]

        # Run the generator
        generator.run(**input_dict)

        # Set the wavelength grid
        self.wavelength_grid = generator.single_grid
开发者ID:SKIRT,项目名称:PTS,代码行数:29,代码来源:base.py


示例20: set_bulge

    def set_bulge(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Setting the old stellar bulge component ...")

        # Get the title for this component
        title = titles["bulge"]

        # Create the new component
        self.ski.create_new_stellar_component(title)

        # Set the geometry
        self.ski.set_stellar_component_geometry(title, self.bulge)

        # Set the SED
        # component_id, template, age, metallicity
        self.ski.set_stellar_component_sed(title, bulge_template, bulge_age, bulge_metallicity)

        # Convert the flux density into a spectral luminosity
        luminosity = bulge_fluxdensity.to("W/micron", fltr=self.i1_filter, distance=self.galaxy_distance)

        # Set the normalization
        # luminosity, filter_or_wavelength=None
        self.ski.set_stellar_component_luminosity(title, luminosity, self.i1_filter.pivot)
开发者ID:SKIRT,项目名称:PTS,代码行数:29,代码来源:base.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python filesystem.join函数代码示例发布时间:2022-05-25
下一篇:
Python configuration.ConfigurationDefinition类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap