Skip to content

Commit

Permalink
Improve docstrings and variable naming behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncan Forgan committed Dec 6, 2018
1 parent 3a2d888 commit d323484
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ Features

* Generates maps of the sky as seen from Observers' point of view

* Current presets optimised for electromagnetic signals - can be configured for signals of arbitrary speed and decay behaviour (gravitational waves, neutrinos)


Future Features/Wishlist
------------------------

* Currently designed for electromagnetic communications - in principle extendable to e.g. neutrino or gravitational wave emission

* Interstellar scintillation/absorption/dispersion
* Interstellar scintillation/absorption/dispersion, other forms of noise

* Sampling of planetary orbits from exoplanet data

Expand Down
22 changes: 15 additions & 7 deletions taktent/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,26 +268,33 @@ def sample_random_sphere(self, seed=-45, rmin = 10.0, rmax = 20.0, vdisp=0.0, fl
self.velocity = self.starvelocity


def sample_GHZ(self, seed = 10, innerRadius=6000.0, outerRadius=10000.0, scale = 3500, max_inclination = 0.0, incmax=0.5):
def sample_GHZ(self, seed = 10, inner_radius=6000.0, outer_radius=10000.0, scale_length = 3500, max_inclination = 0.5):
'''
Places agent in a circular orbit inside an annular Galactic Habitable Zone
Keyword Arguments:
------------------
inner_radius - inner radius of GHZ
outer_radius - outer radius of GHZ
scale_length - scale_length of exponential surface density distribution of Agents
max_inclination - maximum inclination of Agent
'''

# All stars have the same mass
self.starmass = 1.0;

# Scale surface density distribution for the range of radii involved
sigma_0 = (exp(-innerRadius/scale) - exp(-outerRadius/scale));
sigma_0 = (exp(-inner_radius/scale_length) - exp(-outer_radius/scale_length));

# Randomly assign star orbital parameters
# Assign semimajor axis such that the surface density profile is correct

semimajoraxis = exp(-innerRadius/scale) -random()*sigma_0
semimajoraxis = -log(semimajoraxis)*scale
semimajoraxis = exp(-inner_radius/scale_length) -random()*sigma_0
semimajoraxis = -log(semimajoraxis)*scale_length

inclination = -incmax + random() * 2.0 * incmax
inclination = -max_inclination + random() * 2.0 * max_inclination
mean_anomaly = random() * 2.0 * pi
longascend = random() * 2.0 * pi

Expand All @@ -301,7 +308,8 @@ def sample_GHZ(self, seed = 10, innerRadius=6000.0, outerRadius=10000.0, scale =

def plot(self,radius,wedge_length):
"""
Return matplotlib.patches objects for agent's position, and target vector (with opening angle)
Return matplotlib.patches objects for agent's position,
and target vector (with opening angle)
Keyword Arguments:
------------------
Expand Down
1 change: 0 additions & 1 deletion taktent/agents/transmitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ def transmitted_flux(self,distance):
------------------
distance - distance between transmitter and location
Returns:
--------
Flux
Expand Down

0 comments on commit d323484

Please sign in to comment.