aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/configs
Commit message (Collapse)AuthorAgeFilesLines
* configs/manager.py: Support flattening dumped configs (nested dict)Aaron LI2016-11-061-6/+98
| | | | | | | | * Add helper function "_flatten_dict()" to flatten a nested dictionary into an one-level dictionary, with the keys are concatenated with a separator. * Add a new parameter "flatten" to method "dump()" to allow the dumped configurations been flattened.
* webui: websocket.py: Implement "set" action for "_handle_configs()"Aaron LI2016-11-041-5/+5
| | | | | | | Finish the "_set_configs()" function to implement the "set" action for "_handle_configs()". Also change the "status" keyword to "success" to be more intuitive.
* configs/manager.py: Add method "check_all()" using "check_configs()"Aaron LI2016-11-041-0/+31
|
* Update to use renamed "check_configs()" instead of "validate_configs()"Aaron LI2016-11-041-1/+1
|
* configs: Rename "validate.py" and update "validate_configs()"Aaron LI2016-11-041-24/+36
| | | | | | | | * Rename "validate.py" to "checkers.py", to avoid the confusion with the "validate" module from "configobj"; * Rename function "validate_configs()" to "check_configs()"; * "check_configs()": add optional parameter "raise_exception"; * "check_configs()": update to return both the result and errors dict.
* configs/manager.py: Implement "setn()" to set an option valueAaron LI2016-11-041-6/+86
| | | | | | | | | | | The "setn()" method is a corresponding operation with the "getn()", which set the value of a config option to the given value. This function will be used in the Web UI to interact with the WebSocket communications. Also add the "merge()" method which simply merge the input configurations without any validation.
* configs/manager.py: getn(): remove par. "sep"; handle exceptionAaron LI2016-11-031-12/+16
| | | | | | | | * Remove the optional parameter "sep", therefore the key must be "/"-separated or a list of keys. * Add exception handling and raise "KeyError" if the input key is invalid (i.e., specifies a non-exist option). * Update comments and docstring.
* configs/manager.py: Reset before loading user config file againAaron LI2016-11-031-12/+10
| | | | | | | | Originally, the user configuration file is only allowed to load once, and prevent any future loading of user configuration file. This change allows load user configuration file again by resetting the current configurations to defaults before loading.
* configs/manager.py: Add method "reset()" and attribute "userconfig"Aaron LI2016-11-031-1/+16
|
* configs/manager.py: Keep a copy of default configs; Add "dump()"Aaron LI2016-11-021-5/+42
| | | | | | | | * Keep a copy of the default configurations from the specifications * Add "dump()" method to dump the configurations (as well as the default configurations) as plain Python dictionary * Add new parameter "from_default" to methods "get()" and "getn()" to allow get the config value from the default configurations
* extragalactic/pointsource (#3)Jason Ma2016-10-271-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge PR#3: Add new simulation component "extragalactic/pointsources", including SF, SB, RQ, FRI and FRII. * extragalactic/pointsource: add point source simulation module * extracgalactic/pointsource: add point source simulation module * Add configurating spec to extragalgactic point sources. * Modified some variables * base.py: modified * flux.py: modified * fr1.py: modified * fr2.py: modified * pointsources.py: modified * psparams.py: modified * radioquiet.py: modified * starforming.py: modified * starbursting.py: modified * Rewritten the comments. * base.py: modified * flux.py: modified * fr1.py: modified * fr2.py: modified * Modified * psparams.py: modified * radioquiet.py: modified * starforming.py: modified * starbursting.py: modified * Modified * Modified * Modified * Modified * Modified * MOdified * Modified * Modified * Modified * Modified * Modified * Modified * Modified * Modified * Modified * Changed pointsource to pointsources * Fixed some config keywords * Fixed some config keywords * Fixed some config keywords * Fixed some config keywords * Fixed some config keywords * Fixed some config keywords * Fixed some config keywords * base.py:rewrited * fr1.py:rewritten * pointsources.py: rewritten * radioquiet.py: rewritten * Rewritten * Rewritten * base.py: modified * fr1.py: modified * fr2.py: modified * radioquiet.py: modified * starbursting.py: modified * starforming.py: modified * Fix conflicts * fg21sim: fixed conflicts * base.py: modified frequencies loading in _get_configs() * Rewritten as forground.py * fg21sim: fixed conflicts * base.py: deteled loading for frequencies configurations. * fr1.py: modified * fr2.py: modified * pointsources.py: modified * radioquiet.py: modified * starbursting.py: modified * starforming.py: modified * Add new methods to calculate Tb. * Add new methods to calculate Tb. * Add new methods to calculate Tb. * Add new methods to calculate Tb. * Add new methods to calculate Tb. * Add new methods to calculate Tb. * Deleted useless comments. * Add pscomps to deal with multi-type PS problem. * Add a new key. * Fixed permission to 755. * Rejusted PS subsections. * Add methods to calcualte luminosity function and redshift distribution. * Rejusted generation of samples redshift and luminosity. * Fixed mistakes on FRII structure, added hotspots and offsets. * Reajusted generation of samples redshift and luminosity. * Readujsted generation of samples radii, redshifts and luminosity. * Readujsted generation of samples radii, redshifts and luminosity. * Fixed conflicts. * Fixed conficts. * Combined configurations of pointsources. * Removed the older extragalactic configuration file. * Fixed some mistakes. * Fixed mistakes of drawing PS. * Fixed mistakes of drawing PS. * Fixed code style by pep8 checking. * Fixed code style by pep8 checking. * Fixed code style by pep8 checking. * Fixed some coding style. * Reconfigured default redshift interval. * Reconfigured default redshift interval. * Reconfigured default redshift interval. * Fixed mistakes in method calc_single_Tb and changed resolution of grid. * Fixed mistakes in method calc_single_Tb and changed resolution of grid. * Deleted astropy.units style code to accelerate. * Deleted astropy.units style code to accelerate. * Deleted astropy.units style code to accelerate. * Deleted astropy.units style code to accelerate. * Deleted astropy.units style code to accelerate. * Deleted astropy.units style code to accelerate. * Deleted astropy.units style code to accelerate. * Fixed some mistakes. * Fixed some mistakes. * Changed dA from au.Mpc to float64. * Fixed some mistakes. * Fixed some mistakes. * Fixed some mistakes. * Reajusted grid resolution to generate discs. * Reajusted grid resolution to generate discs. * Reajusted loading strategy of parameter resolution. * Reajusted code style of configuration loading. * Reajusted code style of configuration loading. * Reajusted code style of configuration loading. * Reajusted code style of configuration loading. * Reajusted code style of configuration loading.
* configs/00-general.conf.spec: Add new option "checksum"Aaron LI2016-10-271-0/+6
|
* Support new simulation component: extragalactic/clustersAaron LI2016-10-221-0/+41
| | | | | | | | | | | Support simulate the radio emission from clusters of galaxies. Currently only the radio halos is considered, while the radio relics need more investigations. Also, this simulation requires a cluster catalog derived from the Hubble Volume Project simulation. NOTE: not tested at the moment
* configs/10-galactic.conf.spec: Fix/update the descriptionAaron LI2016-10-221-4/+12
|
* configs/manager.py: Update docstring and commentAaron LI2016-10-191-3/+9
|
* configs: Remove the unused config "ordering"Aaron LI2016-10-181-3/+1
| | | | All HEALPix maps used are in *RING* ordering.
* configs/manager.py: Fix the bug that breaks specifications loadingAaron LI2016-10-171-1/+4
| | | | | | | The "filter()" returns an iterator, that is consumed after the use, therefore, the "specfiles" is used by the print under "DEBUG_FG21SIM". Then "specfiles" is empty and thus prevents the reading of the specification files.
* configs/validate.py: Add "check_galactic_snr()" for "galactic/snr"Aaron LI2016-10-171-0/+16
|
* bin/fg21sim: Support new component "galactic/snr"Aaron LI2016-10-171-1/+5
| | | | Also update the general config for the new "galactic/snr" component.
* configs: Add new section "[galactic][snr]" for SNRs simulationAaron LI2016-10-171-1/+19
| | | | NOTE: very preliminary and may change at any time!
* Force "DEBUG" log level if env variable "DEBUG_FG21SIM" setAaron LI2016-10-171-2/+6
|
* configs/manager.py: Change __init__() to load user configAaron LI2016-10-171-9/+15
| | | | | | | | Change the "__init__()" method to load the user configurations (i.e., by invoke the "read_userconfig()" method) instead of loading extra general configurations. Method "getn()": also check the validity for the parameter "sep".
* configs/manager.py: Various updates to docstring and comments.Aaron LI2016-10-171-23/+44
| | | | No functional changes.
* configs: Update get_path() to take care None and non-string valueAaron LI2016-10-151-3/+24
| | | | | | * Return None if specified config is None or not exist * Raise ValueError if specified config is non-string * Update comments
* configs: Switch to use `pkg_resources` to access config specsAaron LI2016-10-151-10/+19
| | | | | | | | | After this switch to `pkg_resources`, this package can also be installed as an EGG (a zip archive), which is more generic. References: * http://setuptools.readthedocs.io/en/latest/pkg_resources.html#basic-resource-access * http://setuptools.readthedocs.io/en/latest/setuptools.html#including-data-files
* Fix an import; Update one pattern and a commentAaron LI2016-10-141-2/+2
|
* configs: Support env variable "DEBUG_FG21SIM" for debuggingAaron LI2016-10-141-0/+3
| | | | | | Since the logging is not avaiable at the moment, we can only use the plain `print` for debugging, if the environment variable "DEBUG_FG21SIM" is defined.
* configs/validate.py: Check component configs only if enabledAaron LI2016-10-121-22/+26
|
* configs/validate.py: Add checker for [galactic][freefree] configsAaron LI2016-10-121-0/+18
|
* galactic: Add free-free component simulationAaron LI2016-10-111-0/+19
| | | | | | | * New class "galactic.FreeFree" to simulate free-free emission * Add new config section "galactic/freefree" NOTE: current untested
* configs: Note that input templates should be HEALPix full-sky mapsAaron LI2016-10-101-0/+4
|
* configs: Change default Nside to 1024Aaron LI2016-10-101-2/+2
|
* Rewrite configs/validate.py to check whole config without breakAaron LI2016-10-041-23/+52
|
* Remove the "common/data_dir" config itemAaron LI2016-10-042-5/+0
|
* Fix wrong config syntax and minor changes to ConfigManagerAaron LI2016-10-042-12/+18
|
* configs/manager.py: Add logging supportAaron LI2016-10-041-2/+6
|
* configs/manager.py: Add method "get_path()"Aaron LI2016-10-041-0/+21
|
* configs/manager.py: Add method "read_userconfig()"Aaron LI2016-10-041-3/+35
| | | | | | | | This "read_userconfig()" method is specifically used to load the user configuration file, and record the absolute path of the configuration file, which allows the use of relative path to specify the input files (e.g., galactic/synchrotron/template) for simulation within the configurations.
* configs/validate.py: Explain these checkers differ to Validator'sAaron LI2016-10-041-1/+7
| | | | | | NOTE: these checker functions check on the whole configuration, and have no relation to the checker functions of the `Validator` class.
* configs/manager.py: Fix a bug that "_validate()" not workingAaron LI2016-10-041-1/+1
|
* configs/manager.py: Add "frequencies" propertyAaron LI2016-10-041-0/+16
| | | | | The "frequencies" property will return or calculate the frequency values of the simulation.
* Update the default config specifications.Aaron LI2016-10-032-6/+14
| | | | | | * Add new configs for the [frequency] section * Use "None" as the default value for some configs * Fix the syntax of "cosmology/OmegaM0"
* Add custom configuration checkers.Aaron LI2016-10-032-0/+95
| | | | | These additional checker functions validate the required configs whether provided by the user config file, as well as against necessary contexts.
* Arrange customs errors/exceptions in a moduleAaron LI2016-10-031-4/+1
|
* Update general configurations and synchrotron configsAaron LI2016-10-032-1/+12
|
* configs: Add sample config spec for galactic componentsAaron LI2016-10-021-0/+30
|
* configs: Add new sections to "00-general.conf.spec"Aaron LI2016-10-021-0/+66
| | | | | | | | These new sections added: * common * frequency * output * cosmology
* configs/manager.py: Add "getn()" method to get multi-level config valueAaron LI2016-10-021-0/+25
|
* configs/manager.py: Refactor "get()" method and remove "set()"Aaron LI2016-10-021-8/+1
|
* configs: Update comments for the logging configsAaron LI2016-10-021-2/+6
|