Commit 5be1d0f9 authored by skamann's avatar skamann
Browse files

Fixed again some deprecation warnings.

parent 7cdfe5c7
""" """
coordinates.py coordinates.py
============== ==============
Copyright 2013-2020 Sebastian Kamann Copyright 2013-2021 Sebastian Kamann
This file is part of PampelMuse. This file is part of PampelMuse.
...@@ -65,7 +65,7 @@ This results in the inverse transformation: ...@@ -65,7 +65,7 @@ This results in the inverse transformation:
Latest Git revision Latest Git revision
------------------- -------------------
2020/02/12 2021/04/22
""" """
import logging import logging
import os import os
...@@ -76,7 +76,7 @@ from ..core.parameters import Parameters ...@@ -76,7 +76,7 @@ from ..core.parameters import Parameters
__author__ = "Sebastian Kamann (s.kamann@ljmu.ac.uk)" __author__ = "Sebastian Kamann (s.kamann@ljmu.ac.uk)"
__revision__ = 20200212 __revision__ = 20210422
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -245,7 +245,7 @@ class Transformation(Parameters): ...@@ -245,7 +245,7 @@ class Transformation(Parameters):
np.nanmean(residuals[:, i, 1]))) np.nanmean(residuals[:, i, 1])))
# define which parameters are free/fixed # define which parameters are free/fixed
free = np.ones((len(cls.PARAMETERS)), dtype=np.bool) free = np.ones((len(cls.PARAMETERS)), dtype=bool)
if fixed is not None: if fixed is not None:
for parameter in fixed.columns.names: for parameter in fixed.columns.names:
free[cls.PARAMETERS.index(parameter)] = False free[cls.PARAMETERS.index(parameter)] = False
...@@ -361,7 +361,7 @@ class Transformation(Parameters): ...@@ -361,7 +361,7 @@ class Transformation(Parameters):
# handle fixed parameters, if any: # handle fixed parameters, if any:
# The idea is to multiply each fixed parameter with the corresponding column of the matrix, # The idea is to multiply each fixed parameter with the corresponding column of the matrix,
# subtract the results from b, and exclude the column from the fit # subtract the results from b, and exclude the column from the fit
use_column = np.ones(in_matrix.shape[1], dtype=np.bool) use_column = np.ones(in_matrix.shape[1], dtype=bool)
for parameter, value in fixed.items(): for parameter, value in fixed.items():
value = np.atleast_1d(value) value = np.atleast_1d(value)
if value.size != b.shape[0]: if value.size != b.shape[0]:
......
""" """
instrument.py instrument.py
============= =============
Copyright 2013-2018 Sebastian Kamann Copyright 2013-2021 Sebastian Kamann
This file is part of PampelMuse. This file is part of PampelMuse.
...@@ -28,7 +28,7 @@ defines generic methods that are inherited by all its subclasses. ...@@ -28,7 +28,7 @@ defines generic methods that are inherited by all its subclasses.
Latest Git revision Latest Git revision
------------------- -------------------
2018/05/08 2021/04/22
""" """
import logging import logging
import matplotlib import matplotlib
...@@ -42,7 +42,7 @@ from ..utils.distance import dist2path, point_in_poly ...@@ -42,7 +42,7 @@ from ..utils.distance import dist2path, point_in_poly
__author__ = "Sebastian Kamann (s.kamann@ljmu.ac.uk)" __author__ = "Sebastian Kamann (s.kamann@ljmu.ac.uk)"
__revision__ = 20180508 __revision__ = 20210422
class Instrument(object): class Instrument(object):
...@@ -455,7 +455,7 @@ class Instrument(object): ...@@ -455,7 +455,7 @@ class Instrument(object):
A boolean array that is True if a science fibre is present at this A boolean array that is True if a science fibre is present at this
index and False if an auxiliary fibre is located there. index and False if an auxiliary fibre is located there.
""" """
_isscience = np.ones((self.nspaxel + self.naux,), dtype=np.bool) _isscience = np.ones((self.nspaxel + self.naux,), dtype=bool)
_isscience[self.aux_fibers] = False _isscience[self.aux_fibers] = False
return _isscience return _isscience
...@@ -554,7 +554,7 @@ class Instrument(object): ...@@ -554,7 +554,7 @@ class Instrument(object):
A boolean flag for each source indicating whether or not it is A boolean flag for each source indicating whether or not it is
inside the field of view. inside the field of view.
""" """
return np.array([point_in_poly(x, y, self.edgepath.vertices) for x, y in xy], dtype=np.bool) return np.array([point_in_poly(x, y, self.edgepath.vertices) for x, y in xy], dtype=bool)
def distance_to_edge(self, xy, metric=None): def distance_to_edge(self, xy, metric=None):
""" """
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment