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.3 hotfix :
Browse files Browse the repository at this point in the history
- Add a threshold in the wcog centroider
- Use dm_index instead of 0 in get_influ_function
- Replace all deprecated np.bool by native bool
  • Loading branch information
a-sevin committed Apr 21, 2023
1 parent 23a6cb2 commit 5ac7a01
Show file tree
Hide file tree
Showing 83 changed files with 140 additions and 99 deletions.
7 changes: 7 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.3 :](#release-v543-)
- [Release v5.4.2 :](#release-v542-)
- [Release v5.4.1 :](#release-v541-)
- [Release v5.3.0](#release-v530)
Expand All @@ -24,6 +25,12 @@
- [Release v2.0](#release-v20)
- [Release v1.1](#release-v11)

## Release v5.4.3 :

- Add a threshold in the wcog centroider
- Use ```dm_index``` instead of 0 in ```get_influ_function```
- Replace all deprecated np.bool by native bool

## Release v5.4.2 :

- Hotfix: remove clipping from pyramid slope-based kernel
Expand Down
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.2"
__version__ = "5.4.3"

__api_version__ = "5.4.2"
__api_version__ = "5.4.3"

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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion 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.2
## @version 5.4.3
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @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.2
## @version 5.4.3
## @date 2023/03/02
## @copyright GNU Lesser General Public License
#
Expand Down
4 changes: 2 additions & 2 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.2
## @version 5.4.3
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down Expand Up @@ -959,7 +959,7 @@ def make_petal_dm_core(pupImage, pupAngleDegree):
# be identified as relevant connex areas
from scipy.ndimage.measurements import label
from scipy.ndimage.morphology import binary_opening
s = np.ones((2, 2), dtype=np.bool)
s = np.ones((2, 2), dtype=bool)
segments, nbSeg = label(binary_opening(pupImage, s))

# Faut trouver le plus petit support commun a tous les
Expand Down
2 changes: 1 addition & 1 deletion shesha/init/geom_init.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.init.geom_init
## @brief Initialization of the system geometry and of the Telescope object
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.2
## @version 5.4.3
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/init/lgs_init.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.init.lgs_init
## @brief Initialization of a LGS in a Wfs object
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.2
## @version 5.4.3
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
9 changes: 5 additions & 4 deletions shesha/init/rtc_init.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.init.rtc_init
## @brief Initialization of a Rtc object
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.2
## @version 5.4.3
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down Expand Up @@ -291,11 +291,12 @@ def init_centroider(context, nwfs: int, p_wfs: conf.Param_wfs,
rtc.d_centro[nwfs].set_pyr_thresh(p_centroider.thresh)

elif (p_wfs.type == scons.WFSType.SH):
if (p_centroider.type == scons.CentroiderType.TCOG):
if (p_centroider.type == scons.CentroiderType.TCOG or
p_centroider.type == scons.CentroiderType.WCOG):
rtc.d_centro[nwfs].set_threshold(p_centroider.thresh)
elif (p_centroider.type == scons.CentroiderType.BPCOG):
if (p_centroider.type == scons.CentroiderType.BPCOG):
rtc.d_centro[nwfs].set_nmax(p_centroider.nmax)
elif (p_centroider.type == scons.CentroiderType.WCOG or
if (p_centroider.type == scons.CentroiderType.WCOG or
p_centroider.type == scons.CentroiderType.CORR):
r0 = p_atmos.r0 * (p_wfs.Lambda / 0.5)**(6 / 5.)
seeing = CONST.RAD2ARCSEC * (p_wfs.Lambda * 1.e-6) / r0
Expand Down
6 changes: 3 additions & 3 deletions shesha/init/target_init.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.init.target_init
## @brief Initialization of a Target object
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.2
## @version 5.4.3
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down Expand Up @@ -79,9 +79,9 @@ def target_init(ctxt: carmaWrap_context, telescope: Telescope, p_targets: list,
# TODO apodizer, Npts=nb element of apodizer>0
ceiled_apodizer = np.ceil(p_geom._apodizer * p_geom._spupil)
ceiled_apodizer[np.where(ceiled_apodizer > 1)] = 1
Npts = np.sum(ceiled_apodizer)
Npts = int(np.sum(ceiled_apodizer))
else:
Npts = np.sum(ceiled_pupil)
Npts = int(np.sum(ceiled_pupil))

xpos = np.array([p_target.xpos for p_target in p_targets], dtype=np.float32)
ypos = np.array([p_target.ypos for p_target in p_targets], dtype=np.float32)
Expand Down
4 changes: 2 additions & 2 deletions shesha/init/wfs_init.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.init.wfs_init
## @brief Initialization of a Sensors object
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.2
## @version 5.4.3
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down Expand Up @@ -83,7 +83,7 @@ def wfs_init(context: carmaWrap_context, telescope: Telescope, p_wfss: list,
nphot = np.array([o._nphotons for o in p_wfss], dtype=np.float32)
nphot4imat = np.array([o.nphotons4imat for o in p_wfss], dtype=np.float32)
lgs = np.array([o.gsalt > 0 for o in p_wfss], dtype=np.int32)
fakecam = np.array([o.fakecam for o in p_wfss], dtype=np.bool)
fakecam = np.array([o.fakecam for o in p_wfss], dtype=bool)
maxFlux = np.array([o.max_flux_per_pix for o in p_wfss], dtype=np.int32)
max_pix_value = np.array([o.max_pix_value for o in p_wfss], dtype=np.int32)

Expand Down
2 changes: 1 addition & 1 deletion shesha/scripts/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.scripts
## @brief Python package for COMPASS simulation scripts
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.2
## @version 5.4.3
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/scripts/closed_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## @package shesha.scripts.closed_loop
## @brief script test to simulate a closed loop
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.2
## @version 5.4.3
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/scripts/dm_standalone.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.scripts.dm_standalone
## @brief Python dm standalone script
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.2
## @version 5.4.3
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/supervisor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.supervisor
## @brief User layer for initialization and execution of a COMPASS simulation
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.2
## @version 5.4.3
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
2 changes: 1 addition & 1 deletion shesha/supervisor/canapassSupervisor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @package shesha.supervisor.canapassSupervisor
## @brief Initialization and execution of a CANAPASS supervisor
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.4.2
## @version 5.4.3
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
Expand Down
Loading

0 comments on commit 5ac7a01

Please sign in to comment.