├── .coveragerc ├── .gitattributes ├── .github └── workflows │ └── CD-build.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENCE.txt ├── README.md ├── config_MCCD.ini ├── data └── sim_inputs │ ├── train_ccd_list.npy │ └── train_positions.npy ├── develop.txt ├── docs ├── _build │ ├── .buildinfo │ ├── .doctrees │ │ ├── about.doctree │ │ ├── changelog.doctree │ │ ├── citing.doctree │ │ ├── contributing.doctree │ │ ├── environment.pickle │ │ ├── index.doctree │ │ ├── installation.doctree │ │ ├── mccd.auxiliary_fun.doctree │ │ ├── mccd.dataset_generation.doctree │ │ ├── mccd.doctree │ │ ├── mccd.grads.doctree │ │ ├── mccd.info.doctree │ │ ├── mccd.mccd.doctree │ │ ├── mccd.mccd_utils.doctree │ │ ├── mccd.proxs.doctree │ │ ├── mccd.utils.doctree │ │ ├── quickstart.doctree │ │ ├── toc.doctree │ │ └── z_ref.doctree │ ├── _modules │ │ ├── index.html │ │ └── mccd │ │ │ ├── auxiliary_fun.html │ │ │ ├── dataset_generation.html │ │ │ ├── grads.html │ │ │ ├── mccd.html │ │ │ ├── mccd_utils.html │ │ │ ├── proxs.html │ │ │ └── utils.html │ ├── _sources │ │ ├── about.rst.txt │ │ ├── changelog.rst.txt │ │ ├── citing.rst.txt │ │ ├── contributing.rst.txt │ │ ├── index.rst.txt │ │ ├── installation.rst.txt │ │ ├── mccd.auxiliary_fun.rst.txt │ │ ├── mccd.dataset_generation.rst.txt │ │ ├── mccd.grads.rst.txt │ │ ├── mccd.info.rst.txt │ │ ├── mccd.mccd.rst.txt │ │ ├── mccd.mccd_utils.rst.txt │ │ ├── mccd.proxs.rst.txt │ │ ├── mccd.rst.txt │ │ ├── mccd.utils.rst.txt │ │ ├── quickstart.rst.txt │ │ ├── toc.rst.txt │ │ └── z_ref.rst.txt │ ├── _static │ │ ├── 0d8bb5b3ee5f5dac9e446d48480d28a9.woff2 │ │ ├── 176f8f5bd5f02b3abfcf894955d7e919.woff2 │ │ ├── 18d00f739ff1e1c52db1a1c0d9e98129.woff │ │ ├── 1c2e1cdea02e7dfab25424e6e42d7973.woff2 │ │ ├── 1ed72cb00dc79e545eb2f86b41a14560.woff │ │ ├── 38b17c60ba71b3aa71c29b0493e6607d.woff │ │ ├── 49ae34d4cc6b98c00c69ab4c41de3e0c.woff │ │ ├── 4a0ed4c488992e375e9793218146647b.woff │ │ ├── 647f3654373165e51135a4fddf0006a9.woff2 │ │ ├── b1d9d9904bfca8802a631c45590b9efa.woff │ │ ├── basic.css │ │ ├── cba8e90503370863b3a0036bda7b0e44.woff │ │ ├── cea99d3e3e13a3a599a015c29f1046d0.woff │ │ ├── d022bc70dc1bf7b3425da9cdaa9841b6.woff2 │ │ ├── d4e12e8e9e242435ab9cbd5a2086ca2c.woff2 │ │ ├── doctools.js │ │ ├── documentation_options.js │ │ ├── f5b74d7ffcdf85b9dd60130fa0b2c087.woff2 │ │ ├── fe990f0633a16121db07a88a65858aee.woff2 │ │ ├── file.png │ │ ├── jquery-3.5.1.js │ │ ├── jquery.js │ │ ├── language_data.js │ │ ├── minus.png │ │ ├── plus.png │ │ ├── pygments.css │ │ ├── searchtools.js │ │ ├── theme.css │ │ ├── theme.js │ │ ├── theme.js.LICENSE.txt │ │ ├── underscore-1.13.1.js │ │ └── underscore.js │ ├── about.html │ ├── changelog.html │ ├── citing.html │ ├── contributing.html │ ├── genindex.html │ ├── index.html │ ├── installation.html │ ├── mccd.auxiliary_fun.html │ ├── mccd.dataset_generation.html │ ├── mccd.grads.html │ ├── mccd.html │ ├── mccd.info.html │ ├── mccd.mccd.html │ ├── mccd.mccd_utils.html │ ├── mccd.proxs.html │ ├── mccd.utils.html │ ├── objects.inv │ ├── py-modindex.html │ ├── quickstart.html │ ├── search.html │ ├── searchindex.js │ ├── toc.html │ └── z_ref.html ├── _script_templates │ ├── module.rst_t │ ├── package.rst_t │ └── toc.rst_t ├── _templates │ ├── module.rst_t │ ├── package.rst_t │ └── toc.rst_t ├── requirements.txt └── source │ ├── about.rst │ ├── changelog.rst │ ├── citing.rst │ ├── conf.py │ ├── contributing.rst │ ├── index.rst │ ├── installation.rst │ ├── mccd.auxiliary_fun.rst │ ├── mccd.dataset_generation.rst │ ├── mccd.grads.rst │ ├── mccd.info.rst │ ├── mccd.mccd.rst │ ├── mccd.mccd_utils.rst │ ├── mccd.proxs.rst │ ├── mccd.rst │ ├── mccd.utils.rst │ ├── my_ref.bib │ ├── quickstart.rst │ ├── refs.bib │ ├── toc.rst │ └── z_ref.rst ├── example ├── __init__.py ├── dataset_generation_parallel.py └── fix_old_calidation_star_catalogue.py ├── mccd ├── __init__.py ├── auxiliary_fun.py ├── dataset_generation.py ├── grads.py ├── info.py ├── mccd.py ├── mccd_utils.py ├── proxs.py └── utils.py ├── notebooks ├── Running MCCD on a SExtractor catalog.ipynb ├── testing-realistic-data.ipynb └── testing-simulated-data.ipynb ├── pypi_pkg_info.rst ├── requirements.txt ├── setup.cfg ├── setup.py └── tests ├── __init__.py └── test_pysap_wavelet.py /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | 3 | [report] 4 | show_missing = True 5 | exclude_lines = 6 | pragma: no cover 7 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Exclude jupyter notebooks from linguist project count 2 | *.ipynb linguist-generated=true 3 | notebooks/*.ipynb linguist-generated=true 4 | -------------------------------------------------------------------------------- /.github/workflows/CD-build.yml: -------------------------------------------------------------------------------- 1 | name: CD 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | 13 | coverage: 14 | name: Deploy Coverage Results 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v3 20 | 21 | - name: Set up Python 3.10 22 | uses: actions/setup-python@v4 23 | with: 24 | python-version: '3.10' 25 | 26 | - name: Install macOS Dependencies 27 | if: runner.os == 'macOS' 28 | run: | 29 | brew tap sfarrens/sf 30 | brew install bigmac libomp 31 | 32 | - name: Check Python Version 33 | run: python --version 34 | 35 | - name: Install dependencies 36 | run: | 37 | python -m pip install --upgrade pip 38 | python -m pip install -r develop.txt 39 | python -m pip install twine 40 | python -m pip install PyQt5 41 | python -m pip install pyqtgraph 42 | python -m pip install git+https://github.com/CEA-COSMIC/pysap.git@2e26a71024b5a0419b27d4b3fc5cdee77bd3919b 43 | python -m pip install GalSim 44 | 45 | - name: Install requirements 46 | run: | 47 | python -m pip install -r docs/requirements.txt 48 | 49 | - name: Install MCCD 50 | run: python -m pip install . 51 | 52 | - name: Run Tests 53 | run: | 54 | python setup.py test 55 | 56 | - name: Check distribution 57 | run: | 58 | python setup.py sdist 59 | twine check dist/* 60 | 61 | api: 62 | name: Deploy API Documentation 63 | runs-on: ubuntu-latest 64 | 65 | steps: 66 | - name: Checkout 67 | uses: actions/checkout@v3 68 | 69 | - name: Set up Python 3.10 70 | uses: actions/setup-python@v4 71 | with: 72 | python-version: '3.10' 73 | 74 | - name: Install macOS Dependencies 75 | if: runner.os == 'macOS' 76 | run: | 77 | brew tap sfarrens/sf 78 | brew install bigmac libomp 79 | 80 | - name: Install dependencies 81 | run: | 82 | python -m pip install --upgrade pip 83 | python -m pip install pandoc 84 | python -m pip install PyQt5 85 | python -m pip install pyqtgraph 86 | python -m pip install git+https://github.com/CEA-COSMIC/pysap.git@2e26a71024b5a0419b27d4b3fc5cdee77bd3919b 87 | python -m pip install -r docs/requirements.txt 88 | python -m pip install GalSim 89 | python -m pip install . 90 | 91 | - name: Build API documentation 92 | run: | 93 | sphinx-apidoc -t docs/_templates -feTMo docs/source mccd 94 | sphinx-build -E docs/source docs/_build 95 | 96 | - name: Deploy API documentation 97 | uses: peaceiris/actions-gh-pages@v3.5.9 98 | with: 99 | github_token: ${{ secrets.GITHUB_TOKEN }} 100 | publish_dir: docs/_build 101 | 102 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore annoying mac files 2 | *.DS_Store 3 | mccd/*.DS_Store 4 | 5 | # Ignore Python compilation 6 | *.pyc 7 | 8 | # Ignore cache 9 | *.cache/ 10 | 11 | # Ignore vscode files 12 | .vscode/ 13 | 14 | # Ignore build files 15 | mccd.egg-info/ 16 | 17 | # Ignore coverage tests 18 | .coverage 19 | .pytest_cache/ 20 | 21 | # Ignore installation 22 | .eggs/ 23 | dist/ 24 | build/ 25 | 26 | # Ignore pypi config 27 | .pypirc 28 | 29 | # Ignore heavy data 30 | data/mccd_inputs/* 31 | data/outputs/* 32 | data/sextractor_preprocessed/* 33 | data/sextractor_inputs/* 34 | 35 | # Ignore notebook checkpoints 36 | notebooks/.ipynb_checkpoints 37 | notebooks/hidden_notenooks/ 38 | 39 | # Ignore hidden tests 40 | tests/hidden_tests/ 41 | 42 | # Mac hidden file 43 | *.DS_Store 44 | 45 | # Ignore files from pycharm 46 | .idea/* 47 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | education, socio-economic status, nationality, personal appearance, race, 10 | religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at {{ email }}. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We will follow [ModOpt](https://github.com/CEA-COSMIC/ModOpt) policy 4 | concerning contributions. 5 | 6 | 7 | 8 | ## Pull Requests 9 | 10 | If you would like to take a more active roll in the development of MCCD you 11 | can do so by submitting a "Pull request". A Pull Requests (PR) is a way by 12 | which a user can submit modifications or additions to the MCCD package directly. 13 | PRs need to be reviewed by the package moderators and if accepted are 14 | merged into the master branch of the repository. 15 | 16 | Before making a PR, be sure to carefully read the following guidelines. 17 | 18 | ### Before Making a PR 19 | 20 | The following steps should be followed before making a pull request: 21 | 22 | 1. Log into your GitHub account or create an account if you do not already have one. 23 | 24 | 1. Go to the main MCCD repository page: [https://github.com/CosmoStat/mccd](https://github.com/CosmoStat/mccd) 25 | 26 | 1. Fork the repository, *i.e.* press the button on the top right with this symbol . 27 | This will create an independent copy of the repository on your account. 28 | 29 | 1. Clone your fork of ModOpt. 30 | 31 | ```bash 32 | git clone https://github.com/YOUR_USERNAME/mccd 33 | ``` 34 | 35 | 5. Add the original repository (*upstream*) to remote. 36 | 37 | ```bash 38 | git remote add upstream https://github.com/CosmoStat/mccd 39 | ``` 40 | 41 | ### Making a PR 42 | 43 | The following steps should be followed to make a pull request: 44 | 45 | 1. Pull the latest updates to the original repository. 46 | 47 | ```bash 48 | git pull upstream master 49 | ``` 50 | 51 | 2. Create a new branch for your modifications. 52 | 53 | ```bash 54 | git checkout -b BRANCH_NAME 55 | ``` 56 | 57 | 3. Make the desired modifications to the relevant modules. 58 | 59 | 4. Add the modified files to the staging area. 60 | 61 | ```bash 62 | git add . 63 | ``` 64 | 65 | 5. Make sure all of the appropriate files have been staged. Note that all 66 | files listed in green will be included in the following commit. 67 | 68 | ```bash 69 | git status 70 | ``` 71 | 72 | 6. Commit the changes with an appropriate description. 73 | 74 | ```bash 75 | git commit -m "Description of commit" 76 | ``` 77 | 78 | 7. Push the commits to a branch on your fork of MCCD. 79 | 80 | ```bash 81 | git push origin BRANCH_NAME 82 | ``` 83 | 84 | 8. Make a pull request for your branch with a clear description of what has 85 | been done, why and what issues this relates to. 86 | 87 | 9. Wait for feedback and repeat steps 3 through 7 if necessary. 88 | 89 | ### After Making a PR 90 | 91 | If your PR is accepted and merged it is recommended that the following steps 92 | be followed to keep your fork up to date. 93 | 94 | 1. Make sure you switch back to your local master branch. 95 | 96 | ```bash 97 | git checkout master 98 | ``` 99 | 100 | 2. Delete the local branch you used for the PR. 101 | 102 | ```bash 103 | git branch -d BRANCH_NAME 104 | ``` 105 | 106 | 3. Pull the latest updates to the original repository, which include your 107 | PR changes. 108 | 109 | ```bash 110 | git pull upstream master 111 | ``` 112 | 113 | 4. Push the commits to your fork. 114 | 115 | ```bash 116 | git push origin master 117 | ``` 118 | 119 | 120 | -------------------------------------------------------------------------------- /LICENCE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Tobias Liaudat 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [![Build Status](https://travis-ci.org/CosmoStat/mccd.svg?branch=master)](https://travis-ci.org/CosmoStat/mccd) 4 | [![PyPI version](https://badge.fury.io/py/mccd.svg)](https://badge.fury.io/py/mccd) 5 | [![PyPI pyversions](https://img.shields.io/badge/python-3.6-blue.svg)](https://python.org) 6 | [![PyPI pyversions](https://img.shields.io/badge/python-3.8-blue.svg)](https://python.org) 7 | [![arXiv](https://img.shields.io/badge/arXiv-2011.09835-B31B1B)](https://arxiv.org/abs/2011.09835) 8 | 9 | # MCCD PSF Modelling 10 | 11 | Multi-CCD Point Spread Function Modelling. 12 | 13 | --- 14 | > Main contributor: Tobias Liaudat 15 | > Email: tobias.liaudat@cea.fr 16 | > Documentation: https://cosmostat.github.io/mccd/ 17 | > Article: DOI - A&A 18 | > Current release: 17/02/2023 19 | --- 20 | 21 | The non-parametric MCCD PSF modelling, or MCCD for short, is a Point Spread Function modelling 22 | pure python package. 23 | It is used to generate a PSF model based on stars observations in the field of view. 24 | Once trained, the MCCD PSF model can then recover the PSF at any position in the field of view. 25 | 26 | ## Contents 27 | 28 | 1. [Dependencies](#Dependencies) 29 | 1. [Installation](#Installation) 30 | 1. [Quick usage](#quick-usage) 31 | 1. [Recommendations](#Recommendations) 32 | 33 | 34 | 35 | ## Dependencies 36 | 37 | The following python packages should be installed with their specific dependencies: 38 | 39 | - [numpy](https://github.com/numpy/numpy) 40 | - [scipy](https://github.com/scipy/scipy) 41 | - [astropy](https://github.com/astropy/astropy) 42 | - [GalSim](https://github.com/GalSim-developers/GalSim) 43 | - [ModOpt](https://github.com/CEA-COSMIC/ModOpt) 44 | - [PySAP](https://github.com/CEA-COSMIC/pysap) 45 | 46 | It is of utmost importance that the PySAP package is correctly installed as we will be using the wavelet transforms provided by it. 47 | 48 | _Note: The GalSim package was removed from ``requirements.txt``, it is expected to be installed (preferably with conda) before installing the MCCD package._ 49 | 50 | ## Installation 51 | 52 | After installing all the dependencies one can perform the MCCD package installation: 53 | 54 | #### Locally 55 | ```bash 56 | git clone https://github.com/CosmoStat/mccd.git 57 | cd mccd 58 | python setup.py install 59 | ``` 60 | 61 | To verify that the PySAP package is correctly installed and that the MCCD package is 62 | accessing the needed wavelet transforms one can run: ``python setup.py test`` and 63 | check that all the tests are passed. 64 | 65 | #### From Pypi 66 | ```bash 67 | pip install mccd 68 | ``` 69 | 70 | 71 | ## Quick usage 72 | 73 | The easiest usage of the method is to go through the configuration file ``config_MCCD.ini`` using the helper classes found 74 | in [auxiliary_fun.py](https://github.com/CosmoStat/mccd/blob/master/mccd/auxiliary_fun.py) 75 | ([documentation](https://cosmostat.github.io/mccd/mccd.auxiliary_fun.html#)). 76 | Description of the parameters can be found directly in the configuration file [config_MCCD.ini](https://github.com/CosmoStat/mccd/blob/master/config_MCCD.ini). 77 | The MCCD method can handle SExtractor dataset as input catalogs given that they follow an appropriate naming convention. 78 | 79 | The main MCCD model parameters are: 80 | 81 | - ``LOC_MODEL``: Indicating the type of local model to be used (MCCD-HYB, MCCD-RCA, or MCCD-POL), 82 | - ``N_COMP_LOC``: Indicating the number of eigenPSFs to use in the local model. 83 | - ``D_COMP_GLOB``: Indicating the maximum polynomial degree for the global model. 84 | 85 | After setting up all the parameters from the configuration file there are three main functions, one to fit the model, 86 | one to validate the model and the last one to fit and then validate the model. The usage is as follows: 87 | 88 | ```python 89 | import mccd 90 | 91 | config_file_path = 'path_to_config_file.ini' 92 | 93 | run_mccd_instance = mccd.auxiliary_fun.RunMCCD(config_file_path, 94 | fits_table_pos=1) 95 | 96 | run_mccd_instance.fit_MCCD_models() 97 | ``` 98 | 99 | For the validation one should replace the last line with: 100 | 101 | ```python 102 | run_mccd_instance.validate_MCCD_models() 103 | ``` 104 | 105 | Finally for the fit and validation one should change the last line to: 106 | 107 | ```python 108 | run_mccd_instance.run_MCCD() 109 | ``` 110 | 111 | All the output file will be saved on the directories specified on the configuration files. 112 | 113 | 114 | #### PSF recovery 115 | 116 | To recover PSFs from the model at specific positions ```test_pos``` from 117 | the CCD ```ccd_id``` one could use the following example: 118 | 119 | ```python 120 | import numpy as np 121 | import mccd 122 | 123 | config_file_path = 'path_to_config_file.ini' 124 | mccd_model_path = 'path_to_fitted_mccd_model.npy' 125 | test_pos = np.load(..) 126 | ccd_id = np.load(..) 127 | local_pos = True 128 | 129 | mccd_instance = mccd.auxiliary_fun.RunMCCD( 130 | config_file_path, 131 | fits_table_pos=1 132 | ) 133 | 134 | rec_PSFs = mccd_instance.recover_MCCD_PSFs( 135 | mccd_model_path, 136 | positions=test_pos, 137 | ccd_id=ccd_id, 138 | local_pos=local_pos 139 | ) 140 | ``` 141 | 142 | See the [documentation](https://cosmostat.github.io/mccd/mccd.auxiliary_fun.html) 143 | of the ```recover_MCCD_PSFs()``` function for more information. 144 | 145 | #### Recommendations 146 | 147 | Some notebook examples can be found 148 | [here](https://github.com/CosmoStat/mccd/tree/master/notebooks). 149 | 150 | ## Changelog 151 | 152 | - Changed from travis deployment to github actions. Changed the github pages template. Now using the one from [pyralid-template](https://github.com/sfarrens/pyralid-template) from [sfarrens](https://github.com/sfarrens). 153 | 154 | - Added new module for realisitic simulations ```dataset_generation.py```. It is capable of simulating realistic simulations from the UNIONS/CFIS survey, including realistic atmospherical simulations following a realisation of a Von Kármán model. See the above-mentioned module documentation for more information. See also the ```testing-realistic-data.ipynb``` in the notebook folder for an example. 155 | 156 | - Added outlier rejection based on a pixel residual criterion. The main parameters, ```RMSE_THRESH``` and ```CCD_STAR_THRESH``` can be found in the MCCD config file. See then parameter documentation for more information. 157 | 158 | - For usage inside shape measurement pipelines: new PSF interpolation function included in the MCCD model ```interpolate_psf_pipeline()```. This function allows to output interpolated PSFs with a specific centroid. 159 | 160 | - New handling of position polynomials, local as well as global polynomials. Increased model performance. 161 | 162 | - New functionalities added. Handling of the max polynomial degree in the local hybrid model by the ```D_HYB_LOC```. Also adding a parameter ```MIN_D_COMP_GLOB``` to remove lower polynomial degrees in the global polynomial model. 163 | 164 | - Increased default number of iterations to have a better convergence in the PSF wings. 165 | 166 | - Algorithm updates to increase performance: Dropping the normalisation proximal operator. Harder sparsity constraint for spatial variations. Forcing RBF interpolation for the global part. Skipping the last weight optimization so that we always finish with a features/components optimization. 167 | 168 | - Set default denoising to zero as wavelet denoising (using starlets) introduce an important bias in the ellipticity estimates of the model. 169 | -------------------------------------------------------------------------------- /config_MCCD.ini: -------------------------------------------------------------------------------- 1 | # Configuration file for the MCCD method 2 | 3 | [INPUTS] 4 | INPUT_DIR = full_path_to/mccd/data/sextractor_inputs/ 5 | INPUT_REGEX_FILE_PATTERN = sexcat-*-*.fits 6 | INPUT_SEPARATOR = - 7 | MIN_N_STARS = 20 8 | OUTLIER_STD_MAX = 100. 9 | USE_SNR_WEIGHTS = False 10 | PREPROCESSED_OUTPUT_DIR = full_path_to/mccd/data/sextractor_preprocessed/ 11 | OUTPUT_DIR = full_path_to/mccd/data/outputs/ 12 | 13 | [INSTANCE] 14 | N_COMP_LOC = 4 15 | D_COMP_GLOB = 6 16 | KSIG_LOC = 0.00 17 | KSIG_GLOB = 0.00 18 | FILTER_PATH = None 19 | D_HYB_LOC = 2 20 | MIN_D_COMP_GLOB = None 21 | RMSE_THRESH = 1.25 22 | CCD_STAR_THRESH = 0.15 23 | FP_GEOMETRY = CFIS 24 | 25 | [FIT] 26 | LOC_MODEL = hybrid 27 | PSF_SIZE = 6.2 28 | PSF_SIZE_TYPE = R2 29 | N_EIGENVECTS = 5 30 | N_ITER_RCA = 1 31 | N_ITER_GLOB = 2 32 | N_ITER_LOC = 2 33 | NB_SUBITER_S_LOC = 300 34 | NB_SUBITER_A_LOC = 400 35 | NB_SUBITER_S_GLOB = 100 36 | NB_SUBITER_A_GLOB = 200 37 | 38 | [VALIDATION] 39 | VAL_MODEL_INPUT_DIR = full_path_to/mccd/data/outputs/ 40 | VAL_DATA_INPUT_DIR = full_path_to/mccd/data/sextractor_inputs/ 41 | VAL_PREPROCESSED_OUTPUT_DIR = full_path_to/mccd/data/sextractor_preprocessed/ 42 | VAL_REGEX_FILE_PATTERN = test-star_selection-*-*.fits 43 | VAL_SEPARATOR = - 44 | VAL_OUTPUT_DIR = full_path_to/mccd/data/outputs/ 45 | APPLY_DEGRADATION = True 46 | MCCD_DEBUG = False 47 | GLOBAL_POL_INTERP = False 48 | 49 | 50 | # Parameter description: 51 | # 52 | # 53 | # [INPUTS] 54 | # INPUT_DIR : (Required) Must be a valid directory containing the input 55 | # MCCD files. 56 | # INPUT_REGEX_FILE_PATTERN : File pattern of the input files to use. It should 57 | # follow regex (regular expression) standards. 58 | # INPUT_SEPARATOR : Separator of the different fields in the filename, 59 | # ie sexcat[SEP]catalog_id[SEP]CCD_id.fits 60 | # MIN_N_STARS : Minimum number of stars to keep a CCD for the training. 61 | # OUTLIER_STD_MAX : Maximum standard deviation used for the outlier rejection. 62 | # Should not be too low as a hihg quantity of low quality 63 | # stars will be rejected. ie 9 is a conservative rejection. 64 | # USE_SNR_WEIGHTS : Boolean to determine if the SNR weighting strategy will 65 | # be used. 66 | # For now, it needs the SNR estimations from SExtractor. 67 | # PREPROCESSED_OUTPUT_DIR : (Required) Must be a valid directory to write the 68 | # preprocessed input files. 69 | # OUTPUT_DIR : (Required) Must be a valid directory to write the output files. 70 | # The constructed models will be saved. 71 | # 72 | # 73 | # [INSTANCE] 74 | # N_COMP_LOC : Number of components of the Local model. If LOC_MODEL is poly, 75 | # will be the max degree D of the polynomial. 76 | # D_COMP_GLOB : Max degree of the global polynomial model. 77 | # KSIG_LOC : Denoising parameter of the local model. 78 | # ie 1 is a normal denoising, 3 is a hard denoising. 79 | # KSIG_GLOB : Denoising parameter of the global model. 80 | # ie 1 is a normal denoising, 3 is a hard denoising. 81 | # FILTER_PATH : Path for predefined filters. 82 | # D_HYB_LOC : Degree of the polynomial component for the local part in case 83 | # the LOC_MODEL used is 'hybrid'. 84 | # MIN_D_COMP_GLOB : The minimum degree of the polynomial for the global 85 | # component. For example, if the paramter is set to 1, the 86 | # polynomials of degree 0 and 1 will be excluded from the 87 | # global polynomial variations. ``None`` means that we are 88 | # not excluding any degree. 89 | # RMSE_THRESH : Parameter concerning the CCD outlier rejection. Once the PSF 90 | # model is calculated we perform an outlier check on the training 91 | # stars. We divide each star in two parts with a given circle. 92 | # The inner part corresponds to the most of the PSF/star energy 93 | # while the outer part corresponds to the observation background. 94 | # The outer part is used to calculate the noise level and the inner 95 | # part to calculate the model residual 96 | # (star observation - PSF model reconstruction). If the RMSE error 97 | # of the residual divided by the noise level is over the RMSE_THRESH, 98 | # the star will be considered an outlier. A perfect reconstruction 99 | # would have RMSE_THRESH equal to 1. 100 | # CCD_STAR_THRESH : Parameter concerning the CCD outlier rejection. If the 101 | # percentage of outlier stars in a single CCD is bigger than 102 | # CCD_STAR_THRESH, the CCD is considered to be an outlier. 103 | # In this case, the CCD is rejected from the PSF model. 104 | # A value lower than 0 means that no outlier rejection 105 | # will be done. 106 | # FP_GEOMETRY : Defines the geometry of the focal plane. For the moment the two 107 | # available options are 'CFIS' and 'EUCLID'. If the parameter is 108 | # not specified it defaults to 'CFIS'. 109 | # 110 | # 111 | # 112 | # [FIT] 113 | # LOC_MODEL : Defines the type of local model to use, it can be: 'rca', 114 | # 'poly' or 'hybrid'. 115 | # When the poly model is used, N_COMP_LOC should be used 116 | # as the D_LOC (max degree of the poly model) 117 | # PSF_SIZE : First guess of the PSF size. A size estimation is done anyways. 118 | # PSF_SIZE_TYPE : Type of the size information. It can be: fwhm, R2, sigma 119 | # N_EIGENVECTS : Number of eigenvectors to keep for the graph constraint 120 | # construction. 121 | # N_ITER_RCA : Number of global epochs in the algorithm. Alternation between 122 | # global and local estimations. 123 | # N_ITER_GLOB : Number of epochs for each global optimization. Alternations 124 | # between A_GLOB and S_GLOB. 125 | # N_ITER_LOC : Number of epochs for each local optimization. Alternations 126 | # between the different A_LOC and S_LOC. 127 | # NB_SUBITER_S_LOC : Iterations for the optimization algorithm over S_LOC. 128 | # NB_SUBITER_A_LOC : Iterations for the optimization algorithm over A_LOC. 129 | # NB_SUBITER_S_GLOB : Iterations for the optimization algorithm over S_GLOB. 130 | # NB_SUBITER_A_GLOB : Iterations for the optimization algorithm over A_GLOB. 131 | # 132 | # 133 | # [VALIDATION] 134 | # MODEL_INPUT_DIR : (Required) Must be a valid directory which contains the 135 | # saved trained models. 136 | # VAL_DATA_INPUT_DIR : (Required) Must be a valid directory which contains the 137 | # validation input data (test dataset). 138 | # VAL_REGEX_FILE_PATTERN : Same as INPUT_REGEX_FILE_PATTERN but for validation. 139 | # VAL_SEPARATOR : Same as INPUT_SEPARATOR but for validation. 140 | # VAL_OUTPUT_DIR : (Required) Must be a valid directory where to save the 141 | # validation outputs, test PSFs and interpolated PSFs. 142 | # APPLY_DEGRADATION : Whether the PSF models should be degraded 143 | # (sampling/shifts/flux) to match stars; use True if you 144 | # plan on making pixel-based comparisons (residuals etc.). 145 | # MCCD_DEBUG : Debug mode. Returns the local and global contributions. 146 | # GLOBAL_POL_INTERP : Uses polynomial interpolation for the global model 147 | # instead of RBF kernel interpolation. 148 | # 149 | 150 | -------------------------------------------------------------------------------- /data/sim_inputs/train_ccd_list.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/data/sim_inputs/train_ccd_list.npy -------------------------------------------------------------------------------- /data/sim_inputs/train_positions.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/data/sim_inputs/train_positions.npy -------------------------------------------------------------------------------- /develop.txt: -------------------------------------------------------------------------------- 1 | coverage>=4.5.4 2 | nose>=1.3.7 3 | pytest>=5.1.2 4 | pytest-cov>=2.7.1 5 | pytest-pep8>=1.0.6 6 | -------------------------------------------------------------------------------- /docs/_build/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 2cb0b6a8314fa71307a32adff4c35bf8 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/_build/.doctrees/about.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/about.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/changelog.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/changelog.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/citing.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/citing.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/contributing.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/contributing.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/_build/.doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/index.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/installation.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/installation.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/mccd.auxiliary_fun.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/mccd.auxiliary_fun.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/mccd.dataset_generation.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/mccd.dataset_generation.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/mccd.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/mccd.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/mccd.grads.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/mccd.grads.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/mccd.info.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/mccd.info.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/mccd.mccd.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/mccd.mccd.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/mccd.mccd_utils.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/mccd.mccd_utils.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/mccd.proxs.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/mccd.proxs.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/mccd.utils.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/mccd.utils.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/quickstart.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/quickstart.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/toc.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/toc.doctree -------------------------------------------------------------------------------- /docs/_build/.doctrees/z_ref.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/.doctrees/z_ref.doctree -------------------------------------------------------------------------------- /docs/_build/_modules/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Overview: module code | mccd v1.2.4 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Skip to content 21 |
22 |

mccd v1.2.4

23 |
29 |
30 |
63 |
64 |
65 |

All modules for which code is available

66 | 74 |
75 |
© Copyright configure_year, Tobias Liaudat Last updated: 17 Feb, 2023. Made with Sphinx 4.3.1
76 |
77 |
78 |
79 | 86 |
87 |
88 |
89 |

Enter search term

95 | 98 |
99 |
100 | 101 |
102 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /docs/_build/_sources/about.rst.txt: -------------------------------------------------------------------------------- 1 | About 2 | ===== 3 | 4 | **Multi-CCD Point Spread Function Modelling.** 5 | 6 | 7 | The non-parametric MCCD PSF modelling, or MCCD for short, is a Point Spread Function modelling 8 | pure python package. 9 | It is used to generate a PSF model based on stars observations in the field of view. 10 | Once trained, the MCCD PSF model can then recover the PSF at any position in the field of view. 11 | It has been tested on real data from the UNIONS/CFIS data with weak lensing purposes. 12 | 13 | 14 | 15 | 16 | .. tip:: 17 | 18 | Some notebook examples can be found |link-to-notebooks|. 19 | 20 | 21 | .. tip:: 22 | 23 | There is also a module with useful functions to simulate exposures. 24 | See |link-to-dataset_generation|. 25 | 26 | 27 | .. |link-to-notebooks| raw:: html 28 | 29 | here 30 | 31 | .. |link-to-dataset_generation| raw:: html 32 | 33 | dataset_generation.py 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /docs/_build/_sources/changelog.rst.txt: -------------------------------------------------------------------------------- 1 | Changelog 2 | ========= 3 | 4 | - Changed from travis deployment to github actions. 5 | Changed the github pages template. Now using the one from 6 | |link-to-pyralid-template| from |link-to-sfarrens|. 7 | 8 | - Added new module for realisitic simulations ```dataset_generation.py```. 9 | It is capable of simulating realistic simulations from the UNIONS/CFIS survey, 10 | including realistic atmospherical simulations following a realisation of a Von Kármán model. 11 | See the above-mentioned module documentation for more information. 12 | See also the ```testing-realistic-data.ipynb``` in the notebook folder for an example. 13 | 14 | - Added outlier rejection based on a pixel residual criterion. 15 | The main parameters, ```RMSE_THRESH``` and ```CCD_STAR_THRESH``` can be found in the MCCD config file. 16 | See then parameter documentation for more information. 17 | 18 | - New interpolation function useful for shape measurement pipelines. 19 | For usage inside shape measurement pipelines: new PSF interpolation 20 | function included in the MCCD model ```interpolate_psf_pipeline()```. 21 | This function allows to output interpolated PSFs with a specific centroid. 22 | 23 | - New handling of position polynomials, local as well as global polynomials. 24 | Increased model performance. 25 | 26 | - New functionalities added. 27 | Handling of the max polynomial degree in the local hybrid model by 28 | the ```D_HYB_LOC```. Also adding a parameter ```MIN_D_COMP_GLOB``` to remove 29 | lower polynomial degrees in the global polynomial model. 30 | 31 | - Increased number of iterations. 32 | Increased default number of iterations to have a better convergence in the PSF wings. 33 | 34 | - Algorithm modifications. 35 | Augmented algorithm updates to increase performance. 36 | Dropping the normalisation proximal operator. 37 | Harder sparsity constraint for spatial variations. 38 | Forcing RBF interpolation for the global part. 39 | Skipping the last weight optimization so that we always finish with a features/components optimization. 40 | 41 | - Changed default denoising. 42 | Set default denoising to zero as wavelet denoising (using starlets) introduce an 43 | important bias in the ellipticity estimates of the model. 44 | 45 | 46 | .. |link-to-pyralid-template| raw:: html 47 | 48 | pyralid-template 49 | 50 | .. |link-to-sfarrens| raw:: html 51 | 52 | sfarrens 53 | -------------------------------------------------------------------------------- /docs/_build/_sources/citing.rst.txt: -------------------------------------------------------------------------------- 1 | Citing this Package 2 | =================== 3 | 4 | We kindly request that any academic work making use of this package to cite 5 | :cite:`liaudat2020`. 6 | 7 | .. bibliography:: my_ref.bib 8 | :style: alpha 9 | -------------------------------------------------------------------------------- /docs/_build/_sources/contributing.rst.txt: -------------------------------------------------------------------------------- 1 | Contributing 2 | ============ 3 | 4 | Read our `Contribution Guidelines `_ 5 | for details on how to contribute to the development of this package. 6 | 7 | All contributors are kindly asked to adhere to the 8 | `Code of Conduct `_ 9 | at all times to ensure a safe and inclusive environment for everyone. 10 | -------------------------------------------------------------------------------- /docs/_build/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | MCCD Documentation 2 | ===================== 3 | 4 | .. Include table of contents 5 | .. include:: toc.rst 6 | 7 | :Author: |link-to-author| `(tobiasliaudat@gmail.com) `_ 8 | :Version: 1.2.1 9 | :Release Date: 25/01/2022 10 | :Repository: |link-to-repo| 11 | 12 | .. |link-to-repo| raw:: html 13 | 14 | https://github.com/CosmoStat/mccd 16 | 17 | .. |link-to-author| raw:: html 18 | 19 | Tobias Liaudat 21 | 22 | Multi-CCD PSF modelling. Modelling the Point Spread Function in all the focal plane at once. 23 | -------------------------------------------------------------------------------- /docs/_build/_sources/installation.rst.txt: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | Dependencies 5 | ------------ 6 | 7 | The following python packages should be installed with their specific dependencies: 8 | 9 | - |link-to-numpy| 10 | - |link-to-scipy| 11 | - |link-to-astropy| 12 | - |link-to-GalSim| 13 | - |link-to-ModOpt| 14 | - |link-to-pysap| 15 | 16 | It is of utmost importance that the PySAP package is correctly installed as we will be using the wavelet transforms provided by it. 17 | 18 | .. note:: 19 | 20 | The GalSim package was removed from ``requirements.txt``, it is expected to be installed (preferably with conda) before installing the MCCD package. 21 | 22 | 23 | Users 24 | ----- 25 | 26 | You can install the latest release from `PyPi `_ 27 | as follows: 28 | 29 | .. code-block:: bash 30 | 31 | pip install mccd 32 | 33 | 34 | Alternatively clone the repository and build the package locally as follows: 35 | 36 | .. code-block:: bash 37 | 38 | pip install . 39 | 40 | 41 | Developers 42 | ---------- 43 | 44 | Developers are recommend to clone the repository and build the package locally 45 | in development mode with testing and documentation packages as follows: 46 | 47 | .. code-block:: bash 48 | 49 | pip install -e . 50 | 51 | 52 | 53 | 54 | 55 | .. |link-to-numpy| raw:: html 56 | 57 | Numpy 58 | 59 | .. |link-to-scipy| raw:: html 60 | 61 | Scipy 62 | 63 | .. |link-to-astropy| raw:: html 64 | 65 | astropy 66 | 67 | .. |link-to-GalSim| raw:: html 68 | 69 | GalSim 70 | 71 | .. |link-to-ModOpt| raw:: html 72 | 73 | ModOpt 74 | 75 | .. |link-to-pysap| raw:: html 76 | 77 | PySap 78 | 79 | -------------------------------------------------------------------------------- /docs/_build/_sources/mccd.auxiliary_fun.rst.txt: -------------------------------------------------------------------------------- 1 | mccd.auxiliary\_fun 2 | ------------------- 3 | 4 | .. automodule:: mccd.auxiliary_fun 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/_build/_sources/mccd.dataset_generation.rst.txt: -------------------------------------------------------------------------------- 1 | mccd.dataset\_generation 2 | ------------------------ 3 | 4 | .. automodule:: mccd.dataset_generation 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/_build/_sources/mccd.grads.rst.txt: -------------------------------------------------------------------------------- 1 | mccd.grads 2 | ---------- 3 | 4 | .. automodule:: mccd.grads 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/_build/_sources/mccd.info.rst.txt: -------------------------------------------------------------------------------- 1 | mccd.info 2 | --------- 3 | 4 | .. automodule:: mccd.info 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/_build/_sources/mccd.mccd.rst.txt: -------------------------------------------------------------------------------- 1 | mccd.mccd 2 | --------- 3 | 4 | .. automodule:: mccd.mccd 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/_build/_sources/mccd.mccd_utils.rst.txt: -------------------------------------------------------------------------------- 1 | mccd.mccd\_utils 2 | ---------------- 3 | 4 | .. automodule:: mccd.mccd_utils 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/_build/_sources/mccd.proxs.rst.txt: -------------------------------------------------------------------------------- 1 | mccd.proxs 2 | ---------- 3 | 4 | .. automodule:: mccd.proxs 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/_build/_sources/mccd.rst.txt: -------------------------------------------------------------------------------- 1 | mccd 2 | ==== 3 | 4 | 5 | .. automodule:: mccd 6 | :members: 7 | :undoc-members: 8 | :show-inheritance: 9 | 10 | Submodules 11 | ---------- 12 | 13 | .. toctree:: 14 | :maxdepth: 4 15 | 16 | mccd.auxiliary_fun 17 | mccd.dataset_generation 18 | mccd.grads 19 | mccd.info 20 | mccd.mccd 21 | mccd.mccd_utils 22 | mccd.proxs 23 | mccd.utils 24 | -------------------------------------------------------------------------------- /docs/_build/_sources/mccd.utils.rst.txt: -------------------------------------------------------------------------------- 1 | mccd.utils 2 | ---------- 3 | 4 | .. automodule:: mccd.utils 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/_build/_sources/quickstart.rst.txt: -------------------------------------------------------------------------------- 1 | Quickstart Tutorial 2 | =================== 3 | 4 | 5 | You can import the package as follows: 6 | 7 | .. code-block:: python 8 | 9 | import mccd 10 | 11 | 12 | The easiest usage of the method is to go through the configuration file ``config_MCCD.ini`` using the helper classes found 13 | in |link-to-auxiliary_fun_py| 14 | (|link-to-documentation-aux|). 15 | Description of the parameters can be found directly in the configuration file |link-to-config_MCCD_ini|. 16 | The MCCD method can handle SExtractor dataset as input catalogs given that they follow an appropriate naming convention. 17 | 18 | The main MCCD model parameters are: 19 | 20 | - ``LOC_MODEL``: Indicating the type of local model to be used (MCCD-HYB, MCCD-RCA, or MCCD-POL), 21 | - ``N_COMP_LOC``: Indicating the number of eigenPSFs to use in the local model. 22 | - ``D_COMP_GLOB``: Indicating the maximum polynomial degree for the global model. 23 | 24 | After setting up all the parameters from the configuration file there are three main functions, one to fit the model, 25 | one to validate the model and the last one to fit and then validate the model. The usage is as follows: 26 | 27 | .. code-block:: python 28 | 29 | import mccd 30 | 31 | config_file_path = 'path_to_config_file.ini' 32 | 33 | run_mccd_instance = mccd.auxiliary_fun.RunMCCD(config_file_path, 34 | fits_table_pos=1) 35 | 36 | run_mccd_instance.fit_MCCD_models() 37 | 38 | 39 | For the validation one should replace the last line with: 40 | 41 | .. code-block:: python 42 | 43 | run_mccd_instance.validate_MCCD_models() 44 | 45 | 46 | Finally for the fit and validation one should change the last line to: 47 | 48 | .. code-block:: python 49 | 50 | run_mccd_instance.run_MCCD() 51 | 52 | 53 | All the output file will be saved on the directories specified on the configuration files. 54 | 55 | 56 | PSF recovery 57 | ------------ 58 | 59 | To recover PSFs from the model at specific positions ```test_pos``` from 60 | the CCD ```ccd_id``` one could use the following example: 61 | 62 | .. code-block:: python 63 | 64 | import numpy as np 65 | import mccd 66 | 67 | config_file_path = 'path_to_config_file.ini' 68 | mccd_model_path = 'path_to_fitted_mccd_model.npy' 69 | test_pos = np.load(..) 70 | ccd_id = np.load(..) 71 | local_pos = True 72 | 73 | mccd_instance = mccd.auxiliary_fun.RunMCCD(config_file_path, 74 | fits_table_pos=1) 75 | 76 | rec_PSFs = mccd_instance.recover_MCCD_PSFs(mccd_model_path, 77 | positions=test_pos, 78 | ccd_id=ccd_id, 79 | local_pos=local_pos) 80 | 81 | 82 | See the |link-to-documentation| 83 | of the ```recover_MCCD_PSFs()``` function for more information. 84 | 85 | 86 | Extra information 87 | ----------------- 88 | 89 | .. tip:: 90 | 91 | There are more interpolation functions. For usage inside shape measurement pipelines, the 92 | new PSF interpolation function included in the MCCD model ```interpolate_psf_pipeline()```. 93 | This function allows to output interpolated PSFs with a specific centroid. 94 | 95 | 96 | 97 | .. |link-to-documentation| raw:: html 98 | 99 | documentation 100 | 101 | 102 | .. |link-to-auxiliary_fun_py| raw:: html 103 | 104 | auxiliary_fun.py 105 | 106 | 107 | .. |link-to-documentation-aux| raw:: html 108 | 109 | documentation 110 | 111 | .. |link-to-config_MCCD_ini| raw:: html 112 | 113 | config_MCCD.ini 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /docs/_build/_sources/toc.rst.txt: -------------------------------------------------------------------------------- 1 | .. Toctrees define sidebar contents 2 | 3 | .. toctree:: 4 | :hidden: 5 | :titlesonly: 6 | :caption: Getting Started 7 | 8 | about 9 | installation 10 | quickstart 11 | changelog 12 | 13 | .. toctree:: 14 | :hidden: 15 | :titlesonly: 16 | :caption: API Documentation 17 | 18 | mccd 19 | z_ref 20 | 21 | .. toctree:: 22 | :hidden: 23 | :titlesonly: 24 | :caption: Guidelines 25 | 26 | contributing 27 | citing 28 | -------------------------------------------------------------------------------- /docs/_build/_sources/z_ref.rst.txt: -------------------------------------------------------------------------------- 1 | References 2 | ========== 3 | 4 | .. bibliography:: refs.bib 5 | :style: alpha 6 | -------------------------------------------------------------------------------- /docs/_build/_static/0d8bb5b3ee5f5dac9e446d48480d28a9.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/0d8bb5b3ee5f5dac9e446d48480d28a9.woff2 -------------------------------------------------------------------------------- /docs/_build/_static/176f8f5bd5f02b3abfcf894955d7e919.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/176f8f5bd5f02b3abfcf894955d7e919.woff2 -------------------------------------------------------------------------------- /docs/_build/_static/18d00f739ff1e1c52db1a1c0d9e98129.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/18d00f739ff1e1c52db1a1c0d9e98129.woff -------------------------------------------------------------------------------- /docs/_build/_static/1c2e1cdea02e7dfab25424e6e42d7973.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/1c2e1cdea02e7dfab25424e6e42d7973.woff2 -------------------------------------------------------------------------------- /docs/_build/_static/1ed72cb00dc79e545eb2f86b41a14560.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/1ed72cb00dc79e545eb2f86b41a14560.woff -------------------------------------------------------------------------------- /docs/_build/_static/38b17c60ba71b3aa71c29b0493e6607d.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/38b17c60ba71b3aa71c29b0493e6607d.woff -------------------------------------------------------------------------------- /docs/_build/_static/49ae34d4cc6b98c00c69ab4c41de3e0c.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/49ae34d4cc6b98c00c69ab4c41de3e0c.woff -------------------------------------------------------------------------------- /docs/_build/_static/4a0ed4c488992e375e9793218146647b.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/4a0ed4c488992e375e9793218146647b.woff -------------------------------------------------------------------------------- /docs/_build/_static/647f3654373165e51135a4fddf0006a9.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/647f3654373165e51135a4fddf0006a9.woff2 -------------------------------------------------------------------------------- /docs/_build/_static/b1d9d9904bfca8802a631c45590b9efa.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/b1d9d9904bfca8802a631c45590b9efa.woff -------------------------------------------------------------------------------- /docs/_build/_static/cba8e90503370863b3a0036bda7b0e44.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/cba8e90503370863b3a0036bda7b0e44.woff -------------------------------------------------------------------------------- /docs/_build/_static/cea99d3e3e13a3a599a015c29f1046d0.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/cea99d3e3e13a3a599a015c29f1046d0.woff -------------------------------------------------------------------------------- /docs/_build/_static/d022bc70dc1bf7b3425da9cdaa9841b6.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/d022bc70dc1bf7b3425da9cdaa9841b6.woff2 -------------------------------------------------------------------------------- /docs/_build/_static/d4e12e8e9e242435ab9cbd5a2086ca2c.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/d4e12e8e9e242435ab9cbd5a2086ca2c.woff2 -------------------------------------------------------------------------------- /docs/_build/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | * 33 | * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL 34 | */ 35 | jQuery.urldecode = function(x) { 36 | if (!x) { 37 | return x 38 | } 39 | return decodeURIComponent(x.replace(/\+/g, ' ')); 40 | }; 41 | 42 | /** 43 | * small helper function to urlencode strings 44 | */ 45 | jQuery.urlencode = encodeURIComponent; 46 | 47 | /** 48 | * This function returns the parsed url parameters of the 49 | * current request. Multiple values per key are supported, 50 | * it will always return arrays of strings for the value parts. 51 | */ 52 | jQuery.getQueryParameters = function(s) { 53 | if (typeof s === 'undefined') 54 | s = document.location.search; 55 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 56 | var result = {}; 57 | for (var i = 0; i < parts.length; i++) { 58 | var tmp = parts[i].split('=', 2); 59 | var key = jQuery.urldecode(tmp[0]); 60 | var value = jQuery.urldecode(tmp[1]); 61 | if (key in result) 62 | result[key].push(value); 63 | else 64 | result[key] = [value]; 65 | } 66 | return result; 67 | }; 68 | 69 | /** 70 | * highlight a given string on a jquery object by wrapping it in 71 | * span elements with the given class name. 72 | */ 73 | jQuery.fn.highlightText = function(text, className) { 74 | function highlight(node, addItems) { 75 | if (node.nodeType === 3) { 76 | var val = node.nodeValue; 77 | var pos = val.toLowerCase().indexOf(text); 78 | if (pos >= 0 && 79 | !jQuery(node.parentNode).hasClass(className) && 80 | !jQuery(node.parentNode).hasClass("nohighlight")) { 81 | var span; 82 | var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); 83 | if (isInSVG) { 84 | span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); 85 | } else { 86 | span = document.createElement("span"); 87 | span.className = className; 88 | } 89 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 90 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 91 | document.createTextNode(val.substr(pos + text.length)), 92 | node.nextSibling)); 93 | node.nodeValue = val.substr(0, pos); 94 | if (isInSVG) { 95 | var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); 96 | var bbox = node.parentElement.getBBox(); 97 | rect.x.baseVal.value = bbox.x; 98 | rect.y.baseVal.value = bbox.y; 99 | rect.width.baseVal.value = bbox.width; 100 | rect.height.baseVal.value = bbox.height; 101 | rect.setAttribute('class', className); 102 | addItems.push({ 103 | "parent": node.parentNode, 104 | "target": rect}); 105 | } 106 | } 107 | } 108 | else if (!jQuery(node).is("button, select, textarea")) { 109 | jQuery.each(node.childNodes, function() { 110 | highlight(this, addItems); 111 | }); 112 | } 113 | } 114 | var addItems = []; 115 | var result = this.each(function() { 116 | highlight(this, addItems); 117 | }); 118 | for (var i = 0; i < addItems.length; ++i) { 119 | jQuery(addItems[i].parent).before(addItems[i].target); 120 | } 121 | return result; 122 | }; 123 | 124 | /* 125 | * backward compatibility for jQuery.browser 126 | * This will be supported until firefox bug is fixed. 127 | */ 128 | if (!jQuery.browser) { 129 | jQuery.uaMatch = function(ua) { 130 | ua = ua.toLowerCase(); 131 | 132 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 133 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 134 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 135 | /(msie) ([\w.]+)/.exec(ua) || 136 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 137 | []; 138 | 139 | return { 140 | browser: match[ 1 ] || "", 141 | version: match[ 2 ] || "0" 142 | }; 143 | }; 144 | jQuery.browser = {}; 145 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 146 | } 147 | 148 | /** 149 | * Small JavaScript module for the documentation. 150 | */ 151 | var Documentation = { 152 | 153 | init : function() { 154 | this.fixFirefoxAnchorBug(); 155 | this.highlightSearchWords(); 156 | this.initIndexTable(); 157 | if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { 158 | this.initOnKeyListeners(); 159 | } 160 | }, 161 | 162 | /** 163 | * i18n support 164 | */ 165 | TRANSLATIONS : {}, 166 | PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, 167 | LOCALE : 'unknown', 168 | 169 | // gettext and ngettext don't access this so that the functions 170 | // can safely bound to a different name (_ = Documentation.gettext) 171 | gettext : function(string) { 172 | var translated = Documentation.TRANSLATIONS[string]; 173 | if (typeof translated === 'undefined') 174 | return string; 175 | return (typeof translated === 'string') ? translated : translated[0]; 176 | }, 177 | 178 | ngettext : function(singular, plural, n) { 179 | var translated = Documentation.TRANSLATIONS[singular]; 180 | if (typeof translated === 'undefined') 181 | return (n == 1) ? singular : plural; 182 | return translated[Documentation.PLURALEXPR(n)]; 183 | }, 184 | 185 | addTranslations : function(catalog) { 186 | for (var key in catalog.messages) 187 | this.TRANSLATIONS[key] = catalog.messages[key]; 188 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 189 | this.LOCALE = catalog.locale; 190 | }, 191 | 192 | /** 193 | * add context elements like header anchor links 194 | */ 195 | addContextElements : function() { 196 | $('div[id] > :header:first').each(function() { 197 | $('\u00B6'). 198 | attr('href', '#' + this.id). 199 | attr('title', _('Permalink to this headline')). 200 | appendTo(this); 201 | }); 202 | $('dt[id]').each(function() { 203 | $('\u00B6'). 204 | attr('href', '#' + this.id). 205 | attr('title', _('Permalink to this definition')). 206 | appendTo(this); 207 | }); 208 | }, 209 | 210 | /** 211 | * workaround a firefox stupidity 212 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 213 | */ 214 | fixFirefoxAnchorBug : function() { 215 | if (document.location.hash && $.browser.mozilla) 216 | window.setTimeout(function() { 217 | document.location.href += ''; 218 | }, 10); 219 | }, 220 | 221 | /** 222 | * highlight the search words provided in the url in the text 223 | */ 224 | highlightSearchWords : function() { 225 | var params = $.getQueryParameters(); 226 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 227 | if (terms.length) { 228 | var body = $('div.body'); 229 | if (!body.length) { 230 | body = $('body'); 231 | } 232 | window.setTimeout(function() { 233 | $.each(terms, function() { 234 | body.highlightText(this.toLowerCase(), 'highlighted'); 235 | }); 236 | }, 10); 237 | $('') 239 | .appendTo($('#searchbox')); 240 | } 241 | }, 242 | 243 | /** 244 | * init the domain index toggle buttons 245 | */ 246 | initIndexTable : function() { 247 | var togglers = $('img.toggler').click(function() { 248 | var src = $(this).attr('src'); 249 | var idnum = $(this).attr('id').substr(7); 250 | $('tr.cg-' + idnum).toggle(); 251 | if (src.substr(-9) === 'minus.png') 252 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 253 | else 254 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 255 | }).css('display', ''); 256 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 257 | togglers.click(); 258 | } 259 | }, 260 | 261 | /** 262 | * helper function to hide the search marks again 263 | */ 264 | hideSearchWords : function() { 265 | $('#searchbox .highlight-link').fadeOut(300); 266 | $('span.highlighted').removeClass('highlighted'); 267 | }, 268 | 269 | /** 270 | * make the url absolute 271 | */ 272 | makeURL : function(relativeURL) { 273 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 274 | }, 275 | 276 | /** 277 | * get the current relative url 278 | */ 279 | getCurrentURL : function() { 280 | var path = document.location.pathname; 281 | var parts = path.split(/\//); 282 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 283 | if (this === '..') 284 | parts.pop(); 285 | }); 286 | var url = parts.join('/'); 287 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 288 | }, 289 | 290 | initOnKeyListeners: function() { 291 | $(document).keydown(function(event) { 292 | var activeElementType = document.activeElement.tagName; 293 | // don't navigate when in search box, textarea, dropdown or button 294 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' 295 | && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey 296 | && !event.shiftKey) { 297 | switch (event.keyCode) { 298 | case 37: // left 299 | var prevHref = $('link[rel="prev"]').prop('href'); 300 | if (prevHref) { 301 | window.location.href = prevHref; 302 | return false; 303 | } 304 | break; 305 | case 39: // right 306 | var nextHref = $('link[rel="next"]').prop('href'); 307 | if (nextHref) { 308 | window.location.href = nextHref; 309 | return false; 310 | } 311 | break; 312 | } 313 | } 314 | }); 315 | } 316 | }; 317 | 318 | // quick alias for translations 319 | _ = Documentation.gettext; 320 | 321 | $(document).ready(function() { 322 | Documentation.init(); 323 | }); 324 | -------------------------------------------------------------------------------- /docs/_build/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '', 4 | LANGUAGE: 'None', 5 | COLLAPSE_INDEX: false, 6 | BUILDER: 'html', 7 | FILE_SUFFIX: '.html', 8 | LINK_SUFFIX: '.html', 9 | HAS_SOURCE: true, 10 | SOURCELINK_SUFFIX: '.txt', 11 | NAVIGATION_WITH_KEYS: true 12 | }; -------------------------------------------------------------------------------- /docs/_build/_static/f5b74d7ffcdf85b9dd60130fa0b2c087.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/f5b74d7ffcdf85b9dd60130fa0b2c087.woff2 -------------------------------------------------------------------------------- /docs/_build/_static/fe990f0633a16121db07a88a65858aee.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/fe990f0633a16121db07a88a65858aee.woff2 -------------------------------------------------------------------------------- /docs/_build/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/file.png -------------------------------------------------------------------------------- /docs/_build/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/minus.png -------------------------------------------------------------------------------- /docs/_build/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/_static/plus.png -------------------------------------------------------------------------------- /docs/_build/_static/pygments.css: -------------------------------------------------------------------------------- 1 | pre { line-height: 125%; } 2 | td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } 3 | span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } 4 | td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } 5 | span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } 6 | .highlight .hll { background-color: #ffffcc } 7 | .highlight { background: #f8f8f8; } 8 | .highlight .c { color: #3D7B7B; font-style: italic } /* Comment */ 9 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 10 | .highlight .k { color: #008000; font-weight: bold } /* Keyword */ 11 | .highlight .o { color: #666666 } /* Operator */ 12 | .highlight .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */ 13 | .highlight .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */ 14 | .highlight .cp { color: #9C6500 } /* Comment.Preproc */ 15 | .highlight .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */ 16 | .highlight .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */ 17 | .highlight .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */ 18 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 19 | .highlight .ge { font-style: italic } /* Generic.Emph */ 20 | .highlight .gr { color: #E40000 } /* Generic.Error */ 21 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 22 | .highlight .gi { color: #008400 } /* Generic.Inserted */ 23 | .highlight .go { color: #717171 } /* Generic.Output */ 24 | .highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ 25 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 26 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 27 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 28 | .highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ 29 | .highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ 30 | .highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ 31 | .highlight .kp { color: #008000 } /* Keyword.Pseudo */ 32 | .highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ 33 | .highlight .kt { color: #B00040 } /* Keyword.Type */ 34 | .highlight .m { color: #666666 } /* Literal.Number */ 35 | .highlight .s { color: #BA2121 } /* Literal.String */ 36 | .highlight .na { color: #687822 } /* Name.Attribute */ 37 | .highlight .nb { color: #008000 } /* Name.Builtin */ 38 | .highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */ 39 | .highlight .no { color: #880000 } /* Name.Constant */ 40 | .highlight .nd { color: #AA22FF } /* Name.Decorator */ 41 | .highlight .ni { color: #717171; font-weight: bold } /* Name.Entity */ 42 | .highlight .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */ 43 | .highlight .nf { color: #0000FF } /* Name.Function */ 44 | .highlight .nl { color: #767600 } /* Name.Label */ 45 | .highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ 46 | .highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */ 47 | .highlight .nv { color: #19177C } /* Name.Variable */ 48 | .highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ 49 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 50 | .highlight .mb { color: #666666 } /* Literal.Number.Bin */ 51 | .highlight .mf { color: #666666 } /* Literal.Number.Float */ 52 | .highlight .mh { color: #666666 } /* Literal.Number.Hex */ 53 | .highlight .mi { color: #666666 } /* Literal.Number.Integer */ 54 | .highlight .mo { color: #666666 } /* Literal.Number.Oct */ 55 | .highlight .sa { color: #BA2121 } /* Literal.String.Affix */ 56 | .highlight .sb { color: #BA2121 } /* Literal.String.Backtick */ 57 | .highlight .sc { color: #BA2121 } /* Literal.String.Char */ 58 | .highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */ 59 | .highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ 60 | .highlight .s2 { color: #BA2121 } /* Literal.String.Double */ 61 | .highlight .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */ 62 | .highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */ 63 | .highlight .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */ 64 | .highlight .sx { color: #008000 } /* Literal.String.Other */ 65 | .highlight .sr { color: #A45A77 } /* Literal.String.Regex */ 66 | .highlight .s1 { color: #BA2121 } /* Literal.String.Single */ 67 | .highlight .ss { color: #19177C } /* Literal.String.Symbol */ 68 | .highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */ 69 | .highlight .fm { color: #0000FF } /* Name.Function.Magic */ 70 | .highlight .vc { color: #19177C } /* Name.Variable.Class */ 71 | .highlight .vg { color: #19177C } /* Name.Variable.Global */ 72 | .highlight .vi { color: #19177C } /* Name.Variable.Instance */ 73 | .highlight .vm { color: #19177C } /* Name.Variable.Magic */ 74 | .highlight .il { color: #666666 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/_build/_static/theme.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * clipboard.js v2.0.6 3 | * https://clipboardjs.com/ 4 | * 5 | * Licensed MIT © Zeno Rocha 6 | */ 7 | -------------------------------------------------------------------------------- /docs/_build/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | About | mccd v1.2.4 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Skip to content 24 |
25 |

mccd v1.2.4

26 |
32 |
33 |
66 |
67 |
68 |
69 |

About

70 |

Multi-CCD Point Spread Function Modelling.

71 |

The non-parametric MCCD PSF modelling, or MCCD for short, is a Point Spread Function modelling 72 | pure python package. 73 | It is used to generate a PSF model based on stars observations in the field of view. 74 | Once trained, the MCCD PSF model can then recover the PSF at any position in the field of view. 75 | It has been tested on real data from the UNIONS/CFIS data with weak lensing purposes.

76 |
77 |

Tip

78 |

Some notebook examples can be found here.

79 |
80 |
81 |

Tip

82 |

There is also a module with useful functions to simulate exposures. 83 | See dataset_generation.py.

84 |
85 |
86 |
87 |
© Copyright configure_year, Tobias Liaudat Last updated: 17 Feb, 2023. Made with Sphinx 4.3.1
88 |
89 |
90 |
91 | 98 |
99 |
100 |
101 |

Enter search term

107 | 110 |
111 |
112 | 113 |
114 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /docs/_build/citing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Citing this Package | mccd v1.2.4 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Skip to content 23 |
24 |

mccd v1.2.4

25 |
31 |
32 |
65 |
66 |
67 |
68 |

Citing this Package

69 |

We kindly request that any academic work making use of this package to cite 70 | [LiaudatTBonninJStarckJL+21].

71 |

72 |
LiaudatTBonninJStarckJL+21
73 |

Liaudat, T., Bonnin, J., Starck, J.-L., Schmitz, M. A., Guinot, A., Kilbinger, M., and Gwyn, S. D. J. Multi-ccd modelling of the point spread function. A&A, 646:A27, 2021. URL: https://doi.org/10.1051/0004-6361/202039584, doi:10.1051/0004-6361/202039584.

74 |
75 |
76 |

77 |
78 |
79 |
© Copyright configure_year, Tobias Liaudat Last updated: 17 Feb, 2023. Made with Sphinx 4.3.1
80 |
81 |
82 |
83 | 90 |
91 |
92 |
93 |

Enter search term

99 | 102 |
103 |
104 | 105 |
106 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /docs/_build/contributing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Contributing | mccd v1.2.4 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Skip to content 24 |
25 |

mccd v1.2.4

26 |
32 |
33 |
66 |
67 |
68 |
69 |

Contributing

70 |

Read our Contribution Guidelines 71 | for details on how to contribute to the development of this package.

72 |

All contributors are kindly asked to adhere to the 73 | Code of Conduct 74 | at all times to ensure a safe and inclusive environment for everyone.

75 |
76 |
77 |
© Copyright configure_year, Tobias Liaudat Last updated: 17 Feb, 2023. Made with Sphinx 4.3.1
78 |
79 |
80 |
81 | 88 |
89 |
90 |
91 |

Enter search term

97 | 100 |
101 |
102 | 103 |
104 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /docs/_build/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | MCCD Documentation | mccd v1.2.4 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Skip to content 23 |
24 |

mccd v1.2.4

25 |
31 |
32 |
65 |
66 |
67 |
68 |

MCCD Documentation

69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
Author
77 |

Tobias Liaudat (tobiasliaudat@gmail.com)

78 |
79 |
Version
80 |

1.2.1

81 |
82 |
Release Date
83 |

25/01/2022

84 |
85 |
Repository
86 |

https://github.com/CosmoStat/mccd

87 |
88 |
89 |

Multi-CCD PSF modelling. Modelling the Point Spread Function in all the focal plane at once.

90 |
91 |
92 |
© Copyright configure_year, Tobias Liaudat Last updated: 17 Feb, 2023. Made with Sphinx 4.3.1
93 |
94 |
95 |
96 | 103 |
104 |
105 |
106 |

Enter search term

112 | 115 |
116 |
117 | 118 |
119 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /docs/_build/mccd.info.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | mccd.info | mccd v1.2.4 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Skip to content 24 |
25 |

mccd v1.2.4

26 |
32 |
33 |
66 |
67 |
68 |
69 |

mccd.info

70 |

PACKAGE INFO.

71 |

This module provides some basic information about the package.

72 |
73 |
74 |
© Copyright configure_year, Tobias Liaudat Last updated: 17 Feb, 2023. Made with Sphinx 4.3.1
75 |
76 |
77 |
78 | 85 |
86 |
87 |
88 |

Enter search term

94 | 97 |
98 |
99 | 100 |
101 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /docs/_build/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmoStat/mccd/863b13b2316996a8ea075e01b85f8977bb2ad676/docs/_build/objects.inv -------------------------------------------------------------------------------- /docs/_build/py-modindex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Python Module Index | mccd v1.2.4 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Skip to content 21 |
22 |

mccd v1.2.4

23 |
29 |
30 |
63 |
64 |
65 |

Python Module Index

66 |
67 | m 68 |
69 | 70 | 71 | 73 | 74 | 75 | 78 | 79 | 80 | 83 | 84 | 85 | 88 | 89 | 90 | 93 | 94 | 95 | 98 | 99 | 100 | 103 | 104 | 105 | 108 | 109 | 110 | 113 | 114 | 115 | 118 |
 
72 | m
76 | mccd 77 |
    81 | mccd.auxiliary_fun 82 |
    86 | mccd.dataset_generation 87 |
    91 | mccd.grads 92 |
    96 | mccd.info 97 |
    101 | mccd.mccd 102 |
    106 | mccd.mccd_utils 107 |
    111 | mccd.proxs 112 |
    116 | mccd.utils 117 |
119 |
120 |
© Copyright configure_year, Tobias Liaudat Last updated: 17 Feb, 2023. Made with Sphinx 4.3.1
121 |
122 |
123 |
124 | 131 |
132 |
133 |
134 |

Enter search term

140 | 143 |
144 |
145 | 146 |
147 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /docs/_build/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Search | mccd v1.2.4 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Skip to content 21 |
22 |

mccd v1.2.4

23 |
29 |
30 |
63 |
64 |
65 |
66 | 67 | 68 | Please activate Javascript to enable searching the documentation. 69 | 70 |
71 |
72 |
73 |
© Copyright configure_year, Tobias Liaudat Last updated: 17 Feb, 2023. Made with Sphinx 4.3.1
74 |
75 |
76 |
77 | 84 |
85 |
86 |
87 |

Enter search term

93 | 96 |
97 |
98 | 99 |
100 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /docs/_build/toc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | <no title> | mccd v1.2.4 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | Skip to content 22 |
23 |

mccd v1.2.4

24 |
30 |
31 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
© Copyright configure_year, Tobias Liaudat Last updated: 17 Feb, 2023. Made with Sphinx 4.3.1
74 |
75 |
76 |
77 | 84 |
85 |
86 |
87 |

Enter search term

93 | 96 |
97 |
98 | 99 |
100 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /docs/_build/z_ref.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | References | mccd v1.2.4 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Skip to content 24 |
25 |

mccd v1.2.4

26 |
32 |
33 |
66 |
67 |
68 |
69 |

References

70 |
71 |
72 |
© Copyright configure_year, Tobias Liaudat Last updated: 17 Feb, 2023. Made with Sphinx 4.3.1
73 |
74 |
75 |
76 | 83 |
84 |
85 |
86 |

Enter search term

92 | 95 |
96 |
97 | 98 |
99 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /docs/_script_templates/module.rst_t: -------------------------------------------------------------------------------- 1 | {%- if show_headings %} 2 | {{- basename | e | heading(2) }} 3 | 4 | {% endif -%} 5 | .. automodule:: {{ qualname }} 6 | {%- for option in automodule_options %} 7 | :{{ option }}: 8 | {%- endfor %} 9 | -------------------------------------------------------------------------------- /docs/_script_templates/package.rst_t: -------------------------------------------------------------------------------- 1 | {%- macro automodule(modname, options) -%} 2 | .. automodule:: {{ modname }} 3 | {%- for option in options %} 4 | :{{ option }}: 5 | {%- endfor %} 6 | {%- endmacro %} 7 | 8 | {%- macro toctree(docnames) -%} 9 | .. toctree:: 10 | :maxdepth: {{ maxdepth }} 11 | {% for docname in docnames %} 12 | {{ docname }} 13 | {%- endfor %} 14 | {%- endmacro %} 15 | 16 | {%- if is_namespace %} 17 | {{- [pkgname, "namespace"] | join(" ") | e | heading }} 18 | {% else %} 19 | {{- pkgname | e | heading }} 20 | 21 | {% endif %} 22 | 23 | {%- if modulefirst and not is_namespace %} 24 | {{ automodule(pkgname, automodule_options) }} 25 | {% endif %} 26 | 27 | {%- if subpackages %} 28 | Subpackages 29 | ----------- 30 | 31 | {{ toctree(subpackages) }} 32 | {% endif %} 33 | 34 | {%- if submodules %} 35 | List of Scripts 36 | --------------- 37 | {% if separatemodules %} 38 | {{ toctree(submodules) }} 39 | {% else %} 40 | {%- for submodule in submodules %} 41 | {% if show_headings %} 42 | {{- submodule | e | heading(2) }} 43 | {% endif %} 44 | {{ automodule(submodule, automodule_options) }} 45 | {% endfor %} 46 | {%- endif %} 47 | {%- endif %} 48 | 49 | {%- if not modulefirst and not is_namespace %} 50 | Module contents 51 | --------------- 52 | 53 | {{ automodule(pkgname, automodule_options) }} 54 | {% endif %} 55 | -------------------------------------------------------------------------------- /docs/_script_templates/toc.rst_t: -------------------------------------------------------------------------------- 1 | {{ header | heading }} 2 | 3 | .. toctree:: 4 | :maxdepth: {{ maxdepth }} 5 | {% for docname in docnames %} 6 | {{ docname }} 7 | {%- endfor %} 8 | 9 | -------------------------------------------------------------------------------- /docs/_templates/module.rst_t: -------------------------------------------------------------------------------- 1 | {%- if show_headings %} 2 | {{- basename | e | heading(2) }} 3 | 4 | {% endif -%} 5 | .. automodule:: {{ qualname }} 6 | {%- for option in automodule_options %} 7 | :{{ option }}: 8 | {%- endfor %} 9 | -------------------------------------------------------------------------------- /docs/_templates/package.rst_t: -------------------------------------------------------------------------------- 1 | {%- macro automodule(modname, options) -%} 2 | .. automodule:: {{ modname }} 3 | {%- for option in options %} 4 | :{{ option }}: 5 | {%- endfor %} 6 | {%- endmacro %} 7 | 8 | {%- macro toctree(docnames) -%} 9 | .. toctree:: 10 | :maxdepth: {{ maxdepth }} 11 | {% for docname in docnames %} 12 | {{ docname }} 13 | {%- endfor %} 14 | {%- endmacro %} 15 | 16 | {%- if is_namespace %} 17 | {{- [pkgname, "namespace"] | join(" ") | e | heading }} 18 | {% else %} 19 | {{- pkgname | e | heading }} 20 | 21 | {% endif %} 22 | 23 | {%- if modulefirst and not is_namespace %} 24 | {{ automodule(pkgname, automodule_options) }} 25 | {% endif %} 26 | 27 | {%- if subpackages %} 28 | Subpackages 29 | ----------- 30 | 31 | {{ toctree(subpackages) }} 32 | {% endif %} 33 | 34 | {%- if submodules %} 35 | Submodules 36 | ---------- 37 | {% if separatemodules %} 38 | {{ toctree(submodules) }} 39 | {% else %} 40 | {%- for submodule in submodules %} 41 | {% if show_headings %} 42 | {{- submodule | e | heading(2) }} 43 | {% endif %} 44 | {{ automodule(submodule, automodule_options) }} 45 | {% endfor %} 46 | {%- endif %} 47 | {%- endif %} 48 | 49 | {%- if not modulefirst and not is_namespace %} 50 | Module contents 51 | --------------- 52 | 53 | {{ automodule(pkgname, automodule_options) }} 54 | {% endif %} 55 | -------------------------------------------------------------------------------- /docs/_templates/toc.rst_t: -------------------------------------------------------------------------------- 1 | {{ header | heading }} 2 | 3 | .. toctree:: 4 | :maxdepth: {{ maxdepth }} 5 | {% for docname in docnames %} 6 | {{ docname }} 7 | {%- endfor %} 8 | 9 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | jupyter==1.0.0 2 | myst-parser==0.16.1 3 | nbsphinx==0.8.7 4 | nbsphinx-link==1.3.0 5 | numpydoc==1.1.0 6 | sphinx==4.3.1 7 | sphinx-gallery==0.10.1 8 | sphinxcontrib-bibtex==2.4.1 9 | sphinx-book-theme==0.3.2 10 | sphinxawesome-theme==1.17.0 -------------------------------------------------------------------------------- /docs/source/about.rst: -------------------------------------------------------------------------------- 1 | About 2 | ===== 3 | 4 | **Multi-CCD Point Spread Function Modelling.** 5 | 6 | 7 | The non-parametric MCCD PSF modelling, or MCCD for short, is a Point Spread Function modelling 8 | pure python package. 9 | It is used to generate a PSF model based on stars observations in the field of view. 10 | Once trained, the MCCD PSF model can then recover the PSF at any position in the field of view. 11 | It has been tested on real data from the UNIONS/CFIS data with weak lensing purposes. 12 | 13 | 14 | 15 | 16 | .. tip:: 17 | 18 | Some notebook examples can be found |link-to-notebooks|. 19 | 20 | 21 | .. tip:: 22 | 23 | There is also a module with useful functions to simulate exposures. 24 | See |link-to-dataset_generation|. 25 | 26 | 27 | .. |link-to-notebooks| raw:: html 28 | 29 | here 30 | 31 | .. |link-to-dataset_generation| raw:: html 32 | 33 | dataset_generation.py 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /docs/source/changelog.rst: -------------------------------------------------------------------------------- 1 | Changelog 2 | ========= 3 | 4 | - Changed from travis deployment to github actions. 5 | Changed the github pages template. Now using the one from 6 | |link-to-pyralid-template| from |link-to-sfarrens|. 7 | 8 | - Added new module for realisitic simulations ```dataset_generation.py```. 9 | It is capable of simulating realistic simulations from the UNIONS/CFIS survey, 10 | including realistic atmospherical simulations following a realisation of a Von Kármán model. 11 | See the above-mentioned module documentation for more information. 12 | See also the ```testing-realistic-data.ipynb``` in the notebook folder for an example. 13 | 14 | - Added outlier rejection based on a pixel residual criterion. 15 | The main parameters, ```RMSE_THRESH``` and ```CCD_STAR_THRESH``` can be found in the MCCD config file. 16 | See then parameter documentation for more information. 17 | 18 | - New interpolation function useful for shape measurement pipelines. 19 | For usage inside shape measurement pipelines: new PSF interpolation 20 | function included in the MCCD model ```interpolate_psf_pipeline()```. 21 | This function allows to output interpolated PSFs with a specific centroid. 22 | 23 | - New handling of position polynomials, local as well as global polynomials. 24 | Increased model performance. 25 | 26 | - New functionalities added. 27 | Handling of the max polynomial degree in the local hybrid model by 28 | the ```D_HYB_LOC```. Also adding a parameter ```MIN_D_COMP_GLOB``` to remove 29 | lower polynomial degrees in the global polynomial model. 30 | 31 | - Increased number of iterations. 32 | Increased default number of iterations to have a better convergence in the PSF wings. 33 | 34 | - Algorithm modifications. 35 | Augmented algorithm updates to increase performance. 36 | Dropping the normalisation proximal operator. 37 | Harder sparsity constraint for spatial variations. 38 | Forcing RBF interpolation for the global part. 39 | Skipping the last weight optimization so that we always finish with a features/components optimization. 40 | 41 | - Changed default denoising. 42 | Set default denoising to zero as wavelet denoising (using starlets) introduce an 43 | important bias in the ellipticity estimates of the model. 44 | 45 | 46 | .. |link-to-pyralid-template| raw:: html 47 | 48 | pyralid-template 49 | 50 | .. |link-to-sfarrens| raw:: html 51 | 52 | sfarrens 53 | -------------------------------------------------------------------------------- /docs/source/citing.rst: -------------------------------------------------------------------------------- 1 | Citing this Package 2 | =================== 3 | 4 | We kindly request that any academic work making use of this package to cite 5 | :cite:`liaudat2020`. 6 | 7 | .. bibliography:: my_ref.bib 8 | :style: alpha 9 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Python Template sphinx config 3 | 4 | # Import relevant modules 5 | import sys 6 | import os 7 | from importlib_metadata import metadata 8 | 9 | # If extensions (or modules to document with autodoc) are in another directory, 10 | # add these directories to sys.path here. If the directory is relative to the 11 | # documentation root, use os.path.abspath to make it absolute, like shown here. 12 | sys.path.insert(0, os.path.abspath('../..')) 13 | sys.path.insert(0, os.path.abspath('../../scripts')) 14 | 15 | # -- General configuration ------------------------------------------------ 16 | 17 | # General information about the project. 18 | project = 'mccd' 19 | 20 | mdata = metadata(project) 21 | author = mdata['Author'] 22 | version = mdata['Version'] 23 | copyright = 'configure_year, {}'.format(author) 24 | gh_user = 'configure_ghuser' 25 | 26 | # If your documentation needs a minimal Sphinx version, state it here. 27 | needs_sphinx = '3.3' 28 | 29 | # Add any Sphinx extension module names here, as strings. They can be 30 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 31 | # ones. 32 | extensions = [ 33 | 'sphinx.ext.autodoc', 34 | 'sphinx.ext.autosummary', 35 | 'sphinx.ext.coverage', 36 | 'sphinx.ext.doctest', 37 | 'sphinx.ext.ifconfig', 38 | 'sphinx.ext.intersphinx', 39 | 'sphinx.ext.mathjax', 40 | 'sphinx.ext.napoleon', 41 | 'sphinx.ext.todo', 42 | 'sphinx.ext.viewcode', 43 | 'sphinxawesome_theme', 44 | 'sphinxcontrib.bibtex', 45 | 'nbsphinx', 46 | 'nbsphinx_link', 47 | 'numpydoc', 48 | ] 49 | 50 | # Include module names for objects 51 | add_module_names = False 52 | 53 | # Set class documentation standard. 54 | autoclass_content = 'class' 55 | 56 | # Order docstrings as in the source 57 | autodoc_member_order = 'bysource' 58 | 59 | # Include private class methods 60 | autodoc_default_flags = ['members', 'private-members'] 61 | 62 | # Generate summaries 63 | autosummary_generate = True 64 | 65 | # Suppress class members in toctree. 66 | numpydoc_show_class_members = False 67 | 68 | # The suffix(es) of source filenames. 69 | # You can specify multiple suffix as a list of string: 70 | source_suffix = ['.rst', '.md'] 71 | 72 | # The master toctree document. 73 | master_doc = 'index' 74 | 75 | # If true, sectionauthor and moduleauthor directives will be shown in the 76 | # output. They are ignored by default. 77 | show_authors = True 78 | 79 | # The name of the Pygments (syntax highlighting) style to use. 80 | pygments_style = 'default' 81 | 82 | # If true, `todo` and `todoList` produce output, else they produce nothing. 83 | todo_include_todos = True 84 | 85 | # -- Options for HTML output ---------------------------------------------- 86 | 87 | # The theme to use for HTML and HTML Help pages. See the documentation for 88 | # a list of builtin themes. 89 | html_theme = 'sphinxawesome_theme' 90 | # html_theme = 'sphinx_book_theme' 91 | 92 | # Theme options are theme-specific and customize the look and feel of a theme 93 | # further. For a list of options available for each theme, see the 94 | # documentation. 95 | html_theme_options = { 96 | "nav_include_hidden": True, 97 | "show_nav": True, 98 | "show_breadcrumbs": False, 99 | "breadcrumbs_separator": "/" 100 | } 101 | html_collapsible_definitions = True 102 | 103 | 104 | # The name for this set of Sphinx documents. If None, it defaults to 105 | # " v documentation". 106 | html_title = '{0} v{1}'.format(project, version) 107 | 108 | # A shorter title for the navigation bar. Default is the same as html_title. 109 | # html_short_title = None 110 | 111 | # The name of an image file (relative to this directory) to place at the top 112 | # of the sidebar. 113 | # html_logo = None 114 | 115 | # The name of an image file (within the static path) to use as favicon of the 116 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 117 | # pixels large. 118 | # html_favicon = None 119 | 120 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 121 | # using the given strftime format. 122 | html_last_updated_fmt = '%d %b, %Y' 123 | 124 | # If true, SmartyPants will be used to convert quotes and dashes to 125 | # typographically correct entities. 126 | html_use_smartypants = True 127 | 128 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 129 | html_show_sphinx = True 130 | 131 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 132 | html_show_copyright = True 133 | 134 | # -- Options for nbshpinx output ------------------------------------------ 135 | 136 | 137 | # Custom fucntion to find notebooks, create .nblink files and update the 138 | # notebooks.rst file 139 | def add_notebooks(nb_path='../../notebooks'): 140 | 141 | print('Looking for notebooks') 142 | nb_ext = '.ipynb' 143 | nb_rst_file_name = 'notebooks.rst' 144 | nb_link_format = '{{\n "path": "{0}/{1}"\n}}' 145 | 146 | nbs = sorted([nb for nb in os.listdir(nb_path) if nb.endswith(nb_ext)]) 147 | 148 | for list_pos, nb in enumerate(nbs): 149 | 150 | nb_name = nb.rstrip(nb_ext) 151 | 152 | nb_link_file_name = nb_name + '.nblink' 153 | print('Writing {0}'.format(nb_link_file_name)) 154 | with open(nb_link_file_name, 'w') as nb_link_file: 155 | nb_link_file.write(nb_link_format.format(nb_path, nb)) 156 | 157 | print('Looking for {0} in {1}'.format(nb_name, nb_rst_file_name)) 158 | with open(nb_rst_file_name, 'r') as nb_rst_file: 159 | check_name = nb_name not in nb_rst_file.read() 160 | 161 | if check_name: 162 | print('Adding {0} to {1}'.format(nb_name, nb_rst_file_name)) 163 | with open(nb_rst_file_name, 'a') as nb_rst_file: 164 | if list_pos == 0: 165 | nb_rst_file.write('\n') 166 | nb_rst_file.write(' {0}\n'.format(nb_name)) 167 | 168 | return nbs 169 | 170 | 171 | # Add notebooks 172 | # [TL] Don't add notebooks 173 | # add_notebooks() 174 | 175 | binder = 'https://mybinder.org/v2/gh' 176 | binder_badge = 'https://mybinder.org/badge_logo.svg' 177 | github = 'https://github.com/' 178 | github_badge = 'https://badgen.net/badge/icon/github?icon=github&label' 179 | 180 | # Remove promts and add binder badge 181 | nb_header_pt1 = r''' 182 | {% if env.metadata[env.docname]['nbsphinx-link-target'] %} 183 | {% set docpath = env.metadata[env.docname]['nbsphinx-link-target'] %} 184 | {% else %} 185 | {% set docpath = env.doc2path(env.docname, base='docs/source/') %} 186 | {% endif %} 187 | 188 | .. raw:: html 189 | 190 | 196 | 197 | ''' 198 | nb_header_pt2 = ( 199 | r'''

''' 200 | r'''''' + 202 | r'''Binder badge
''' 204 | r'''

''' 209 | ) 210 | 211 | nbsphinx_prolog = nb_header_pt1 + nb_header_pt2 212 | 213 | # -- Intersphinx Mapping ---------------------------------------------- 214 | 215 | # Refer to the package libraries for type definitions 216 | intersphinx_mapping = { 217 | 'python': ('http://docs.python.org/3', None), 218 | 'numpy': ('https://numpy.org/doc/stable/', None), 219 | 'scipy': ('https://docs.scipy.org/doc/scipy/reference', None), 220 | 'matplotlib': ('https://matplotlib.org', None) 221 | } 222 | 223 | # -- BibTeX Setting ---------------------------------------------- 224 | 225 | bibtex_bibfiles = ['refs.bib', 'my_ref.bib'] 226 | -------------------------------------------------------------------------------- /docs/source/contributing.rst: -------------------------------------------------------------------------------- 1 | Contributing 2 | ============ 3 | 4 | Read our `Contribution Guidelines `_ 5 | for details on how to contribute to the development of this package. 6 | 7 | All contributors are kindly asked to adhere to the 8 | `Code of Conduct `_ 9 | at all times to ensure a safe and inclusive environment for everyone. 10 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | MCCD Documentation 2 | ===================== 3 | 4 | .. Include table of contents 5 | .. include:: toc.rst 6 | 7 | :Author: |link-to-author| `(tobiasliaudat@gmail.com) `_ 8 | :Version: 1.2.1 9 | :Release Date: 25/01/2022 10 | :Repository: |link-to-repo| 11 | 12 | .. |link-to-repo| raw:: html 13 | 14 | https://github.com/CosmoStat/mccd 16 | 17 | .. |link-to-author| raw:: html 18 | 19 | Tobias Liaudat 21 | 22 | Multi-CCD PSF modelling. Modelling the Point Spread Function in all the focal plane at once. 23 | -------------------------------------------------------------------------------- /docs/source/installation.rst: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | Dependencies 5 | ------------ 6 | 7 | The following python packages should be installed with their specific dependencies: 8 | 9 | - |link-to-numpy| 10 | - |link-to-scipy| 11 | - |link-to-astropy| 12 | - |link-to-GalSim| 13 | - |link-to-ModOpt| 14 | - |link-to-pysap| 15 | 16 | It is of utmost importance that the PySAP package is correctly installed as we will be using the wavelet transforms provided by it. 17 | 18 | .. note:: 19 | 20 | The GalSim package was removed from ``requirements.txt``, it is expected to be installed (preferably with conda) before installing the MCCD package. 21 | 22 | 23 | Users 24 | ----- 25 | 26 | You can install the latest release from `PyPi `_ 27 | as follows: 28 | 29 | .. code-block:: bash 30 | 31 | pip install mccd 32 | 33 | 34 | Alternatively clone the repository and build the package locally as follows: 35 | 36 | .. code-block:: bash 37 | 38 | pip install . 39 | 40 | 41 | Developers 42 | ---------- 43 | 44 | Developers are recommend to clone the repository and build the package locally 45 | in development mode with testing and documentation packages as follows: 46 | 47 | .. code-block:: bash 48 | 49 | pip install -e . 50 | 51 | 52 | 53 | 54 | 55 | .. |link-to-numpy| raw:: html 56 | 57 | Numpy 58 | 59 | .. |link-to-scipy| raw:: html 60 | 61 | Scipy 62 | 63 | .. |link-to-astropy| raw:: html 64 | 65 | astropy 66 | 67 | .. |link-to-GalSim| raw:: html 68 | 69 | GalSim 70 | 71 | .. |link-to-ModOpt| raw:: html 72 | 73 | ModOpt 74 | 75 | .. |link-to-pysap| raw:: html 76 | 77 | PySap 78 | 79 | -------------------------------------------------------------------------------- /docs/source/mccd.auxiliary_fun.rst: -------------------------------------------------------------------------------- 1 | mccd.auxiliary\_fun 2 | ------------------- 3 | 4 | .. automodule:: mccd.auxiliary_fun 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/source/mccd.dataset_generation.rst: -------------------------------------------------------------------------------- 1 | mccd.dataset\_generation 2 | ------------------------ 3 | 4 | .. automodule:: mccd.dataset_generation 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/source/mccd.grads.rst: -------------------------------------------------------------------------------- 1 | mccd.grads 2 | ---------- 3 | 4 | .. automodule:: mccd.grads 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/source/mccd.info.rst: -------------------------------------------------------------------------------- 1 | mccd.info 2 | --------- 3 | 4 | .. automodule:: mccd.info 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/source/mccd.mccd.rst: -------------------------------------------------------------------------------- 1 | mccd.mccd 2 | --------- 3 | 4 | .. automodule:: mccd.mccd 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/source/mccd.mccd_utils.rst: -------------------------------------------------------------------------------- 1 | mccd.mccd\_utils 2 | ---------------- 3 | 4 | .. automodule:: mccd.mccd_utils 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/source/mccd.proxs.rst: -------------------------------------------------------------------------------- 1 | mccd.proxs 2 | ---------- 3 | 4 | .. automodule:: mccd.proxs 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/source/mccd.rst: -------------------------------------------------------------------------------- 1 | mccd 2 | ==== 3 | 4 | 5 | .. automodule:: mccd 6 | :members: 7 | :undoc-members: 8 | :show-inheritance: 9 | 10 | Submodules 11 | ---------- 12 | 13 | .. toctree:: 14 | :maxdepth: 4 15 | 16 | mccd.auxiliary_fun 17 | mccd.dataset_generation 18 | mccd.grads 19 | mccd.info 20 | mccd.mccd 21 | mccd.mccd_utils 22 | mccd.proxs 23 | mccd.utils 24 | -------------------------------------------------------------------------------- /docs/source/mccd.utils.rst: -------------------------------------------------------------------------------- 1 | mccd.utils 2 | ---------- 3 | 4 | .. automodule:: mccd.utils 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: -------------------------------------------------------------------------------- /docs/source/my_ref.bib: -------------------------------------------------------------------------------- 1 | @BOOK{DUMMY, 2 | AUTHOR="Boba Fett", 3 | TITLE="How to survive a Sarlacc", 4 | PUBLISHER="Guild Publisher", 5 | YEAR="9 ABY", 6 | } 7 | 8 | @article{liaudat2020, 9 | author = {{Liaudat, T.} and {Bonnin, J.} and {Starck, J.-L.} and {Schmitz, M. A.} and {Guinot, A.} and {Kilbinger, M.} and {Gwyn, S. D. J.}}, 10 | date-added = {2021-02-03 18:00:24 +0100}, 11 | date-modified = {2021-02-03 18:00:34 +0100}, 12 | doi = {10.1051/0004-6361/202039584}, 13 | journal = {A\&A}, 14 | pages = {A27}, 15 | title = {Multi-CCD modelling of the point spread function}, 16 | url = {https://doi.org/10.1051/0004-6361/202039584}, 17 | volume = 646, 18 | year = 2021, 19 | Bdsk-Url-1 = {https://doi.org/10.1051/0004-6361/202039584}} 20 | -------------------------------------------------------------------------------- /docs/source/quickstart.rst: -------------------------------------------------------------------------------- 1 | Quickstart Tutorial 2 | =================== 3 | 4 | 5 | You can import the package as follows: 6 | 7 | .. code-block:: python 8 | 9 | import mccd 10 | 11 | 12 | The easiest usage of the method is to go through the configuration file ``config_MCCD.ini`` using the helper classes found 13 | in |link-to-auxiliary_fun_py| 14 | (|link-to-documentation-aux|). 15 | Description of the parameters can be found directly in the configuration file |link-to-config_MCCD_ini|. 16 | The MCCD method can handle SExtractor dataset as input catalogs given that they follow an appropriate naming convention. 17 | 18 | The main MCCD model parameters are: 19 | 20 | - ``LOC_MODEL``: Indicating the type of local model to be used (MCCD-HYB, MCCD-RCA, or MCCD-POL), 21 | - ``N_COMP_LOC``: Indicating the number of eigenPSFs to use in the local model. 22 | - ``D_COMP_GLOB``: Indicating the maximum polynomial degree for the global model. 23 | 24 | After setting up all the parameters from the configuration file there are three main functions, one to fit the model, 25 | one to validate the model and the last one to fit and then validate the model. The usage is as follows: 26 | 27 | .. code-block:: python 28 | 29 | import mccd 30 | 31 | config_file_path = 'path_to_config_file.ini' 32 | 33 | run_mccd_instance = mccd.auxiliary_fun.RunMCCD(config_file_path, 34 | fits_table_pos=1) 35 | 36 | run_mccd_instance.fit_MCCD_models() 37 | 38 | 39 | For the validation one should replace the last line with: 40 | 41 | .. code-block:: python 42 | 43 | run_mccd_instance.validate_MCCD_models() 44 | 45 | 46 | Finally for the fit and validation one should change the last line to: 47 | 48 | .. code-block:: python 49 | 50 | run_mccd_instance.run_MCCD() 51 | 52 | 53 | All the output file will be saved on the directories specified on the configuration files. 54 | 55 | 56 | PSF recovery 57 | ------------ 58 | 59 | To recover PSFs from the model at specific positions ```test_pos``` from 60 | the CCD ```ccd_id``` one could use the following example: 61 | 62 | .. code-block:: python 63 | 64 | import numpy as np 65 | import mccd 66 | 67 | config_file_path = 'path_to_config_file.ini' 68 | mccd_model_path = 'path_to_fitted_mccd_model.npy' 69 | test_pos = np.load(..) 70 | ccd_id = np.load(..) 71 | local_pos = True 72 | 73 | mccd_instance = mccd.auxiliary_fun.RunMCCD(config_file_path, 74 | fits_table_pos=1) 75 | 76 | rec_PSFs = mccd_instance.recover_MCCD_PSFs(mccd_model_path, 77 | positions=test_pos, 78 | ccd_id=ccd_id, 79 | local_pos=local_pos) 80 | 81 | 82 | See the |link-to-documentation| 83 | of the ```recover_MCCD_PSFs()``` function for more information. 84 | 85 | 86 | Extra information 87 | ----------------- 88 | 89 | .. tip:: 90 | 91 | There are more interpolation functions. For usage inside shape measurement pipelines, the 92 | new PSF interpolation function included in the MCCD model ```interpolate_psf_pipeline()```. 93 | This function allows to output interpolated PSFs with a specific centroid. 94 | 95 | 96 | 97 | .. |link-to-documentation| raw:: html 98 | 99 | documentation 100 | 101 | 102 | .. |link-to-auxiliary_fun_py| raw:: html 103 | 104 | auxiliary_fun.py 105 | 106 | 107 | .. |link-to-documentation-aux| raw:: html 108 | 109 | documentation 110 | 111 | .. |link-to-config_MCCD_ini| raw:: html 112 | 113 | config_MCCD.ini 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /docs/source/refs.bib: -------------------------------------------------------------------------------- 1 | @INBOOK{Drake:1965, 2 | author = {{Drake}, Frank D.}, 3 | title = "{The Radio Search for Intelligent Extraterrestrial Life}", 4 | publisher = {Oxford University Press}, 5 | keywords = {DRAKE EQUATION, SETI, EXOBIOLOGY, LIFE ON OTHER PLANETS}, 6 | booktitle = {In Current aspects of exobiology}, 7 | year = 1965, 8 | pages = {323-345}, 9 | adsurl = {https://ui.adsabs.harvard.edu/abs/1965cae..book..323D}, 10 | adsnote = {Provided by the SAO/NASA Astrophysics Data System}, 11 | } 12 | 13 | @Article{Hunter:2007, 14 | Author = {Hunter, J. D.}, 15 | Title = {Matplotlib: A 2D graphics environment}, 16 | Journal = {Computing in Science \& Engineering}, 17 | Volume = {9}, 18 | Number = {3}, 19 | Pages = {90--95}, 20 | abstract = {Matplotlib is a 2D graphics package used for Python for 21 | application development, interactive scripting, and publication-quality 22 | image generation across user interfaces and operating systems.}, 23 | publisher = {IEEE COMPUTER SOC}, 24 | doi = {10.1109/MCSE.2007.55}, 25 | year = 2007 26 | } 27 | 28 | @ARTICLE{Harris:2020, 29 | author = {{Harris}, Charles R. and {Jarrod Millman}, K. and {van der Walt}, St{\'e}fan J. and {Gommers}, Ralf and {Virtanen}, Pauli and {Cournapeau}, David and {Wieser}, Eric and {Taylor}, Julian and {Berg}, Sebastian and {Smith}, Nathaniel J. and {Kern}, Robert and {Picus}, Matti and {Hoyer}, Stephan and {van Kerkwijk}, Marten H. and {Brett}, Matthew and {Haldane}, Allan and {Fern{\'a}ndez del R{\'\i}o}, Jaime and {Wiebe}, Mark and {Peterson}, Pearu and {G{\'e}rard-Marchant}, Pierre and {Sheppard}, Kevin and {Reddy}, Tyler and {Weckesser}, Warren and {Abbasi}, Hameer and {Gohlke}, Christoph and {Oliphant}, Travis E.}, 30 | title = "{Array Programming with NumPy}", 31 | journal = {arXiv e-prints}, 32 | doi = {https://doi.org/10.1038/s41586-020-2649-2}, 33 | keywords = {Computer Science - Mathematical Software, Statistics - Computation}, 34 | year = 2020, 35 | month = jun, 36 | eid = {arXiv:2006.10256}, 37 | pages = {arXiv:2006.10256}, 38 | archivePrefix = {arXiv}, 39 | eprint = {2006.10256}, 40 | primaryClass = {cs.MS}, 41 | adsurl = {https://ui.adsabs.harvard.edu/abs/2020arXiv200610256H}, 42 | adsnote = {Provided by the SAO/NASA Astrophysics Data System} 43 | } 44 | -------------------------------------------------------------------------------- /docs/source/toc.rst: -------------------------------------------------------------------------------- 1 | .. Toctrees define sidebar contents 2 | 3 | .. toctree:: 4 | :hidden: 5 | :titlesonly: 6 | :caption: Getting Started 7 | 8 | about 9 | installation 10 | quickstart 11 | changelog 12 | 13 | .. toctree:: 14 | :hidden: 15 | :titlesonly: 16 | :caption: API Documentation 17 | 18 | mccd 19 | z_ref 20 | 21 | .. toctree:: 22 | :hidden: 23 | :titlesonly: 24 | :caption: Guidelines 25 | 26 | contributing 27 | citing 28 | -------------------------------------------------------------------------------- /docs/source/z_ref.rst: -------------------------------------------------------------------------------- 1 | References 2 | ========== 3 | 4 | .. bibliography:: refs.bib 5 | :style: alpha 6 | -------------------------------------------------------------------------------- /example/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """Example Module 4 | 5 | Provide some basic description of the example module. 6 | 7 | """ 8 | 9 | from . import * 10 | 11 | __all__ = ['auxiliary_fun'] # List of submodules 12 | -------------------------------------------------------------------------------- /example/dataset_generation_parallel.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | import numpy as np 5 | import mccd.dataset_generation as dataset_generation 6 | from joblib import Parallel, delayed, cpu_count, parallel_backend 7 | 8 | 9 | # Total number of datasets (equivalent to number of proceses) 10 | n_procs = 4 11 | # Number of CPUs to use 12 | n_cpus = 2 13 | 14 | # Print some info 15 | cpu_info = ' - Number of available CPUs: {}'.format(cpu_count()) 16 | proc_info = ' - Total number of processes: {}'.format(n_procs) 17 | 18 | # Paths 19 | e1_path = './e1_psf.npy' 20 | e2_path = './e2_psf.npy' 21 | fwhm_path = './seeing_distribution.npy' 22 | output_path = './datasets/' 23 | 24 | # Print infof 25 | print('Dataset generation.') 26 | print(cpu_info) 27 | print(proc_info) 28 | print('Number of catalogs: ', n_procs) 29 | print('Number of CPUs: ', n_cpus) 30 | 31 | # Generate catalog list 32 | cat_id_list = [2000000 + i for i in range(n_procs)] 33 | 34 | 35 | def generate_dataset(cat_id): 36 | print('\nProcessing catalog: ', cat_id) 37 | sim_dataset_generator = dataset_generation.GenerateRealisticDataset( 38 | e1_path=e1_path, 39 | e2_path=e2_path, 40 | size_path=fwhm_path, 41 | output_path=output_path, 42 | catalog_id=cat_id) 43 | sim_dataset_generator.generate_train_data() 44 | sim_dataset_generator.generate_test_data() 45 | 46 | 47 | with parallel_backend("loky", inner_max_num_threads=1): 48 | results = Parallel(n_jobs=n_cpus)(delayed(generate_dataset)(_cat_id) 49 | for _cat_id in cat_id_list) 50 | -------------------------------------------------------------------------------- /example/fix_old_calidation_star_catalogue.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | import numpy as np 5 | from astropy.io import fits 6 | import matplotlib.pyplot as plt 7 | import mccd 8 | 9 | 10 | # Class definition 11 | class Glob2CCD(object): 12 | r""" Get the CCD ID number from the global coordinate position. 13 | 14 | The Loc2Glob() object as input is the one that defines the instrument's 15 | geometry. 16 | 17 | Parameters 18 | ---------- 19 | loc2glob: Loc2Glob object 20 | Object with the desired focal plane geometry. 21 | with_gaps: bool 22 | If add the gaps to the CCD area. 23 | """ 24 | def __init__(self, loc2glob, with_gaps=True): 25 | # Save loc2glob object 26 | self.loc2glob = loc2glob 27 | self.with_gaps = with_gaps 28 | self.ccd_list = np.arange(self.loc2glob.ccd_tot) 29 | # Init edges defininf the CCDs 30 | self.edge_x_list, self.edge_y_list = self.build_all_edges() 31 | 32 | def build_all_edges(self): 33 | """ Build the edges for all the CCDs in the focal plane. 34 | """ 35 | edge_x_list = np.array([ 36 | self.build_edge(ccd_n)[0] for ccd_n in self.ccd_list 37 | ]) 38 | edge_y_list = np.array([ 39 | self.build_edge(ccd_n)[1] for ccd_n in self.ccd_list 40 | ]) 41 | 42 | return edge_x_list, edge_y_list 43 | 44 | def build_edge(self, ccd_n): 45 | """ Build the edges of the `ccd_n` in global coordinates. 46 | """ 47 | if self.with_gaps: 48 | corners = np.array([ 49 | [ 50 | -self.loc2glob.x_gap / 2, 51 | -self.loc2glob.y_gap / 2 52 | ], 53 | [ 54 | self.loc2glob.x_npix + self.loc2glob.x_gap / 2, 55 | -self.loc2glob.y_gap / 2 56 | ], 57 | [ 58 | -self.loc2glob.x_gap / 2, 59 | self.loc2glob.y_npix + self.loc2glob.y_gap / 2 60 | ], 61 | [ 62 | self.loc2glob.x_npix + self.loc2glob.x_gap / 2, 63 | self.loc2glob.y_npix + self.loc2glob.y_gap / 2, 64 | ], 65 | ]) 66 | else: 67 | corners = np.array([ 68 | [0, 0], 69 | [self.loc2glob.x_npix, 0], 70 | [0, self.loc2glob.y_npix], 71 | [self.loc2glob.x_npix, self.loc2glob.y_npix], 72 | ]) 73 | 74 | glob_corners = np.array([ 75 | self.loc2glob.loc2glob_img_coord(ccd_n, pos[0], pos[1]) 76 | for pos in corners 77 | ]) 78 | 79 | edge_x = np.array([ 80 | np.min(glob_corners[:, 0]), np.max(glob_corners[:, 0]) 81 | ]) 82 | edge_y = np.array([ 83 | np.min(glob_corners[:, 1]), np.max(glob_corners[:, 1]) 84 | ]) 85 | 86 | return edge_x, edge_y 87 | 88 | def is_inside(self, x, y, edge_x, edge_y): 89 | """ Is the position inside the edges. 90 | 91 | Return True if the position is within the rectangle 92 | defined by the edges. 93 | 94 | Parameters 95 | ---------- 96 | x: float 97 | Horizontal position in global coordinate system. 98 | y: float 99 | Vertical position in global coordinate system. 100 | edge_x: np.ndarray 101 | Edge defined as `np.array([min_x, max_x])`. 102 | edge_y: np.ndarray 103 | Edge defined as `np.array([min_y, max_y])`. 104 | """ 105 | if (x > edge_x[0]) and (x < edge_x[1]) and \ 106 | (y > edge_y[0]) and (y < edge_y[1]): 107 | return True 108 | else: 109 | return False 110 | 111 | def get_ccd_n(self, x, y): 112 | """ Returns the CCD number from the position `(x, y)`. 113 | 114 | Returns `None` if the position is not found. 115 | """ 116 | bool_list = np.array([ 117 | self.is_inside(x, y, edge_x, edge_y) 118 | for edge_x, edge_y in zip(self.edge_x_list, self.edge_y_list) 119 | ]) 120 | 121 | try: 122 | return self.ccd_list[bool_list][0] 123 | except Exception: 124 | return None 125 | 126 | 127 | # Starting the script 128 | data_dir = '/n05data/tliaudat/CFIS_shapepipe_v1/data/' 129 | original_cat = 'unions_shapepipe_psf_2022_v1.0.1.fits' 130 | new_cat = 'unions_shapepipe_psf_2022_v1.0.2-0000000.fits' 131 | 132 | starcat = fits.open(data_dir + original_cat, memmap=True) 133 | print(starcat[1].columns) 134 | 135 | # Build a mask to remove objects with problems 136 | # These are objects with DEC coordinate equal to zero 137 | mask_good_dec = ~(starcat[1].data['DEC'] == 0.) 138 | 139 | loc2glob = mccd.mccd_utils.Loc2Glob() 140 | glob2ccd = Glob2CCD(loc2glob) 141 | 142 | ccd_list = np.array([ 143 | glob2ccd.get_ccd_n(x, y) for x, y in zip( 144 | starcat[1].data['X'][mask_good_dec], 145 | starcat[1].data['Y'][mask_good_dec] 146 | ) 147 | ]) 148 | 149 | # Collect columns 150 | data = { 151 | 'X': starcat[1].data['X'][mask_good_dec], 152 | 'Y': starcat[1].data['Y'][mask_good_dec], 153 | 'RA': starcat[1].data['RA'][mask_good_dec], 154 | 'DEC': starcat[1].data['DEC'][mask_good_dec], 155 | 'E1_PSF_HSM': starcat[1].data['E1_PSF_HSM'][mask_good_dec], 156 | 'E2_PSF_HSM': starcat[1].data['E2_PSF_HSM'][mask_good_dec], 157 | 'SIGMA_PSF_HSM': starcat[1].data['SIGMA_PSF_HSM'][mask_good_dec], 158 | 'E1_STAR_HSM': starcat[1].data['E1_STAR_HSM'][mask_good_dec], 159 | 'E2_STAR_HSM': starcat[1].data['E2_STAR_HSM'][mask_good_dec], 160 | 'SIGMA_STAR_HSM': starcat[1].data['SIGMA_STAR_HSM'][mask_good_dec], 161 | 'FLAG_PSF_HSM': starcat[1].data['FLAG_PSF_HSM'][mask_good_dec], 162 | 'FLAG_STAR_HSM': starcat[1].data['FLAG_STAR_HSM'][mask_good_dec], 163 | 'CCD_NB': ccd_list.astype(float), 164 | } 165 | 166 | save_path = data_dir + new_cat 167 | mccd.mccd_utils.save_to_fits(data, save_path) 168 | -------------------------------------------------------------------------------- /mccd/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """MCCD PACKAGE. 4 | 5 | MCCD is a non-parametric PSF modelling method. 6 | 7 | :Author: Tobias Liaudat 8 | 9 | """ 10 | 11 | from .mccd import MCCD, mccd_quickload 12 | from . import mccd_utils, utils, grads, proxs, dataset_generation 13 | from . import auxiliary_fun 14 | from .info import __version__, __about__ 15 | 16 | __all__ = [] # List of submodules 17 | __all__ += ['mccd'] 18 | __all__ += ['proxs'] 19 | __all__ += ['grads'] 20 | __all__ += ['utils'] 21 | __all__ += ['mccd_utils'] 22 | __all__ += ['auxiliary_fun'] 23 | __all__ += ['dataset_generation'] 24 | -------------------------------------------------------------------------------- /mccd/info.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """PACKAGE INFO. 4 | 5 | This module provides some basic information about the package. 6 | 7 | """ 8 | 9 | # Set the package release version 10 | version_info = (1, 2, 4) 11 | __version__ = '.'.join(str(c) for c in version_info) 12 | 13 | # Set the package details 14 | __author__ = 'Tobias Liaudat' 15 | __email__ = 'tobiasliaudat@gmail.com' 16 | __year__ = '2020' 17 | __url__ = 'https://github.com/CosmoStat/mccd' 18 | __description__ = 'A non-parametric Multi-CCD Point Spread Function modelling.' 19 | 20 | # Default package properties 21 | __license__ = 'MIT' 22 | __about__ = ('{}\nAuthor: {} \nEmail: {} \nYear: {} \nInfo: {}' 23 | ''.format(__name__, __author__, __email__, __year__, 24 | __description__)) 25 | __setup_requires__ = ['pytest-runner', ] 26 | __tests_require__ = ['pytest', 'pytest-cov', 'pytest-pycodestyle', 'galsim'] 27 | -------------------------------------------------------------------------------- /pypi_pkg_info.rst: -------------------------------------------------------------------------------- 1 | 2 | MCCD Point Spread Function modelling 3 | ==================================== 4 | 5 | :Author: `Tobias Liaudat `_ 6 | 7 | :Version: 1.2.4 8 | 9 | :Repository: `https://github.com/CosmoStat/mccd `_ 10 | 11 | :Documentation: `https://cosmostat.github.io/mccd/ `_ 12 | 13 | :Description: The non-parametric MCCD PSF modelling, or MCCD for short, is a Point Spread Function modelling pure python package. It is used to generate a PSF model based on stars observations in the field of view. Once trained, the MCCD PSF model can then recover the PSF at any position in the field of view. 14 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | numpy>=1.19.5 2 | scipy>=1.5.4 3 | modopt>=1.5.1 4 | astropy>=4.0.2 5 | python-pysap>=0.0.6 6 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [aliases] 2 | test=pytest 3 | 4 | [build_sphinx] 5 | all_files=1 6 | build-dir=docs/build 7 | 8 | [metadata] 9 | description-file = README.md 10 | 11 | [pycodestyle] 12 | ignore = E121,E126,E128,E402,W504,E127,E502,E131,E731 13 | statistics = True 14 | 15 | [tool:pytest] 16 | addopts = --verbose --pycodestyle --cov=mccd 17 | testpaths = 18 | mccd 19 | tests 20 | norecursedirs = tests/* 21 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | from setuptools import setup, find_packages 5 | import os 6 | 7 | __name__ = 'mccd' 8 | 9 | release_info = {} 10 | infopath = os.path.abspath(os.path.join(os.path.dirname(__file__), 11 | __name__, 'info.py')) 12 | with open(infopath) as open_file: 13 | exec(open_file.read(), release_info) 14 | 15 | this_directory = os.path.abspath(os.path.dirname(__file__)) 16 | with open(os.path.join(this_directory, 'pypi_pkg_info.rst'), 17 | encoding='utf-8') as f: 18 | long_description = f.read() 19 | 20 | with open('requirements.txt') as open_file: 21 | install_requires = open_file.read() 22 | 23 | setup( 24 | name=__name__, 25 | author=release_info['__author__'], 26 | author_email=release_info['__email__'], 27 | version=release_info['__version__'], 28 | url=release_info['__url__'], 29 | packages=find_packages(), 30 | install_requires=install_requires, 31 | license=release_info['__license__'], 32 | description=release_info['__about__'], 33 | long_description=long_description, 34 | long_description_content_type="text/x-rst", 35 | setup_requires=release_info['__setup_requires__'], 36 | tests_require=release_info['__tests_require__'], 37 | classifiers=[ 38 | "Programming Language :: Python :: 3.6", 39 | "License :: OSI Approved :: MIT License", 40 | "Operating System :: MacOS", 41 | "Operating System :: POSIX :: Linux", 42 | "Topic :: Scientific/Engineering", 43 | "Intended Audience :: Science/Research", 44 | "Intended Audience :: Developers"], 45 | ) 46 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """Unit Tests 4 | 5 | Unit testing framework for the package. 6 | 7 | """ 8 | 9 | from . import * 10 | 11 | __all__ = ['test_pysap_wavelet'] # List of submodules 12 | -------------------------------------------------------------------------------- /tests/test_pysap_wavelet.py: -------------------------------------------------------------------------------- 1 | from unittest import TestCase 2 | import numpy.testing as npt 3 | import numpy as np 4 | from mccd.mccd_utils import get_mr_filters 5 | 6 | 7 | class PysapWaveletTestCase(TestCase): 8 | def setUp(self): 9 | self.data_shape = (5, 5) 10 | self.opt = 'BsplineWaveletTransformATrousAlgorithm' 11 | self.n_scales = 3 12 | self.new_filters = None 13 | 14 | self.expected_filter = np.array([ 15 | [[-0.00390625, -0.015625, -0.0234375, -0.015625, -0.00390625], 16 | [-0.015625, -0.0625, -0.09375, -0.0625, -0.015625], 17 | [-0.0234375, -0.09375, 0.859375, -0.09375, -0.0234375], 18 | [-0.015625, -0.0625, -0.09375, -0.0625, -0.015625], 19 | [-0.00390625, -0.015625, -0.0234375, -0.015625, -0.00390625] 20 | ], 21 | 22 | [[-0.01586914, -0.00964355, -0.00183105, -0.00964355, -0.01586914], 23 | [-0.00964355, 0.0302124, 0.0614624, 0.0302124, -0.00964355], 24 | [-0.00183105, 0.0614624, 0.1083374, 0.0614624, -0.00183105], 25 | [-0.00964355, 0.0302124, 0.0614624, 0.0302124, -0.00964355], 26 | [-0.01586914, -0.00964355, -0.00183105, -0.00964355, -0.01586914] 27 | ], 28 | 29 | [[0.01977539, 0.02526855, 0.02526855, 0.02526855, 0.01977539], 30 | [0.02526855, 0.0322876, 0.0322876, 0.0322876, 0.02526855], 31 | [0.02526855, 0.0322876, 0.0322876, 0.0322876, 0.02526855], 32 | [0.02526855, 0.0322876, 0.0322876, 0.0322876, 0.02526855], 33 | [0.01977539, 0.02526855, 0.02526855, 0.02526855, 0.01977539] 34 | ]], 35 | dtype=np.float32) 36 | 37 | def tearDown(self): 38 | self.data_shape = None 39 | self.opt = None 40 | self.n_scales = None 41 | self.new_filters = None 42 | self.expected_filter = None 43 | 44 | def get_filters(self): 45 | self.new_filters = get_mr_filters(self.data_shape, self.opt, 46 | n_scales=self.n_scales, 47 | coarse=True, trim=False) 48 | 49 | def test_pysap_wavelet(self): 50 | self.get_filters() 51 | npt.assert_almost_equal(self.new_filters, self.expected_filter, 52 | decimal=6, 53 | err_msg='''The filter output from Pysap is not 54 | the expected one.''') 55 | 56 | 57 | if __name__ == '__main__': 58 | test_instance = PysapWaveletTestCase() 59 | test_instance.setUp() 60 | test_instance.test_pysap_wavelet() 61 | --------------------------------------------------------------------------------