sherlock.imports.ifs module

Import Multi Unit Spectroscopic Explorer (MUSE) IFS galaxy stream into sherlock-catalogues database

Author

David Young

class ifs(log, settings=False, pathToDataFile=False, version=False, catalogueName='', coordinateList=[], radiusArcsec=False)[source]

Bases: sherlock.imports._base_importer._base_importer

Importer for the Multi Unit Spectroscopic Explorer (MUSE) IFS galaxy catalogue stream

Key Arguments

  • log – logger

  • settings – the settings dictionary

Usage

To import the IFS catalogue stream into the sherlock-catalogues database, run the following:

from sherlock.imports import IFS
stream = IFS(
    log=log,
    settings=settings
)
stream.ingest()
- abstract this module out into its own stand alone script
- check sublime snippet exists
ingest()[source]

Import the IFS catalogue into the sherlock-catalogues database

The method first generates a list of python dictionaries from the IFS datafile, imports this list of dictionaries into a database table and then generates the HTMIDs for that table.

Usage

See class docstring for usage

_create_dictionary_of_IFS()[source]

Generate the list of dictionaries containing all the rows in the IFS stream

Return

  • dictList - a list of dictionaries containing all the rows in the IFS stream

Usage

from sherlock.imports import IFS
stream = IFS(
    log=log,
    settings=settings
)
dictList = stream._create_dictionary_of_IFS()
_add_htmids_to_database_table()[source]

Add HTMIDs to database table once all the data has been imported (HTM Levels 10,13,16)

Usage

self._add_htmids_to_database_table()
_update_database_helper_table()[source]

Update the sherlock catalogues database helper table with the time-stamp of when this catlogue was last updated

Usage

self._update_database_helper_table()
add_data_to_database_table(dictList, createStatement=False)[source]

Import data in the list of dictionaries in the requested database table

Also adds HTMIDs and updates the sherlock-catalogue database helper table with the time-stamp of when the imported catlogue was last updated

Key Arguments

  • dictList - a list of dictionaries containing all the rows in the catalogue to be imported

  • createStatement - the table’s mysql create statement (used to generate table if it does not yet exist in database). Default False

Usage

self.add_data_to_database_table(
    dictList=dictList,
    createStatement=createStatement
)
- Write a checklist for creating a new sherlock database importer