Warning, /education/kstars/kstars/data/tools/README.tools is written in an unsupported language. File is not indexed.
0001 THIS DIRECTORY: 0002 --------------- 0003 This directory contains tools used to analyse the data used in 0004 KStars. It has tools to test, read and create the binary files used 0005 for star data amongst other things. 0006 0007 Most of these programs (particularly the C / C++ programs) are rather 0008 poorly written code, but somehow happen to work. Also, this directory 0009 can be a pain to build (read the note in the Makefile for details). I 0010 really don't know if it is worth spending time cleaning all this up, 0011 since it's anyway something that very few people would be interested 0012 in building (or so I think). 0013 0014 Most of the perl scripts are due to James Bowlin, who can be contacted 0015 at <bowlin@mindspring.com>. Most of the C programs are my work, and I 0016 can be contacted at <akarsh@kde.org> 0017 0018 Some of the Perl scripts require the HTMesh perl wrapper, which is 0019 also present in this directory. The library is released under a 0020 license more liberal than GPL, and the details are found in the README 0021 file in the relevant directory. This library needs to be built (it 0022 depends on the HTMesh C++ library, available in kstars/kstars/htmesh) 0023 and installed before running many of the Perl scripts in this 0024 directory. 0025 0026 Many of the Perl scripts and C++ programs as of this writing require a 0027 MySQL database server to be available on localhost. The database is 0028 used as an intermediary to hold the data loaded from ASCII data files 0029 in a nice format. 0030 0031 DESCRIPTIONS OF FILES: 0032 ---------------------- 0033 0034 read-hippo.pl Reads the Hipparcos catalog files 0035 0036 reformat-hip.pl Converts old format star data files into the new format, 0037 where the fixed length Genetive name comes before the 0038 variable length long name 0039 0040 mag-linenum.pl Write the line number magnitude index file 0041 0042 max-length.pl Find the longest line in a file 0043 0044 sort-hip-by-pm.pl Sort the Hipparcos catalog data by proper motion 0045 0046 hipdatatomysql.pl Reads Hipparcos star catalog text files and puts them into 0047 a MySQL database (server on localhost). CAUTION: This script 0048 will empty the table that it is writing into. 0049 0050 tycdatatomysql.pl The Tycho star catalog text files used by KStars are in a 0051 different format from the Hipparcos catalog files. This script 0052 puts the data from the Tycho star catalog into a MySQL 0053 database. It's just a modified version of hipdatatomysql.pl 0054 0055 binfiletester.c C Program to test KStars' star data in binary format 0056 0057 nomadbinfiletester.c C Program to test KStars' deep star data from the 0058 NOMAD catalog in binary format 0059 0060 mysql2bin.c C Program to put data from the MySQL database (generated 0061 using datatomysql.pl) into the binary data format defined 0062 by KStars. [See README.fileformat in the kstars/data 0063 directory]. To make this, you will need to have the 0064 libmysqlclient-dev package or equivalent installed 0065 0066 nomaddatatomysql.pl Reads the NOMAD catalog data in ASCII format and puts it into a 0067 MySQL database for easy processing. This is just a modified 0068 version of tycdatatomysql.pl 0069 0070 nomadbinfile2mysql.c Reads binary NOMAD catalog data and puts it in a 0071 MySQL database for easy processing. 0072 0073 # TODO: Document the split and merge stuff. 0074 0075 BUILDING THE PROGRAMS: 0076 ---------------------- 0077 0078 To build both the C programs, use: 0079 0080 make 0081 0082 To build only mysql2bin, use: [Requires MySQL client library] 0083 0084 make mysql2bin 0085 0086 To build only binfiletester, use: 0087 0088 make binfiletester 0089 0090 To clean up, use: 0091 0092 make clean 0093 0094 CREATING THE DATA FILES: 0095 ------------------------ 0096 0097 To create and put the binary data files in kstars/data, first export 0098 your MySQL DB username and password: 0099 0100 export KSTARS_MYSQL_DB_USER='<your DB username>' 0101 export KSTARS_MYSQL_DB_PASS='<your DB password>' 0102 0103 If the database in which the star data table is stored is not 0104 identical to the DB username, export that too: 0105 0106 export KSTARS_MYSQL_DB_DB='<the DB name>' 0107 0108 If the table in which the data is present is not allstars (default if 0109 you used datatomysql.pl to generate the tables), then export that too: 0110 0111 export KSTARS_MYSQL_DB_TBL='<table name>' 0112 0113 Then, finally do: 0114 0115 make datafiles 0116 0117 This will build mysql2bin, collect the data, and put it in 0118 kstars/data. 0119 0120 If 'make datafiles' hangs (it typically takes about 5 - 10 minutes), 0121 then you should first double check that it is really hanging by 0122 setting VERBOSE to 1 on line 17 of mysql2bin.c and retry. If it shows 0123 no progress, reduce the value of MYSQL_STARS_PER_QUERY in the #define 0124 directive on line 24 of mysql2bin.c till it works. This is because the 0125 database query may hang if the query results are too large in size. I 0126 don't know why this happens, but it seems to work that way. 0127 0128 LICENSING INFORMATION: 0129 ---------------------- 0130 Copyright (c) 2008-2011 Akarsh Simha <akarsh.simha@kdemail.net> 0131 This document is released under the terms of the GPL v2.