{ "info": { "author": "Isobel Romero-Shaw, Roshni Vincent, Andreas Freise", "author_email": "isobel.romeroshaw@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# MAGIC 0.0.1\n\n\nMAGIC is a Modular and Adaptable Gravitational-wave Interferometer noise Calculator. It is heavily influenced by [GWINC](https://awiki.ligo-wa.caltech.edu/shibboleth-ds/index.html?entityID=https%3A%2F%2Fawiki.ligo-wa.caltech.edu%2Fshibboleth-sp&return=https%3A%2F%2Fawiki.ligo-wa.caltech.edu%2FShibboleth.sso%2FLogin%3FSAMLDS%3D1%26target%3Dss%253Amem%253Ae4615f3c155486166d019988554dfd489130db97ff31761cc8a7613e45d46e6f \"GWINC\") (access requires albert.einstein style credentials), the noise calculator developed for LIGO detectors by the LIGO collaboration.\n\n### Installation \n\nTo install, clone this repository, then go into the `MAGIC/Code/` directory and run\n\n`python setup.py install`\n\nThis will install MAGIC, and you can then delete the repository.\n\n### Documentation\n\nAs well as the code, we provide here the project reports of the two students who began development on MAGIC.\nWe also provide many referenced documents in PDF form to give the physical motivation behind the code used.\n\nWhere possible, the code has been commented in an attempt to clarify what it's doing.\n\n### Testing\n\nTo run unit tests, run `pytest` from project root directory\n\nUnit tests are in `Code/tests`\n\nIf you run `pip install pytest-cov` (which will install `coverage.py` and the coverage pytest plugin) and then run `pytest --cov=magic` Coverage will generate a report showing what percentage of the MAGIC codebase is executed by the tests in the test directory\n\nTo show specifically which lines are not being called, run `pytest --cov-report term-missing --cov=magic`\n\nYou can also run coverage with just `coverage.py` using `coverage run -m pytest`. You can then view the coverage report using `coverage report` or generate a html coverage report using `coverage html`\n\n***\n## Basic Uses\n\n### Plotting LIGO's Noise Curves\n\n![](detector_plots/aLIGO.png)\n\nGenerate the plot above using the following simple code.\n\n```python\nfrom magic import Interface\nfrom magic.detectors import aLIGO\n\nmy_detector = aLIGO()\nmy_interface = Interface(my_detector)\nmy_interface.showNoise()\n```\n\n### Changing Detector Parameters\n\nA lot of detectors parameters are available to you for varying. Change detector parameters using the following script.\n\n```python\nfrom magic import Interface\nfrom magic.detectors import aLIGO\n\nmy_detector = aLIGO()\nmy_interface = Interface(my_detector)\nmy_interface.showNoise()\n\nnew_parameters = {\n\t'length' : 10000,\n\t'power' : 200\n}\n\nmy_interface.addNew(parameters=new_parameters)\nmy_interface.showNoise()\n```\n\nIn order to see a nicely-formatted list of the detector's variable parameters, include the following code.\n\n```python\nvariables = sorted(list(my_detector.variable_keys))\nfor v in variables:\nprint(v)\n```\n\n### Calculating the Detector's Range\n\nThe range of the detector can be calculated using binary coalescence signals. MAGIC provides the option of a full inspiral-merge-ringdown range, in addition to the more widely-used inspiral range. \n\nTo get started with range calculations, try\n\n```python\nfrom magic import Calculator\nfrom magic.detectors import aLIGO\n\nmy_detector = aLIGO()\n\nmy_calculator = Calculator(my_detector)\n\n# Masses (Msol)\nm1 = 30\nm2 = 40\n\n# Full IMR -> True, just inspiral -> False\nimr = True\n\ndistance = my_calculator.calculateDetectorRange(m1, m2, imr)\n\nprint('Your detector\\'s range is ' + str(distance) + ' Mpc')\n```\n\n*****\n\n## Technical Notes\n\n### detector\n\nExisting detector models are aLIGO, Voyager and the Einstein Telescope (ET). Creating an instance of a model requires use of its constructor, like\n```python\nmy_detector = aLIGO([f], [xlim], [ylim], [parameters], [verbose])\n```\nwhere square parenthesis ([]) indicate that the named argument is optional.\n```\n[f] : frequency range to investigate (1d array)\n[xlim] : x-limits of the output plot\n[ylim] : y-limits of the ouput plot\n[parameters] : new or replacement detector parameters of the form {'parameter_name' : value}\n[verbose] : boolean switch to enable output of flags for detetor and noise model initialisation\n```\nThus, the simplest instantiation is \n```python\nmy_detector = aLIGO()\n```\nIn order to set up the noise models for a detector, use the reset_noise function,\n```python\nmy_detector.reset_noise([noiseModels], [parameters])\n```\n```\n[noiseModels] : new or replacement noise models in a dict of the form {'NoiseName' : NoiseModel()}\n[parameters] : new or replacement detector parameters of the form {'parameter_name' : value}\n```\nThe detector is now set up with noise models. \n\n### interface\n\nTo create plots and output data, first create an instance of the interface object by passing your detector as an argument.\n```python\nmy_interface = Interface(detector, [parameters])\n```\n```\ndetector : interferometer model\n[parameters] : new or replacement detector parameters of the form {'parameter_name' : value}\n```\n\nThis object can interact with a user at the command line, allowing them to view and change the detector's available parameters, or to add their own. \n\nFunctions are provided by the interface that can:\n* print the detector's properties to a text file and/or the screen\n* print its best sensitivity and the frequency at which this occurs\n* return the range to which a command-line user can see the merge of a binary with their chosen constituent masses\n* store the detector's name, description, parameters and noise budget in an timed-and-dated HDF5 file\n* read a detector's name, description and attributes from an HDF5 file\n\n### calculator\n\nIf the user interface is unnecessary, you can set up a calculator independent from an interface by passing a detector directly to its constructor,\n\n```python\nmy_calculator = Calculator(my_detector, [parameters])\n```\n\nFunctions provided by the calculator can\n* generate the detector's noise budget and calculate its total sensitivity limit\n* calculate the detector's range based on a signal from a merger of two input masses\n\n### Included Examples\n\nSome example scripts are provided in the Code folder, each demonstrating how the MAGIC package might be used.\n\n#### user_script\n\nuser_script instantiates a detector noise model. It saves the total noise and its contributions to a pdf, which also contains the parameters upon which each contributing trace depends. The budget data and the detector parameters used to create them are also stored in a HDF5 file in the Code/output folder. userscript then reads back in this file to check that saving has been successful.\n\n#### magic_script \n\nmagic_script can be used to choose a detector and pass it some new parameters\nusing command-line flags. It then runs much like userscript.\n\nusage: magic_script.py [-h] [--d DETECTOR] [--p NEW_PARAMETERS]\n\nView the noise budget of a gravitational wave interferometer.\n\noptional arguments:\n -h, --help show this help message and exit\n --d DETECTOR the name of the interferometer (aLIGO, Voyager, ET)\n --p NEW_PARAMETERS any new/changed parameters (currently only single\n numeric values supported)\n\n#### loop_script\n\nloop_script sets up a detector and then allows a user to repeatedly change any number of parameters at a time, saving and altering the detector's state after the previous loop and displaying a plot each time. Upon termination, the final achieved noise budget is shown, and the final parameters and noise budgets are saved in a hdf5 file in Code/output.\n\n#### parameter_tracker\n\nparameter_tracker finds the noise models and utility functions in which the detector's parameters are used, and prints the name, location and parameters used within each noise and function in MAGIC.\n\n#### optimisation_script\n\noptimisation_script can be used to optimise multiple detector parameters to maximise the horizon distance or SNR. It enable input signal in the form of a data file containing \nfrequencies and strain, as well as has an inspiral merger ringdown signal based on the [IMRPhenomB] (https://arxiv.org/pdf/0710.2335) model by Ajith et al., 2009. This takes an input\nof detector frequency band, as well as source masses. Further instructions can be found in comments in the script. \n\nSemi-realistic cost and complexity functions for power and signal recycling mirror transmittance are defined in the \ncalculator. These can easily be altered and added to. These influence the distance as \n```Python \n if cost > budget:\n distance = 0\n```\nand\n\n```Python \n distance = -distance/complexity\n```\n\nThe script sets the optimised detector parameters to the optimum found, and prints a dictionary containing the maximum distance and corresponding detector parameters. \n\n***\n## Authors\nMAGIC and its accompanying testing/optimisation suite were developed by Isobel Romero-Shaw and Roshni Vincent, respectively.\n\n### Contact:\n#### Isobel Romero-Shaw\niromero@star.sr.bham.ac.uk\n#### Roshni Vincent\nrxv419@star.sr.bham.ac.uk\n***\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://gitlab.sr.bham.ac.uk/ifolab/MAGIC/tree/master/Code", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "ifomagic", "package_url": "https://pypi.org/project/ifomagic/", "platform": "", "project_url": "https://pypi.org/project/ifomagic/", "project_urls": { "Homepage": "http://gitlab.sr.bham.ac.uk/ifolab/MAGIC/tree/master/Code" }, "release_url": "https://pypi.org/project/ifomagic/0.0.5/", "requires_dist": [ "pykat", "seaborn" ], "requires_python": "", "summary": "", "version": "0.0.5" }, "last_serial": 4733660, "releases": { "0.0.5": [ { "comment_text": "", "digests": { "md5": "af2abd0eeffdb0563e67a5a2cdbff5db", "sha256": "516a9b510336f92393753ec6ff291a0079e00c15b040ff3a09e67369447b9ba9" }, "downloads": -1, "filename": "ifomagic-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "af2abd0eeffdb0563e67a5a2cdbff5db", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4009491, "upload_time": "2019-01-24T00:51:29", "url": "https://files.pythonhosted.org/packages/b7/c7/b8a4c4015a50241353e7234a99d84ae06791718f4600a0a9c8eb18f0ff17/ifomagic-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2bfc945e61e1f0e9a11e78147725b71a", "sha256": "071348f92ede9d84501effcf90d4db7630d870317f4d33341c734e90c7fb4f99" }, "downloads": -1, "filename": "ifomagic-0.0.5.tar.gz", "has_sig": false, "md5_digest": "2bfc945e61e1f0e9a11e78147725b71a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3975117, "upload_time": "2019-01-24T00:51:32", "url": "https://files.pythonhosted.org/packages/95/17/30b6834b0e0973202bcf28555ce79edabb904e10fa661c2a4740c9b060f3/ifomagic-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "af2abd0eeffdb0563e67a5a2cdbff5db", "sha256": "516a9b510336f92393753ec6ff291a0079e00c15b040ff3a09e67369447b9ba9" }, "downloads": -1, "filename": "ifomagic-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "af2abd0eeffdb0563e67a5a2cdbff5db", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4009491, "upload_time": "2019-01-24T00:51:29", "url": "https://files.pythonhosted.org/packages/b7/c7/b8a4c4015a50241353e7234a99d84ae06791718f4600a0a9c8eb18f0ff17/ifomagic-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2bfc945e61e1f0e9a11e78147725b71a", "sha256": "071348f92ede9d84501effcf90d4db7630d870317f4d33341c734e90c7fb4f99" }, "downloads": -1, "filename": "ifomagic-0.0.5.tar.gz", "has_sig": false, "md5_digest": "2bfc945e61e1f0e9a11e78147725b71a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3975117, "upload_time": "2019-01-24T00:51:32", "url": "https://files.pythonhosted.org/packages/95/17/30b6834b0e0973202bcf28555ce79edabb904e10fa661c2a4740c9b060f3/ifomagic-0.0.5.tar.gz" } ] }