├── .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 | [](https://travis-ci.org/CosmoStat/mccd)
4 | [](https://badge.fury.io/py/mccd)
5 | [](https://python.org)
6 | [](https://python.org)
7 | [](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 |
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.