diff --git a/ChangeLog b/ChangeLog index c87113ead4fe21f54f286d60fde3072b74478fc9..0c11b6356fc6a7a298deeb40a991cd127e6e1d95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2013-08-17 Jana Mendrok <jana.mendrok@ltu.se> + + * ARTS-XML-DATA-2-1-57 + + * planets/[Venus,Mars,Jupiter]/isotopratio_[Venus,Mars,Jupiter].xml: + Adapted for isotopologues recently added/adapted to newest HITRAn data + in species_data.cc. + + * planets/aux/isotopologue_ratios/isotopratios.txt: + Some additions to documention of calculation method. Adapted molecule + list. Spellfixes. + + * planets/aux/isotopologue_ratios/isotopratios.py: + Bugfixes. More documentation. More support/suggested setups. + 2013-08-17 Jana Mendrok <jana.mendrok@ltu.se> * ARTS-XML-DATA-2-1-56 diff --git a/planets/Jupiter/isotopratio_Jupiter.xml b/planets/Jupiter/isotopratio_Jupiter.xml index f6c0aa8cd80581c9b4395ea70cb7ddd3ef60cd3b..51fa81a34d7948feeffe806fca11f47c1eb8b018 100644 --- a/planets/Jupiter/isotopratio_Jupiter.xml +++ b/planets/Jupiter/isotopratio_Jupiter.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <arts format="ascii" version="1"> -<SpeciesAuxData version="1" nelem="194" nparam="1"> +<SpeciesAuxData version="1" nelem="204" nparam="1"> @ H2O-161 0.997572947934 @ H2O-181 0.00200034318924 @ H2O-171 0.000372095461312 @@ -88,19 +88,23 @@ @ NH3-4111 9.976597e-01 @ NH3-5111 2.244734e-03 @ NH3-4112 7.781746e-05 -@ HNO3-146 9.906273e-01 +@ HNO3-146 9.906402e-01 +@ HNO3-156 2.228940e-03 @ OH-61 0.997602433337 @ OH-81 0.00200039954065 @ OH-62 2.59376632668e-05 -@ HF-19 0.999968195957 -@ HF-29 2.59991730949e-05 -@ HCl-15 0.757681348634 -@ HCl-17 0.242287170287 -@ HCl-25 1.95600947671e-05 -@ HCl-27 6.3441134375e-06 -@ HBr-19 5.068438e-01 -@ HBr-11 4.931241e-01 -@ HI-17 9.999682e-01 +@ HF-19 9.999740e-01 +@ HF-29 2.599932e-05 +@ HCl-15 7.576853e-01 +@ HCl-17 2.422884e-01 +@ HCl-25 1.969809e-05 +@ HCl-27 6.300051e-06 +@ HBr-19 5.068468e-01 +@ HBr-11 4.931270e-01 +@ HBr-29 1.317829e-05 +@ HBr-21 1.282104e-05 +@ HI-17 9.999740e-01 +@ HI-27 2.599932e-05 @ ClO-56 0.755908 @ ClO-76 0.24172 @ OCS-622 0.937395 @@ -115,7 +119,8 @@ @ H2CO-2226 6.669066e-10 @ HOCl-165 7.558837e-01 @ HOCl-167 2.417130e-01 -@ N2-44 0.99548843 +@ N2-44 9.955459e-01 +@ N2-45 4.479957e-03 @ N2-SelfContMPM93 nan @ N2-SelfContPWR93 nan @ N2-SelfContStandardType nan @@ -137,6 +142,7 @@ @ C2H6-1231 2.196894e-02 @ PH3-1111 9.999047e-01 @ COF2-269 0.986544 +@ COF2-369 0.01108 @ SF6-29 0.95018 @ H2S-121 9.501345e-01 @ H2S-141 4.214801e-02 @@ -189,9 +195,13 @@ @ SO-46 0.0420727 @ SO-28 0.00194089 @ C3H8-21 9.672486e-01 -@ H2-11 9.999479e-01 -@ H2-12 5.199729e-05 +@ H2-11 9.999594e-01 +@ H2-12 5.199789e-05 +@ H-1 1 @ He-4 1 +@ Ar-8 1 +@ C4H2-2211 9.562372e-01 +@ SO3-26 0.9434 @ liquidcloud-MPM93 nan @ icecloud-MPM93 nan @ rain-MPM93 nan diff --git a/planets/Mars/isotopratio_Mars.xml b/planets/Mars/isotopratio_Mars.xml index eba04ba65ddd5a022647c5314b8a183fef104660..a7edebe65b885507a041b7dfdb68b3d2acd882db 100644 --- a/planets/Mars/isotopratio_Mars.xml +++ b/planets/Mars/isotopratio_Mars.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <arts format="ascii" version="1"> -<SpeciesAuxData version="1" nelem="194" nparam="1"> +<SpeciesAuxData version="1" nelem="204" nparam="1"> @ H2O-161 0.996010631696 @ H2O-181 0.00199721041719 @ H2O-171 0.000371512716178 @@ -88,19 +88,23 @@ @ NH3-4111 9.919026e-01 @ NH3-5111 5.653845e-03 @ NH3-4112 2.410323e-03 -@ HNO3-146 9.864557e-01 +@ HNO3-146 9.864685e-01 +@ HNO3-156 5.622870e-03 @ OH-61 0.996820946034 @ OH-81 0.00199883249672 @ OH-62 0.000807424966287 -@ HF-19 0.999184855397 -@ HF-29 0.000809339732872 -@ HCl-15 0.757087807226 -@ HCl-17 0.242097370883 -@ HCl-25 0.000608894821999 -@ HCl-27 0.000197488706894 -@ HBr-19 5.064468e-01 -@ HBr-11 4.927378e-01 -@ HI-17 9.991849e-01 +@ HF-19 9.991906e-01 +@ HF-29 8.093444e-04 +@ HCl-15 7.570918e-01 +@ HCl-17 2.420986e-01 +@ HCl-25 6.131906e-04 +@ HCl-27 1.961171e-04 +@ HBr-19 5.064497e-01 +@ HBr-11 4.927407e-01 +@ HBr-29 4.102328e-04 +@ HBr-21 3.991117e-04 +@ HI-17 9.991906e-01 +@ HI-27 8.093444e-04 @ ClO-56 0.755908 @ ClO-76 0.24172 @ OCS-622 0.937395 @@ -115,7 +119,8 @@ @ H2CO-2226 6.462605e-07 @ HOCl-165 7.552916e-01 @ HOCl-167 2.415236e-01 -@ N2-44 0.9886702 +@ N2-44 9.887273e-01 +@ N2-45 1.127149e-02 @ N2-SelfContMPM93 nan @ N2-SelfContPWR93 nan @ N2-SelfContStandardType nan @@ -137,6 +142,7 @@ @ C2H6-1231 2.186588e-02 @ PH3-1111 9.975567e-01 @ COF2-269 0.986544 +@ COF2-369 0.01108 @ SF6-29 0.95018 @ H2S-121 9.486465e-01 @ H2S-141 4.208200e-02 @@ -189,9 +195,13 @@ @ SO-46 0.0420727 @ SO-28 0.00194089 @ C3H8-21 9.612035e-01 -@ H2-11 9.983818e-01 -@ H2-12 1.617379e-03 +@ H2-11 9.983934e-01 +@ H2-12 1.617397e-03 +@ H-1 1 @ He-4 1 +@ Ar-8 1 +@ C4H2-2211 9.547396e-01 +@ SO3-26 0.9434 @ liquidcloud-MPM93 nan @ icecloud-MPM93 nan @ rain-MPM93 nan diff --git a/planets/Venus/isotopratio_Venus.xml b/planets/Venus/isotopratio_Venus.xml index b2d6a2635884981ca62c6ef0bc688385fab0cb6e..54af041ee38f7c30b6ddd383be246f3e3a4f42ff 100644 --- a/planets/Venus/isotopratio_Venus.xml +++ b/planets/Venus/isotopratio_Venus.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <arts format="ascii" version="1"> -<SpeciesAuxData version="1" nelem="194" nparam="1"> +<SpeciesAuxData version="1" nelem="204" nparam="1"> @ H2O-161 0.960768771556 @ H2O-181 0.001926543089 @ H2O-171 0.000358367475789 @@ -88,19 +88,23 @@ @ NH3-4111 9.416209e-01 @ NH3-5111 3.461839e-03 @ NH3-4112 5.367239e-02 -@ HNO3-146 9.708129e-01 +@ HNO3-146 9.708130e-01 +@ HNO3-156 3.568739e-03 @ OH-61 0.979026860648 @ OH-81 0.00196315166932 @ OH-62 0.0186015103523 -@ HF-19 0.981348572257 -@ HF-29 0.0186456228729 -@ HCl-15 0.743573158341 -@ HCl-17 0.237775730867 -@ HCl-25 0.0140277596158 -@ HCl-27 0.00454975803218 -@ HBr-19 4.974063e-01 -@ HBr-11 4.839421e-01 -@ HI-17 9.813486e-01 +@ HF-19 9.813542e-01 +@ HF-29 1.864573e-02 +@ HCl-15 7.435770e-01 +@ HCl-17 2.377770e-01 +@ HCl-25 1.412673e-02 +@ HCl-27 4.518158e-03 +@ HBr-19 4.974092e-01 +@ HBr-11 4.839448e-01 +@ HBr-29 9.450970e-03 +@ HBr-21 9.194762e-03 +@ HI-17 9.813542e-01 +@ HI-27 1.864573e-02 @ ClO-56 0.755908 @ ClO-76 0.24172 @ OCS-622 0.937395 @@ -115,7 +119,8 @@ @ H2CO-2226 3.430044e-04 @ HOCl-165 7.418090e-01 @ HOCl-167 2.372122e-01 -@ N2-44 0.992687 +@ N2-44 0.9926874 +@ N2-45 0.00733 @ N2-SelfContMPM93 nan @ N2-SelfContPWR93 nan @ N2-SelfContStandardType nan @@ -137,6 +142,7 @@ @ C2H6-1231 1.962600e-02 @ PH3-1111 9.450830e-01 @ COF2-269 0.986544 +@ COF2-369 0.01108 @ SF6-29 0.95018 @ H2S-121 9.150805e-01 @ H2S-141 4.059302e-02 @@ -189,9 +195,13 @@ @ SO-46 0.0420727 @ SO-28 0.00194089 @ C3H8-21 8.322139e-01 -@ H2-11 9.630561e-01 -@ H2-12 3.659613e-02 +@ H2-11 9.630672e-01 +@ H2-12 3.659655e-02 +@ H-1 1 @ He-4 1 +@ Ar-8 1 +@ C4H2-2211 9.209580e-01 +@ SO3-26 0.9434 @ liquidcloud-MPM93 nan @ icecloud-MPM93 nan @ rain-MPM93 nan diff --git a/planets/aux/isotopologue_ratios/isotopratios.py b/planets/aux/isotopologue_ratios/isotopratios.py index f216ffc3a5009c0d1ae1090d6c6dc4f3517b7823..925c29d8e3110fdc6e107944cb91c9787b5a2f95 100644 --- a/planets/aux/isotopologue_ratios/isotopratios.py +++ b/planets/aux/isotopologue_ratios/isotopratios.py @@ -15,13 +15,14 @@ import numpy as N +import pdb #-------------------- #this to be done once #-------------------- ''' copy to commandline: import isotopratios as iso -tags,dhv,dhm,dhj,dnm,dnj,dheh2,dnen2 = iso.InitIR() +tags,d = iso.InitIR() ''' #------------------------------------------- @@ -43,58 +44,84 @@ ir,st,en = iso.getMolInfo(name,tags) ##### (B)-(E) ''' adapt (B)-(E) in IRSingSpec, then copy to commandline: reload(iso) -iso.IRSingSpec(ir,st,en) +iso.IRSingSpec(ir,st,en,tags,d) ''' -def IRSingSpec(ir,st,en): +def IRSingSpec(ir,st,en,tags,d): ''' ''' + #pdb.set_trace() #STEP (1): derive the Earth isotopic ratio that we are going to replace ##### (B) #(1b) - D/H - dhe = dheh2 #D/H from H2 (if no molecule-specific available) + dhe = d['dheh2'] #D/H from H2 (if no molecule-specific available) + print('D/H from H2: %.3e' %dhe) #(1a) - D/H - n = 3. #replace permutational factor properly - # in case only one pair we can derive internal isotopic ratio from (that's the common case) - dhe = (1./n)*ir[-1]/ir[0] #replace indices properly - # in case there's more than one we are taking the mean (e.g. for H2O, HCl) + n = 2. #REPLACE permutational factor of H properly (equal the number of + # H-atoms that can be interchanged in position, e.g. 4 for CH4) + + #in case of only one pair of main-isotope-minor-isotope isotopologue (e.g. + # HF and DF) we can derive internal isotopic ratio from + dhe = (1./n)*ir[-1]/ir[0] #REPLACE indices properly + + #in case there's more than one main-isotope-minor-isotope pair (e.g. for H2O + # (which has H2O-16/HDO-16, H2O-18/HDO-18, H2O-17/HDO-17), HCl, ...) we take + # the mean #dhe = N.mean(ir[1:3]/ir[0]) #n=2; dhe = N.mean(N.append((1./n)*ir[3:6]/ir[0:3],N.sqrt(ir[6]/ir[0]))) #D/H from H2O #n=4; dhe = N.mean((1./n)*ir[2:]/ir[0:2]) #D/H from CH4 #n=2; dhe = N.mean(N.append((1./n)*ir[3]/ir[0],N.sqrt(ir[-1]/ir[0]))) #D/H from H2CO + #n=1; dhe = N.mean((1./n)*ir[-2:]/ir[0:2]) #HBr,HCl + print('D/H from internal: %.3e' %dhe) ##### (C) #(1b) - 15N/14N - #dne = dnen2 #15N/14N from N2 (if no molecule-specific available) + # REPLACE dne calc properly + dne = d['dnen2'] #15N/14N from N2 (if no molecule-specific available) + print('N4/N5 from N2: %.3e' %dne) #(1a) - 15N/14N - # in case only one pair we can derive internal isotopic ratio from (that's the common case) - dne = ir[-2]/ir[0] - # in case there's more than one we are taking the mean + n = 2. #REPLACE permutational factor of N properly (equal the number of + # N-atoms that can be interchanged in position, e.g. 2 for N2) + + # in case of only one pair of main-isotope-minor-isotope isotopologue we can + # derive internal isotopic ratio from + + #miniso=-2 #common (if both H and N can be calculated) + #miniso=1 #if only N can be calculated, e.g. HNO3, N2 + #dne = (1./n)*ir[miniso]/ir[0] #REPLACE indices properly + + # in case there's more than one pair we take the mean #dne=N.mean(ir[1:3]/ir[0]) #N2O + print('N4/N5 from internal: %.3e' %dne) #STEP (2): derive the rescaling factors ##### (D) - #if no H/N atom in molecule, then set the respective m to 0 - mh=3; mn=1 + #REPLACE numbers properly. if no H/N atom in molecule, then set the + # respective m to 0. + mh=2; mn=0 - rvh=((dhe+1)/(dhv+1))**mh; rvn=1. - rmh=((dhe+1)/(dhm+1))**mh; rmn=((dne+1)/(dnm+1))**mn - rjh=((dhe+1)/(dhj+1))**mh; rjn=((dne+1)/(dnj+1))**mn + rvh=((dhe+1)/(d['dhv']+1))**mh; rvn=1. + rmh=((dhe+1)/(d['dhm']+1))**mh; rmn=((dne+1)/(d['dnm']+1))**mn + rjh=((dhe+1)/(d['dhj']+1))**mh; rjn=((dne+1)/(d['dnj']+1))**mn #now apply the rescaling (including minor-isotope refactoring) - dp = N.array([[dhv,dhm,dhj],[dne,dnm,dnj]]) + dp = N.array([[d['dhv'],d['dhm'],d['dhj']],[dne,d['dnm'],d['dnj']]]) rp = N.array([[rvh,rmh,rjh],[rvn,rmn,rjn]]) planet = ['Venus','Mars','Jupiter'] for i in N.arange(dp.shape[1]): dhp = dp[0,i]; dnp=dp[1,i]; rph = rp[0,i]; rpn = rp[1,i] ##### (E) - #fac = N.append(N.ones(3),N.append((dnp/dne),(dhp/dhe))) - fac = N.append(N.ones(3),N.append(N.ones(3)*(dhp/dhe),(dhp/dhe)**2)) #H2O - fac = N.append(1.,N.append(N.ones(2)*(dnp/dne),N.ones(2))) #N2O - fac = N.append(N.ones(2),N.ones(2)*(dhp/dhe)) #CH4 - fac = N.append(1.,N.append((dnp/dne),(dhp/dhe))) #NH3 + # REPLACE fac calc properly + #fac = N.ones(1) #when only the main isotopologue exists, e.g. C4H2 + #fac = N.append(N.ones(3),N.append(N.ones(3)*(dhp/dhe),(dhp/dhe)**2)) #H2O + #fac = N.append(1.,N.append(N.ones(2)*(dnp/dne),N.ones(2))) #N2O + #fac = N.append(N.ones(2),N.ones(2)*(dhp/dhe)) #CH4 + #fac = N.append(1.,N.append((dnp/dne),(dhp/dhe))) #NH3 + #fac = N.append(1.,(dnp/dne)) #HNO3, N2 + #fac = N.append(N.ones(2),N.ones(2)*(dhp/dhe)) #HBr,HCl + fac = N.append(1.,(dhp/dhe)) #HI,HF,H2 nir = fac.size irp = ir[:nir]*rph*rpn*fac print(planet[i]) @@ -120,27 +147,31 @@ def InitIR(infile='IRfromARTSBuiltin.xml'): the ARTS built-in isotopologue records. the 3 second-dim elements are the line-start symbol '@', the species&isotoplogue tag, and the corresponding isotopologue ratio. - dhv, dhm, dhj, dnm, dnj : float + d: dict + holds the isotopic ratios of H and N for different planets. entries as + below: + dhv, dhm, dhj, dnm, dnj : float D/H (dh) and 15N/14N (dn) isotopic ratios for [V]enus, [M]ars, and [J]upiter - dheh2, dnen2 : float + dheh2, dnen2 : float D/H and 15N/14N Earth (fixed) isotopic ratios from H2 and N2 isotopologue abundances ''' + d = {} #set the planetary isotopic ratios - dhv = 1.9e-2; dhm = 8.1e-4; dhj = 2.6e-5 #D/H - dnm = 5.7e-3; dnj = 2.25e-3 + d['dhv'] = 1.9e-2; d['dhm'] = 8.1e-4; d['dhj'] = 2.6e-5 #D/H + d['dnm'] = 5.7e-3; d['dnj'] = 2.25e-3 #get ARTS built-in data tags=N.loadtxt(infile,comments='<',dtype=N.str) #inititialise D/H and 15N/14N from H2 and N2 (we don't want to do this over and over... ir,st,en=getMolInfo('H2',tags,do_print=0) - dheh2 = 1./N.sqrt(ir[0])-1. + d['dheh2'] = 1./N.sqrt(ir[0])-1. ir,st,en=getMolInfo('N2',tags,do_print=0) - dnen2 = 1./N.sqrt(ir[0])-1. + d['dnen2'] = 1./N.sqrt(ir[0])-1. - return tags,dhv,dhm,dhj,dnm,dnj,dheh2,dnen2 + return tags, d def getMolInfo(name,tags,do_print=1): diff --git a/planets/aux/isotopologue_ratios/isotopratios.txt b/planets/aux/isotopologue_ratios/isotopratios.txt index 6c8b9e24f311f118d95414b0f6007716ba51d96b..de212437fea6397ef5b49d163569941caa4c7380 100644 --- a/planets/aux/isotopologue_ratios/isotopratios.txt +++ b/planets/aux/isotopologue_ratios/isotopratios.txt @@ -11,11 +11,11 @@ Files with adapted planetary isotopologue ratios have been created and can be Isotopic ratios of planets (Mars, Venus, Jupiter) differ from Earth only for D/H (all planets) and 15N/14N (Mars and Jupiter, not Venus), while 13C/12C as - well as 18O/16O and 17O/16O are within 5% or Earths values. + well as 18O/16O and 17O/16O are within 5% of Earth's values. That is, only species containing H (all 3 planets) and N (Mars, Jupiter) need adaptation. -Applied planetary isotopic ratios were provided by L.Rezac under ESA planetary +Applied planetary isotopic ratios were provided by L. Rezac under ESA planetary toolbox study (see TN1). Earth values were derived from ARTS built-in isotopologue ratios separately per molecular species (hence only an approximate value given here): @@ -116,10 +116,11 @@ In the IR formula derived above we now replace (D/H)_earth by (D/H)_planet by = IR(CH3D_e) * [(1+D/H_p) / (1+D/H_e)]**4 * [(D/H_p) / (D/H_e)] That is, all IR_e get rescaled by [(1+D/H_p) / (1+D/H_e)]**N, where N is the - number of atoms of the specific species in this molecul (here: H and N=4). + number of atoms of the specific species in this molecule (here: atom=H and + N=4). This is the planetary rescaling factor (rp). Isotopologues with other than the main isotope furthermore get refactored by [(D/H_p) / (D/H_e)]**M, where M is the number of atoms of the isotope - replacing the main one (here: D and M=1; CD4 would have M=4). + replacing the main one (here: D and M=1; CD4 would have M=4). This is isotopologue rescaling factor (fac). Note: using this refactoring method, we do not need to care about the positional permutation factors. As they occur in both the Earth and the planet IR, they factor out. @@ -153,17 +154,17 @@ Below is a list of species implemented in ARTS including tags showing what SO2 xx NO2 * NH3 -x HNO3 +*/x HNO3 (no internal calc of D/H, only of N14/15) *** OH *** HF *** HCl -xxx HBr -xxx HI +*** HBr +*** HI ClO OCS *** H2CO xxx HOCl -xx N2 +** N2 * HCN xxx CH3Cl xxx H2O2 @@ -189,11 +190,14 @@ xxx CH3Br * CH3CN CF4 * HC3N - CS + CS * HNC - SO + SO xxx C3H8 -*** H2 - He +*** H2 + He + Ar +x C4H2 + SO3 #############################