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
ef4fbdaf
Commit
ef4fbdaf
authored
Jul 3, 2023
by
Alexander Kutkin
Browse files
Options
Downloads
Patches
Plain Diff
fix matplotlib version
parent
ae30e160
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#52602
passed
Jul 3, 2023
Stage: build
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+12
-12
12 additions, 12 deletions
Dockerfile
autocorrelations.py
+6
-3
6 additions, 3 deletions
autocorrelations.py
cluster.py
+3
-2
3 additions, 2 deletions
cluster.py
with
21 additions
and
17 deletions
Dockerfile
+
12
−
12
View file @
ef4fbdaf
...
@@ -253,7 +253,7 @@ RUN wget -q -O /WSRT_Measures.ztar \
...
@@ -253,7 +253,7 @@ RUN wget -q -O /WSRT_Measures.ztar \
rm
/WSRT_Measures.ztar
rm
/WSRT_Measures.ztar
# Some python stuff
# Some python stuff
RUN
python3
-m
pip
install
h5py pandas pyyaml astropy matplotlib scipy shapely bdsf ipython radio_beam scikit-learn
RUN
python3
-m
pip
install
h5py pandas pyyaml astropy
matplotlib
==
3.5.2
scipy shapely bdsf ipython radio_beam scikit-learn
# cd /src && \
# cd /src && \
# git clone https://github.com/lofar-astron/PyBDSF.git && \
# git clone https://github.com/lofar-astron/PyBDSF.git && \
# cd /src/PyBDSF && \
# cd /src/PyBDSF && \
...
...
This diff is collapsed.
Click to expand it.
autocorrelations.py
100644 → 100755
+
6
−
3
View file @
ef4fbdaf
...
@@ -27,9 +27,10 @@ def get_autocorr(tab, ant, avg='time', flagged=False):
...
@@ -27,9 +27,10 @@ def get_autocorr(tab, ant, avg='time', flagged=False):
data
[
q
.
getcol
(
'
FLAG
'
)]
=
np
.
nan
data
[
q
.
getcol
(
'
FLAG
'
)]
=
np
.
nan
if
avg
.
lower
()
==
'
time
'
:
if
avg
.
lower
()
==
'
time
'
:
return
abs
(
np
.
nanmean
(
data
,
axis
=
0
))
return
abs
(
np
.
nanmean
(
data
,
axis
=
0
))
elif
avg
.
lower
().
startswith
(
'
freq
'
):
elif
avg
.
lower
().
startswith
(
'
freq
'
)
and
len
(
data
.
shape
)
==
3
:
print
(
data
.
shape
)
return
abs
(
np
.
nanmean
(
data
,
axis
=
1
))
return
abs
(
np
.
nanmean
(
data
,
axis
=
1
))
elif
avg
.
lower
().
startswith
(
'
pol
'
):
elif
avg
.
lower
().
startswith
(
'
pol
'
)
and
len
(
data
.
shape
)
==
3
:
return
abs
(
np
.
nanmean
(
data
,
axis
=
2
))
return
abs
(
np
.
nanmean
(
data
,
axis
=
2
))
else
:
else
:
logging
.
error
(
'
Unknown average keywodr, must be time/freq/pol...
'
)
logging
.
error
(
'
Unknown average keywodr, must be time/freq/pol...
'
)
...
@@ -99,8 +100,10 @@ def plot_autocorrs(ms, flagged=False):
...
@@ -99,8 +100,10 @@ def plot_autocorrs(ms, flagged=False):
antname
=
antnames
[
i
]
antname
=
antnames
[
i
]
avg_time
=
get_autocorr
(
tab
,
ant
,
avg
=
'
time
'
,
flagged
=
flagged
)
# TIME_AVG
avg_time
=
get_autocorr
(
tab
,
ant
,
avg
=
'
time
'
,
flagged
=
flagged
)
# TIME_AVG
avg_freq
=
get_autocorr
(
tab
,
ant
,
avg
=
'
freq
'
,
flagged
=
flagged
)
# FREQ_AVG
avg_freq
=
get_autocorr
(
tab
,
ant
,
avg
=
'
freq
'
,
flagged
=
flagged
)
# FREQ_AVG
if
not
isinstance
(
avg_time
,
np
.
ndarray
)
or
not
isinstance
(
avg_freq
,
np
.
ndarray
):
continue
med_time_avgs
.
append
(
np
.
nanmedian
(
avg_time
,
axis
=
0
))
med_time_avgs
.
append
(
np
.
nanmedian
(
avg_time
,
axis
=
0
))
med_freq_avgs
.
append
(
np
.
nanmedian
(
avg_freq
,
axis
=
0
))
med_freq_avgs
.
append
(
np
.
nanmedian
(
avg_freq
,
axis
=
1
))
for
fig
,
res
in
zip
([
fig1
,
fig2
],
[
avg_time
,
avg_freq
]):
for
fig
,
res
in
zip
([
fig1
,
fig2
],
[
avg_time
,
avg_freq
]):
ax
=
fig
.
add_subplot
(
ny
,
nx
,
i
+
1
)
ax
=
fig
.
add_subplot
(
ny
,
nx
,
i
+
1
)
at
=
AnchoredText
(
antname
,
prop
=
dict
(
size
=
9
),
frameon
=
True
,
loc
=
'
upper left
'
)
at
=
AnchoredText
(
antname
,
prop
=
dict
(
size
=
9
),
frameon
=
True
,
loc
=
'
upper left
'
)
...
...
This diff is collapsed.
Click to expand it.
cluster.py
+
3
−
2
View file @
ef4fbdaf
...
@@ -932,7 +932,7 @@ def main(img, resid, model, clustering_method='Voronoi', add_manual=False, nclus
...
@@ -932,7 +932,7 @@ def main(img, resid, model, clustering_method='Voronoi', add_manual=False, nclus
# racen = f[0].header['CRVAL1']
# racen = f[0].header['CRVAL1']
# deccen = f[0].header['CRVAL2']
# deccen = f[0].header['CRVAL2']
fig
=
plt
.
figure
(
figsize
=
[
12
,
12
])
fig
=
plt
.
figure
(
figsize
=
[
12
,
12
])
ax
=
fig
.
add_subplot
(
1
,
1
,
1
,
projection
=
wcs
.
celestial
)
ax
=
fig
.
add_subplot
(
1
,
1
,
1
,
projection
=
wcs
.
celestial
[
0
]
)
vmin
,
vmax
=
np
.
percentile
(
image_data
,
5
),
np
.
percentile
(
image_data
,
95
)
vmin
,
vmax
=
np
.
percentile
(
image_data
,
5
),
np
.
percentile
(
image_data
,
95
)
ax
.
imshow
(
resid_data
,
vmin
=
vmin
,
vmax
=
vmax
,
origin
=
'
lower
'
)
#cmap='gray', vmin=2e-5, vmax=0.1)#, norm=LogNorm())
ax
.
imshow
(
resid_data
,
vmin
=
vmin
,
vmax
=
vmax
,
origin
=
'
lower
'
)
#cmap='gray', vmin=2e-5, vmax=0.1)#, norm=LogNorm())
...
@@ -960,4 +960,5 @@ def main(img, resid, model, clustering_method='Voronoi', add_manual=False, nclus
...
@@ -960,4 +960,5 @@ def main(img, resid, model, clustering_method='Voronoi', add_manual=False, nclus
### if __name__ == "__main__":
### if __name__ == "__main__":
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
main
(
img
,
resid
,
model
,
clustering_method
=
'
Voronoi
'
,
nclusters
=
6
)
pass
# main(img, resid, model, clustering_method='Voronoi', nclusters=6)
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