Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pykat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
finesse
pykat
Commits
189384dc
Commit
189384dc
authored
11 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
adding in version number
parent
d7e43c41
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.rst
+47
-4
47 additions, 4 deletions
README.rst
pykat/__init__.py
+2
-0
2 additions, 0 deletions
pykat/__init__.py
pykat/finesse.py
+1
-1
1 addition, 1 deletion
pykat/finesse.py
setup.py
+2
-2
2 additions, 2 deletions
setup.py
with
52 additions
and
7 deletions
README.rst
+
47
−
4
View file @
189384dc
...
...
@@ -15,9 +15,28 @@ The easiest way to install PyKat is through PyPi::
If you are a Windows user you also have the option to download the installer at https://pypi.python.org/pypi/PyKat.
You should now be able to open up a new Python terminal and type `import pykat`, the output should be::
>>> import pykat
..-
PyKat 0.1 _ '(
\`.|\.__...-""""-_." )
..+-----.._ / ' ` .-'
. ' `: 7/* _/._\ \ (
( '::;;+;;: `-"' =" /,`"" `) /
L. \`:::a:f c_/ n_'
..`--...___`. . ,
`^-....____: +. www.gwoptics.org/pykat
>>>
You will also need to ensure that you have a fully working copy of FINESSE installed and setup on your machine.
More details on this can be found at http://www.gwoptics.org/finesse.
You must setup 2 environment variables: 'FINESSE_DIR', whose value is the directory that the 'kat' executable is in;
'KATINI', which states the directory and name of the kat.ini file to use by default in FINESSE, more information in the
FINESSE manual can be found about this.
Usage
------
...
...
@@ -40,12 +59,13 @@ Regardless of which interpreter you use, to begin using PyKat you first need to
This provides all the various FINESSE components and commands you will typically need.
Running a simulation requires you to already know how to code FINESSE files, which is beyond
the scope of this readme. FINESSE commands can be entered in many ways:
R
eading in a previous .kat
file, creating pykat objects representing the various FINESSE commands or by wring blocks of code
the scope of this readme. FINESSE commands can be entered in many ways:
r
eading in a previous .kat
file, creating pykat objects representing the various FINESSE commands or by wri
ti
ng blocks of
FINESSE
code
as shown next::
import pylab as pl
# Here we write out any FINESSE commands we want to process
code = """
l l1 1 0 0 n1
s s1 10 1 n1 n2
...
...
@@ -60,15 +80,21 @@ as shown next::
# this kat object represents one single simulation, it containts
# all the objects and their various states.
kat = finesse.kat()
# Currently the kat object is empty. We can fill it using a block
# string of normal FINESSE commands by parsing them.
kat.parseCommands(code)
# Once we have some simulation built up we can run it simply by calling...
out = kat.run()
# This out object contains the results from this run of the simulation.
# Parameters can then be changed and kat.run() can be called again producing
# another output object.
# another output object. So if we wanted to change the reflectivity of m1 we can do
kat.m1.R = 0.2
kat.m1.T = 0.8
# now run it again...
out2 = kat.run()
# We can plot the output simply enough using pylab plotting.
pl.figure()
...
...
@@ -83,6 +109,23 @@ including any post-processing and plotting in one Python script file. Or you can
kat files separately and produce Python scripts to run and process them, that choice is upto
you, Pykat provides the means to be used in both ways.
To load in a separate FINESSE .kat file we can use the commands::
kat = finesse.kat()
# load in a separate file in the same directory...
kat.loadKatFile('test.kat')
# the kat object has now parsed all the commands in this file.
# We can alter and objects in there, e.g. if there was a mirror called m1
kat.m1.phi = 45
out = kat.run()
Finesse Test Server
----------------------
...
...
This diff is collapsed.
Click to expand it.
pykat/__init__.py
+
2
−
0
View file @
189384dc
__version__
=
0.3
#__all__ = ['finesse', 'components', 'detectors', 'commands']
import
finesse
import
components
...
...
This diff is collapsed.
Click to expand it.
pykat/finesse.py
+
1
−
1
View file @
189384dc
...
...
@@ -197,7 +197,7 @@ class kat(object):
(
'
::;;+;;: `-
"'
=
"
/,`
""
`) /
L.
\\
`:::a:f c_/ n_
'
..`--...___`. . ,
`^-....____: +. {1}
"""
.
format
(
pykat_version
,
pykat_web
)
`^-....____: +. {1}
"""
.
format
(
pykat
.
_
_version
__
,
pykat_web
)
def
loadKatFile
(
self
,
katfile
):
commands
=
open
(
katfile
).
read
()
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
2
−
2
View file @
189384dc
...
...
@@ -4,14 +4,14 @@ Created on Sun Jan 27 09:43:16 2013
@author: Daniel
"""
import
pykat
from
distutils.core
import
setup
REQUIREMENTS
=
[
i
.
strip
()
for
i
in
open
(
"
requirements.txt
"
).
readlines
()]
setup
(
name
=
'
PyKat
'
,
version
=
'
0.2.4
'
,
version
=
pykat
.
__version__
,
author
=
'
Daniel Brown
'
,
author_email
=
'
ddb@star.sr.bham.ac.uk
'
,
packages
=
[
'
pykat
'
,
'
pykat.gui
'
,
'
pykat.gui.resources
'
,
'
pykat.testing
'
,
'
pykat.testing.web
'
],
...
...
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