-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathco2lines_jmhartmann.m.works
91 lines (83 loc) · 3 KB
/
co2lines_jmhartmann.m.works
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
function [hartmann_bands,lineOUT] = co2lines_jmhartmann(...
wn1,wn2,lineIN,which_isotope);
%%% this loads in the data from JM Hartmann IR and sees which bands he uses
%%% for linemixing;
%%% input :
%%% wn1,wn2 are the start/stop of the chunk you want to compute optdepths
%%% lineIN is from hitread
%%% isotopes are the isotope list
%%% output
%%% hartmann_bands = see if we can identify them with usual run8co2 IDs
%%% (if you find NaN, then it is not identified)
%%% lineOUT are the remaining HITRAN lineparams
%%% remove these from the lineIN structure and then use use regular run8.m
%%% code for the rest of the lines
hartmann = load('~/SPECTRA/JMHARTMANN/LM_PQR_CO2_2.0/Data/BandInfo.dat');
[m,n] = size(hartmann);
usethis = [];
if which_isotope == 0
%% all isotopes
for ii = 1 : m
if (hartmann(ii,6) <= wn2 & hartmann(ii,7) >= wn1)
usethis = [usethis ii];
end
end
else
for jj = 1 : length(which_isotope)
jx = which_isotope(jj);
for ii = 1 : m
if (hartmann(ii,6) <= wn2 & hartmann(ii,7) >= wn1 & hartmann(ii,1) == jx)
usethis = [usethis ii];
end
end
end
end
hartmann_bands = usethis;
ggall = [];
bandall = [];
if length(usethis) > 0
str = ' # Iso US LS Jmax(Hart) len(Band) Sum(SoFar) AllLines';
disp(str);
disp('--------------------------------------------------------------------')
for ii = 1 : length(usethis)
iii = usethis(ii);
xx = hartmann(iii,:);
numhartmann = xx(8);
gg = find(lineIN.iso == xx(1) & lineIN.iusgq == xx(2) & ...
lineIN.ilsgq == xx(3));
ggall = [ggall gg];
semilogy(lineIN.wnum,lineIN.stren,'b.',...
lineIN.wnum(ggall),lineIN.stren(ggall),'r.')
title('looking for JM Hartmann bands (in red)')
data = [ii xx(1) xx(2) xx(3) xx(8) ...
length(gg) length(ggall) length(lineIN.wnum)];
fprintf(1,'%3i %3i %3i %3i %3i %4i %7i %7i\n',data')
pause(0.1);
end
end
allin = 1 : length(lineIN.wnum);
fprintf(1,'---> original number of lines = %7i \n',length(lineIN.wnum));
fprintf(1,'---> number of lines in JMHartmanns bands = %7i \n',length(ggall));
if length(usethis) > 0
allout = setdiff(allin,ggall);
lineOUT.linct = length(allout);
lineOUT.iso = lineIN.iso(allout);
lineOUT.wnum = lineIN.wnum(allout);
lineOUT.stren = lineIN.stren(allout);
lineOUT.tprob = lineIN.tprob(allout);
lineOUT.abroad = lineIN.abroad(allout);
lineOUT.sbroad = lineIN.sbroad(allout);
lineOUT.els = lineIN.els(allout);
lineOUT.abcoef = lineIN.abcoef(allout);
lineOUT.tsp = lineIN.tsp(allout);
lineOUT.iusgq = lineIN.iusgq(allout);
lineOUT.ilsgq = lineIN.ilsgq(allout);
lineOUT.uslq = lineIN.uslq(allout,:);
lineOUT.bslq = lineIN.bslq(allout,:);
lineOUT.ai = lineIN.ai(allout,:);
lineOUT.ref = lineIN.ref(allout,:);
lineOUT.gasid = lineIN.gasid(allout);
lineOUT.igas = lineIN.igas;
else
lineOUT = lineIN;
end