Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
COMPASS v5.4.4 hotfix :
Browse files Browse the repository at this point in the history
- Debug KL2V when DM has unseen actuators
  • Loading branch information
a-sevin committed Jun 29, 2023
1 parent f8825b1 commit f8e5708
Show file tree
Hide file tree
Showing 84 changed files with 155 additions and 139 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# COMPASS Change logs

- [COMPASS Change logs](#compass-change-logs)
- [Release v5.4.4 :](#release-v544-)
- [Release v5.4.3 :](#release-v543-)
- [Release v5.4.2 :](#release-v542-)
- [Release v5.4.1 :](#release-v541-)
Expand All @@ -25,6 +26,10 @@
- [Release v2.0](#release-v20)
- [Release v1.1](#release-v11)

## Release v5.4.4 :

- Debug KL2V when DM has unseen actuators

## Release v5.4.3 :

- Add a threshold in the wcog centroider
Expand Down
58 changes: 29 additions & 29 deletions report_E2E.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# E2E Test Report

*Report generated on 31-May-2023 14:15:52 by checkCompass.sh*
*Report generated on 04-Apr-2023 14:50:01 by checkCompass.sh*

[Unit Tests report](report_unit_test.html)

## Summary

| | Test name | Init | SR@100iter | T Init | T Loop |
|---:|:-------------------------------|:-------|:--------------------|---------:|----------:|
| 0 | test_custom_dm.py | False | N/A | 0 | 0 |
| 1 | test_custom_dm_diam_dm.py | False | N/A | 0 | 0 |
| 2 | test_custom_dm_diam_dm_proj.py | False | N/A | 0 | 0 |
| 3 | test_custom_dm_pitch.py | False | N/A | 0 | 0 |
| 4 | test_pyr3_maskedpix.py | True | 0.7534236311912537 | 0 | 0.186098 |
| 5 | test_pyr_ELTpup.py | False | N/A | 0 | 0 |
| 6 | test_pyr_base.py | True | 0.6425961256027222 | 0 | 0.188278 |
| 7 | test_sh_ELTpup.py | False | N/A | 0 | 0 |
| 8 | test_sh_base.py | True | 0.7167712450027466 | 0 | 0.0620468 |
| 9 | test_sh_bpcog.py | True | 0.712725043296814 | 0 | 0.0612929 |
| 10 | test_sh_control_klbasis.py | True | 0.7313299775123596 | 0 | 0.0603774 |
| 11 | test_sh_cured.py | True | 0.8101580142974854 | 0 | 0.104124 |
| 12 | test_sh_generic.py | True | 0.1397433578968048 | 0 | 0.0628918 |
| 13 | test_sh_generic_linear.py | True | 0.1397433578968048 | 0 | 0.0761074 |
| 14 | test_sh_geo.py | True | 0.8506492376327515 | 0 | 0.05818 |
| 15 | test_sh_influBessel.py | True | 0.30245241522789 | 0 | 0.0609266 |
| 16 | test_sh_influBlacknutt.py | True | 0.722876787185669 | 0 | 0.059993 |
| 17 | test_sh_influGaussian.py | True | 0.7200782895088196 | 0 | 0.0586266 |
| 18 | test_sh_influRadialSchwartz.py | True | 0.724751353263855 | 0 | 0.0605238 |
| 19 | test_sh_influSquareSchwartz.py | True | 0.7160112261772156 | 0 | 0.0633124 |
| 20 | test_sh_kl.py | False | N/A | 0 | 0 |
| 21 | test_sh_lgs_corr.py | True | 0.40904784202575684 | 0 | 0.0780183 |
| 22 | test_sh_lgs_wcog.py | True | 0.6934942603111267 | 0 | 0.0676732 |
| 23 | test_sh_modopti.py | True | 0.6609103679656982 | 0 | 0.0640732 |
| 24 | test_sh_mv.py | True | 0.7505921721458435 | 0 | 0.064799 |
| 25 | test_sh_tcog.py | True | 0.7167202830314636 | 0 | 0.059764 |
| | Test name | Init | SR@100iter | T Init | T Loop |
|---:|:-------------------------------|:-------|-------------:|---------:|----------:|
| 0 | test_custom_dm.py | True | 0.702118 | 0 | 0.556473 |
| 1 | test_custom_dm_diam_dm.py | True | 0.763851 | 0 | 0.537063 |
| 2 | test_custom_dm_diam_dm_proj.py | True | 0.745001 | 0 | 0.517915 |
| 3 | test_custom_dm_pitch.py | True | 0.766456 | 0 | 0.518557 |
| 4 | test_pyr3_maskedpix.py | True | 0.753423 | 0 | 0.180621 |
| 5 | test_pyr_ELTpup.py | True | 0.316653 | 0 | 0.188196 |
| 6 | test_pyr_base.py | True | 0.642595 | 0 | 0.186667 |
| 7 | test_sh_ELTpup.py | True | 0.586173 | 0 | 0.0583244 |
| 8 | test_sh_base.py | True | 0.716834 | 0 | 0.0545 |
| 9 | test_sh_bpcog.py | True | 0.712825 | 0 | 0.0596717 |
| 10 | test_sh_control_klbasis.py | True | 0.731295 | 0 | 0.0632768 |
| 11 | test_sh_cured.py | True | 0.810137 | 0 | 0.0984057 |
| 12 | test_sh_generic.py | True | 0.13974 | 0 | 0.0576695 |
| 13 | test_sh_generic_linear.py | True | 0.13974 | 0 | 0.071544 |
| 14 | test_sh_geo.py | True | 0.850649 | 0 | 0.0529277 |
| 15 | test_sh_influBessel.py | True | 0.301968 | 0 | 0.0561081 |
| 16 | test_sh_influBlacknutt.py | True | 0.722685 | 0 | 0.0569003 |
| 17 | test_sh_influGaussian.py | True | 0.7202 | 0 | 0.0557682 |
| 18 | test_sh_influRadialSchwartz.py | True | 0.724742 | 0 | 0.0571054 |
| 19 | test_sh_influSquareSchwartz.py | True | 0.715861 | 0 | 0.0566593 |
| 20 | test_sh_kl.py | True | 0.696613 | 0 | 0.0520598 |
| 21 | test_sh_lgs_corr.py | True | 0.408993 | 0 | 0.0717044 |
| 22 | test_sh_lgs_wcog.py | True | 0.693549 | 0 | 0.0665297 |
| 23 | test_sh_modopti.py | True | 0.660711 | 0 | 0.0594816 |
| 24 | test_sh_mv.py | True | 0.750539 | 0 | 0.0628628 |
| 25 | test_sh_tcog.py | True | 0.71676 | 0 | 0.0608476 |
4 changes: 2 additions & 2 deletions shesha/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import subprocess, sys

__version__ = "5.4.3"
__version__ = "5.4.4"

__api_version__ = "5.4.3"
__api_version__ = "5.4.4"

def check_shesha_compass_versions():
compass_package = subprocess.check_output('conda list compass | tail -n1',shell=True).decode(
Expand Down
2 changes: 1 addition & 1 deletion shesha/ao/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.ao
## @brief Python package for AO operations on COMPASS simulation
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/ao/basis.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.ao.basis
## @brief Functions for modal basis (DM basis, KL, Btt, etc...)
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/ao/cmats.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.ao.cmats
## @brief Computation implementations of command matrix
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/ao/imats.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.ao.imats
## @brief Computation implementations of interaction matrix
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/ao/modopti.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.ao.modopti
## @brief Functions used for modal optimization control
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/ao/tomo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.ao.tomo
## @brief Computation of tomographic reconstructor
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/ao/wfs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.ao.wfs
## @brief On the fly modification of the WFS
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/config/PATMOS.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.config.PATMOS
## @brief Param_atmos class definition
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/config/PCENTROIDER.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.config.PCENTROIDER
## @brief Param_centroider class definition
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/config/PCONTROLLER.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.config.PCONTROLLER
## @brief Param_controller class definition
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/config/PCORONO.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.config.PCORONO
## @brief Param_corono class definition
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/config/PDMS.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.config.PDMS
## @brief Param_dm class definition
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/config/PGEOM.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.config.PGEOM
## @brief Param_geom class definition
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/config/PLOOP.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.config.PLOOP
## @brief Param_loop class definition
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/config/PTARGET.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.config.PTARGET
## @brief Param_target class definition
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/config/PTEL.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.config.PTEL
## @brief Param_tel class definition
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/config/PWFS.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.config.PWFS
## @brief Param_wfs class definition
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.config
## @brief Parameter classes for COMPASS
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
5 changes: 2 additions & 3 deletions shesha/config/config_setter_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.config.config_setter
## @brief Utility functions for enforcing types in a property setter
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down Expand Up @@ -39,8 +39,7 @@


def enforce_int(n):
if not (isinstance(n, int) or isinstance(n, np.int32) or isinstance(n,
np.int64)):
if not isinstance(n, int):
raise TypeError("Value should be integer.")
return n

Expand Down
2 changes: 1 addition & 1 deletion shesha/config/pconfig.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.config
## @brief Parameters configuration class
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/constants.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.constants
## @brief Numerical constants for shesha and config enumerations for safe-typing
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/init/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.init
## @brief Python package for COMPASS simulation initialization
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/init/atmos_init.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.init.atmos_init
## @brief Initialization of a Atmos object
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/init/coronagraph_init.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.init.coronagraph_init
## @brief Initialization of a Coronagraph object
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2023/03/02
## @copyright GNU Lesser General Public License
#
Expand Down
19 changes: 12 additions & 7 deletions shesha/init/dm_init.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.init.dm_init
## @brief Initialization of a Dms object
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.3
## @version 5.4.4
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down Expand Up @@ -581,6 +581,7 @@ def init_custom_dm(p_dm: conf.Param_dm, p_geom: conf.Param_geom, diam: float):
if cases == [False, False, False]:
f_pupm = hdul[0].header['PUPM']
scale = diam / f_pupm
print('Custom DM: stretching DM to fit PUPM (%f) to compass (%f)' % (f_pupm, diam))
elif cases == [True, False, False]:
scale = diam / p_dm.diam_dm
elif cases == [False, True, False]:
Expand All @@ -602,7 +603,9 @@ def init_custom_dm(p_dm: conf.Param_dm, p_geom: conf.Param_geom, diam: float):
f_pixsize *= scale
print("Custom dm scaling factor to pupil plane :", scale)

# Scaling factor from fits to compass system
# Scaling factor from fits to compass system. The float32() acts as a
# roundoff, required to avoid weird behavior when exporting/importing
# custom DMs from/to compass
scaleToCompass = np.float32(f_pixsize) / np.float32(p_geom._pixsize)

# shift to add to coordinates from fits to compass
Expand All @@ -627,7 +630,7 @@ def init_custom_dm(p_dm: conf.Param_dm, p_geom: conf.Param_geom, diam: float):

# Allocate influence function maps and other arrays
p_dm._ntotact = ntotact
p_dm._influsize = np.int32(smallsize)
p_dm._influsize = np.int(smallsize)
p_dm._i1 = np.zeros(ntotact, dtype=np.int32)
p_dm._j1 = np.zeros(ntotact, dtype=np.int32)
p_dm._xpos = np.zeros(ntotact, dtype=np.float32)
Expand Down Expand Up @@ -736,11 +739,11 @@ def make_kl_dm(p_dm: conf.Param_dm, patchDiam: int, p_geom: conf.Param_geom,
print("KL type: ", p_dm.type_kl)

if (p_dm.nkl < 13):
nr = np.int64(5.0 * np.sqrt(52)) # one point per degree
npp = np.int64(10.0 * nr)
nr = np.long(5.0 * np.sqrt(52)) # one point per degree
npp = np.long(10.0 * nr)
else:
nr = np.int64(5.0 * np.sqrt(p_dm.nkl))
npp = np.int64(10.0 * nr)
nr = np.long(5.0 * np.sqrt(p_dm.nkl))
npp = np.long(10.0 * nr)

radp = kl_util.make_radii(cobs, nr)

Expand Down Expand Up @@ -784,8 +787,10 @@ def comp_dmgeom(p_dm: conf.Param_dm, p_geom: conf.Param_geom):
mpup_dim = p_geom._mpupil.shape[0]

if (dm_dim < mpup_dim):
print('DM support is smaller than mpupil')
offs = (mpup_dim - dm_dim) // 2
else:
print('DM support is larger than mpupil')
offs = 0
mpup_dim = dm_dim

Expand Down
Loading

0 comments on commit f8e5708

Please sign in to comment.