Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
resolve
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
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
ift
resolve
Commits
b9593947
Commit
b9593947
authored
4 years ago
by
Philipp Arras
Browse files
Options
Downloads
Patches
Plain Diff
Various tweaks
parent
b5fbf5e3
No related branches found
No related tags found
No related merge requests found
Pipeline
#94545
passed
4 years ago
Stage: build_docker
Stage: testing
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
demo/mosaicing.py
+2
-1
2 additions, 1 deletion
demo/mosaicing.py
demo/post_mosaicing.py
+12
-1
12 additions, 1 deletion
demo/post_mosaicing.py
with
14 additions
and
2 deletions
demo/mosaicing.py
+
2
−
1
View file @
b9593947
...
@@ -68,11 +68,12 @@ def minimize_with_varcov(lh, varcov_keys, prefix):
...
@@ -68,11 +68,12 @@ def minimize_with_varcov(lh, varcov_keys, prefix):
lh
,
ift
.
AbsDeltaEnergyController
(
0.5
,
5
,
300
,
name
=
"
Sampling
"
)
lh
,
ift
.
AbsDeltaEnergyController
(
0.5
,
5
,
300
,
name
=
"
Sampling
"
)
)
)
fld
=
0.1
*
ift
.
from_random
(
lh
.
domain
)
fld
=
0.1
*
ift
.
from_random
(
lh
.
domain
)
fld
=
ift
.
MultiField
.
union
([
fld
,
fld
.
extract_by_keys
(
varcov_keys
)
*
0.0
])
state
=
rve
.
MinimizationState
(
fld
,
[])
state
=
rve
.
MinimizationState
(
fld
,
[])
mini
=
ift
.
NewtonCG
(
ift
.
GradientNormController
(
name
=
"
newton
"
,
iteration_limit
=
5
))
mini
=
ift
.
NewtonCG
(
ift
.
GradientNormController
(
name
=
"
newton
"
,
iteration_limit
=
5
))
for
ii
in
range
(
20
):
for
ii
in
range
(
20
):
state
=
rve
.
simple_minimize
(
state
=
rve
.
simple_minimize
(
ham
,
state
.
mean
,
3
,
mini
,
constants
=
varcov_keys
if
ii
<
3
else
[]
ham
,
state
.
mean
,
5
,
mini
,
constants
=
varcov_keys
if
ii
<
2
else
[]
)
)
plotter
.
plot
(
f
"
{
ii
}
both
"
,
state
)
plotter
.
plot
(
f
"
{
ii
}
both
"
,
state
)
state
.
save
(
f
"
{
prefix
}
both
"
)
state
.
save
(
f
"
{
prefix
}
both
"
)
...
...
This diff is collapsed.
Click to expand it.
demo/post_mosaicing.py
+
12
−
1
View file @
b9593947
...
@@ -15,17 +15,23 @@ import cfg_mosaicing as c
...
@@ -15,17 +15,23 @@ import cfg_mosaicing as c
def
imshow
(
ax
,
fld
,
**
kwargs
):
def
imshow
(
ax
,
fld
,
**
kwargs
):
if
isinstance
(
fld
.
domain
,
ift
.
MultiDomain
):
fld
=
ift
.
FieldAdapter
(
fld
.
domain
,
"
sky
"
)(
fld
)
kwargs
=
{
**
dict
(
origin
=
"
lower
"
,
cmap
=
"
inferno_r
"
),
**
kwargs
}
kwargs
=
{
**
dict
(
origin
=
"
lower
"
,
cmap
=
"
inferno_r
"
),
**
kwargs
}
return
ax
.
imshow
(
fld
.
val
.
T
,
**
kwargs
)
return
ax
.
imshow
(
fld
.
val
.
T
,
**
kwargs
)
def
imshow_with_colorbar
(
ax
,
fld
,
**
kwargs
):
def
imshow_with_colorbar
(
ax
,
fld
,
**
kwargs
):
if
isinstance
(
fld
.
domain
,
ift
.
MultiDomain
):
fld
=
ift
.
FieldAdapter
(
fld
.
domain
,
"
sky
"
)(
fld
)
kwargs
=
{
**
dict
(
origin
=
"
lower
"
,
cmap
=
"
inferno_r
"
),
**
kwargs
}
kwargs
=
{
**
dict
(
origin
=
"
lower
"
,
cmap
=
"
inferno_r
"
),
**
kwargs
}
im
=
ax
.
imshow
(
fld
.
val
.
T
,
**
kwargs
)
im
=
ax
.
imshow
(
fld
.
T
,
**
kwargs
)
plt
.
colorbar
(
im
,
ax
=
ax
)
plt
.
colorbar
(
im
,
ax
=
ax
)
def
imshow_symmetric
(
ax
,
fld
):
def
imshow_symmetric
(
ax
,
fld
):
if
isinstance
(
fld
.
domain
,
ift
.
MultiDomain
):
fld
=
ift
.
FieldAdapter
(
fld
.
domain
,
"
sky
"
)(
fld
)
lim
=
np
.
max
(
np
.
abs
(
fld
.
val
))
lim
=
np
.
max
(
np
.
abs
(
fld
.
val
))
im
=
imshow
(
ax
,
fld
,
vmin
=-
lim
,
vmax
=
lim
,
cmap
=
"
seismic
"
)
im
=
imshow
(
ax
,
fld
,
vmin
=-
lim
,
vmax
=
lim
,
cmap
=
"
seismic
"
)
plt
.
colorbar
(
im
,
ax
=
ax
)
plt
.
colorbar
(
im
,
ax
=
ax
)
...
@@ -56,6 +62,11 @@ def dirty_images(mean_sky):
...
@@ -56,6 +62,11 @@ def dirty_images(mean_sky):
]
]
weights
.
append
(
reduce
(
lambda
a
,
b
:
a
.
unite
(
b
),
weights
))
weights
.
append
(
reduce
(
lambda
a
,
b
:
a
.
unite
(
b
),
weights
))
# Remove single dish response since it is not linear if additive_term is taken into account
responses
=
responses
[
1
:]
data
=
data
[
1
:]
weights
=
weights
[
1
:]
fig
,
axs
=
plt
.
subplots
(
5
,
5
,
figsize
=
(
20
,
20
),
sharey
=
True
,
sharex
=
True
)
fig
,
axs
=
plt
.
subplots
(
5
,
5
,
figsize
=
(
20
,
20
),
sharey
=
True
,
sharex
=
True
)
for
ii
,
(
R
,
icov
,
d
)
in
enumerate
(
zip
(
responses
,
weights
,
data
)):
for
ii
,
(
R
,
icov
,
d
)
in
enumerate
(
zip
(
responses
,
weights
,
data
)):
...
...
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