SVOCat Documentation

Version 2.01, October 2020, author: Carlos Rodrigo

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. Web Design
    6.1. style.css
    6.2. Colors
    6.3. header.php
    6.4. footer.php
7. Extra tips
Previous   Next

Example catalogue

When you download SVOCat you get it preconfigured with the properties of an example catalogue.

The idea is that you can get, as fast as possible, a working version of SVOCat so that you can see it at work and get tips on how to configure your own catalogue.

This example catalogue is made using a very small subset of the SpeX Prism library. We have chosen it because it allows to explain many of the SVOCat options.

We have used the name excat2 (for 'example catalogue number 2') to label files, database tables and so on.

As a very brief summary:

In the data-csv/excat2.csv file you have the data in csv format.

These data are equivalent to a table with 10 rows and 10 columns.

Create a MySQL database (vocats)

We need to create a MySQL table with that structure and then load the data into it (you could want to take a look at the MySQL database configuration).

First, we need a database that you must create in your own way. A typical command to create a database is:

mysqladmin -u root -p create vocats

If you decide to use other name for the database, please go to the administration application and change it too in the Mysql section.

Create a MySQL user (mycatuser)

Creating a mysql user is a little more tricky. If you don't know how to do it you should probably ask for some help from your system administrator.

In any case, we give you a simplified example.

You first open the MySQL command line interface:

mysql -u root -p

Then, under the mysql prompt, you create a user named "mycatuser" with all privileges in the 'vocats' database and password "mycatp@ss"

mysql> grant all privileges on vocats.* to 'mycatuser'@'locahost' identified by 'mycatp@ss';

and you exit the mysql interface:

mysql> quit;

But take this as just a tip. You maybe want to be more restrictive about mycatuser permissions.

Create a MySQL table (excat2)

We now must create a table to contain the catalogue data. In the work/ folder you have a file work/ with the mysql instructions to create a table named "excat2".

you can use this file to create the table in the database as:

cd /var/www/catalogues/excat2/work/
mysql -u mycatuser -p vocats <

("mycatuser" must be a mysql-user allowed to create a table, like the one that we created above).

You can also create the table by your own means (using phpMyAdmin, by the command line mysql interface or by any other way that you are used to). Just use the same table definition shown above.

Load data into the table

The last step is loading the catalogue data into the table.

There are different methods that you could use to insert data into the database table.

(1) Using mysqlimport

An easy way is to use the command mysqlimport with the options already included in the file work/myimport.csh:

mysqlimport -u mycatuser -p --local --ignore-lines=1 --fields-terminated-by=, --columns=RAdeg,DECdeg,name,opspty,jmag,hmag,ksmag,dateobs,ref,filename0 --delete vocats excat2.csv

You can take a look to mysqlimport documentation (mysqlimport --help) to see more details or options. In this case:

  • mycatuser: a mysql user with permission to insert data in the table excat
  • the database name is vocats (you can change it if your database name is different).
  • excat2 is the name of the database table.
  • excat2.csv is the csv file. The database table must be named likewise (that is, excat2).
  • we ignore the first line in excat2.csv (the commented one, with the column names).
  • we delete the content of the excat2 database table before adding data.
  • columns in excat2.csv are separated by commas (,).
  • columns in the csv files that correspond with the columns in the database table, in the same order as they appear in the csv file: (RAdeg, DECdeg, name, opspty, jmag, hmag, ksmag, dateobs, ref, filename0).

(2) Inserting line by line (

To do this you have work/ which is a quite ugly file with instructions to load the data line by line:

You can use this script to load the data in the table as:

cd /var/www/catalogues/excat2/work/
mysql -u mycatuser -p vocats <

If everything has gone right, you should have now a database table containing the catalogue data. You should be able to go to:

where, remember, should be the main URL that corresponds to your installation. (if you are trying to install this in a laptop or any other computer without a real internet address, try http://localhost/catalogues/excat2/)

And search for data in the "Data Retrieval" section.

The catalogue is small. To get a results try for instance:

  • RA=0
  • DEC=10
  • SR=180
Previous   Next