Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
skamann
pampelmuse
Commits
1b0e0796
Commit
1b0e0796
authored
Jul 16, 2021
by
skamann
Browse files
Removed centre determination for Maoppy PSF. This is done internally in Maoppy v.1.4.
parent
0e9fcade
Changes
2
Hide whitespace changes
Inline
Side-by-side
pampelmuse/psf/profiles/maoppy.py
View file @
1b0e0796
...
...
@@ -33,6 +33,7 @@ Latest Git revision
import
importlib.util
import
io
import
logging
import
warnings
import
numpy
as
np
from
contextlib
import
redirect_stdout
from
scipy.interpolate
import
RectBivariateSpline
,
InterpolatedUnivariateSpline
,
interp2d
...
...
@@ -384,10 +385,9 @@ class Maoppy(Profile):
# run MAOPPY code
__f
=
psf
((
self
.
r0
,
self
.
bck
,
self
.
amp
,
self
.
alpha
,
self
.
q
,
self
.
theta
,
self
.
beta
),
dx
=
dy
,
dy
=
dx
)
# account for offset between assumed and MAOPPY-internal centre
x_center
,
y_center
=
self
.
get_maoppy_centre
(
k
=
psf
.
_k
)
shift_x
=
int
(
self
.
xc
)
-
x_center
shift_y
=
int
(
self
.
yc
)
-
y_center
# account for offset between PSF array and array used by Maoppy
shift_x
=
int
(
self
.
xc
)
-
self
.
maoppy_shape
[
0
]
//
2
shift_y
=
int
(
self
.
yc
)
-
self
.
maoppy_shape
[
1
]
//
2
# MAOPPY returns 2D array. Need to revert to pixel sampling used by instance.
ip
=
RectBivariateSpline
(
x
=
np
.
arange
(
self
.
maoppy_shape
[
1
])
+
shift_x
,
...
...
@@ -409,6 +409,8 @@ class Maoppy(Profile):
def
get_maoppy_centre
(
self
,
k
,
shape
=
None
):
"""
DEPRECATED
Determine the centre of the PSF profile that is used by the MAOPPY
code for a given oversampling factor `k` and array size `shape`.
...
...
@@ -425,6 +427,8 @@ class Maoppy(Profile):
centre : tuple of 2 floats
The central coordinates of the PSF along the y- and x-axes.
"""
warnings
.
warn
(
'This method should not be used with Maoppy versions >=1.4.0'
,
DeprecationWarning
)
if
shape
is
None
:
shape
=
self
.
maoppy_shape
return
shape
[
0
]
/
2
-
(
k
-
1.
)
/
(
2.
*
k
),
shape
[
1
]
/
2
-
(
k
-
1.
)
/
(
2.
*
k
)
...
...
@@ -561,7 +565,7 @@ class Maoppy(Profile):
x0
=
[]
names
=
[
'r0'
,
'bck'
,
'amp'
,
'alpha'
,
'e'
,
'theta'
,
'beta'
]
fixed
=
np
.
ones
(
len
(
names
),
dtype
=
np
.
bool
)
fixed
=
np
.
ones
(
len
(
names
),
dtype
=
bool
)
for
i
,
parameter
in
enumerate
(
names
):
if
parameter
in
parameters
:
fixed
[
i
]
=
False
...
...
@@ -571,7 +575,7 @@ class Maoppy(Profile):
else
:
x0
.
append
(
getattr
(
self
,
parameter
))
y_center
,
x_center
=
self
.
get_
maoppy_
centre
(
k
=
oversample
(
self
.
samp
)[
1
])
y_center
,
x_center
=
self
.
maoppy_
shape
[
0
]
//
2
,
self
.
maoppy_shape
[
1
]
//
2
shift_x
=
int
(
round
(
x_center
-
self
.
xc
))
shift_y
=
int
(
round
(
y_center
-
self
.
yc
))
...
...
@@ -605,7 +609,7 @@ class Maoppy(Profile):
npixfit
=
None
# perform fit
# code prints out some "-" symbols to indic
id
ate progression, which are captured so that is does not interfere
# code prints out some "-" symbols to indicate progression, which are captured so that is does not interfere
# with the logging
f
=
io
.
StringIO
()
with
redirect_stdout
(
f
):
...
...
setup.py
View file @
1b0e0796
...
...
@@ -12,5 +12,5 @@ setup(
scripts
=
[
'bin/PampelMuse'
,
],
package_data
=
{
'pampelmuse.config'
:
[
'data/pampelmuse.json'
,
],
'pampelmuse.filters'
:
[
'data/*'
,
]},
install_requires
=
[
'numpy'
,
'scipy'
,
'astropy'
,
'matplotlib'
,
'pandas>1.0,<1.3'
,
'PyQt5'
,
'tqdm'
],
extras_require
=
{
'nfm'
:
'maoppy'
}
extras_require
=
{
'nfm'
:
'maoppy
>=1.4.0
'
}
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment