光谱拟合辅助工具ASERA的安装

我的系统版本是Ubuntu 22.04,其它系统思路相似

ASERA简介

ASERA全称: A spectrum eye recognition assistant for quasar spectra
由国家天文台袁海龙老师等人编写,主要用于LAMOST光谱,尤其是LAMOST类星体光谱交互式拟合,也可用于恒星星系等的光谱。

笔者装完感觉很简单,但装的时候遇到报错很烦恼,于是顺便写下教程为了记忆。

原文章链接
代码源网站

安装步骤

安装git、maven和java环境

Ubuntu 自带java环境,所以我只安装了git和、maven

sudo apt install git
sudo apt install maven

下载asera软件包

git clone https://gitee.com/yuanhl1984/asera_pub.git

下载完之后进入下载目录

cd asera_pub

然后如果按作者代码源网站说的直接进行下一条mvn命令会报错,需要先配置一下

进入文件下载目录之后先配置一下

已进入asera_pub目录,然后输入

sudo cp -r extlib/jsamp-1.3.7.jar ~/.m2/repository/org/astrogrid/jsamp/1.3.7

然后继续输入

mvn install

最后执行代码源网站安装的最后一条命令

mvn exec:java -Dexec.mainClass="rmtx.ngxx.asera.ImagePanel"

然后如图交互式界面就出来了

在这里插入图片描述
导入一个在LAMOST随机寻找的光谱数据示例

在这里插入图片描述

目前我每次运行交互界面都要进入文件目录输入

mvn exec:java -Dexec.mainClass="rmtx.ngxx.asera.ImagePanel"

运行一次后也可只输入

mvn exec:java 

最新发现Java11编译环境会报错导致无法运行,可以换成JDK8编译

参考JDK8环境安装

后续有待进一步探索

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
这是一个使用MATLAB计算天文光谱Lick线指标的示例代码: ```matlab % Lick index definition % Lick indices are defined as a ratio of the flux in a bandpass centered on a % feature to the flux in a nearby pseudo-continuum bandpass. The feature is % defined with two passbands of equal width, one centered on the feature and % one to the blue of the feature. The pseudo-continuum bandpasses are defined % to be at the same position relative to the feature bandpasses in all Lick % indices. Here we use the definitions from Worthey et al. 1994. % Load the Lick index bandpass definitions load LickIndex.mat % Load the spectrum data load spectrum.mat % Smooth the spectrum with a Gaussian filter sigma = 2; spectrum_smooth = imgaussfilt(spectrum, sigma); % Compute the Lick indices n = size(spectrum_smooth, 2); lick_index = zeros(n, 25); for i = 1:25 feature = spectrum_smooth(:, LickIndex(i).feature); continuum = (spectrum_smooth(:, LickIndex(i).blue) + ... spectrum_smooth(:, LickIndex(i).red)) / 2; lick_index(:, i) = sum(feature, 2) / sum(continuum, 2); end % Plot the Lick indices figure; plot(lick_index); xlabel('Wavelength (Angstroms)'); ylabel('Lick index'); title('Lick indices for spectrum'); legend(LickIndex.label); ``` 这里假设spectrum.mat中包含了一个N x M的矩阵,其中N是波长采样点数,M是光谱数量。你需要替换这个矩阵为你自己的数据。LickIndex.mat包含了25个Lick线指标的定义,每个定义包含了feature、blue、red、label四个字段。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱天文的同学

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值