aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/utils
Commit message (Collapse)AuthorAgeFilesLines
* utils: Add ds.py with function "dictlist_to_dataframe()"Aaron LI2017-08-031-0/+82
| | | | | | | This function convert a list of dictionaries created by e.g., GalaxyClusters._simulate_halos() to be a Pandas DataFrame. Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/io.py: Fix issue in "_create_dir()" with empty directory pathAaron LI2017-08-011-1/+3
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* Improve logging messagesAaron LI2017-08-011-1/+5
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* utils: Add profile.py to diagnose memory usageAaron LI2017-08-011-0/+97
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/io.py: Add functions "pickle_dump()" and "pickle_load()"Aaron LI2017-08-011-0/+31
|
* utils/io.py: Split out "_create_dir()" and "_check_existence()"Aaron LI2017-08-011-12/+31
|
* utils/cosmology.py: Add "dVc()": differential comoving volumeAaron LI2017-07-311-0/+8
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* utils: Add interpolate.py with "bilinear()" functionAaron LI2017-07-311-0/+42
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* cosmology: Avoid the circular importing issueAaron LI2017-07-312-7/+1
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* Add `fg21sim.share` module to hold globally shared "CONFIGS" & "COSMO"Aaron LI2017-07-312-3/+1
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* clusters/halo.py: Add property "angular_radius" (unit: [arcsec])Aaron LI2017-07-301-0/+2
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* 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".