aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/utils
Commit message (Collapse)AuthorAgeFilesLines
...
* utils/units.py: Add several units conversionsAaron LI2017-07-291-0/+4
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/cosmology.py: age() and redshift() accepts numpy arraysAaron LI2017-07-271-7/+10
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/cosmology.py: Update references and commentsAaron LI2017-07-271-36/+66
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* Use all uppercase to identify the global CONFIGS and COSMOAaron LI2017-07-222-6/+6
| | | | | | Update to use the global CONFIGS and COSMO Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/units.py: Add "mec2" energy of a still electronAaron LI2017-07-221-1/+5
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/cosmology.py: Add property "baryon_fraction"Aaron LI2017-07-211-0/+9
| | | | | | XXX: assumed to be independent of redshifts! Signed-off-by: Aaron LI <aly@aaronly.me>
* Fix parameter names about cosmologyAaron LI2017-07-211-2/+2
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* bin/fg21sim: Setup cosmology model at the beginningAaron LI2017-07-211-1/+1
| | | | | | | | * Update copyright * Add a help on "DEBUG_FG21SIM" * Also fix a bug in cosmology setup() Signed-off-by: Aaron LI <aly@aaronly.me>
* utils: Import Cosmology and make "cosmo" a global instanceAaron LI2017-07-211-1/+4
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* cosmology.py: Add "setup()" method to allow update parametersAaron LI2017-07-211-11/+38
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* dataframe_to_csv(): Add parameter "comment"Aaron LI2017-07-191-4/+17
| | | | | | Also write the writer and datetime to header by default. Signed-off-by: Aaron LI <aly@aaronly.me>
* Small updates to comments and configuration descriptionsAaron LI2017-07-191-8/+11
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* Add utils/io.py with function "dataframe_to_csv()"Aaron LI2017-07-191-0/+47
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* Use [arcsec] as the unit for pixel size and resolutionAaron LI2017-07-192-3/+18
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/transform.py: Add function "circle2ellipse()"Aaron LI2017-07-181-0/+40
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* Rename utils/rotate.py to utils/transform.pyAaron LI2017-07-182-4/+5
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/draw.py: Add function circle()Aaron LI2017-07-181-1/+62
| | | | | | Draw a circle at the center of the output grid with radial profile Signed-off-by: Aaron LI <aly@aaronly.me>
* Revert "utils/convert.py: Use 'utils.units' module"Aaron LI2017-06-241-7/+6
| | | | | | This reverts commit eb660ae70db40d36418f1e4eb886fd9bb02af1a7. Numba cannot recognize AUC/AC classes, or needs further updates
* cosmology: Use default parameters from configurationsAaron LI2017-06-231-1/+5
| | | | Also add configuration option "cosmology/Omegab0".
* utils/convert.py: Use 'utils.units' moduleAaron LI2017-06-231-6/+7
|
* utils/units.py: Add "rad2deg" and "k_B"Aaron LI2017-06-231-1/+5
|
* utils/cosmology: Add methods DL() and DA()Aaron LI2017-06-191-0/+14
|
* clusters: Move units.py and cosmology.py to utilsAaron LI2017-06-012-0/+287
|
* Add utils/wcs.py with function "make_wcs()"Aaron LI2017-05-221-0/+54
|
* utils/grid: Add function "make_ellipse()"Aaron LI2017-05-221-7/+47
|
* utils/draw.py: Merge "_ellipse_in_shape()" to "ellipse()"Aaron LI2016-12-132-85/+25
| | | | | * Fix the bug that "ellipse()" generate unexpected results. * Update the parameters of "ellipse()" also
* utils/draw.py: Fix a wrong brace in "_ellipse_in_shape()"Aaron LI2016-12-131-1/+1
| | | | | This bug causes wrong ellipse generation, which is the main reason to the strange and wrong SNRs shapes.
* utils: Add download.py with function "download_file()"Aaron LI2016-11-261-0/+112
|
* utils: Rename function "md5()" to "calc_md5()"Aaron LI2016-11-261-1/+1
|
* utils: Add "hashutil.py" with function "md5()"Aaron LI2016-11-211-0/+40
| | | | | | md5(): Calculate the MD5 checksum of the file. Credit: https://stackoverflow.com/a/3431838/4856091
* utils/draw.py: Remove the "Modified BSD" license; Update creditAaron LI2016-11-181-40/+4
|
* utils/healpix.py: Fix the import issueAaron LI2016-11-091-1/+1
|
* utils/__init__.py: Only import "setup_logging" from "logging.py"Aaron LI2016-10-291-3/+0
| | | | | | | | | | 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!
* utils/random.py: Add a note on conversion to (longitude, latitude)Aaron LI2016-10-281-0/+5
|
* utils/rotate.py: Add a new ref. which may help further vectorizationAaron LI2016-10-281-0/+2
| | | | Investigate whether the vectorization will improve the speed.
* utils/fits.py: Add parameter "checksum" for write_fits_healpix()Aaron LI2016-10-271-8/+13
| | | | Also update the docstring and one comment.
* utils/rotate.py: Fix two bugs which cause wrong resultsAaron LI2016-10-261-4/+13
| | | | | | | * Fix the wrong output shape: wrongly swap the row and column * Fix the area mapping method, which may give zero values when the index of the input is integer, which cause problem to calculate the overlapping areas.
* utils/grid.py: JIT optimize "make_grid_ellipse()"Aaron LI2016-10-261-10/+15
| | | | NOTE that the original optional paramter "rotation" is now required.
* utils/grid.py: Use own-implemented JIT-optimized "rotate_center()"Aaron LI2016-10-261-3/+3
| | | | Also remove the dependence on "scipy".
* Add utils/rotate.py: Implement basic image rotationAaron LI2016-10-261-0/+131
| | | | | | | | | The "rotate_center()" function rotates a gray-scale image by a given angle about its center, using the area mapping method or simple nearest neighbor. This function is `numba` JIT-optimized, and can replace the `scipy.ndimage.rotate()` function.
* draw.py: Remove the unused "circle()" functionAaron LI2016-10-251-42/+0
|
* draw.py: Optimize "ellipse()" using numba JITAaron LI2016-10-251-17/+27
| | | | | | | | | | NOTE: However, there are two significant problems: * Cannot figure out why ``nb.optional(nb.types.UniTuple(nb.int64, 2))`` does NOT work. Therefore, make ``shape`` as mandatory parameter instead of optional. * Cannot figure out multi-dispatch that allows both int and float types for ``r``, ``c``, ``r_radius`` and ``c_radius``. Thus only support the int type for the moment.
* draw.py: Optimize "_ellipse_in_shape()" using JITAaron LI2016-10-251-3/+20
|
* grid.py: Override "make_coordinate_grid()" using JIT-optimized versionAaron LI2016-10-251-46/+2
| | | | | Remove the original "make_coordinate_grid()" function, and rename the "make_coordinate_grid_fast()" to override the former one.
* grid.py: Change "make_coordinate_grid_fast()" parametersAaron LI2016-10-251-11/+16
| | | | | Change the parameters of "make_coordinate_grid_fast()", make it share the same parameter list as "make_coordinate_grid()".
* grid.py: Optimize "map_grid_to_healpix()" using "numba.jit"Aaron LI2016-10-251-11/+19
| | | | | There are some limitations with the numba JIT, which are commented in the code.
* healpix.py: Change all "indices" to "indexes"Aaron LI2016-10-252-19/+19
| | | | Also fix a wrong notation in "random.py"
* healpix.py: Implement "ang2pix_ring" and "pix2ang_ring" with JITAaron LI2016-10-251-0/+213
| | | | | | | | | | To optimize "map_grid_to_healpix()" in `grid.py` which uses "healpy.ang2pix()" using `numba.jit`, implement the latter's functionality explicitly with `numba.jit` support. The implementation simply mimic the corresponding functions "ang2pix_ring_z_phi()" and "pix2ang_ring_z_phi()" in HEALPix's "src/C/subs/chealpix.c". Thanks!
* healpix.py: Optimize "_calc_hpx_indicies()" and "_calc_hpx_row_idx()"_Aaron LI2016-10-251-60/+68
| | | | | Also place "_calc_hpx_row_idx()" before "_calc_hpx_indicies()", which is required by `numba`.
* utils/grid.py: Add optimized "make_coordinate_grid_fast()"Aaron LI2016-10-251-4/+56
| | | | | | | | Optimize "make_coordinate_grid()" using "numba.jit", which improves the speed a bit, since the other two functions (i.e., "make_grid_ellipse()", and "map_grid_to_healpix()") are much slow and time-consuming. TODO: optimize "make_grid_ellipse()" and "map_grid_to_healpix()"