diff options
| -rw-r--r-- | fg21sim/configs/00-general.conf.spec | 15 | ||||
| -rw-r--r-- | fg21sim/utils/random.py | 19 | 
2 files changed, 19 insertions, 15 deletions
| diff --git a/fg21sim/configs/00-general.conf.spec b/fg21sim/configs/00-general.conf.spec index 906be3e..baa7d5e 100644 --- a/fg21sim/configs/00-general.conf.spec +++ b/fg21sim/configs/00-general.conf.spec @@ -30,29 +30,30 @@ extragalactic/pointsources = boolean(default=False)  [sky]  # Type of the input/output simulation sky  # + patch: -#       Input sky template is only a (square) patch of the sky. +#       Input/output sky template is only a (square) patch of the sky.  #       The simulated output maps have the same coverage/field as the  #       input template, as well as the coordinate projection.  # + healpix: -#       Input sky template covers (almost) all sky, and stored in -#       HEALPix format.  The simulated output maps will also be +#       Input/output sky template covers (almost) all sky, and stored +#       in HEALPix format.  The simulated output maps will also be  #       all-sky using the HEALPix projection.  type = option("patch", "healpix", default="patch") -  # Configurations for input sky patch +  # Configurations for input/output sky patch    [[patch]] -  # The (R.A., Dec.) coordinate of the input patch center [ deg ] +  # The (R.A., Dec.) coordinate of the sky patch center [deg]    xcenter = float(default=0.0, min=0.0, max=360.0)    ycenter = float(default=0.0, min=-90.0, max=90.0) -  # The (pixel) dimensions of the input patch    xsize = integer(default=None, min=1)    ysize = integer(default=None, min=1) +  # The image dimensions (i.e., number of pixels) of the sky patch, +  # along the X (R.A./longitude) and Y (Dec./latitude) axes.    # Pixel size [ arcsec ]    pixelsize = float(default=None, min=0.0) -  # Configurations for input HEALPix sky +  # Configurations for input/output HEALPix sky    [[healpix]]    # HEALPix Nside value, i.e., pixel resolution    nside = integer(min=1, default=1024) diff --git a/fg21sim/utils/random.py b/fg21sim/utils/random.py index 6d835f8..d546f34 100644 --- a/fg21sim/utils/random.py +++ b/fg21sim/utils/random.py @@ -1,15 +1,16 @@ -# Copyright (c) 2016 Weitian LI <liweitianux@live.com> +# Copyright (c) 2016-2017 Weitian LI <weitian@aaronly.me>  # MIT license  """ -Custom utilities of random number generations. +Random number and/or points generations.  """  import numpy as np  def spherical_uniform(n=1): -    """Uniformly pick random points on the surface of a unit sphere. +    """ +    Uniformly pick random points on the surface of an unit sphere.      The algorithm is described in [SpherePointPicking]_.      Parameters @@ -20,11 +21,13 @@ def spherical_uniform(n=1):      Returns      -------      theta : float, or 1D `~numpy.ndarray` -        The polar angles, θ ∈ [0, π]. (unit: rad) +        The polar angles, θ ∈ [0, π].          If ``n > 1``, then returns a 1D array containing all the generated -        coordinates. (unit: rad) +        coordinates. +        Unit: [rad]      phi : float, or 1D `~numpy.ndarray`          The azimuthal angles, φ ∈ [0, 2π). +        Unit: [rad]      NOTE      ---- @@ -35,9 +38,9 @@ def spherical_uniform(n=1):      used by mathematicians.      The following relation can be used to convert the generated (theta, phi) -    to the Galactic longitude and latitude convention: -        glon = np.rad2deg(phi) -        glat = 90.0 - np.rad2deg(theta) +    to the Galactic/equatorial longitude and latitude convention: +        lon = np.rad2deg(phi) +        lat = 90.0 - np.rad2deg(theta)      References      ---------- | 
