aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/utils
Commit message (Collapse)AuthorAgeFilesLines
* Fix the warning on scipy.ndimage.zoom output shape calculationAaron LI2017-08-141-1/+4
| | | | | | | | | scipy.ndimage.zoom calculate the output/zoomed image shape with round(), while the old versions use int() instead. When the two calculations are different, a warning is raised. This commit fixes the calculation mismatch. Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/convert.py: Add function "JyPerPix_to_K()"Aaron LI2017-08-131-0/+17
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/io.py: Default float32=False to preserve the data typeAaron LI2017-08-131-4/+4
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/io.py: Add "float32" param and update "write_fits_healpix()"Aaron LI2017-08-131-15/+30
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/io.py: Fix a dtype bug; Improve comments and FITS headerAaron LI2017-08-131-3/+26
| | | | | | Fix the dtype bug in "write_fits_image()" function. Signed-off-by: Aaron LI <aly@aaronly.me>
* utils: Merge fits.py into io.pyAaron LI2017-08-133-155/+143
| | | | | | Functions "{read,write}_fits_healpix()" merged into io.py Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/io.py: Implement new function "write_fits_image()"Aaron LI2017-08-131-0/+37
|
* utils/io.py: Improve documentationsAaron LI2017-08-131-1/+19
|
* utils/transform.py: Update comment and minor cleanupsAaron LI2017-08-121-5/+3
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* Fix a bug in clusters/halo.py; Add a comment to utils/io/_create_dir()Aaron LI2017-08-061-0/+4
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/convert.py: omega unit default to [arcsec^2], other improvementsAaron LI2017-08-031-10/+11
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/convert.py: Improve various comments/descriptionsAaron LI2017-08-031-23/+33
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* utils/convert.py: Improve unit check and conversionAaron LI2017-08-031-2/+2
| | | | Signed-off-by: Aaron LI <aly@aaronly.me>
* 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