Changes between Version 138 and Version 139 of ippToPsps
- Timestamp:
- Aug 3, 2011, 8:51:36 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ippToPsps
v138 v139 29 29 Essentially, 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}}}. 30 30 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.32 31 33 32 == Languages and tools used == 34 33 34 The 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 35 36 === MySQL === 36 37 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 possiblequery 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.38 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 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. 38 39 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.40 An 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. 40 41 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. 42 43 43 44 === Jython and STILTS === 44 45 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 forus.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. 46 47 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 tobe both more readable and maintainable.48 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, helping it be both more readable and maintainable. 48 49 49 50 == High-level design == … … 53 54 {{{ippToPsps}}} works like this: 54 55 55 -reads all relevant FITS tables from a given {{{smf}}} or {{{cmf}}} into temporary tables in a 'scratch' MySQL database56 -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 necessary58 -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 tables60 -replaces any NULL values with -999, as required by the PSPS loader61 -exports the PSPS tables to a FITS file62 -publishes FITS file, complete with a batch 'manifest' file, to the datastore56 * 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 63 64 64 65 The 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). … … 73 74 = Using the software = 74 75 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 {{{ 79 cd trunk/ippToPsps/jython 80 ./run.sh ipptopsps.py someConfig.xml 81 }}} 82 83 The {{{./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) 76 84 77 85 == Deletion policy ==
