通过中值滤波,归一化对比LAMOST与SDSS的光谱

49 篇文章 0 订阅
17 篇文章 2 订阅
% Author:shizhixin
% Email:szhixin@gmail.com
% Blog:http://blog.csdn.net/shizhixin
% Date:2012-03-12

% 通过退红移,中值滤波,然后归一化对光谱进行处理,对比LAMOST与SDSS的光谱。
% 光谱文件为:DR8: 4.fits  
% LAMOST: 1.fits
% 参数dered为是否退红移,area处理的波长区间,w中值滤波的窗口半径,边界未做处理。
% 如Dered=0  area=all  w=0 5 50 100
% 表示下面四个图都未退红移,并且处理的是整个光谱区间,
% 依次为未滤波w=5、w=5、w=50、w=100

clc,clear,close all

filename_dr8 = 'compare\4.fits';
filename_lamost = 'compare\1.fits';

dered = true;
[head_dr8 lamda_dr8 flux_dr8 z_dr8] = read_dr8_flux(filename_dr8,dered,false);
[head_lamost lamda_lamost flux_lamost z_lamost] = read_lamost_fits(filename_lamost,dered,false);

area = [3400 6780];%以退红移后的波长为标准
if dered == 0
    area =area*(1+z_dr8);
end
%整个区间
area = [max([lamda_dr8(1) lamda_lamost(1)]) min([lamda_dr8(end) lamda_lamost(end)])];
figure
[lamda1, flux1] = get_window_flux(area, lamda_lamost, flux_lamost, true)
title('LAMOST');
figure
[lamda2, flux2] = get_window_flux(area, lamda_dr8, flux_dr8, true)
title('SDSS');

figure
w_filter = [0 5 50 100];
for i=1:length(w_filter)

wflux1 = meanfilter(lamda1, flux1, w_filter(i));%中值滤波
wflux2 = meanfilter(lamda2, flux2, w_filter(i));
wflux1 = (wflux1-min(wflux1))/(max(wflux1)-min(wflux1));%归一化
wflux2 = (wflux2-min(wflux2))/(max(wflux2)-min(wflux2));
subplot(2,2,i);
plot(lamda1,wflux1);
hold on
plot(lamda2,wflux2);
end

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值