{"id":24523558,"url":"https://github.com/dreamjade/toy_coronagraph","last_synced_at":"2025-04-14T12:53:42.707Z","repository":{"id":180547863,"uuid":"665310914","full_name":"dreamjade/Toy_Coronagraph","owner":"dreamjade","description":"A toy project for coronagraphs","archived":false,"fork":false,"pushed_at":"2023-11-07T15:08:45.000Z","size":93312,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-28T02:03:48.897Z","etag":null,"topics":["astro","astronomy","coronagraph","exoplanet","exozodi","telescope","zodiacal-dust"],"latest_commit_sha":null,"homepage":"https://dreamjade.github.io/Toy_Coronagraph/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dreamjade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-11T23:43:20.000Z","updated_at":"2024-10-16T02:03:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c0881b9-4e0f-40b9-a02b-ccaf6d8278e4","html_url":"https://github.com/dreamjade/Toy_Coronagraph","commit_stats":null,"previous_names":["dreamjade/toy_coronagraph"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamjade%2FToy_Coronagraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamjade%2FToy_Coronagraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamjade%2FToy_Coronagraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamjade%2FToy_Coronagraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dreamjade","download_url":"https://codeload.github.com/dreamjade/Toy_Coronagraph/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248885462,"owners_count":21177625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astro","astronomy","coronagraph","exoplanet","exozodi","telescope","zodiacal-dust"],"created_at":"2025-01-22T04:15:49.213Z","updated_at":"2025-04-14T12:53:42.678Z","avatar_url":"https://github.com/dreamjade.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Version](https://img.shields.io/badge/Version-v1.6.1-red.svg?style=flat-square)](https://github.com/dreamjade/Toy_Coronagraph/blob/main/toycoronagraph/__init__.py)\n\u003ca href=\"https://pypi.org/project/toycoronagraph/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/lrgs.svg\" alt=\"PyPI\" /\u003e\u003c/a\u003e\n[![Test](https://img.shields.io/badge/Tests-v1.6.1-yellow.svg?style=flat-square)](https://github.com/dreamjade/Toy_Coronagraph/tree/main/tests)\n[![Documentation Status](https://img.shields.io/badge/Docs-v1.6.1-green.svg?style=flat-square)](https://dreamjade.github.io/Toy_Coronagraph/index.html)\n\u003ca href=\"./LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/cran/l/lrgs.svg\" alt=\"MIT License\" /\u003e\u003c/a\u003e\n[![DOI](https://zenodo.org/badge/665310914.svg)](https://zenodo.org/badge/latestdoi/665310914)\n[![GitHub repo size](https://img.shields.io/github/repo-size/codewithsadee/vcard-personal-portfolio)](https://github.com/dreamjade/Toy_Coronagraph.git)\n[![Dependencies](https://img.shields.io/badge/Dependencies-v1.6.1-purple.svg?style=flat-square)](https://github.com/dreamjade/Toy_Coronagraph/tree/main/requirements.txt)\n\n# Toy Coronagraph\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./static/planetary-system.svg\" width=\"600\" title=\"Toy Coronagraph logo\"\u003e\n\u003c/p\u003e\n\nThe toycoronagraph package is implemented in Python\n\nLanguage | Release | Note\n---------- | -------- | ------\nPython | [On PyPI](https://pypi.python.org/pypi/toycoronagraph) | though not always the most recent [version](./toycoronagraph/__init__.py)\n\nfor simulating coronagraphs. It is designed to be simple and easy to use, while still providing a powerful and flexible framework for simulating a variety of coronagraph designs. \n\nThe package includes a number of pre-defined coronagraph designs, as well as a library of functions for creating custom coronagraphs. It also includes a number of tools for visualizing the results of simulations, such as ray tracing plots and intensity maps.\n\nThe toycoronagraph package is open source and available on GitHub. It is a valuable tool for anyone interested in learning about coronagraphs or simulating the performance of coronagraph designs.\n\n### Here are some of the features of this package:\n\n* Simple and easy to use\n* Powerful and flexible framework\n* Pre-defined coronagraph designs\n* Library of functions for creating custom coronagraphs\n* Tools for visualizing the results of simulations\n* Open source and available on GitHub\n\n### Here are some of the applications of this package:\n\n* Learning about coronagraphs\n* Simulating the performance of coronagraph designs\n* Designing new coronagraph designs\n* Testing the performance of coronagraph hardware\n* Studying the physics of light scattering\n\n### Example\n\nexample target           |  Final image (Charge=2)  |  Final image (Charge=6)\n:-------------------------:|:-------------------------:|:-------------------------:\n![origin](./static/origin.png) | ![charge2_final](./static/charge2_final.png) | ![charge6_final](./static/charge6_final.png)\n\n#### with planets\n\nPre-image  |  Final image (Charge=6)\n:-------------------------:|:-------------------------:\n![pre_image](./static/origin_with_planets.png) | ![charge6_final](./static/charge6_with_planets_final.png)\n\n#### Turn on/off dust inside IWA\n\nFinal image (Charge=6)  |  Final image but ignored dust inside IWA (Charge=6)\n:-------------------------:|:-------------------------:\n![charge6_final](./static/charge6_with_planets_final.png) | ![charge6_final_iwa_ignore](./static/charge6_with_planets_iwa_ignore_final.png)\n\n#### Moving planet on an elliptic orbit\n\nFrame definition\n:-------------------------:\n![frame](./static/frame.svg)\n\nPlot the orbit (time = 0.2 period, starting from the perihelion and moving clockwise in the figure)\n:-------------------------:\n![oribit_planet1](./static/oribit_planet1.png)\n\n##### User could even make a video now\n\nVideo (Charge=6)  |  Video but ignored dust inside IWA (Charge=6)\n:-------------------------:|:-------------------------:\n![video](./static/planet_video.gif) | ![video_iwa_ignore](./static/planet_video_iwa_ignore.gif)\n\n### Example usage (Python)\nThis [py file](./tests/test.py) illustrates how the Python package is used.\n```Python\nimport toycoronagraph.main as toy\n\n# Load the example target image (example.fits) in Toy_Coronagraph/toycoronagraph/example_data/ folder\ntoy_target = toy.Target()\n\n# Plot the preimage; the image will auto-save to origin.png\ntoy_target.plot_origin()\n\n# Plot the final image through vortex coronagraph with charge = 2; the image will auto-save to charge2_final.png\ntoy_target.plot_final(charge=2)\n\n# Plot the final image through vortex coronagraph with charge = 6; the image will auto-save to charge6_final.png\ntoy_target.plot_final(charge=6)\n\n# Now add a static planet, where pos=(x_position, y_position)\ntoy_target.add_planet(pos=[0.5,0], brightness=0.00005, mode=\"cartesian\")\n\n# You could also add a moving planet on an elliptic orbit, where pos=(length of the semi-major axis, eccentricity, position angle, inclination angle, time/period))\ntoy_target.add_planet(pos=[0.5,0.6,60,0,0.1], brightness=0.00003, mode=\"moving\")\n\n# Plot the preimage with planets; the image will auto-save to origin_with_planets.png\ntoy_target.plot_origin()\n\n# Plot the final image with planets; the image will auto-save to charge6_with_planets_final.png\ntoy_target.plot_final(charge=6)\n\n# Plot the final image by turning off the target inside IWA; the image will auto-save to charge6_with_planets_iwa_ignore_final.png\ntoy_target.plot_final(charge=6, iwa_ignore=True)\n\n# List the planets\ntoy_target.list_planets()\n'''\nStatic Planet 1: (0.5, 0.0) arcsec, brightness: 5.00e-05 Jy\nMoving Planet 2: (-0.3818058424930897, 0.08394161212137384) arcsec, brightness: 3.00e-05 Jy\n'''\n\n# Delete a specific planet\ntoy_target.delete_planet(order=1)\n'''\nSuccessfully remove planet #1, here is the latest planet list:\nMoving Planet 1: (-0.3818058424930897, 0.08394161212137384) arcsec, brightness: 3.00e-05 Jy\n'''\n\n# Move a moving planet on its orbit by time/period=0.1\ntoy_target.planet_move(time=0.1, order=1)\n'''\nPlanet has moved to new position\n'''\n\n# Plot the orbit of a specific moving planet; the image will auto-save to oribit_planet#.png\ntoy_target.plot_orbit(order=1)\n\n# Plot the new preimage with planets; the image will auto-save to origin_with_planets.png\ntoy_target.plot_origin()\n\n# Plot the new final image with planets; the image will auto-save to charge6_with_planets_final.png\ntoy_target.plot_final(charge=6)\n\n# Print a specific planet brightness, background brightness, and background brightness (ignored dust inside IWA) in the final image through vortex coronagraph with charge = 6\ntoy_target.contrast(charge=6, order=1)\n'''\nThis is a charge-6 vortex coronagraph.\n'''\n\n# Plot the core_throughput and inner working angle (in pixel)\nimport toycoronagraph.psf as psf\nimport numpy as np\npsfs = np.load(\"psfs_c2.npy\")\npsf.cir_core_throughput_plot(psfs)\n\n# Make the planet movie\ntoy_target.planet_video(charge=6)\n# The video will be save to planet_video.mp4\n\n# Make the planet movie again, but ignore the dust inside IWA\ntoy_target.planet_video(charge=6, iwa_ignore=True)\n# The video will be save to planet_video_iwa_ignore.mp4\n```\nMore instructions could be found in [docs](https://dreamjade.github.io/Toy_Coronagraph/index.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreamjade%2Ftoy_coronagraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdreamjade%2Ftoy_coronagraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreamjade%2Ftoy_coronagraph/lists"}