IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Version 138 and Version 139 of ippToPsps


Ignore:
Timestamp:
Aug 3, 2011, 8:51:36 AM (15 years ago)
Author:
rhenders
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ippToPsps

    v138 v139  
    2929Essentially, the job of ippToPsps is to take a collection of IPP tables and convert them to tables suitable for ingestion to PSPS. Some mappings between IPP and PSPS are direct (eg IPP exposure ID = PSPS frame ID), while many require a format conversion, or can only be derived from multiple IPP fields; some require mining info from other IPP sources, such as DVO databases or the IPP MySQL database, {{{gpc1}}}.
    3030
    31 The tools chosen for {{{ippToPsps}}} are those considered to be the most effective to tackle the task at hand. {{{ippToPsps}}} is not, therefore, consistant with the rest of the IPP code-base, but since its role is essentially ''outside'' the IPP, this, to me, is not an issue.
    3231
    3332== Languages and tools used ==
    3433
     34The tools chosen for {{{ippToPsps}}} are those considered to be the most effective to tackle the task at hand. As a result, {{{ippToPsps}}} is not consistant with the rest of the IPP code-base (which is, predominately, Perl and C), but since its role is essentially ''outside'' the IPP, this, to me, is not an issue.
     35
    3536=== MySQL ===
    3637
    37 Because we are dealing with table data that requires some intensive manipulation, it follows that a relational database be used. Relational databases are highly optimized to provide the fastest possible query times, especially when indexing in incorporated. Thus we gain speed over the more obvious route of read-a-table-from-FITS-into-an-array-then-loop-through-each-value etc.
     38Because we are dealing with table data that requires some intensive manipulation, it follows that a relational database be used. Relational databases are highly optimized to provide extremely fast query times, especially when indexing in incorporated. Thus we gain speed over the more obvious route of read-a-table-from-FITS-into-an-array-then-loop-through-each-value etc.
    3839
    39 An added bonus is that, by using keys that enforce uniqueness in a given column, we protect ourselves against the risk of duplicates making into PSPS.
     40An added bonus is that, by using keys that enforce uniqueness in a given column (or columns), we protect ourselves against the risk of duplicates making into PSPS.
    4041
    41 {{{ippToPsps}}} uses two MySQL databases, a 'scratch' database, used to import tables and manipulate then, and the 'ippToPsps' database, which keeps track of which batches have been processed, published to PSPS etc.
     42{{{ippToPsps}}} uses two MySQL databases, a ''scratch'' database, used to import tables and manipulate then before discarding them, and the ''ippToPsps'' database, which keeps track of which batches have been processed, published to PSPS etc.
    4243
    4344=== Jython and STILTS ===
    4445
    45 {{{ippToPsps}}} is written in [http://www.jython.org/ Jython], this is in part to take full advantage of the [http://www.star.bris.ac.uk/~mbt/stilts/ STILTS] package, which enables very fast and efficient processing of astronomical catalog data tables. Since it supports FITS, VOTable, and SQL, it is a perfect fit for this project. It is also software maintained elsewhere, reducing this burden for us.
     46{{{ippToPsps}}} is written in [http://www.jython.org/ Jython], this is in part to take full advantage of the [http://www.star.bris.ac.uk/~mbt/stilts/ STILTS] package, which enables very fast and efficient processing of astronomical catalog data tables. Since it supports FITS, VOTable, and SQL, it is a perfect fit for this project. It is also software maintained elsewhere, reducing this burden on us.
    4647
    47 Jython is simply a Java implementation of Python, a modern, high-level and object-oriented language enabling {{{ippToPsps}}} to be written in a minimal number of lines of code, thus helping it to be both more readable and maintainable.
     48Jython is simply a Java implementation of Python, a modern, high-level and object-oriented language enabling {{{ippToPsps}}} to be written in a minimal number of lines of code, helping it be both more readable and maintainable.
    4849
    4950== High-level design ==
     
    5354{{{ippToPsps}}} works like this:
    5455
    55 - reads all relevant FITS tables from a given {{{smf}}} or {{{cmf}}} into temporary tables in a 'scratch' MySQL database
    56 - creates empty MySQL tables for PSPS output (also in the 'scratch' database). These tables match the shape of the final PSPS database tables exactly.
    57 - copies all relevant columns from the temporary IPP tables into the PSPS tables, discarding duplicates where necessary
    58 - accesses the DVO database and creates temporary MySQL tables containing all the detections for this {{{smf}}} or {{{cmf}}}
    59 - updates the PSPS tables with the IDs from the DVO MySQL tables
    60 - replaces any NULL values with -999, as required by the PSPS loader
    61 - exports the PSPS tables to a FITS file
    62 - publishes FITS file, complete with a batch 'manifest' file, to the datastore
     56 * reads all relevant FITS tables from a given {{{smf}}} or {{{cmf}}} into temporary tables in a 'scratch' MySQL database
     57 * creates empty MySQL tables for PSPS output (also in the 'scratch' database). These tables match the shape of the final PSPS database tables exactly.
     58 * copies all relevant columns from the temporary IPP tables into the PSPS tables, discarding duplicates where necessary
     59 * accesses the DVO database and creates temporary MySQL tables containing all the detections for this {{{smf}}} or {{{cmf}}}
     60 * updates the PSPS tables with the IDs from the DVO MySQL tables
     61 * replaces any NULL values with -999, as required by the PSPS loader
     62 * exports the PSPS tables to a FITS file
     63 * publishes FITS file, complete with a batch 'manifest' file, to the datastore
    6364
    6465The reading and export of FITS tables is done using STILTS. For import, we can specify which columns we wish to import from the IPP smf and cmf files (we don't need everything).
     
    7374= Using the software =
    7475
    75 Notes on how to run ippToPsps can be found on the individual batch-type pages, linked to at the top of this page.
     76{{{ippToPsps}}} is configured for use entirely by a config file (see above). So, running the software is simply a case of editing a config and passing it as the sole argument to the program, like this:
     77
     78{{{
     79cd trunk/ippToPsps/jython
     80./run.sh ipptopsps.py someConfig.xml
     81}}}
     82
     83The {{{./run.sh}}} prefix above is necessary to invoke the correct Java virtual machine, while including the relevant jar files in the CLASSPATH (all included in the {{{trunk/ippToPsps/Jars}}} subdir)
    7684
    7785== Deletion policy ==