Пример #1
0
    def setup(self, **kwargs):
        """
        This function ...
        :param kwargs:
        :return:
        """

        # Call the setup function of the base class
        super(MapsStandaloneTest, self).setup(**kwargs)

        # Create data path
        self.data_path = fs.create_directory_in(self.path, "data")

        # Create maps path
        self.maps_path = fs.create_directory_in(self.path, "maps")

        # Login to the DustPedia database
        self.database = DustPediaDatabase()
        username, password = get_account()
        self.database.login(username, password)

        # Get the galaxy center
        self.galaxy_center = get_center(self.config.galaxy)

        # Get the distance
        self.distance = get_distance(self.config.galaxy)

        # Get the inclination
        self.inclination = get_inclination(self.config.galaxy)

        # Get the DustPedia properties instance
        properties = DustPediaProperties()

        # Get FWHMs
        self.fwhms = properties.fwhms
Пример #2
0
Файл: test.py Проект: SKIRT/PTS
    def setup(self, **kwargs):

        """
        This function ...
        :param kwargs:
        :return:
        """

        # Call the setup function of the base class
        super(MapsStandaloneTest, self).setup(**kwargs)

        # Create data path
        self.data_path = fs.create_directory_in(self.path, "data")

        # Create maps path
        self.maps_path = fs.create_directory_in(self.path, "maps")

        # Login to the DustPedia database
        self.database = DustPediaDatabase()
        username, password = get_account()
        self.database.login(username, password)

        # Get the galaxy center
        self.galaxy_center = get_center(self.config.galaxy)

        # Get the distance
        self.distance = get_distance(self.config.galaxy)

        # Get the inclination
        self.inclination = get_inclination(self.config.galaxy)

        # Get the DustPedia properties instance
        properties = DustPediaProperties()

        # Get FWHMs
        self.fwhms = properties.fwhms
Пример #3
0
# Create the configuration definition
definition = ConfigurationDefinition()

# The galaxy name
definition.add_required("galaxy", "string", "galaxy name")

# Get configuration
config = parse_arguments("strategy", definition)

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

sample = DustPediaSample()

# Database
username, password = get_account()
database = DustPediaDatabase()
database.login(username, password)

# Get the DustPedia name
name = sample.get_name(config.galaxy)

# Get info
info = database.get_galaxy_info_table(name)

# FIRST IMAGES AND THAN THIS FAILS FOR SOME REASON!!
path = fs.join(introspection.pts_temp_dir, time.unique_name("cutouts_" + name) + ".png")
database.download_photometry_cutouts(name, path)

# Get image names
#image_names = database.get_image_names(name, error_maps=False)
Пример #4
0
            splitted = line.split()

            if len(splitted) < 2: continue

            # Get the galaxy name and add it to the list
            name = splitted[1]
            names.append(name)

    # Return the list of galaxy names
    return names

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

# Get the account info
username, password = get_account()

# Create the database instance
database = DustPediaDatabase()

# Login with the user and password
#database.login(username, password)

# EARLY TYPE SPIRALS: early-type (Sa–Sab) spiral galaxies

parameters = {"D25": (5., None),
              "Hubble type": ["Sa", "Sab", "Sb"]}

table = database.get_galaxies(parameters)

s4g_names = get_galaxy_names_s4g()