Skip to content

Commit

Permalink
added sub-Lorentzian profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
sigrimm committed Aug 12, 2020
1 parent dc31722 commit 1b45b38
Show file tree
Hide file tree
Showing 27 changed files with 75,695 additions and 18 deletions.
11 changes: 11 additions & 0 deletions chiPH89__CO2-CO2.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sigma1 3.0
sigma2 30.0
sigma3 120.0

B alpha beta epsilon
B1 0.0888 -0.160 0.00410
B2 0.0 0.0526 0.00152
B3 0.0232 0.0 0.0

range in cm^-1
2100 2500
12 changes: 12 additions & 0 deletions chiPH89__CO2-N2.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sigma1 3.0
sigma2 10.0
sigma3 70.0

B alpha beta epsilon
B1 0.416 -0.354 0.00386
B2 0.00167 0.0421 0.00248
B3 0.0200 0.0 0.0

range in cm^-1
2100 2500

7 changes: 6 additions & 1 deletion define.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#endif


#define VERSION 2.03
#define VERSION 2.04


#define def_T0 296.0 //Reference Temperature in K
Expand Down Expand Up @@ -158,8 +158,13 @@ struct Param{
double gammaF;
int doTuning;
int removePlinth;
char subLorentzianFilename[160];
int useSubLorentzian;
};

//Sub-Lorentzian coefficients
float sLchi_h[17];

struct Line{
double *nu_h, *nu_d; //Wavenumber
double *S_h, *S_d; //Intensity
Expand Down
9 changes: 9 additions & 0 deletions docs/helios_k/heliosk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,15 @@ used parameters are listed here, the order can not be changed.
- 3: Gaussian
- 4: Integrated Binned Gaussian

- subLorentzianfile: A '-' ignores this option, otherwise this option
specifies a file name which contains the chi factor parameters for
sub-Lorentzian CO2 profiles.

- removePlinth:

- 0: nothing is done here
- 1: the plinth (base) is removed from cutted line profiles

- doTuning:

- 0: nothing is done here
Expand Down
17 changes: 14 additions & 3 deletions docs/helios_k/plinth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@ Removing the Plinth
When using cutted line wing profiles in combination with a continuum and
far wing background cross section, it can be necessary to remove the plinth
of each transition line, since this can be already included in the backround.
See for example:
Ptashnik, Igor & McPheat, Robert & Shine, Keith & Smith, Kevin & Williams, Robert. (2012). Water vapour foreign-continuum absorption in near-infrared windows from laboratory measurements. Philosophical transactions. Series A, Mathematical, physical, and engineering sciences. 370. 2557-77. 10.1098/rsta.2011.0218.

Removing the plinth from the opacities can be done with the `removePlinth` option
|See for example:
|Ptashnik, Igor & McPheat, Robert & Shine, Keith & Smith, Kevin & Williams, Robert. (2012). Water vapour foreign-continuum absorption in near-infrared windows from laboratory measurements. Philosophical transactions. Series A, Mathematical, physical, and engineering sciences. 370. 2557-77. 10.1098/rsta.2011.0218.
|or
|S.A. Clough, F.X. Kneizys, R.W. Davies,
Line shape and the water vapor continuum,
Atmospheric Research,
Volume 23, Issues 3–4,
1989,
Pages 229-241,
ISSN 0169-8095,
https://doi.org/10.1016/0169-8095(89)90020-3.

| Removing the plinth from the opacities can be done with the `removePlinth` option
in the `param.dat` file. The hight of the plinth is defines as the value of the
line profile at the cutting length. And example is shown in :numref:`fiplinth`.

Expand Down
67 changes: 67 additions & 0 deletions docs/helios_k/subLorentzian.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
CO2 sub-Lorentzian line wings
=============================


HELIOS-K supports sub-Lorentzian profiles according to the :math:`\chi` factors
from Perrin and Hartmann 1998. The :math:`\chi` factors are specified in the files
``chiPH89__CO2-CO2.dat`` and ``chiPH89__CO2-N2.dat``. In these files, the affected
wavenumber range can be set. The ``param.dat`` file contains the option
``subLorentzianfile``, where the file name of the used :math:`\chi` factors file
can be set. If a filename is set there, the sub-Lorentzian line wings are enabled.


In principle, the :math:`\chi` factors can be applied also to other molecules than
CO2, but this is not recommended to do.



M.Y.Perrin and J.M.Hartmann, 1988 (TEMPERATURE-DEPENDENT MEASUREMENTS AND MODELING OF ABSORPTION BY CO2-N2 MIXTURES
IN THE FAR LINE-WINGS OF THE 4.3 # m CO2 BAND).



In :numref:`figSubLorentzian` is shown an example of the sub-Lorentzian profile for CO2.


| Relevant parameters for full Voigt:
- doStoreFullK = 1
- cutMode = 0
- cut = 25.0
- profile = 1
- subLorentzianfile = -

| Relevant parameters for sub-Lorentzian Voigt profile in specific wavenumber band:
- doStoreFullK = 1
- cutMode = 0
- cut = 25.0
- profile = 1
- subLorentzianfile = chiPH89__CO2-CO2.dat

- in chiPH89__CO2-CO2.dat:
- range in cm^-1
- 2100 2500

| Relevant parameters for sub-Lorentzian Voigt profile in the full wavenumber range:
- doStoreFullK = 1
- cutMode = 0
- cut = 25.0
- profile = 1
- subLorentzianfile = chiPH89__CO2-CO2.dat

- in chiPH89__CO2-CO2.dat:
- range in cm^-1
- 0 10000




.. figure:: ../../plots/SubLorentzian/plot001.png
:name: figSubLorentzian

CO2 sub-Lorentzian wings with :math:`\chi` factors for Perrin and Hartmann 1998. Top panel,:
:math:`\chi` factors applied to the band 2100-2600 cm^-1. Bottom panel: :math:`\chi` factors
applied to the full wavenumber range. CO2, Hitran 2016, T = 250 K, P = 2 atm.

1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ OPTIONS
:maxdepth: 1

helios_k/profiles.rst
helios_k/subLorentzian.rst
helios_k/cut.rst
helios_k/plinth.rst
helios_k/bins.rst
Expand Down
17 changes: 12 additions & 5 deletions exomol2.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ def transitionRanges(url):
if(len(transList) > 1):
#check range of files
for x in transList:
x0 = float(x.split('-')[0])
x1 = float(x.split('-')[1])
dg = len(x.split('-')[0])
#print(x1-x0)
rangesList.append(x1-x0)
#print(x)
try:
x0 = float(x.split('-')[0])
x1 = float(x.split('-')[1])
dg = len(x.split('-')[0])
#print(x1-x0)
rangesList.append(x1-x0)
except:
print("error", url, x)
return(0, 0, 0)

s = rangesList[0]
for r in rangesList:
Expand Down Expand Up @@ -99,8 +104,10 @@ def main():
url2 = url1 + el1 + "/"
page2 = requests.get(url2).text
soup2 = BeautifulSoup(page2, "html.parser")
#print(soup2)

List2 = soup2.find_all('a', attrs={"class" : "list-group-item link-list-group-item "})
List2 += soup2.find_all('a', attrs={"class" : "list-group-item link-list-group-item"})
List2 += soup2.find_all('a', attrs={"class" : "list-group-item link-list-group-item recommended"})

#Line list
Expand Down
12 changes: 12 additions & 0 deletions heliosk.cu
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ return 0;
param.pathK[0] = 0;
param.nSpecies = 1;
param.useSpeciesFile = 0;
param.useSubLorentzian = 0;

param.T = 0.0;
param.P = 0.0;
Expand Down Expand Up @@ -405,6 +406,8 @@ return 0;
return 0;
}

subLorentzianConstantCopy(param.useSubLorentzian);

//If the bin file is used, store the boundaries of the bins
double *binBoundaries_h, *binBoundaries_d;
binBoundaries_h = (double*)malloc((param.nbins + 1) * sizeof(double));
Expand Down Expand Up @@ -465,6 +468,11 @@ printf("%g %g %g %g\n", param.numax, param.numin, param.dnu, (param.numax - para
return 0;
}
}
if(param.useSubLorentzian == 1){
subLorentzianB(param.T);
param.useIndividualX = 1;
//this is needed because of the nu/nu0 factor
}


//If the output edges file is used store the edges
Expand Down Expand Up @@ -498,6 +506,7 @@ printf("%g %g %g %g\n", param.numax, param.numin, param.dnu, (param.numax - para
if(er == 0) return 0;
}


double time[9];
double timeT[3];
for(int i = 0; i < 9; ++i){
Expand Down Expand Up @@ -542,6 +551,9 @@ printf("%g %g %g %g\n", param.numax, param.numin, param.dnu, (param.numax - para
fprintf(infofile, "Species in file: %s\n", param.SpeciesFilename);
fprintf(infofile, "Number of Species: %d\n", param.nSpecies);
}
if(param.useSubLorentzian > 0){
fprintf(infofile, "sub-Lorentzian file: %s\n", param.SpeciesFilename);
}
fprintf(infofile, "cia System = %s\n", param.ciaSystem);
fprintf(infofile, "pathToData = %s\n", param.path);
fprintf(infofile, "numin = %g\n", param.numin);
Expand Down
36 changes: 36 additions & 0 deletions host.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ __host__ int read_parameters(Param &param, char *paramFilename, int argc, char*a
fscanf (paramFile, "%d", &param.removePlinth);
fgets(sp, 3, paramFile);
}
//read subLorentzianFile
else if(strcmp(sp, "subLorentzianfile =") == 0){
fscanf (paramFile, "%s", param.subLorentzianFilename);
fgets(sp, 3, paramFile);
}
else{
printf("Undefined line in param.dat file: line %d\n", j);
return 0;
Expand Down Expand Up @@ -486,6 +491,37 @@ __host__ int read_parameters(Param &param, char *paramFilename, int argc, char*a
}
fclose(Speciesfile);
}
if(strcmp(param.subLorentzianFilename, "-") != 0){
printf("Use sub-Lorentzian file %s\n", param.subLorentzianFilename);
param.useSubLorentzian = 1;
FILE *sLfile;
sLfile = fopen(param.subLorentzianFilename, "r");
if(sLfile == NULL){
printf("Error: sub-Lorentzian file not found: %s\n", param.subLorentzianFilename);
return 0;
}

char b[160];
int er;
//Read Perrin and Hartmann 1989 coefficients
er = fscanf(sLfile, "%s %f", b, &sLchi_h[0]); //sigma1
er = fscanf(sLfile, "%s %f", b, &sLchi_h[1]); //sigma2
er = fscanf(sLfile, "%s %f", b, &sLchi_h[2]); //sigma3

er = fscanf(sLfile, "%s %s %s %s", b, b, b, b); //B alpha beta epsilon
er = fscanf(sLfile, "%s %f %f %f", b, &sLchi_h[3], &sLchi_h[4], &sLchi_h[5]); //B1
er = fscanf(sLfile, "%s %f %f %f", b, &sLchi_h[6], &sLchi_h[7], &sLchi_h[8]); //B2
er = fscanf(sLfile, "%s %f %f %f", b, &sLchi_h[9], &sLchi_h[10], &sLchi_h[11]); //B3
//read range
er = fscanf(sLfile, "%s %s %s", b, b, b); //range
er = fscanf(sLfile, "%f %f", &sLchi_h[12], &sLchi_h[13]); //B3

if(er <= 0){
printf("Error in sub-Lorentzian file read %s\n", param.subLorentzianFilename);
return 0;
}
fclose(sLfile);
}
if(strcmp(param.ciaSystem, "-") != 0){
param.useCia = 1;
}
Expand Down
1 change: 1 addition & 0 deletions param.dat
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ doMean = 0
Units = 0
ReplaceFiles = 1
profile = 1
subLorentzianfile = -
removePlinth = 0
doTuning = 1
72 changes: 72 additions & 0 deletions plots/SubLorentzian/Info_i.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
Name:GeForce GTX 980, Major:5, Minor:2, Max threads per Block:1024, Max x dim:1024
, #Multiprocessors:16, Clock Rate:1215500, Memory Clock Rate:3505000, Global Memory:4230807552, Shared memory per block: 49152

Version: 2.04
Using device 0

Runtime Version 10000
Driver Version 10020
GIT Describe: v1.0-124-gdc31722
Build Date: Di 11. Aug 12:37:57 CEST 2020
Build Path: /home/sigrimm/kCalc
Build System: Linux mashu 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build Compute Capability: SM=52

name = i
T = 250
P = 2
cia System = -
pathToData = ../storage/EXOMOL/
numin = 0
numax = 2500
dnu = 0.1
Nnu per bin = 25000
Number of points: 25000
cutMode = 0
cut = 100
doResampling = 0
nC = 20
doTransmission = 0
nTr = 1000
dTr = 0.05
doStoreFullK = 1
pathToK =
dostoreK = 0
nbins = 1
kmin = 0
qalphaL = 1
gammaF = 1
doMean = 0
Units = 0
Replace files = 1
profile = 1
doTuning = 0
def_TOL = 1.43e-17
def_TOLf = 2.48e-12
def_nthmax = 1048576
def_nlmax = 32768
def_maxlines = 1048576
def_maxfiles = 500
def_NmaxSample = 100

Species Name = 02_hit16
dataBase = 0
Molecule Number = 2
default L = 0
default n = 0

File 0 of 1
Number of lines: 559874
Time for input: 0.15566 seconds
Time for Lines: 0.00931168 seconds
Time for K(x): 0.0584077 seconds

Time for input total: 0 seconds
Time for Lines total: 0 seconds
Time for K(x) total: 0 seconds
Time for write K(x): 0.0216046 seconds
Time for mean K(x): 2.3584e-05 seconds
Time for sort K(x): 0.000690624 seconds
Time for Resampling: 1.5584e-05 seconds
Time for write K(y): 3.968e-06 seconds
Time for Transmission: 9.344e-06 seconds

0 comments on commit 1b45b38

Please sign in to comment.