|
7 | 7 | To create a plot, the first object that is needed is a Layer object. A layer has attributes of |
8 | 8 | (depth in cm, temperature in Kelvin, pressure in mBars, minimum window range in wavenumber cm-1, |
9 | 9 | 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 | +
|
20 | 14 | # co2 = your_layer_name_here.addMolecule('co2', 44, ppm=350) |
21 | 15 | # 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 | +
|
27 | 17 | With the layer properties and composition defined, choose what to plot: |
28 | 18 | # pyrad.plot(object, plotchoice) |
29 | 19 |
|
|
32 | 22 | 'absorption coefficient' |
33 | 23 | 'absorbance' |
34 | 24 | '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. |
38 | 31 | Questions or bugs, email brad.schrag@gmail.com |
39 | 32 | """ |
40 | 33 |
|
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) |
45 | 38 |
|
46 | | -layer.addMolecules(co2, h2o, ozone) |
47 | | -pyrad.plot(co2, 'transmittance', individualColors=True) |
| 39 | +layer.createCrossSection() |
| 40 | +pyrad.plot(layer, 'transmittance', individualColors=True) |
48 | 41 |
|
49 | 42 | """ |
50 | 43 | MOLECULE_ID = {'h2o': 1, 'co2': 2, 'o3': 3, 'n2o': 4, 'co': 5, |
|
0 commit comments