{"id":22698169,"url":"https://github.com/yash-10/beta-sgp","last_synced_at":"2025-07-25T07:33:31.858Z","repository":{"id":108564860,"uuid":"437292007","full_name":"Yash-10/beta-sgp","owner":"Yash-10","description":"Scaled Gradient Projection (SGP) algorithm with beta divergence","archived":false,"fork":false,"pushed_at":"2023-07-03T04:46:59.000Z","size":25349,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T18:35:18.567Z","etag":null,"topics":["astronomy","image-restoration","mathematical-optimization"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Yash-10.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-11T13:37:45.000Z","updated_at":"2023-07-08T04:31:57.000Z","dependencies_parsed_at":"2025-03-29T18:39:35.544Z","dependency_job_id":null,"html_url":"https://github.com/Yash-10/beta-sgp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Yash-10/beta-sgp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yash-10%2Fbeta-sgp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yash-10%2Fbeta-sgp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yash-10%2Fbeta-sgp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yash-10%2Fbeta-sgp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yash-10","download_url":"https://codeload.github.com/Yash-10/beta-sgp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yash-10%2Fbeta-sgp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266973081,"owners_count":24014618,"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","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["astronomy","image-restoration","mathematical-optimization"],"created_at":"2024-12-10T05:18:30.239Z","updated_at":"2025-07-25T07:33:31.850Z","avatar_url":"https://github.com/Yash-10.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scaled Gradient Projection with $\\beta$-divergence\n\nThis repository contains the code implementation accompanying the paper: [**$\\beta$-SGP: Scaled Gradient Projection with $\\beta$-divergence for astronomical image restoration**](https://arxiv.org/abs/2207.10973). It is aimed at single-image deconvolution of astronomical images with a known Point Spread Function.\n\n## Repository overview\n\n\u003cdetails\u003e\n\u003csummary\u003eClick here to see the folder structure\u003c/summary\u003e\n\u003cpre\u003e\n\n.\n├── images\n│   ├── crowded_flux_subdiv.png\n│   ├── crowded_subdiv_example.png\n│   ├── ellipticity_ratio.png\n│   ├── flux_frac_diff.png\n│   ├── flux_line_plot_stamps.png\n│   ├── flux_subdiv.png\n│   ├── fwhm_ratio.png\n│   └── subdiv_example.png\n├── pre_processing\n│   └── Automation.cl\n├── psf\n│   ├── get_psf_coeffs.bash\n│   ├── psf_calculate.py\n│   ├── psfccfbrd210048_1_1.bin.txt\n│   ├── psfccfbrd210048_1_1_img.fits\n│   ├── psf_estimation.bash\n│   ├── psf_mat_show.ipynb\n│   ├── psf_steps_and_params.MD\n│   └── README.md\n├── README.md\n├── restoration\n│   ├── application_sgp_star_stamps.py\n│   ├── application_sgp_subdivisions.py\n│   ├── flux_conserve_proj.py\n│   ├── sgp.py\n│   ├── simulated_test\n│   │   ├── data\n│   │   │   ├── NGC7027_255.mat\n│   │   │   └── satellite_25500.mat\n│   │   └── __init__.py\n│   ├── simulation_test_sgp.py\n│   ├── tests.py\n│   └── utils.py\n└── results\n    ├── CROWDED_SUBDIV_BEST_BETA_INIT.npy\n    ├── CROWDED_SUBDIV_EXEC_TIME_BETA.npy\n    ├── CROWDED_SUBDIV_EXEC_TIME.npy\n    ├── CROWDED_SUBDIV_NUM_ITERS_BETA.npy\n    ├── CROWDED_SUBDIV_NUM_ITERS.npy\n    ├── CROWDED_SUBDIV_ORIGCAT_2sigma.csv\n    ├── CROWDED_SUBDIV_ORIGCAT.csv\n    ├── CROWDED_SUBDIV_ORIG_FLUX_BETA.npy\n    ├── CROWDED_SUBDIV_ORIG_FLUX.npy\n    ├── CROWDED_SUBDIV_ORIGIMG_BETA.fits\n    ├── CROWDED_SUBDIV_ORIGIMG.fits\n    ├── CROWDED_SUBDIV_RESTORED_BETA.csv\n    ├── CROWDED_SUBDIV_RESTORED_BETA_MATCHED.csv\n    ├── CROWDED_SUBDIV_RESTORED.csv\n    ├── CROWDED_SUBDIV_RESTORED_FLUX_BETA.npy\n    ├── CROWDED_SUBDIV_RESTORED_FLUX.npy\n    ├── CROWDED_SUBDIV_RESTOREDIMG_BETA.fits\n    ├── CROWDED_SUBDIV_RESTOREDIMG.fits\n    ├── CROWDED_SUBDIV_RESTORED_MATCHED.csv\n    ├── ELLIPTICITY_RATIO_BETA.npy\n    ├── ELLIPTICITY_RATIO.npy\n    ├── EXEC_TIME_BETA.npy\n    ├── EXEC_TIME.npy\n    ├── FLUX_FRACTIONAL_DIFFERENCE_BETA.npy\n    ├── FLUX_FRACTIONAL_DIFFERENCE.npy\n    ├── FWHM_RATIO_BETA.npy\n    ├── FWHM_RATIO.npy\n    ├── NUM_ITERS_BETA.npy\n    ├── NUM_ITERS.npy\n    ├── ORIG_FLUX_BETA.npy\n    ├── ORIG_FLUX.npy\n    ├── RESTORED_FLUX_BETA.npy\n    ├── RESTORED_FLUX.npy\n    ├── SUBDIV_BEST_BETA_INIT.npy\n    ├── SUBDIV_EXEC_TIME_BETA.npy\n    ├── SUBDIV_EXEC_TIME.npy\n    ├── SUBDIV_NUM_ITERS_BETA.npy\n    ├── SUBDIV_NUM_ITERS.npy\n    ├── SUBDIV_ORIGCAT.csv\n    ├── SUBDIV_ORIG_FLUX_BETA.npy\n    ├── SUBDIV_ORIG_FLUX.npy\n    ├── SUBDIV_ORIGIMG_BETA.fits\n    ├── SUBDIV_ORIGIMG.fits\n    ├── SUBDIV_RESTORED_BETA.csv\n    ├── SUBDIV_RESTORED_BETA_MATCHED.csv\n    ├── SUBDIV_RESTORED.csv\n    ├── SUBDIV_RESTORED_FLUX_BETA.npy\n    ├── SUBDIV_RESTORED_FLUX.npy\n    ├── SUBDIV_RESTOREDIMG_BETA.fits\n    ├── SUBDIV_RESTOREDIMG.fits\n    ├── SUBDIV_RESTORED_MATCHED.csv\n    ├── WD_RADIAL_PROFILE_DISTANCE_BETA.npy\n    └── WD_RADIAL_PROFILE_DISTANCE.npy\n\n7 directories\n\n\u003c/pre\u003e\n\u003c/details\u003e\n\n### `restoration`\n- `sgp.py` contains implementation for SGP with both, $\\beta$-divergence and KL divergence.\n- `flux_conserve_proj.py` contains the flux conservation projection step code.\n- `utils.py` contains some utility functions helpful in other scripts.\n\n### `psf`\n\n- `psf_calculate.py` calculates the PSF matrix from the parameters output by the `getpsf` code from the [DIAPL package](https://users.camk.edu.pl/pych/DIAPL/)\u003csup\u003e1\u003c/sup\u003e.\n\n### `results`\n\n- It contains the results in form of metrics embedded in .npy files.\n\n### `pre_processing`\n\n- `Automation.cl` is the IRAF automation script we generated to automate the process of removing bad bias and flat frames during the image reduction process.\n\n## Example results and comparison\n\nExample 1:\n![Example 1](https://github.com/Yash-10/beta-sgp/blob/master/images/subdiv_example.png?raw=true)\n\nExample 2:\n![Example 2](https://github.com/Yash-10/beta-sgp/blob/master/images/crowded_subdiv_example.png?raw=true)\n\n## Data availability\n\nThe M13 globular cluster I-filter images (244 images) are available [here](https://drive.google.com/file/d/13Vk2TpXgSB6IoLUIv-zdh-XI53wJp-0y/view?usp=sharing). These images have gone through the usual image reduction pipeline.\n\n## Bugs or issues\n\nIf you find something not working as expected or anything weird, we would like to know and improve it! Please feel free to open an issue in the [issue tracker](https://github.com/Yash-10/fc_sgp-star-restoration/issues) or send an email to yashgondhalekar567@gmail.com\n\n## Code motivation\n\nThe code presented here is a modified, Python implementation of the [Matlab SGP code of the SGP-dec software](https://www.unife.it/prin/software)\u003csup\u003e3\u003c/sup\u003e. However, it is not the official Python implementation of SGP-dec.\n\n## Code status\n\nCurrently, SGP and $\\beta$-SGP are written in two separate functions, despite both having many commonalities. This could make it slightly cumbersome to switch between both functions, especially given that $\\beta$-SGP generalizes SGP. Future versions would focus on improving this aspect.\n\n## References\n\n[1] Pych, W. Difference Image Analysis Package (DIAPL).\n\n[2] Efficient deconvolution methods for astronomical imaging: algorithms and IDL-GPU codes M.  Prato, R.  Cavicchioli, L.  Zanni, P.  Boccacci, M.  Bertero A\u0026A 539 A133 (2012) DOI: 10.1051/0004-6361/201118681\n\n[3] Bonettini S., Zanella R., Zanni L., 2009, InvPr, 25, 015002. doi:10.1088/0266-5611/25/1/015002\n\n## License and copyright\nThe code here is licensed under the [MIT License](https://github.com/Yash-10/beta-sgp/blob/master/LICENSE).\n\nCopyright (c) 2023 Yash Gondhalekar\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyash-10%2Fbeta-sgp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyash-10%2Fbeta-sgp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyash-10%2Fbeta-sgp/lists"}