-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
111 lines (101 loc) · 3.98 KB
/
README.txt
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
astrocloud.py
NAME
astrocloud - Module for implementing a Monte Carlo simulation of photons propagating through a scattering cloud.
CLASSES
builtins.object
Cloud
Photon
class Cloud(builtins.object)
| Methods defined here:
|
| __init__(self, radius, star_distance, observer_distance, observer_angle, scatter_coefficient, scatter_type='uniform')
| Initialize self. See help(type(self)) for accurate signature.
|
| check_if_escaped(self, photon)
| Checks if photon has escaped the cloud radius. Returns true if escaped. False otherwise.
| Returns: Boolean.
|
| enter_photon(self)
| Initiates a new photon. Chooses a random incident angle from which the initial position is calculated.
|
| Returns: Photon.
|
| hit_target(self, photon)
| Checks if photon will be seen by the observer. Returns True if photon is within target area. False otherwise.
| Returns: Boolean.
|
| photon_step(self, photon)
| Executes a photon scattering step. Samples scattering length L, calls Photon.scatter to step photon in its current
| direction, then samples new random scattering direction based on scattering type. Sets new photon direction. | Returns: None
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class Photon(builtins.object)
| Methods defined here:
|
| __init__(self, phi, theta, position)
| Initialize self. See help(type(self)) for accurate signature.
|
| get_dir(self)
| Gets Photon direction.
| Returns: Float,Float
|
| get_numsteps(self)
| Gets number of scattering steps for Photon.
| Returns: Int
|
| get_pos(self)
| Gets Photon position.
| Returns: List [x,y,z]
|
| scatter(self, length)
| Executes Photon scattering step. Updates the Photon position and direction.
| Returns: None
|
| set_dir(self, new_phi, new_theta)
| Sets new Photon direction in spherical coordinates.
| Returns: None
|
| set_pos(self, new_position)
| Sets new Photon position. new_position should be an array or list in the form [x,y,z]
| Returns: None
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
FUNCTIONS
run_scatter(cloud, maxphi, R, Dstar, Dobs, Phobs, asc, num_photons)
Example scattering simulation. Returns list of simulation data.
Returns: List.
[maxphi: Maximum photon incident angle
R: Cloud radius.
Dstar: Star distance from center of cloud.
Dobs: Observer distance from center of cloud.
Phobs: Angle within which photons are considered to be seen by observer.
asc: Cloud scattering coefficient.
hits: Number of photons seen by observer.
stuck: Number of photons that don't escape cloud within 10**7 steps
reflected: Number of photons that leave cloud on same side as they enter (z-position is negative)
mean_phsteps: Mean photon scattering steps.
phpos: List of each photon's exit position.
angle_wrt_observer: List of angles each photon radiates with respect to observer]
DATA
__copyright__ = 'Copyright 2019, Jesse Weller, All rights reserved'
__email__ = '[email protected]'
VERSION
1.0
AUTHOR
Jesse Weller
FILE
astrocloud.py