File: example-python-thindisk.xml

package info (click to toggle)
gyoto 2.0.2-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,444 kB
  • sloc: cpp: 42,330; sh: 4,512; python: 3,436; xml: 2,865; makefile: 691; ansic: 346
file content (46 lines) | stat: -rw-r--r-- 1,311 bytes parent folder | download | duplicates (7)
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Scenery>

  This example shows how to code a spectrum in Python directly in the
  XML file.

  <Metric kind = "KerrBL">
    <Spin> 0. </Spin>
  </Metric>

  <Screen>
    <Position> 1000. 100. 1.22 0. </Position>
    <Time unit="geometrical_time"> 1000. </Time>
    <FieldOfView> 0.314159265358979323846264338327950288419716 </FieldOfView>
    <Resolution> 32 </Resolution>
  </Screen>

  <Astrobj kind = "Python::ThinDisk">

    Python::ThinDisk inherits from ThinDisk, we can set the usual
    parameters:
    <InnerRadius> 3. </InnerRadius>
    <OpticallyThin/>


    We could write a python module in a separate file, say
    "gyoto_sample_spectra.py", and use the "Module" entity to load it:
    <!--Module>gyoto_sample_spectra</Module-->

    Alternatively, we can put the Python code inline using the
    "InlineModule" entity. Common indentation will be removed so we
    don't have to flush everything left .
    <InlineModule>
        class ThinDisk:
            def emission(self, nuem, dsem, cph, co):
                return dsem
    </InlineModule>

    Since there is only one class in the module, we do not need to
    specify the class name here:
    <!--Class>ThinDisk</Class-->

  </Astrobj>

  <MinimumTime> 0. </MinimumTime>
</Scenery>