Skip to content

Commit b833a8b

Browse files
authored
Merge pull request #3 from bschrag620/dev
Version 1.1
2 parents 834cf2f + 8147e14 commit b833a8b

3 files changed

Lines changed: 763 additions & 263 deletions

File tree

main.py

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,13 @@
77
To create a plot, the first object that is needed is a Layer object. A layer has attributes of
88
(depth in cm, temperature in Kelvin, pressure in mBars, minimum window range in wavenumber cm-1,
99
maximum window range in wavenumber cm-1)
10-
# var_name = pyrad.Layer(10, 296, 1013.25, 600, 700
11-
Next, define the molecules that make up the layer. This can be done in 2 ways. Either method will
12-
require the same attributes to be defined, which are a (text name, HITRAN molecule ID - see table below,
13-
molecular weight, concentration). Concentration can be defined using ppm=, ppb=, percentage=, or concentration=,
14-
the app will adjust accordingly. You will get a warning if total concentrations exceed 1. First method for adding
15-
molecules, add them one at a time directly to the layer using .addMolecule. It's also a good idea if you want to
16-
change properties of the molecules to set this equal to a molecule variable name. For ease, use the same variable
17-
name as description:
18-
#### UPDATE ####
19-
ONLY USE THE TEXT NAME OF THE MOLECULE, NO NEED TO GIVE THE MOLECULE ID ANYMORE
10+
# var_name = pyrad.Layer(10, 296, 1013.25, 600, 700)
11+
Next, define the molecules that make up the layer. To do so, use layer.addMolecule(text name or molecule ID,
12+
concentration, isotopeDepth)
13+
2014
# co2 = your_layer_name_here.addMolecule('co2', 44, ppm=350)
2115
# h2o = your_layer_name_here.addMolecule('h2o', 18, percentage=.4)
22-
The second method involves defining the molecules individually, then adding them to the layer using
23-
.addMolecules (note the 's' on the end)
24-
# co2 = pyrad.Molecule('co2', 2, 44, ppm=350)
25-
# h2o = pyrad.Molecule('h2o, 1, 18, concentration=.004)
26-
# layer.addMolecules(co2, h2o)
16+
2717
With the layer properties and composition defined, choose what to plot:
2818
# pyrad.plot(object, plotchoice)
2919
@@ -32,19 +22,22 @@
3222
'absorption coefficient'
3323
'absorbance'
3424
'cross section'
35-
Personal favorite add-on is to set individualColors=True in the plot command. This will plot up to
36-
6 molecules individually by color as well as the total in white. There is also a choice to set
37-
fill=False if you prefer to see just the outline.
25+
'emissivity'
26+
27+
Personal favorite add-on is to set individualColors=True in the plot command. This will plot the base object in white
28+
and up to 6 of the objects that make it up in individual colors. Example, define co2 to have an isotope depth of 3,
29+
plotting the transmittance will show each isotope in it's own color with the total transmittance in white. There is
30+
also a choice to set fill=False if you prefer to see just the outline.
3831
Questions or bugs, email brad.schrag@gmail.com
3932
"""
4033

41-
layer = pyrad.Layer(10, 300, 101.325, 640, 670)
42-
co2 = pyrad.Molecule('co2', 44, ppm=400)
43-
h2o = pyrad.Molecule('h2o', 18, percentage=.4)
44-
ozone = pyrad.Molecule('o3', 48, ppb=10)
34+
layer = pyrad.Layer(10, 300, 1013.25, 635, 640)
35+
co2 = layer.addMolecule('co2', ppm=400, isotopeDepth=3)
36+
h2o = layer.addMolecule('h2o', percentage=.4)
37+
ozone = layer.addMolecule('o3', ppb=10)
4538

46-
layer.addMolecules(co2, h2o, ozone)
47-
pyrad.plot(co2, 'transmittance', individualColors=True)
39+
layer.createCrossSection()
40+
pyrad.plot(layer, 'transmittance', individualColors=True)
4841

4942
"""
5043
MOLECULE_ID = {'h2o': 1, 'co2': 2, 'o3': 3, 'n2o': 4, 'co': 5,

0 commit comments

Comments
 (0)