Install - EranOfek/AstroPack GitHub Wiki
Installation
Requirements
- Ubuntu Linux 16.04 or later
- Windows 7 or 10
- MATLAB v2020b or later on Linux or Windows
- The following matlab toolboxes are required: communication_toolbox, image_toolbox, map_toolbox, signal_blocks, signal_toolbox, statistics_toolbox, symbolic_toolbox.
Install
To install, download from github: https://github.com/EranOfek/AstroPack, or alternatively install git (version 2.33 or higher) and run the following commands: We recommend installing AstroPack in the user ~matlab directory (although this is not mandatory).
git clone https://github.com/EranOfek/AstroPack
cd AstroPack
git checkout dev1
startup file
matlab startup file allows for running a set of commands on matlab startup. MATLAB will automatically look for a startup.m file in its default search path, and execute this file. As part of AstroPack we maintain our recomended startup file. This file is available in: AstroPack/matlab/startup/startup.m
IMPORTANT:
- Do not modify this file.
- The location of this file is not in the matlab search path.
There are several options on how to use the startup file:
Recomended option : In your ~/matlab directory (or analog windows dir, which is in the default MATLAB path) create (or use your existing) startup.m file. Your startup file should include the following lines:
% LINUX/MAC case:
PWD = pwd;
HomeDir = getenv('HOME');
cd(sprintf('%s/matlab/AstroPack/matlab/startup/',HomeDir));
% Edit if needed : the location of the AstroPack dir:
AstroPack_BasePath = sprintf('%s/matlab/AstroPack',HomeDir);
% Edit if needed : the location of the data dir (used by the Installer to install additional catalogs):
AstroPack_DataPath = sprintf('%s/matlab/data',HomeDir);
% Edit if needed : the location of the catsHTM dir (optional)
AstroPack_CatsHTMPath = '/home/eran/catsHTM';
startup('AstroPack_BasePath',AstroPack_BasePath, 'AstroPack_DataPath', AstroPack_DataPath, 'AstroPack_CatsHTMPath', AstroPack_CatsHTMPath);
cd(PWD)
% This code can be adapted to Windows by changing the relevant dir names.
Other options:
- Build your own startup file
- Copy the AstroPack startup file to your matlab dir and edit.
The startup main function is to:
- Add several AstroPack directories to the search path (using the addpath command).
- Set the default axes fonts and their size.
- Introduce a variable RAD=180./pi to the base.
- Set: format short g
- Set: rng('shuffle'); % will shuffle the random number generator seed.
compile mex files
AstroPack contains several mex files (MATLAB executable). These functions are pre-compiled but in some cases they may require re-compilation, which may be platform specific. By default the code is compiled on a linux 64-bit and windows machines. Do not compile the code unless you have to.
Installer.compileAllMex
Data files
Some functionality of AstroPack depends on additional data files. Some of these data files are updated constantly, or are very large, and therefore are not distributed with AstroPack. Examples for external data files include:
- The +cats catalog package - a package of intermediate size astronomical catalogs (about 54GB).
- Orbital elements of minor planets.
- VSOP87 planetary theory.
- IERS earth orientation and time files.
- Several spectral libraries.
In order to see the available external data files:
I = Installer; % create an Installer object
I.seeAvailableData
In the future, the catsHTM file may be available via the Installer.
Next, you can install a data set using its DataName - e.g.,
I = Installer;
I.install('EarthGravity');
I.install('MinorPlanets');
I.install('cats');
ds9 and xpa
ds9 is an astronomical image viewing software, while xpa is a protocol that allows to communicate with ds9 from the command line. ds9 is available from: https://sites.google.com/cfa.harvard.edu/saoimageds9 To install xpa download it from: https://github.com/ericmandel/xpa and follows the INSTALL instructions.