aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-12-13 10:03:50 +0800
committerAaron LI <aaronly.me@outlook.com>2016-12-13 10:04:33 +0800
commit4db3a8d951176f1631c7c4a90c386b235539302a (patch)
tree1ae5be84b5bf9112b76573c4ef60a1297d743e18
parent2e01bf4145087159fbecc741a9e8a96dc0a2b9c3 (diff)
downloadfg21sim-4db3a8d951176f1631c7c4a90c386b235539302a.tar.bz2
Import modules (with Numba JIT) just before usage
Thus, the usage information can be printed out quickly :)
-rwxr-xr-xbin/healpix2hpx6
-rwxr-xr-xbin/hpx2healpix5
-rwxr-xr-xbin/zea2healpix5
3 files changed, 9 insertions, 7 deletions
diff --git a/bin/healpix2hpx b/bin/healpix2hpx
index fda9627..ed4b66e 100755
--- a/bin/healpix2hpx
+++ b/bin/healpix2hpx
@@ -13,12 +13,9 @@ import sys
import argparse
import logging
-from astropy.io import fits
-
import fg21sim
from fg21sim.configs import configs
from fg21sim.utils import setup_logging
-from fg21sim.utils.healpix import healpix2hpx
def main():
@@ -70,6 +67,9 @@ def main():
else:
raise OSError("Output file already exists: %s" % args.outfile)
+ logger.info("Importing modules + Numba JIT, waiting ...")
+ from astropy.io import fits
+ from fg21sim.utils.healpix import healpix2hpx
hpx_data, hpx_header = healpix2hpx(args.infile,
append_history=history,
append_comment=comments)
diff --git a/bin/hpx2healpix b/bin/hpx2healpix
index 5d48987..e5460c8 100755
--- a/bin/hpx2healpix
+++ b/bin/hpx2healpix
@@ -16,8 +16,6 @@ import logging
import fg21sim
from fg21sim.configs import configs
from fg21sim.utils import setup_logging
-from fg21sim.utils.healpix import hpx2healpix
-from fg21sim.utils.fits import write_fits_healpix
def main():
@@ -69,6 +67,9 @@ def main():
else:
raise OSError("Output file already exists: %s" % args.outfile)
+ logger.info("Importing modules + Numba JIT, waiting ...")
+ from fg21sim.utils.healpix import hpx2healpix
+ from fg21sim.utils.fits import write_fits_healpix
hp_data, hp_header = hpx2healpix(args.infile,
append_history=history,
append_comment=comments)
diff --git a/bin/zea2healpix b/bin/zea2healpix
index dde7dbd..4eb25a9 100755
--- a/bin/zea2healpix
+++ b/bin/zea2healpix
@@ -23,8 +23,6 @@ import logging
import fg21sim
from fg21sim.configs import configs
from fg21sim.utils import setup_logging
-from fg21sim.utils.reproject import zea2healpix
-from fg21sim.utils.fits import write_fits_healpix
def main():
@@ -85,6 +83,9 @@ def main():
else:
raise OSError("Output file already exists: %s" % args.outfile)
+ logger.info("Importing modules + Numba JIT, waiting ...")
+ from fg21sim.utils.reproject import zea2healpix
+ from fg21sim.utils.fits import write_fits_healpix
hp_data, hp_header, __ = zea2healpix(args.infile1, args.infile2,
nside=args.nside,
order=args.interp_order,