# Astro-TS3 **Repository Path**: AstroTJU/Astro-TS3 ## Basic Information - **Project Name**: Astro-TS3 - **Description**: Time-series Sub-image Search Engine For Archived Astronomical Data - **Primary Language**: Unknown - **License**: GPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-03-23 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Astro-TS3 This is the main source code and executable program of Astro-TS3, a search engine for retrieving time-series sub-images which covers a specific sky region of interest within a specific time period from massive archived optical images. There are three versions of the code, **GUI**(QT version), **CLI**, and **Web** with their respective source code. The source packages for Cfitsio and HEALPix are placed under the **Software** directory. The executable is in the **Release** directory. Sample data can be accessed on this website of China-VO (https://nadc.china-vo.org/data/data/ast3-field/result?sqlid=1096947&rows=100&page=1&sort=&order=asc). ### Prerequisites - Cfitsio_3.45 - HEALPix_3.40 - MySQL - Python **Installation steps of Cfitsio** 1. Decompress and extract the contents of the distribution file in a source directory. You can use the following commands: ```shell tar -zvxf cfitsio_3.45.tar.gz ``` 2. Generate the make file: ```shell ./configure ``` 3. Compile the source files: ```shell make make install ``` the CFITSIO library(libcfitsio.a) are install under the path "./lib". The auxiliary files longnam.h, fitsio.h are placed under the path "./include". **Installation steps of HEALPix** The HEALPix installed is the C++ version, which relied on gfortran. If your environment has no gfortran compiler, you can install it by the command: ```shell sudo apt-get install gfortran ``` 1. We need to unzip the HEALPix source package and go into the HEALPix path. ```shell tar -zvxf Healpix_3.40.tar.gz cd Healpix_3.40 ``` 2. Generate the make file ```shell ./configure ``` Then choose the number (4) : C++ package, then follow the prompts to enter the relevant path for Cfitsio and select general Linux C++. Then enter all the way until it comes out again, this time (3) : F90 package, then name the F90 compiler gfortran, and finally (0) : exit 3. Compile the source files: ```shell make ``` **Installation steps of Python3** In the step, we used Python3 to convert FITS files into thumbnails in JPG format. Here we used the matplotlib and astropy modules in Python3, so we use the following command to install the dependencies. ```shell sudo apt-get install python3-matplotlib sudo apt-get install python3-astropy ``` If we run into a problem with the libmysqlclient.so library dependencies, we can use the next command to solve it. ```shell sudo apt-get install libmysqlclient-dev ``` ### Installation All versions rely on the MySQL database. Users need to create databases and data tables using statements in astro-ts3.sql. **Folder: Release/GUI/Astro-TS3-Server** QT version only needs to install MySQL in the environment, then the user sets the appropriate MySQL database information in the baseConfig.ini file under the executable Astro-TS3-server path, then use the command to run: ```shell ./Astro-TS3-Server ``` **Folder: Release/GUI/Astro-TS3-Client** The client can run the executable using the following command: ``` ./Astro-TS3-Client ``` **Folder: Release/GUI/Astro-TS3-Standalone** The standalone version can run the executeable using the following command: ``` ./Astro-TS3-standalone ``` **Folder: CLI/Astro-TS3-Server** The CLI version is compiled by using a make file, which allows the user to make custom changes to the code and recompile to produce an executable. All of the above dependency libraries are required. Modify the lib(-L) path in the makefile in the ./Debug/makefile and the include(-I) path in the./Debug/src/subdir.mk file.(current environment Cfitsio and HEALPix installation paths). Then it will generate an executable file: Astro-TS3-Server by the next command. ```shell make ``` **Folder: CLI/Astro-TS3-Client** the Client can use the next command to generate an executable file: Astro-TS3-Client ```shell make ``` **Folder: CLI/Astro-TS3-Standalone** the Stand-alone version can use the same steps of Astro-TS3-Server to generate an executable file: Astro-TS3-Standalone **Folder: Web/Astro-TS3** The web version uses the spring boot framework, which is easy to deploy. Users can customize the source code before using maven to repackage the program. if user needs the maven, they can use the command: ```shell sudo apt-get install maven ``` then in "./" directory user can use the command to clear the previous jar. ```shell mvn clean ``` and the following command can be used to repackage new .jar, which will generate new jars in the ./target directory. ``` mvn install ``` After that, The user needs to extract./Astro-ts3.tar.gz into./target/. Then user needs to configure the Astro-TS3 environment and follows the steps in Astro-TS3-Standalone to generate the corresponding executable file. Finally, the installation of the web version is completed. As for the jar file in ./Web/astroTS3/target can be directly used without the above command, but the configured Astro-TS3 files must be in the same directory as jar file. ### Operating guide **GUI:** It can run the program by executing commands in the server and client executable directories respectively. ```shell ./Astro-TS3-Server ./Astro-TS3-Client ``` - The user first enters the IP address and port number of the server in the input box and clicks the connection button - Then users can choose to enter the management interface or the query page - Entering the management interface, you can first configure the FITS head keyword set of the dataset. - To build an index, select the type of data set to be built from the drop-down box. The index is then built by defining the data set name and finally entering the storage path where the data set resides. - Entering the query interface, user can input query conditions, and the thumbnail images will be returned to the user. The user can download the time-series sub-images(FITS) by clicking the download button. **CGI:** We start the client and server programs with the following command, and need to be modified according to the actual situation. ```shell ./Astro-TS3-Server ./Astro-TS3-Client ``` After startup, the following keyword commands need to be used on the client side to perform corresponding operations: - **configuration**--Configure the keywords name in the FITS header. Including the data set type,WCS keywords (CD1_1,CD1_2,CD2_1,CD2_2,CRPIX1,CRPIX2,CRVAL1,CRVAL1,CRVAL2), observation time(date-obs) and NAXIS1,NAXIS2. And user just needs to modify the values in the followinig example(the value on the right of "="), and ensure that all keyword pairs are entered correctly. eg:configuration:DataSetType=AST3;str_cd1_1=CD1_1;str_cd1_2=CD1_2;str_cd2_1=CD2_1;str_cd2_2=CD2_2;str_crpix1=CRPIX1;str_crpix2=CRPIX2;str_crval1=CRVAL1;str_crval2=CRVAL2;str_date=date-obs;str_dec=dec_targ;str_keywords=[Primary];str_ra=ra_targ;str_naxis1=NAXIS1;str_naxis2=NAXIS2; - **dataSetType**-- get the type of data set that exists in the system - **index**-- the built index command including data set type, data set name, data set path. Use ";" to separate them. eg:index:AST3;AST3;/home/kangql/data/; - **dataSet**-- get the data set that exists in the system eg: dataSet - **query**-- Query condition contains data set name, RA, DEC, Size_x, Size_y, start time, end time. Use ";" to separate them. eg:query:AST3;203.317;-62.317;0.5;0.5;2011-01-01;2019-01-01; - **thumbnail**-- get thumbnails eg: thumbnail - **FITS**--get time-series sub-image(FITS) eg: FITS **Web:** We can use the following command to start the program, use http://\:\/astrots3/index to access. ``` java -jar astroTS3-0.0.1-SNAPSHOT.jar ``` The order of use is that the user firstly configures the data set type, then builds indexes on the data set. After that, user can query the time-series sub-images, the thumbnail preview and download the FITS files must be performed after query.