SVOCat Documentation

Version 2.2-nocoor, Last change: March 30, 2021; Author: Carlos Rodrigo

HomeDownloadDocumentationExamplesCreditsHelp-Desk
1. Introduction
2. Download
    2.1. Extract
    2.2. Permissions
3. The files
4. Example
5. Configure
    5.1. First
    5.2. Project
    5.3. Mysql
    5.4. Web
    5.5. VO options
    5.6. Fields
    5.7. Photometry
    5.8. Search Opts.
    5.9. File Paths
    5.10. Scripts
    5.11. Registry
    5.12. Spectra
    5.13. Links
    5.14. References
6. Edit
7. Web Design
    7.1. style.css
    7.2. Colors
    7.3. header.php
    7.4. footer.php
Previous   Next

Configuration

[First][Project][Mysql][Web][VO options][Fields][Photometry][Search Opts.][File Paths][Scripts][Registry][Spectra][Links][References]

Scripts

In practice you don't need to configure anything here.

This configuration section is there so that you can click on the "Create scripts" button whenever you want and the scripts in the "work" folder will be generated again taking into account any changes that you have made in other configuration sections.

These scripts intend to be useful to help you to create and populate the database with your catalogue data starting with your csv file/s. If you want to create the database and populate the database table by your own, you can ignore this configuration section.

If you want to use the scripts you can do as follows:

  1. First, you need to create a table in the database with the columns that correspond to your catalogue. In the "work/create_table.my" file you have the commands in SQL to create the table (SQL is the language for interacting with relational databases).

    If you understand a little SQL you can read the file. If not, in summary, it deletes the table named "mycat" (or the name given by you in the "Mysql database" configuration section) if it already exists and then creates the table again using the information about the fields given by you in the "Catalogue fields" section.

    Typically you can use this file as follows:

    > mysql -u catuser -p vocats < work/create_table.my

  2.  

  3. The second step is reading the csv file/s and loading the actual data in the mysql table. For this, SVOCat generates a simple csh script named work/load_data2.csh. This script will read your csv file/s and generate files in SQL so that you can insert the data in the MySQL database easily.

    Typically you can use this file as follows:

    • First you move to the directory where you have installed your catalogue:

      > csh /var/www/catalogues/mycat

    • Then you execute the script:

      > csh work/load_data2.csh

      This will generate a XXX.csv.my file for each of your XXX.csv files.

    • Then you load each of those files in the database as:

      > mysql -u catuser -p vocats < XXX.csv.my

Previous   Next