Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
apipeline
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Jira
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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Kutkin
apipeline
Commits
acc3a3d5
Commit
acc3a3d5
authored
Aug 11, 2021
by
Alexander Kutkin
Browse files
Options
Downloads
Patches
Plain Diff
add option to clip model after cleaning
parent
28c8aa3a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
imcal.py
+6
-4
6 additions, 4 deletions
imcal.py
imcal.yml
+5
-0
5 additions, 0 deletions
imcal.yml
with
11 additions
and
4 deletions
imcal.py
+
6
−
4
View file @
acc3a3d5
...
@@ -282,15 +282,15 @@ def view_sols(h5param, outname=None):
...
@@ -282,15 +282,15 @@ def view_sols(h5param, outname=None):
# plt.show()
# plt.show()
# TODO
# TODO
def
model_apply_threshold
(
model
,
threshold
=
0.0
,
out
=
None
):
def
remove_model_components_below_level
(
model
,
level
=
0.0
,
out
=
None
):
"""
"""
Clip the model to be above the given
threshold
Clip the model to be above the given
level
Parameters
Parameters
----------
----------
model : STR, model file name
model : STR, model file name
the input model file name
the input model file name
threshold
: FLOAT, optional
level
: FLOAT, optional
the threshold above which the components are kept. The default is 0.0.
the threshold above which the components are kept. The default is 0.0.
out : STR, optional
out : STR, optional
The output model filename. The default is None (the model file will be overwritten).
The output model filename. The default is None (the model file will be overwritten).
...
@@ -299,10 +299,12 @@ def model_apply_threshold(model, threshold=0.0, out=None):
...
@@ -299,10 +299,12 @@ def model_apply_threshold(model, threshold=0.0, out=None):
-------
-------
None.
None.
"""
"""
if
level
is
None
:
return
model
out
=
out
or
model
out
=
out
or
model
logging
.
warning
(
'
Overwriting the model
'
)
logging
.
warning
(
'
Overwriting the model
'
)
df
=
pd
.
read_csv
(
model
,
skipinitialspace
=
True
)
df
=
pd
.
read_csv
(
model
,
skipinitialspace
=
True
)
new
=
df
.
query
(
'
I>@
threshold
'
)
new
=
df
.
query
(
'
I>@
level
'
)
new
.
to_csv
(
out
,
index
=
False
)
new
.
to_csv
(
out
,
index
=
False
)
return
out
return
out
...
...
This diff is collapsed.
Click to expand it.
imcal.yml
+
5
−
0
View file @
acc3a3d5
...
@@ -25,6 +25,7 @@ clean1: # wsclean setup
...
@@ -25,6 +25,7 @@ clean1: # wsclean setup
automask
:
20
automask
:
20
autothresh
:
5
autothresh
:
5
multiscale
:
False
multiscale
:
False
clip_model_level
:
None
# use a float number to clip the model to above this level
kwstring
:
'
-use-wgridder
-parallel-deconvolution
1400'
# use this for additional wsclean options, e.g. '-weight uniform -use-idg'
kwstring
:
'
-use-wgridder
-parallel-deconvolution
1400'
# use this for additional wsclean options, e.g. '-weight uniform -use-idg'
dical1
:
# DPPP setup for direction independent calibration
dical1
:
# DPPP setup for direction independent calibration
...
@@ -40,6 +41,7 @@ clean2:
...
@@ -40,6 +41,7 @@ clean2:
automask
:
10
automask
:
10
autothresh
:
5
autothresh
:
5
multiscale
:
True
multiscale
:
True
clip_model_level
:
None
kwstring
:
'
-use-wgridder
-parallel-deconvolution
1400
-parallel-gridding
8
-deconvolution-channels
3'
kwstring
:
'
-use-wgridder
-parallel-deconvolution
1400
-parallel-gridding
8
-deconvolution-channels
3'
dical2
:
dical2
:
...
@@ -55,6 +57,7 @@ clean3:
...
@@ -55,6 +57,7 @@ clean3:
automask
:
7
automask
:
7
autothresh
:
3.5
autothresh
:
3.5
multiscale
:
True
multiscale
:
True
clip_model_level
:
None
kwstring
:
'
-use-wgridder
-parallel-deconvolution
1400
-parallel-gridding
8
-deconvolution-channels
3'
kwstring
:
'
-use-wgridder
-parallel-deconvolution
1400
-parallel-gridding
8
-deconvolution-channels
3'
dical3
:
dical3
:
...
@@ -70,6 +73,7 @@ clean4:
...
@@ -70,6 +73,7 @@ clean4:
automask
:
4.5
automask
:
4.5
autothresh
:
0.5
autothresh
:
0.5
multiscale
:
True
multiscale
:
True
clip_model_level
:
None
kwstring
:
'
-use-wgridder
-parallel-deconvolution
1400
-parallel-gridding
8
-deconvolution-channels
3
-weight
briggs
0.0'
kwstring
:
'
-use-wgridder
-parallel-deconvolution
1400
-parallel-gridding
8
-deconvolution-channels
3
-weight
briggs
0.0'
####################### CLUSTERING #######################
####################### CLUSTERING #######################
...
@@ -100,6 +104,7 @@ clean5:
...
@@ -100,6 +104,7 @@ clean5:
autothresh
:
0.5
autothresh
:
0.5
multiscale
:
True
multiscale
:
True
fitsmask
:
'
mask2.fits'
fitsmask
:
'
mask2.fits'
clip_model_level
:
None
kwstring
:
'
-use-wgridder
-parallel-deconvolution
1400
-parallel-gridding
8
-deconvolution-channels
3
-weight
briggs
0.0'
kwstring
:
'
-use-wgridder
-parallel-deconvolution
1400
-parallel-gridding
8
-deconvolution-channels
3
-weight
briggs
0.0'
### END
### END
...
...
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