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
d2ccf8a5
Unverified
Commit
d2ccf8a5
authored
5 years ago
by
Eduardo Gonzalez Solares
Browse files
Options
Downloads
Patches
Plain Diff
Use pathlib
parent
f61e337a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3
Dask
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
stpt_pipeline/main.py
+7
-6
7 additions, 6 deletions
stpt_pipeline/main.py
stpt_pipeline/mosaic_functions.py
+3
-23
3 additions, 23 deletions
stpt_pipeline/mosaic_functions.py
stpt_pipeline/schema.py
+4
-3
4 additions, 3 deletions
stpt_pipeline/schema.py
with
14 additions
and
32 deletions
stpt_pipeline/main.py
+
7
−
6
View file @
d2ccf8a5
import
logging
from
os
import
listdir
from
pathlib
import
Path
import
numpy
as
np
from
dask
import
delayed
# noqa: F401
...
...
@@ -65,21 +66,21 @@ def list_directories(root_dir):
if
this_file
.
find
(
'
4t1
'
)
>
-
1
:
if
this_file
.
find
(
'
.txt
'
)
>
-
1
:
continue
dirs
.
append
(
root_dir
+
'
/
'
+
this_file
+
'
/
'
)
dirs
.
append
(
root_dir
/
this_file
)
dirs
.
sort
()
return
dirs
def
main
(
*
,
root_dir
:
str
,
flat_file
:
str
,
output_dir
:
str
):
def
main
(
*
,
root_dir
:
Path
,
flat_file
:
Path
,
output_dir
:
Path
):
"""
[summary]
Parameters
----------
root_dir :
str
root_dir :
Path
[description]
flat_file :
str
flat_file :
Path
[description]
output_dir :
str
output_dir :
Path
[description]
"""
log
.
info
(
'
Reading flatfield %s
'
,
flat_file
)
...
...
@@ -92,7 +93,7 @@ def main(*, root_dir: str, flat_file: str, output_dir: str):
log
.
info
(
'
Processing directory %s
'
,
this_dir
)
# read mosaic file, get delta in microns
mosaic_file
=
get_mosaic_file
(
this_dir
)
dx
,
dy
,
lx
,
ly
=
read_mosaicifile_stpt
(
this_dir
+
mosaic_file
)
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
...
...
This diff is collapsed.
Click to expand it.
stpt_pipeline/mosaic_functions.py
+
3
−
23
View file @
d2ccf8a5
...
...
@@ -2,7 +2,7 @@ from os import listdir
import
numpy
as
np
from
imaxt_image.
external
import
t
iff
file
as
tf
from
imaxt_image.
image
import
T
iff
Image
def
find_delta
(
dx
,
dy
):
...
...
@@ -143,25 +143,5 @@ def get_img_cube(
(
channel
==
channel_to_use
)
&
((
optical_slice
-
np
.
min
(
optical_slice
)
+
1
)
==
slice_to_use
)
)[
0
]
im_t
=
[
tf
.
imread
(
root_dir
+
t
).
astype
(
'
float32
'
)
for
t
in
imgs
[
ii
]]
#
return
np
.
array
(
im_t
)
def
imread
(
img_name
):
"""
[summary]
Parameters
----------
img_name : [type]
[description]
Returns
-------
[type]
[description]
"""
# this is just for convenience in case we change tiff library
im_t
=
tf
.
imread
(
img_name
).
astype
(
'
float32
'
)
#
return
im_t
im_t
=
[
TiffImage
(
root_dir
/
t
).
asarray
()
for
t
in
imgs
[
ii
]]
return
np
.
array
(
im_t
).
astype
(
'
float32
'
)
This diff is collapsed.
Click to expand it.
stpt_pipeline/schema.py
+
4
−
3
View file @
d2ccf8a5
import
voluptuous
as
vo
from
pathlib
import
Path
schema
=
vo
.
Schema
(
{
vo
.
Required
(
'
root_dir
'
):
str
,
vo
.
Required
(
'
output_dir
'
):
str
,
vo
.
Required
(
'
flat_file
'
):
str
,
vo
.
Required
(
'
root_dir
'
):
vo
.
Coerce
(
Path
)
,
vo
.
Required
(
'
output_dir
'
):
vo
.
Coerce
(
Path
)
,
vo
.
Required
(
'
flat_file
'
):
vo
.
Coerce
(
Path
)
,
}
)
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