aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-10-29 23:10:40 +0800
committerAaron LI <aaronly.me@outlook.com>2016-10-29 23:10:40 +0800
commit9d7c7bb53244d2f79173b0f7fe1c6e91a656a240 (patch)
tree182f90a2007e1abdca0c721a9c424d7432ea9607
parentd078c1ae3f7171e9e8252474ce5dbaef37a26281 (diff)
downloadfg21sim-9d7c7bb53244d2f79173b0f7fe1c6e91a656a240.tar.bz2
utils/__init__.py: Only import "setup_logging" from "logging.py"
Since some modules (e.g., healpix.py) under "utils" involves Numba JIT optimization, which significantly slows the start-up speed, even some consumers (e.g., bin/fg21sim-webui) do not need them at all. Fix various import statements of other modules. NOTE: not test at the moment!
-rwxr-xr-xbin/healpix2hpx3
-rwxr-xr-xbin/hpx2healpix4
-rwxr-xr-xbin/zea2healpix4
-rw-r--r--fg21sim/extragalactic/clusters.py2
-rw-r--r--fg21sim/foregrounds.py2
-rw-r--r--fg21sim/galactic/freefree.py2
-rw-r--r--fg21sim/galactic/snr.py2
-rw-r--r--fg21sim/galactic/synchrotron.py2
-rw-r--r--fg21sim/utils/__init__.py3
9 files changed, 13 insertions, 11 deletions
diff --git a/bin/healpix2hpx b/bin/healpix2hpx
index 6f30795..fda9627 100755
--- a/bin/healpix2hpx
+++ b/bin/healpix2hpx
@@ -17,7 +17,8 @@ from astropy.io import fits
import fg21sim
from fg21sim.configs import configs
-from fg21sim.utils import healpix2hpx, setup_logging
+from fg21sim.utils import setup_logging
+from fg21sim.utils.healpix import healpix2hpx
def main():
diff --git a/bin/hpx2healpix b/bin/hpx2healpix
index bbc3e0d..5d48987 100755
--- a/bin/hpx2healpix
+++ b/bin/hpx2healpix
@@ -15,7 +15,9 @@ import logging
import fg21sim
from fg21sim.configs import configs
-from fg21sim.utils import hpx2healpix, write_fits_healpix, setup_logging
+from fg21sim.utils import setup_logging
+from fg21sim.utils.healpix import hpx2healpix
+from fg21sim.utils.fits import write_fits_healpix
def main():
diff --git a/bin/zea2healpix b/bin/zea2healpix
index 334bf6d..dde7dbd 100755
--- a/bin/zea2healpix
+++ b/bin/zea2healpix
@@ -22,7 +22,9 @@ import logging
import fg21sim
from fg21sim.configs import configs
-from fg21sim.utils import zea2healpix, write_fits_healpix, setup_logging
+from fg21sim.utils import setup_logging
+from fg21sim.utils.reproject import zea2healpix
+from fg21sim.utils.fits import write_fits_healpix
def main():
diff --git a/fg21sim/extragalactic/clusters.py b/fg21sim/extragalactic/clusters.py
index 753b025..d23ddbf 100644
--- a/fg21sim/extragalactic/clusters.py
+++ b/fg21sim/extragalactic/clusters.py
@@ -21,7 +21,7 @@ from astropy.cosmology import FlatLambdaCDM
import healpy as hp
import pandas as pd
-from ..utils import write_fits_healpix
+from ..utils.fits import write_fits_healpix
from ..utils.random import spherical_uniform
from ..utils.convert import Fnu_to_Tb_fast
from ..utils.grid import make_grid_ellipse, map_grid_to_healpix
diff --git a/fg21sim/foregrounds.py b/fg21sim/foregrounds.py
index e3e0f62..85bbf16 100644
--- a/fg21sim/foregrounds.py
+++ b/fg21sim/foregrounds.py
@@ -26,7 +26,7 @@ from .galactic import (Synchrotron as GalacticSynchrotron,
SuperNovaRemnants as GalacticSNR)
from .extragalactic import GalaxyClusters as EGGalaxyClusters
from .extragalactic import PointSources as ExtragalacticPointSources
-from .utils import write_fits_healpix
+from .utils.fits import write_fits_healpix
logger = logging.getLogger(__name__)
diff --git a/fg21sim/galactic/freefree.py b/fg21sim/galactic/freefree.py
index bc5741b..f47f008 100644
--- a/fg21sim/galactic/freefree.py
+++ b/fg21sim/galactic/freefree.py
@@ -14,7 +14,7 @@ from astropy.io import fits
import astropy.units as au
import healpy as hp
-from ..utils import read_fits_healpix, write_fits_healpix
+from ..utils.fits import read_fits_healpix, write_fits_healpix
logger = logging.getLogger(__name__)
diff --git a/fg21sim/galactic/snr.py b/fg21sim/galactic/snr.py
index 5fc52e3..b7bfadc 100644
--- a/fg21sim/galactic/snr.py
+++ b/fg21sim/galactic/snr.py
@@ -15,7 +15,7 @@ import astropy.units as au
import healpy as hp
import pandas as pd
-from ..utils import write_fits_healpix
+from ..utils.fits import write_fits_healpix
from ..utils.convert import Fnu_to_Tb
from ..utils.grid import make_grid_ellipse, map_grid_to_healpix
diff --git a/fg21sim/galactic/synchrotron.py b/fg21sim/galactic/synchrotron.py
index b82b636..9521155 100644
--- a/fg21sim/galactic/synchrotron.py
+++ b/fg21sim/galactic/synchrotron.py
@@ -14,7 +14,7 @@ from astropy.io import fits
import astropy.units as au
import healpy as hp
-from ..utils import read_fits_healpix, write_fits_healpix
+from ..utils.fits import read_fits_healpix, write_fits_healpix
logger = logging.getLogger(__name__)
diff --git a/fg21sim/utils/__init__.py b/fg21sim/utils/__init__.py
index 1e4eac6..b3b8723 100644
--- a/fg21sim/utils/__init__.py
+++ b/fg21sim/utils/__init__.py
@@ -1,7 +1,4 @@
# Copyright (c) 2016 Weitian LI <liweitianux@live.com>
# MIT license
-from .fits import read_fits_healpix, write_fits_healpix
-from .healpix import healpix2hpx, hpx2healpix
-from .reproject import zea2healpix
from .logging import setup_logging