Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
ecbc4221
Commit
ecbc4221
authored
Mar 13, 2013
by
Marco Selig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
field's L2norm generalized to Lqnorm.
parent
0c38434c
Changes
2
Hide whitespace changes
Inline
Sidebyside
Showing
2 changed files
with
16 additions
and
9 deletions
+16
9
nifty_core.py
nifty_core.py
+14
4
nifty_power.py
nifty_power.py
+2
5
No files found.
nifty_core.py
View file @
ecbc4221
...
...
@@ 5897,17 +5897,27 @@ class field(object):
x
=
self
.
domain
.
calc_weight
(
x
,
power
=
1
)
return
self
.
domain
.
calc_dot
(
self
.
val
,
x
)
def
norm
(
self
):
## TODO: extend to L^q norm
def
norm
(
self
,
q
=
None
):
"""
Computes the L2norm of the field values.
Computes the Lqnorm of the field values.
Parameters

q : scalar
Parameter q of the Lqnorm (default: 2).
Returns

norm : scalar
The L2
norm of the field values.
The Lq
norm of the field values.
"""
return
np
.
sqrt
(
self
.
dot
(
x
=
self
.
val
))
if
(
q
is
None
):
return
np
.
sqrt
(
self
.
dot
(
x
=
self
.
val
))
else
:
return
self
.
dot
(
x
=
self
.
val
**
(
q

1
))
**
(
1
/
q
)
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def
pseudo_dot
(
self
,
x
=
1
,
**
kwargs
):
"""
...
...
nifty_power.py
View file @
ecbc4221
...
...
@@ 36,11 +36,8 @@
homogeneity and isotropy. Fields which are only statistically homogeneous
can also be created using the diagonal operator routine.
At the moment, NIFTy offers one additional routine for power spectrum
manipulation, the smooth_power function to smooth a power spectrum with a
Gaussian convolution kernel. This can be necessary in cases where power
spectra are reconstructed and reused in an iterative algorithm, where
too much statistical variation might severely effect the results.
At the moment, NIFTY offers several additional routines for power spectrum
manipulation.
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment