Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
nifty_gridder
Commits
380afd2c
Commit
380afd2c
authored
Aug 09, 2019
by
Martin Reinecke
Browse files
add get_taper() function
parent
e2093551
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty_gridder.cc
View file @
380afd2c
...
...
@@ -310,6 +310,31 @@ vector<double> correction_factors (size_t n, size_t nval, size_t w)
return
res
;
}
constexpr
auto
get_taper_DS
=
R"""(
Returns the correction coefficients.
Parameters
==========
ndirty : integer
the number of pixels on the dirty image in the desired direction
epsilon : np.float64
the gridder epsilon
Returns
=======
np.array((ndirty,), dtype=np.float64)
the correction factors.
)"""
;
pyarr_c
<
double
>
get_taper
(
size_t
ndirty
,
double
epsilon
)
{
auto
tmp
=
correction_factors
(
2
*
ndirty
,
ndirty
,
get_w
(
epsilon
));
auto
res
=
makeArray
<
double
>
({
ndirty
});
auto
vres
=
res
.
mutable_data
();
for
(
size_t
i
=
0
;
i
<
ndirty
;
++
i
)
vres
[
i
]
=
tmp
[
i
];
return
res
;
}
template
<
typename
T
>
struct
UVW
{
T
u
,
v
,
w
;
...
...
@@ -1412,4 +1437,5 @@ PYBIND11_MODULE(nifty_gridder, m)
"idx"
_a
,
"grid"
_a
,
"wgt"
_a
,
"ms_in"
_a
=
None
);
m
.
def
(
"apply_holo"
,
&
apply_holo
<
double
>
,
"baselines"
_a
,
"gconf"
_a
,
"idx"
_a
,
"grid"
_a
);
m
.
def
(
"get_taper"
,
&
get_taper
,
get_taper_DS
,
"n"
_a
,
"epsilon"
_a
);
}
Write
Preview
Supports
Markdown
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