diff options
author | Aaron LI <aly@aaronly.me> | 2018-12-20 23:50:04 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-12-20 23:50:04 +0800 |
commit | 97b8badebfe5067fad1c012d4955b20dcc1ed24b (patch) | |
tree | bfc8e2f0ca886979dc78eecab5a716e9283416b3 /fg21sim | |
parent | 76942d3fa965d4b8fd5e9726bd93b54d0c0f5dab (diff) | |
download | fg21sim-97b8badebfe5067fad1c012d4955b20dcc1ed24b.tar.bz2 |
PEP8 fix
Diffstat (limited to 'fg21sim')
-rw-r--r-- | fg21sim/extragalactic/clusters/solver.py | 4 | ||||
-rw-r--r-- | fg21sim/extragalactic/pointsources/psparams.py | 4 | ||||
-rw-r--r-- | fg21sim/sky.py | 18 | ||||
-rw-r--r-- | fg21sim/uvsim/telescope.py | 2 |
4 files changed, 15 insertions, 13 deletions
diff --git a/fg21sim/extragalactic/clusters/solver.py b/fg21sim/extragalactic/clusters/solver.py index ad5c320..10fd8e4 100644 --- a/fg21sim/extragalactic/clusters/solver.py +++ b/fg21sim/extragalactic/clusters/solver.py @@ -77,9 +77,9 @@ class FokkerPlanckSolver: """ Solve the Fokker-Planck equation: - ∂u(x,t) ∂ / ∂u(x) \ u(x,t) + ∂u(x,t) ∂ [ ∂u(x) ] u(x,t) ------- = -- | B(x)u(x) + C(x)----- | + Q(x,t) - ------ - ∂t ∂x \ ∂x / T(x,t) + ∂t ∂x [ ∂x ] T(x,t) u(x,t) : distribution/spectrum w.r.t. x at different times B(x,t) : advection coefficient diff --git a/fg21sim/extragalactic/pointsources/psparams.py b/fg21sim/extragalactic/pointsources/psparams.py index 7c3a93a..823af72 100644 --- a/fg21sim/extragalactic/pointsources/psparams.py +++ b/fg21sim/extragalactic/pointsources/psparams.py @@ -19,6 +19,7 @@ from astropy.cosmology import FlatLambdaCDM class PixelParams(): """ A class to transform cosmology distance to angles or pixels. + Parameters ------------ H0: float @@ -28,11 +29,12 @@ class PixelParams(): ang_res: float Angular resolution, i.e. degree per pixel. (May be useless) ang_total: list - Total angles of the simulated sky region,whose unit is degree (\deg) + Total angles of the simulated sky region, whose unit is degree z : float Redshift scale: float The real object scale. + Example ------------ >>> PixelParams = PixelParams(img_size=(1024,1024),ang_total=(5,5)) diff --git a/fg21sim/sky.py b/fg21sim/sky.py index 724e3fa..2b94c7c 100644 --- a/fg21sim/sky.py +++ b/fg21sim/sky.py @@ -88,7 +88,7 @@ class SkyBase: elif isinstance(other, (int, float, np.ndarray)): return self.data + other else: - raise NotImplemented + raise NotImplementedError def __sub__(self, other): """Binary arithmetic operation: ``-``.""" @@ -97,7 +97,7 @@ class SkyBase: elif isinstance(other, (int, float, np.ndarray)): return self.data - other else: - raise NotImplemented + raise NotImplementedError def __mul__(self, other): """Binary arithmetic operation: ``*``.""" @@ -106,7 +106,7 @@ class SkyBase: elif isinstance(other, (int, float, np.ndarray)): return self.data * other else: - raise NotImplemented + raise NotImplementedError def __truediv__(self, other): """Binary arithmetic operation: ``/``.""" @@ -115,7 +115,7 @@ class SkyBase: elif isinstance(other, (int, float, np.ndarray)): return self.data / other else: - raise NotImplemented + raise NotImplementedError def __pow__(self, other): """Binary arithmetic operation: ``**``.""" @@ -124,7 +124,7 @@ class SkyBase: elif isinstance(other, (int, float, np.ndarray)): return self.data ** other else: - raise NotImplemented + raise NotImplementedError def __iadd__(self, other): """ @@ -143,7 +143,7 @@ class SkyBase: self.data += other return self else: - raise NotImplemented + raise NotImplementedError def __isub__(self, other): """Augmented arithmetic assignment: ``-=``.""" @@ -154,7 +154,7 @@ class SkyBase: self.data -= other return self else: - raise NotImplemented + raise NotImplementedError def __imul__(self, other): """Augmented arithmetic assignment: ``*=``.""" @@ -165,7 +165,7 @@ class SkyBase: self.data *= other return self else: - raise NotImplemented + raise NotImplementedError def __itruediv__(self, other): """Augmented arithmetic assignment: ``/=``.""" @@ -176,7 +176,7 @@ class SkyBase: self.data /= other return self else: - raise NotImplemented + raise NotImplementedError def __neg__(self): """Unary arithmetic operation: ``-``.""" diff --git a/fg21sim/uvsim/telescope.py b/fg21sim/uvsim/telescope.py index 9e224a9..0620005 100644 --- a/fg21sim/uvsim/telescope.py +++ b/fg21sim/uvsim/telescope.py @@ -68,7 +68,7 @@ class SKA1Low: self.ant_min_sep = ant_min_sep # [m] self.r_core = r_core # [m] self.r_central = r_central # [m] - self.data = pd.read_csv(infile, sep="\s+", comment="#", + self.data = pd.read_csv(infile, sep=r"\s+", comment="#", index_col="Label") logger.info("Read telescope layout data from: %s" % infile) self.position_wgs84 = np.array(self.data.loc["CENTER", :]) |