aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
Commit message (Collapse)AuthorAgeFilesLines
* configs/manager.py: Replace a filter with list comprehensionAaron LI2016-11-071-4/+1
| | | | | Replace the filter hack with a cleaner list comprehension. Be Pythonic :)
* webui: websocket.py: Use flattened configs; Change "data" to "keys"Aaron LI2016-11-061-3/+3
| | | | | | | * Get the server-side configurations as a flattened one-level dictionary, for easier manipulations. * When get the configurations, specify the requested config options as an Array under the "keys" property (original: "data" property).
* 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: Add "configs.js" with basic support with interact with serverAaron LI2016-11-051-0/+127
| | | | | | | NOTE: Still missing important client-side functions to be usable, e.g., set the configuration form according to the received data from the server, and mark the error states on the fields with invalid values.
* webui: websocket.py: Support "reset", "load", "save" actions.Aaron LI2016-11-051-18/+105
| | | | | | | | | | | * Improve the response data to be more consistent. If the request failed, the returned response has "success" item of value "False" and an "error" item recording the message; * Add method "_reset_configs()" to handle the "reset" action; * Add method "_load_configs()" to handle the "load" action; * Add method "_save_configs()" to handle the "save" action. NOTE: needs tests.
* webui: websocket.py: Make the response message more consistentAaron LI2016-11-041-11/+24
| | | | | | | | All response message has a "success" item indicating whether the request be successfully handled. If anything unexpected happens, "success" is False, and an additional "error" item presents recording the detail. Also add some more stubs which are necessary for the Web UI.
* webui: websocket.py: Implement "set" action for "_handle_configs()"Aaron LI2016-11-042-16/+39
| | | | | | | Finish the "_set_configs()" function to implement the "set" action for "_handle_configs()". Also change the "status" keyword to "success" to be more intuitive.
* webui: websocket.py: Implement the "get" part of "_handle_configs()"Aaron LI2016-11-041-5/+118
| | | | | | | Add internal method "_get_configs()" which implement the "get" action part of the "_handle_configs()" method. TODO: implement the "set" action part.
* webui: websocket.py: Fix wrong exception handlingAaron LI2016-11-041-19/+17
|
* webui: Update server & client sides WebSocket handlersAaron LI2016-11-042-24/+104
| | | | | | | | | | | | * Server side: + Update the "on_message()" method to support 3 types of message requests (i.e., "configs", "console", and "results"); + Add messages stub handlers: "_handle_{configs,console,results}()"; + Reorder the methods + Client side: + Change timeout before reconnection to 3000 ms; + Parse the received JSON message to JS object;
* 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.
* webui: Add a manual reconnection button to the header bannerAaron LI2016-11-033-6/+60
| | | | | Also add a global variable "ws_reconnect" to control the timeout between reconnection and the maximum reconnection times (default: 100).
* webui: Add "utils.py" to get the IP addressAaron LI2016-11-032-11/+85
| | | | | | | FIXME/TODO: How to determine the WebSocket origin is in the same subnet as the server? An additional network mask required to determine this. How does this additional mask passed?
* configs/manager.py: Add method "reset()" and attribute "userconfig"Aaron LI2016-11-031-1/+16
|
* webui: Rewrite "websocket.py" with "FG21simWSHandler"Aaron LI2016-11-022-12/+88
| | | | | | NOTE: This "FG21simWSHandler" is still very preliminary, and there are a lot of necessary functions need to be implemented.
* 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
* webui: Rewrite and reconnect to WebSocket when closedAaron LI2016-11-021-32/+97
|
* webui: Add preliminary WebSocket support to front-end UIAaron LI2016-11-024-0/+65
| | | | | Add a label to the header banner to show the WebSocket support status and connection status.
* webui: Add FA icons for sections/headers; Adjust header stylesAaron LI2016-11-025-24/+22
|
* webui: fonts.css: Avoid space in font-family name; Some cleanupAaron LI2016-11-011-10/+11
|
* webui: font-awesome: Only keep the WOFF formatAaron LI2016-11-012-2/+1
|
* webui: milligram.css: Fix font-weight to use "bold" and "normal"Aaron LI2016-11-011-5/+5
|
* webui: fonts.css: Use semibold instead of bold for Source Sans ProAaron LI2016-11-011-8/+8
|
* webui: Update header and configs templatesAaron LI2016-11-012-6/+6
|
* webui: Update index template; Add console and results templatesAaron LI2016-11-013-10/+43
|
* webui: Add new style rules (Thanks Bootstrap!)Aaron LI2016-11-011-5/+125
|
* webui: Add the main CSS and JavaScriptAaron LI2016-11-012-0/+287
| | | | The js code still misses many necessary functions.
* webui: Add the index and configs templatesAaron LI2016-11-012-0/+489
|
* webui: Add header and footer templatesAaron LI2016-11-012-0/+42
|
* webui: Add favicon and logo (nyan ~~~)Aaron LI2016-11-013-0/+151
|
* webui: Add fonts.css (Source Sans Pro & Source Code Pro)Aaron LI2016-11-011-0/+63
|
* Serve jQuery locally (use jqyeru-3.1.1.js)Aaron LI2016-11-012-1/+10222
|
* webui: Rearrange structures of the base templateAaron LI2016-10-311-4/+14
|
* webui: Add the base templateAaron LI2016-10-301-0/+37
| | | | Tornado template: http://www.tornadoweb.org/en/stable/guide/templates.html
* webui: Import Milligram v1.1.0Aaron LI2016-10-301-0/+628
| | | | | Milligram is a minimalist CSS framework (only CSS). https://milligram.github.io/
* webui: Import normalize.css v5.0.0Aaron LI2016-10-301-0/+461
| | | | normalize.css: https://github.com/necolas/normalize.css
* webui: Import FontAwesome v4.7.0Aaron LI2016-10-303-0/+2337
| | | | FontAwesome: http://fontawesome.io/
* webui: Build the Web UI using Tornado with WebSocketAaron LI2016-10-303-0/+68
| | | | Tornado: http://www.tornadoweb.org/
* utils/__init__.py: Only import "setup_logging" from "logging.py"Aaron LI2016-10-296-8/+5
| | | | | | | | | | 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.
* extragalactic/pointsource (#3)Jason Ma2016-10-2712-0/+1881
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* fg21sim/__init__.py: Do not import from ".foregrounds"Aaron LI2016-10-271-2/+0
| | | | | | | Import from ".foregrounds" involves a lot of imports of other components, which cause a lot of numba JIT compilations. Therefore, the simple "import fg21sim" causes a long lag for running the scripts, e.g., bin/healpix2hpx.
* Update to use the new "checksum" config optionAaron LI2016-10-274-4/+12
| | | | | Also add a warning log message for "galactic/snr.py" and "extragalactic/clusters.py".
* utils/fits.py: Add parameter "checksum" for write_fits_healpix()Aaron LI2016-10-271-8/+13
| | | | Also update the docstring and one comment.