Giter VIP home page Giter VIP logo

wiser's Introduction

WISER

WISER: Wavefront sImulation codE libRary

WISER is a physical optics package, currently based on Huygens-Fresnel propagation integral, conceived for simulating the optical performances of X-Ray Mirrors.

Features

  • It is 2D
  • Optical elements are segments, curves, elliptic arc sections, circle arc setions, etc.
  • Various sorces
  • Various optical elements
  • Accounts for error surface defects
    • Figure error (as profile)
    • Roughness (as statistical Power Density)
  • Uses Huygens-Fresnel integral (monochromatic light, spatially coherent)

Light Sources

  • Gaussian (TEM00)
  • Gaussian-Laguerre
  • Point Source (Spherical wave)
  • Plane Wave
  • Arbitrary (passed as 1d complex field at given wavelength)

Optics element

  • Plane Mirror
  • Elliptic Mirror
  • Spherical Mirror
  • Slit
  • Detector
  • Grating

Common Tasks

wiser's People

Contributors

aljosahafner avatar capitanevs avatar lucarebuffi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

capitanevs

wiser's Issues

Detector Widget - Problems while finding the focus

1)This is what one gets when plotting the HEW.

immagine

It seems that it is plotted upside down.
Shall we check on a LibWiser simulation, or shell we have a look at the plot functions?
2) The slider does not work. We totally need to define a debug strategy for that
immagine

  1. We still need to improve this side of the panel, by using the N of samples as input and displaying the Step as (read only) output.
    immagine

Normalisation

Correctly normalise the equation in HuygensIntegral_1d_Kernel().

Figure error - Inconsistent behavior

  1. The "Custom height scaling" is doing something strange.
    I had to multiply the original datum times 30, to have it multiplied times 100.

immagine
immagine

  1. We need to better handle the case reading the file format fails.

Foundation. GeneralDistanceFromParent

Two comments on that.

a) As an (untold) convention, I used to name attributes so that properties sound like nouns, while methods(i.e. functions) sound like verbs. Since GeneralDistanceFromParent(self, Orientation=True, Reference=True):, is a function, it shall be renamed with Get
GetGeneralDistanceFromParent. BUT... (see b)

b) As another (untold) convention that I used, more specific functions are marked by "appending" labels describing features. E.g. MirrorElliptic, MirrorPlane and not EllipticMirror, PlaneMirror. The reason is simple: it sounds "bad English", but it makes programming easier and tidier. For instance, with autocompletion you type "Mirror..." and then you get all the "Mirror-ware".
I would do the same for yout function.
So GetGeneralDistanceFromParent => GetDistanceFromParentGeneral

Disclaimer "Convention" is a big word. Let's call it "guideline".

c) We should keep only one function for getting the distance in the future. Which is the best one? GetDistanceFromParent or GetDistanceFromParentGeneral?
We are not deciding now, but every time that we will use a new "GetDistanceFromParent..." we will discuss which one to use. It "general" is the best, we will replace it everywhere little by little.

Miscellaneous

We should refurbish the code like that
DOWNSTREAM_FOCUS
instead of
DowstreamFocus

immagine

Normalization

Correct the normalization of HuygensIntegral_1d_Kernel
re-wire AngleGrazing and L from the oustide.

PyPI

We should publish WISEr on PyPI. This can be useful also for (possible) collaborations.
If you have some general caveat before doing that, we can discuss.

tags: wave optics, huygens fresnel, synchrotron, x ray, figure error, roughness
description: Wave Optics Package. It is specifically aimed at the composition of Synchrotron/Free Electron Laser beamlines, including the capability of handling metrological information on mirror figure error and roughness.

Two branches?

Please resolve the issue with two master branches.

Figure error - alignment

This was not an issue but an improvement.

Now the figure error is padded to reach the same size as the mirrror length:

immagine

Big Numbers

A simulation with a big (but not huge) sampling (e.g. N = 6e5) takes way out long (>1 hour)

To do (after OASYS-GUI will be complete)
-quick shared benchmarking
-understand if further optimization is possible
-understand if RAZFEC can make one leap ahead

LibWiser.Enums

Gather all the enums of Optics. Fundation etc in a unique Enums file, so that in WofryWise the import is simpler.
We have two options
OPTION1

> <Enums.py>
> ---------------------------------------------
> from LibWiser.Optics import Enum1
<Optics.py>
---------------------------------------------
@Enum
class Enum1
     field1 = val1
     fiel2 = val2

OR
OPTION2

 <Enums.py>
 ---------------------------------------------
@Enum
class Enum1
     field1 = val1
     fiel2 = val2
<Optics.py>
---------------------------------------------
from LibWiser.Enums import Enum1```

Option2 Is more tidy.
Option1 is easier to do right now, since one does not need to change too many files, and it is more functional to wofrywiser




Function names

Please keep the first letter of functions, variables and classes non-capitalized.

ORIENTATION BUG -

Ok That was hard to find. It is well hidden, serious but (maybe) not difficult.

ISOTROPIC Source +
No elements +
HORIZONTAL or VERTICAL KB and Detector => the best focus is in the right position

ISOTROPIC Source +
HORIZONTAL elements +
VERTICAL KB and Detector => the best focus is in the WRONG position
immagine

ISOTROPIC Source +
HORIZONTAL elements +
HORIZONTAL KB and Detector => the best focus is in the right position
immagine

The bamline layout is the same. BUT the relative differences are not: Notice DeltaZ of kb, it is too long. This means source too far => focal spot shifted at z<0 (orange curve)

Orange curve: the minimum is in the wrong position, others: right position.

immagine

Sampling

Implement Eq. 12 and/or 11 (Raimondi, Spiga, A&A (2014)) for the sampling.

The function to upgrade is:
Fundation.GetNSamples_OpticalElement

print(Beamline) for slits

<<What has to be corrected is the print(Beamline) statement, as DeltaZ should be the real DeltaZ, including the slits (in my opinion). Now the deltaZ is shown wrong. >>

from Aljosa Mail

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.