FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
STPT Mosaic Pipeline
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Institute of Astronomy
camCEAD
IMAXT
STPT Mosaic Pipeline
Commits
305c2ae1
Unverified
Commit
305c2ae1
authored
5 years ago
by
Eduardo Gonzalez Solares
Browse files
Options
Downloads
Patches
Plain Diff
Add logging. Remove prints
parent
4967a20c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3
Dask
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
stpt_pipeline/chi_functions.py
+6
-2
6 additions, 2 deletions
stpt_pipeline/chi_functions.py
stpt_pipeline/main.py
+16
-9
16 additions, 9 deletions
stpt_pipeline/main.py
with
22 additions
and
11 deletions
stpt_pipeline/chi_functions.py
+
6
−
2
View file @
305c2ae1
import
logging
import
numpy
as
np
from
scipy.signal
import
medfilt2d
log
=
logging
.
getLogger
(
'
owl.daemon.pipeline
'
)
def
MAD
(
x
):
"""
[summary]
...
...
@@ -222,7 +226,7 @@ def find_overlap_conf(
#
#
for
i_delta
in
range
(
len
(
DELTA
)):
print
(
'
Iteration
{0:1d}
'
.
format
(
i_delta
+
1
)
)
log
.
info
(
'
Iteration
%d
'
,
i_delta
+
1
)
# the first iteration sets up the displacements to be
# evaluated
if
(
i_delta
==
0
)
&
blind_start
:
...
...
@@ -344,7 +348,7 @@ def find_overlap_conf(
dx
=
int
(
np
.
median
(
desp_x
))
dy
=
int
(
np
.
median
(
desp_y
))
#
print
(
'
Found min at dx=
{0:4d},dy={1:4d}
'
.
format
(
dx
,
dy
)
)
log
.
info
(
'
Found min at dx=
%d, dy=%d
'
,
dx
,
dy
)
#
# now on to generate the relevant outputs
#
...
...
This diff is collapsed.
Click to expand it.
stpt_pipeline/main.py
+
16
−
9
View file @
305c2ae1
...
...
@@ -82,7 +82,10 @@ def main(*, root_dir: str, flat_file: str, output_dir: str):
output_dir : str
[description]
"""
log
.
info
(
'
Reading flatfield %s
'
,
flat_file
)
nflat
=
read_flatfield
(
flat_file
)
log
.
info
(
'
Getting directory listing %s
'
,
root_dir
)
dirs
=
list_directories
(
root_dir
)
for
this_dir
in
dirs
:
...
...
@@ -91,6 +94,7 @@ def main(*, root_dir: str, flat_file: str, output_dir: str):
mosaic_file
=
get_mosaic_file
(
this_dir
)
dx
,
dy
,
lx
,
ly
=
read_mosaicifile_stpt
(
this_dir
+
mosaic_file
)
delta_x
,
delta_y
=
find_delta
(
dx
,
dy
)
log
.
debug
(
'
delta_x : %s , delta_y: %s
'
,
delta_x
,
delta_y
)
# dx0,dy0 are just the coordinates of each image
# in columns/rows
dx0
=
np
.
round
((
dx
-
dx
.
min
())
/
delta_x
).
astype
(
int
)
...
...
@@ -115,11 +119,7 @@ def main(*, root_dir: str, flat_file: str, output_dir: str):
std_img
=
magic_function
(
np
.
std
(
img_cube
,
0
),
flat
=
nflat
)
shapes
=
magic_function
(
img_cube
[
0
,
...],
flat
=
nflat
).
shape
#
print
(
'
Found {0:d} images, cube STD {1:.3f}
'
.
format
(
img_cube
.
shape
[
0
],
np
.
mean
(
std_img
)
)
)
log
.
info
(
'
Found %d images, cube STD %.3f
'
,
img_cube
.
shape
[
0
],
np
.
mean
(
std_img
))
# Default confidence map, as the array is square but
# the geometrical transform to correct distortion
# leaves some pixels empty, so these are set to zero in
...
...
@@ -165,9 +165,9 @@ def main(*, root_dir: str, flat_file: str, output_dir: str):
for
this_img
in
i_t
:
if
dx_mat
[
i
,
this_img
]
!=
-
9999
:
# already done
print
(
'
({0:2d},{1:2d}
) already done
'
.
format
(
i
,
this_img
)
)
log
.
debug
(
'
(%d, %d
) already done
'
,
i
,
this_img
)
continue
print
(
'
Finding shifts for (
{0:2d},{1:2d})
'
.
format
(
i
,
this_img
)
)
log
.
info
(
'
Finding shifts for (
%d, %d)
'
,
i
,
this_img
)
#
# Find relative orientation. As the crossmatching code always assumes
# that the images are aligned along the X axis and the reference is to
...
...
@@ -189,11 +189,14 @@ def main(*, root_dir: str, flat_file: str, output_dir: str):
ind_ref
=
this_img
ind_obj
=
i
continue
log
.
debug
(
'
Orientation %s
'
,
ORIENTATION
)
#
# Transformed images
#
im_ref
=
magic_function
(
img_cube
[
ind_ref
,
...],
flat
=
nflat
)
log
.
debug
(
'
Transforming image %d
'
,
ind_ref
)
new_ref
=
geometric_transform
(
magic_function
(
img_cube
[
ind_ref
,
...],
flat
=
nflat
)
,
im_ref
,
get_coords
,
output_shape
=
(
int
(
shapes
[
0
]),
shapes
[
1
]),
extra_arguments
=
(
Settings
.
cof_dist
,
shapes
[
0
]
*
0.5
,
shapes
[
0
]),
...
...
@@ -202,8 +205,11 @@ def main(*, root_dir: str, flat_file: str, output_dir: str):
cval
=
0.0
,
order
=
1
,
)
im_obj
=
magic_function
(
img_cube
[
ind_obj
,
...],
flat
=
nflat
)
log
.
debug
(
'
Transforming image %d
'
,
ind_obj
)
new_obj
=
geometric_transform
(
magic_function
(
img_cube
[
ind_obj
,
...],
flat
=
nflat
)
,
im_obj
,
get_coords
,
output_shape
=
(
int
(
shapes
[
0
]),
shapes
[
1
]),
extra_arguments
=
(
Settings
.
cof_dist
,
shapes
[
0
]
*
0.5
,
shapes
[
0
]),
...
...
@@ -213,6 +219,7 @@ def main(*, root_dir: str, flat_file: str, output_dir: str):
order
=
1
,
)
# finding shift
log
.
debug
(
'
Finding shifts
'
)
dx
,
dy
,
mer
=
find_overlap_conf
(
new_ref
,
dist_conf
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment