AS=AstSpec
%AS.<tab>
% show available templates
AstSpec.get_galspec
% load specific template
S=AstSpec.get_galspec('QSO_NIR');
plot(S)
% load the entire Pickles library
S=AstSpec.get_pickles
% load spectra of GV star:
S=AstSpec.get_pickles('g','v');
stairs(S);
S=AstSpec.get_gaia_synspec(5000,0,0,0);
plot(S)
% BB spectra at 5000K and 10000K
AstS=AstSpec.blackbody([5000;10000]);
plot(AstS);
set(gca,'YS','log','XS','log')
% More options
WaveRange = (2000:100:10000)';
AstS=blackbody(5000,WaveRange,'ph/A'); % spectra units photons/Ang
plot(AstSpec.zodiac_spectrum);
S=AstSpec.get_pickles;
W=(5000:10:6000)';
S=interp(S,W);
plot(S(1:3))
S=resample(S,'log')
S=AstSpec.get_pickles;
S=interp(S,S(1).Wave);
arith(S,S(1),@minus);   % subtract the first spectra from all the spectra
S=AstSpec.get_pickles;
% add the intensity in S(1:2) to that in S(1)
AstS=astspec_fun2(S(1:2),S(1),'Int',@plus);
% calculate the sin of all the fields
AstS=astspec_fun1(S(1:3),'all',@sin);
% calculate the sin of all fields except wavelength
AstS=astspec_fun1(S(1:3),'notwave',@sin);
S=AstSpec.get_pickles;
Mean = S.fun_scalar(@mean)
S=AstSpec.get_pickles;
mean(S);
median(S);
integral(S);  % Calculate the integral of the spectrum
S=AstSpec.get_pickles;   % load all the Pickles library spectra
% calculate synthetic photometry in the SDSS r-band in AB magnitude
[Mag,Flag,EffW]=synphot(S,'SDSS','r','AB');
% Divide all the spectra such that their r-band mag will be -20
S1=arith(S,10.^(0.4.*(Mag-(-20))),@times);
plot(S(1));
hold on;
plot(S1(1))
S=AstSpec.get_pickles('g','v');
S=S(1); % not necessery for the example
plot(S);
hold on;
Sm = medfilt1(S,10);
plot(Sm)
hold on;
% filter_lines identify and remove spectral lines
Sl = filter_lines(S)
plot(Sl)
legend('Original','medfilt1','filter\_lines')
% zoom in on one line to see how it works:
axis([6000 7000 0.6 0.9]);
S=AstSpec.get_pickles('g','v');
S=S(1); % not necessery for the example
% plot original spectrum
plot(S);
hold on;
% remove spectral lines
S = filter_lines(S);
plot(S);
hold on;
[Fit,Sbb]=fit_bb(S);
hold on;
% overlay the BB spectrum
plot(Sbb)
% show fit results
Fit
The class AstSpec has no Constant property or Static method named 'mlx'.