<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.sternwarte.uni-erlangen.de/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lang</id>
	<title>Remeis-Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.sternwarte.uni-erlangen.de/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lang"/>
	<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php/Special:Contributions/Lang"/>
	<updated>2026-04-09T13:34:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.7</generator>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=PhD_hat_for_Veronika&amp;diff=1457</id>
		<title>PhD hat for Veronika</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=PhD_hat_for_Veronika&amp;diff=1457"/>
		<updated>2018-05-02T14:24:12Z</updated>

		<summary type="html">&lt;p&gt;Lang: Created page with &amp;quot;&amp;lt;u&amp;gt;'''Defense date: 17. July, 14:30 (2:30 pm)'''&amp;lt;/u&amp;gt;  ====== PhD hat for Veronika ======  ==== What to put on the hat? ====  ==== Arbeit ====  * Innsbruck: Berge an einer Seit...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;u&amp;gt;'''Defense date: 17. July, 14:30 (2:30 pm)'''&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== PhD hat for Veronika ======&lt;br /&gt;
&lt;br /&gt;
==== What to put on the hat? ====&lt;br /&gt;
&lt;br /&gt;
==== Arbeit ====&lt;br /&gt;
&lt;br /&gt;
* Innsbruck: Berge an einer Seite des Hutes?&lt;br /&gt;
* Hw Virginis System&lt;br /&gt;
* Atomdaten&lt;br /&gt;
* Lichtkurven&lt;br /&gt;
* Diss 5 mal ausgedruckt, musste sortiert werden&lt;br /&gt;
* Römische Zahlen!&lt;br /&gt;
* UV-Spektren&lt;br /&gt;
* Eisengruppen-Elemente, R- und S-Prozess Elemente&lt;br /&gt;
* Braune Zwerge zu SdBs (Begleiter)&lt;br /&gt;
&lt;br /&gt;
==== privat ====&lt;br /&gt;
&lt;br /&gt;
* Bratsche&lt;br /&gt;
* Kajak&lt;br /&gt;
* Hochzeit&lt;br /&gt;
* Liegerad?&lt;br /&gt;
* Kaninchen&lt;br /&gt;
* Calar Alto Abenteuer mit Lew: Übernachtung im Freien hinter selbstgebauter Steinwand, Fuchs auf Schlafsack&lt;br /&gt;
* Richard Schaffenroth (nach Hochzeit)&lt;br /&gt;
&lt;br /&gt;
===== Model =====&lt;br /&gt;
&lt;br /&gt;
* build some mountains representing the Alpes around Innsbruck, print panorama, Inntal (Matthias) |&lt;br /&gt;
* build a stone wall with sleeping bags, snow and a fox (Eugenia) | done&lt;br /&gt;
* Write some notes with a UV-pencil on the hat, r- s-process elements, forest (Herr Doktor) | forest is ready&lt;br /&gt;
* Roman numbers (Eugenia) | done&lt;br /&gt;
* print some pages from her diss or paper |&lt;br /&gt;
* Fahrradschlauch als Quaste (Christian) | ready&lt;br /&gt;
* Kajak, Liegerad fährt die Alpen herab | kajak and liegerad build&lt;br /&gt;
* Bratsche, Kaninchen: Figuren | done&lt;br /&gt;
* Hubble paper model (Fe) | in progress&lt;br /&gt;
* lightcurve around the hat (Markus) | done&lt;br /&gt;
* fotos from observing: fotobook with dates (Edith) and pictures (Eva) | done&lt;br /&gt;
* Age of Empires Wololo (Christian) | prepared&lt;br /&gt;
* brown dwarf | done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=PhD_Hat_Thorsten&amp;diff=1456</id>
		<title>PhD Hat Thorsten</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=PhD_Hat_Thorsten&amp;diff=1456"/>
		<updated>2018-05-02T14:16:54Z</updated>

		<summary type="html">&lt;p&gt;Lang: Created page with &amp;quot;====== PhD Hat Thorsten ======  '''Defense Date: 10.05.2017'''  === Building Plan ===   === Idea Collection === * Satellite paper model(s), e.g. of eROSITA and Athena * Fashio...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====== PhD Hat Thorsten ======&lt;br /&gt;
&lt;br /&gt;
'''Defense Date: 10.05.2017'''&lt;br /&gt;
&lt;br /&gt;
=== Building Plan ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Idea Collection ===&lt;br /&gt;
* Satellite paper model(s), e.g. of eROSITA and Athena&lt;br /&gt;
* Fashion the hat surface like a CCD chip grid; let it be hit by &amp;quot;photons&amp;quot; (maybe waves with different size made out of paper?)&lt;br /&gt;
* he designed the paper model for XMM. If you need one, it's hanging at the wall behind Minja's desk.&lt;br /&gt;
* the Remeis logo is also from him. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Natalie%27s_PhD_Hat&amp;diff=1455</id>
		<title>Natalie's PhD Hat</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Natalie%27s_PhD_Hat&amp;diff=1455"/>
		<updated>2018-05-02T14:13:24Z</updated>

		<summary type="html">&lt;p&gt;Lang: Created page with &amp;quot;====== Natalies' PhD Hat ======  ==== Private ====  * Rainbow cake (*Tobi*) * Candy: Skittles, gummi bears &amp;amp;rarr; *tassle* (*Mina*) * Cats  * American flag &amp;quot;eating&amp;quot; the German...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====== Natalies' PhD Hat ======&lt;br /&gt;
&lt;br /&gt;
==== Private ====&lt;br /&gt;
&lt;br /&gt;
* Rainbow cake (*Tobi*)&lt;br /&gt;
* Candy: Skittles, gummi bears &amp;amp;rarr; *tassle* (*Mina*)&lt;br /&gt;
* Cats &lt;br /&gt;
* American flag &amp;quot;eating&amp;quot; the German flag: mini tax forms with flag on back (*Basti*)&lt;br /&gt;
* Bouldering: she was force-convinced, handles made from Fimo Knete, LEGO figure, top of boulder has PhD flag (*Ralf, Mina*)&lt;br /&gt;
* Marbles / puzzles: Murmelbahn (oder kleinere Kugel) aus mit Hitze gebogenen Plastikrohren / Schlaeuchen, halbiert (*WHO?*)&lt;br /&gt;
* skirt bet: Joern will wear one if she wears one: model of Joern on top of hat with skirt (*Matthias*)&lt;br /&gt;
* gun club: electrons walk out of gun (Luftgewehr 3D Druck, *Flo*)&lt;br /&gt;
* discworld (top of hat built on elephants (3D print?) that are carried by turtle (Pappmachee) on top of the hat basement): Pappmachee turtle (*Matthias, Basti, Tobi*), 3D print of 4 Elephants (*Flo*), LED eyes turtle (*Tobi*), The death speaking in capital letters (some capitals somewhere)&lt;br /&gt;
&lt;br /&gt;
==== Work ====&lt;br /&gt;
&lt;br /&gt;
* Different ionization states of atoms: maybe illustrate that with candy? (*WHO?*)&lt;br /&gt;
* model of EBIT (maybe using a mouse trap and magnets, electrons = styrofoam balls with a - sign and a paper boot glued to them?) (*Maria*)&lt;br /&gt;
* grating model, Chandra, ASTRO-H (da koennte man sich natuerlich auslassen) model (*WHO?*)&lt;br /&gt;
* prints: xfig periodic table, &lt;br /&gt;
&lt;br /&gt;
[[Category:Internal]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Nela%27s_Doktorhut&amp;diff=1445</id>
		<title>Nela's Doktorhut</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Nela%27s_Doktorhut&amp;diff=1445"/>
		<updated>2018-05-02T13:56:29Z</updated>

		<summary type="html">&lt;p&gt;Lang: Created page with &amp;quot;====== Nela's Doktorhut ====== ===== Ideensammlung =====  ==== Arbeit ==== * VLBI (Radioantennen, Visualisierung von Interferometrie?) ** Plot einer (u,v)-Abdeckung einer ihre...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====== Nela's Doktorhut ======&lt;br /&gt;
===== Ideensammlung =====&lt;br /&gt;
&lt;br /&gt;
==== Arbeit ====&lt;br /&gt;
* VLBI (Radioantennen, Visualisierung von Interferometrie?)&lt;br /&gt;
** Plot einer (u,v)-Abdeckung einer ihrer Cen A Beobachtungen (Quelle und Datum der Beobachtung kann sie dann erraten); die UV-coverage klingt schon danach, dass der Deckel des Hutes praedestiniert ist&lt;br /&gt;
* TANAMI (Wüste, Australien?)&lt;br /&gt;
* Cen A (Zentaure?)&lt;br /&gt;
* ein AGN Modell&lt;br /&gt;
* Multiwellenlängen&lt;br /&gt;
* Fermi (Gamma-Radio connection)&lt;br /&gt;
* PMN J1603-4904 (the puzzling, strange source &amp;amp;rarr; show confusion???)&lt;br /&gt;
* japanische TV-Doku über Schwarze Löcher: &amp;quot;starring Nela&amp;quot;&lt;br /&gt;
** Verbindung zwischen Radioantennen und japanischer Doku, in dem man eine oder meherer Radioantennen (als kleines Array) mit Origami baut (dafür gibt es Anleitungen vom NAOJ, die zwar auf japanisch sind, aber gut bebildert sind und das eine oder andere könnte ich (Robert) vielleicht noch übersetzen)&lt;br /&gt;
* FRANCI meeting Organisation (Logo)&lt;br /&gt;
* human cross correlation (once she has asked everybody to do a CCF by eye)&lt;br /&gt;
* Bagger&lt;br /&gt;
* Pendeln&lt;br /&gt;
* Quaste (Pendel?, Minion aus Überraschungsei)&lt;br /&gt;
* 90er Parties, Backstreet Boys&lt;br /&gt;
* Eule (Irland)&lt;br /&gt;
&lt;br /&gt;
==== Privates ====&lt;br /&gt;
* &amp;quot;abgebrannter&amp;quot; alter Opel Corsa, wobei abgebrannt uebertrieben ist&lt;br /&gt;
* Looping Louie&lt;br /&gt;
* Berg, Maßkrug?&lt;br /&gt;
&lt;br /&gt;
==== Reisen, Interessen, etc. ====&lt;br /&gt;
* zahlreiche USA-Reisen (Washington, Socorro, etc.)&lt;br /&gt;
* Skifahren&lt;br /&gt;
&lt;br /&gt;
===== Umsetzung =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Aufgabe&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| verantwortlich&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| fertig&lt;br /&gt;
|-&lt;br /&gt;
| Hut-Grundgerüst &lt;br /&gt;
| Andreas &lt;br /&gt;
| ✔ &lt;br /&gt;
|-&lt;br /&gt;
| Origami Radioantennen        &lt;br /&gt;
| Annika &lt;br /&gt;
| ✔ &lt;br /&gt;
|-&lt;br /&gt;
| Jetmodell       &lt;br /&gt;
| Thomas, Katha, Tobi &lt;br /&gt;
| ✔ &lt;br /&gt;
|-&lt;br /&gt;
| Pendelauto      &lt;br /&gt;
| Katha &lt;br /&gt;
| ✔ &lt;br /&gt;
|-&lt;br /&gt;
| Zentaure        &lt;br /&gt;
| Andreas &lt;br /&gt;
| ✔ &lt;br /&gt;
|-&lt;br /&gt;
| Wüste           &lt;br /&gt;
| Andreas &lt;br /&gt;
| ✔ &lt;br /&gt;
|-&lt;br /&gt;
| Bagger          &lt;br /&gt;
| Katha &lt;br /&gt;
| ✔ &lt;br /&gt;
|-&lt;br /&gt;
| Japanisches TV  &lt;br /&gt;
| Matthias &lt;br /&gt;
| ✔ &lt;br /&gt;
|-&lt;br /&gt;
| Quaste (Minion + PMN + Pferdehaar)         &lt;br /&gt;
| Fe+Basti, Eva &lt;br /&gt;
| ✔ &lt;br /&gt;
|-&lt;br /&gt;
| 90er Party      &lt;br /&gt;
| Tobi, Thomas &lt;br /&gt;
| ✔ &lt;br /&gt;
|-&lt;br /&gt;
| Sushi   &lt;br /&gt;
| Eugenia &lt;br /&gt;
| ✔ &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
==== Bilder auf den Seiten ====&lt;br /&gt;
* (u,v)-Abdeckung&lt;br /&gt;
* FRANCI logo&lt;br /&gt;
*  Eule (Irland)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Michael_PhD_Hat&amp;diff=1437</id>
		<title>Michael PhD Hat</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Michael_PhD_Hat&amp;diff=1437"/>
		<updated>2018-05-02T13:40:30Z</updated>

		<summary type="html">&lt;p&gt;Lang: Created page with &amp;quot;====== Michael PhD Hat ====== ===== Collection of ideas =====  * balloon experiment in Canada &amp;amp;rarr; balloon lands in lake although forest everywhere/not much water [A] * Kore...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====== Michael PhD Hat ======&lt;br /&gt;
===== Collection of ideas =====&lt;br /&gt;
&lt;br /&gt;
* balloon experiment in Canada &amp;amp;rarr; balloon lands in lake although forest everywhere/not much water [A]&lt;br /&gt;
* Korean (?) manuals [Ralf, Natalie: print manual picture]&lt;br /&gt;
* Imaging with Remeis telescopes &amp;amp;rarr; &amp;quot;Sendung mit der Maus&amp;quot; clip [Matthias: picture for side]&lt;br /&gt;
* CCD experience and studies of detector noise/cosmics etc.; wrote own software for Jem-EUSO showing the colorful CCD images in &amp;quot;real time&amp;quot; [B]&lt;br /&gt;
* whiskey tasting [ideas: small bottle on hat, only labels?]&lt;br /&gt;
* Tuebingen [???]&lt;br /&gt;
* cats [Andrea: cat figure besides lake]&lt;br /&gt;
* xkcd [Macarena: favourite comic strips on the side of the hat?]&lt;br /&gt;
* futurama: season 4 episode 15 'box containing the universe' [C]&lt;br /&gt;
* Portal (game) [Basti: portal cake connected with invisible strings as tessel]&lt;br /&gt;
* Xbox Kinect [Matthias: Michael playing Xbox sculpture (tiny)]&lt;br /&gt;
* dead pixel T-Shirt [dead pixel joke on LED matrix?]&lt;br /&gt;
===== The Plan =====&lt;br /&gt;
&lt;br /&gt;
== A. Jem/EUSO ==&lt;br /&gt;
&lt;br /&gt;
# paper balloon on hat [1 Euro shop? Macarena, Matthias]&lt;br /&gt;
# instrument on balloon with sensor electronics attached [Matthias]&lt;br /&gt;
# trajectory leading into the lake (connects balloon with lake), wire fixes balloon if empty of helium [Basti, Andrea]&lt;br /&gt;
# tiny lake &amp;amp;rarr; transparent foil, blue paper [Andrea, Basti]&lt;br /&gt;
# fake grass for model train to cover the top with trees [Andrea, Basti]&lt;br /&gt;
&lt;br /&gt;
== B. Top ==&lt;br /&gt;
&lt;br /&gt;
# LED matrix 8x8 on top at the front [Fritz]&lt;br /&gt;
# electronics for LED matrix [Fritz]&lt;br /&gt;
&lt;br /&gt;
== C. Big Blue Box ==&lt;br /&gt;
&lt;br /&gt;
# Inside pictures of universes, Remeis telescope pictures taken by Michael et al, self illuminated stars, think about light [Matthias]&lt;br /&gt;
# picture of Michael on the front of the box [Macarena]&lt;br /&gt;
# paper box around head [Macarena]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Isis:tutorial:slang&amp;diff=1088</id>
		<title>Isis:tutorial:slang</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Isis:tutorial:slang&amp;diff=1088"/>
		<updated>2018-04-13T20:52:56Z</updated>

		<summary type="html">&lt;p&gt;Lang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====== Programming in S-Lang ======&lt;br /&gt;
&lt;br /&gt;
''Remark:'' This brief introduction into S-Lang is primarily a translation of the German-language introduction to S-Lang used in the Remeis astronomy lab, which was mainly written by Manfred Hanke.&lt;br /&gt;
&lt;br /&gt;
===== Introduction =====&lt;br /&gt;
&lt;br /&gt;
The underlying engine of Isis is S-Lang, an interpreted language that is similar to other modern scripting languages such as Perl or python. All of these languages are &amp;quot;Algol-like&amp;quot;, therefore, if you know how to program in C or any other of these scripting languages, you should not have a problem to program in S-Lang as well. &lt;br /&gt;
&lt;br /&gt;
The big advantage of having a scripting language as part of a data analysis package is that many things that are &amp;quot;routine&amp;quot; work can be automated, increasing your efficiency. This includes things like loading the data set that you're working with, e.g., in the case you are working with many spectra from different instruments, and need to do some specific ignoring and rebinning, or the calculation of errors. It also allows you to access all internal structures used in doing your best fit, such that you can prepare very nice figures our output your best fit parameters in a way that is better suited to publication than the standard isis routines. Historically, many astronomers (yours truly included) did this last step in IDL. While that language is very nice, it is also very expensive, with educational licenses costing around 1000 EUR ''per year''. It thus makes a lot of sense to move away from this and use a cheaper and more integrated approach to data analysis.&lt;br /&gt;
&lt;br /&gt;
''A comment to future data analysts:'' Scripting is very good, however, do not try to script everything. Many points of data analysis have to do with understanding your data set and here it is often much better to play with it by hand than to automatize things. Get a &amp;quot;feel&amp;quot; for your data first before trusting the computer to do everything right...&lt;br /&gt;
&lt;br /&gt;
''A comment to the language-warriors:'' Often people will ask why S-Lang was chosen as the interface and not, e.g., python. The reason is simple: because it was there. The important thing is that a scripting language is there at all. The main difficulty in learning how to program is not the programming syntax - if you think so, then you are not a good programmer - but rather to think in an algorithmic way. And this type of thinking is difficult to learn. Learning a new syntax isn't. The author of these lines (not M. Hanke ;-) ) started his life with a simple form of Amstrad Basic, followed by Omikron Basic, PASCAL, Turbo Pascal, Fortran-77(yes, it really is spelled &amp;quot;Fortran&amp;quot;, not &amp;quot;FORTRAN&amp;quot;. The only FORTRAN in existence was FORTRAN 66, since the 1977 standard, that language was spelled &amp;quot;Fortran&amp;quot;...), Fortran-90, IDL, C, C++, Perl, javascript, and I am sure some more languages that I have forgotten (plus all of the assembly languages that were useful when one was still programming in assembly, i.e., 80x86, 68xxxx, and so on). Historically, all of these languages have a syntax that goes back to Algol in the 1960s, and thus in the core they are all the same. For this reason, do not worry about having to learn yet another scripting language, it's just a little bit of syntax. And, if you don't know how to program, start now. Because of the languages are all the same, it does not matter that S-Lang might be seen as obscure by some people, once you know how to think algorithmically, switching over to another language won't cost you too much time. This also means that if you are applying to jobs and somebody claims that you must know java or any other language, stay away from these jobs - knowing how to program is what makes you interesting, not the specific language...&lt;br /&gt;
&lt;br /&gt;
In contrast to compiled languages such as C, C++ or Fortran, scripting languages such as IDL, Perl, python, have the advantage that one can also work with them interactively and thus write small &amp;quot;programs&amp;quot; directly on the command line. We are using this feature all the time when doing data analysis by hand.&lt;br /&gt;
&lt;br /&gt;
In the following we assume that you had at least some previous exposure to programming, and just give a list of the most important language structures. &lt;br /&gt;
&lt;br /&gt;
===== S-Lang Language elements =====&lt;br /&gt;
&lt;br /&gt;
S-Lang consists of the following language elements that allow you to structure your programs. Note that in S-Lang programs ''all'' statements must be ending with a semicolon.&lt;br /&gt;
&lt;br /&gt;
==== Variable Declarations and Assignments ====&lt;br /&gt;
&lt;br /&gt;
In S-Lang programs, variables must be declared (this is optional on the command line). This is done with the instruction&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable var_1, var_2, ... ;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
you then assign values to a variable with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var_1=value;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is a valid S-Lang statement. It is possible to combine the variable declaration and assignment, e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or more complicated expressions such as&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var_1 = sin(a)+sqrt(25.);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Variable names may consist of any combination of the standard ASCII characters &amp;lt;code&amp;gt;a-zA-Z0-9&amp;lt;/code&amp;gt; as well as the underscore &amp;lt;code&amp;gt;_&amp;lt;/code&amp;gt;  and the dollar sign &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt;. A variable is not allowed to start with a number.&lt;br /&gt;
&lt;br /&gt;
==== Data Types ====&lt;br /&gt;
&lt;br /&gt;
=== Simple Data Types ===&lt;br /&gt;
&lt;br /&gt;
S-Lang variables are generally weakly typed, that is the type of a variable is defined by the type of whatever is assigned to it. For example&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
means that after the assignment &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; is an integer. While&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=2.;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
means that &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; is a floating point number. Strings are assigned with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=&amp;quot;abcd&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
However, note that a variable can easily change its type, because the weak typing will mean that after the execution of&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=&amp;quot;abcd&amp;quot;; % String_Type&lt;br /&gt;
a=2.3;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; will have the type &amp;lt;code&amp;gt;Double_Type&amp;lt;/code&amp;gt;.  You can check this by printing the type of the variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typeof(a);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Exercise 1:'''&lt;br /&gt;
&lt;br /&gt;
Assign the result of &amp;lt;code&amp;gt;typeof(a)&amp;lt;/code&amp;gt; to some other variable. What is the datatype of that other variable?&lt;br /&gt;
&lt;br /&gt;
=== An aside on integer and floating point arithmetic ===&lt;br /&gt;
&lt;br /&gt;
Note that while weak typing usually speeds up code development, it does not preserve you from the pitfalls that go hand in hand with integer and floating point arithmetic. Consider the following classical example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=5;&lt;br /&gt;
variable b=10;&lt;br /&gt;
variable c=a/b;&lt;br /&gt;
print(c);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; is 0 because of the rules of integer arithmetic (everything after the &amp;quot;.&amp;quot; is cut away). The correct result is obtained when doing floating point arithmetic:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=5.;&lt;br /&gt;
variable b=10.;&lt;br /&gt;
variable c=a/b;&lt;br /&gt;
print(c);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Even worse is the following often encountered example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=1000;&lt;br /&gt;
variable b=6500;&lt;br /&gt;
variable c=a*b;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and because of the rules of integer arithmetic you will have an integer overflow and &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; might even be negative.&lt;br /&gt;
&lt;br /&gt;
The rule in arithmetic expressions is that the &amp;quot;strongest&amp;quot; data type wins, i.e., in&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=10000000.0;&lt;br /&gt;
variable b=65000000;&lt;br /&gt;
variable c=a*b;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; will have the correct data type since the multiplication is performed in double precision.&lt;br /&gt;
&lt;br /&gt;
If you need to be 100 percent sure that a calculation needs to be done in a certain data type and you have no control that the variables entering an expression have that type (this is, e.g., the case in functions that are called by somebody else), you can force S-Lang to convert (&amp;quot;typecast&amp;quot;) a variable to a certain type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a=double(a);&lt;br /&gt;
b=int(b);&lt;br /&gt;
c=string(c);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Arrays and Lists ===&lt;br /&gt;
&lt;br /&gt;
You can combine the above simple data types into more complicated ones. The most important of these are&lt;br /&gt;
&lt;br /&gt;
== Arrays==&lt;br /&gt;
&lt;br /&gt;
Arrays are ordered lists of things of the same data type and are declared using brackets:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable arr=[1,2,3];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Content of arrays is accessed by giving the index in brackets:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable c=arr[1];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that arrays are zero based, i.e., the above returns &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;;&lt;br /&gt;
It is possible to access more than one element at the same time by using an array as the argument of the brackets:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable c=arr[[0,1]];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which produces an array containing two elements. If you want larger parts of an array, there is a very powerful &amp;quot;slicing&amp;quot; syntax that makes use of the fact that &amp;lt;code&amp;gt;[a:b]&amp;lt;/code&amp;gt; defines the array &amp;lt;code&amp;gt;[a,a+1,a+2,..,b]&amp;lt;/code&amp;gt; (for b&amp;gt;a and a,b Integers):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable b=arr[[0:1]];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(which is a somewhat silly example...).&lt;br /&gt;
&lt;br /&gt;
Arrays can be multi-dimensional, but the definition is not as nice as in other scripting languages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable arr=Array_Type[2,3];&lt;br /&gt;
arr[0,[0:2]]=[1,2,3];&lt;br /&gt;
arr[1,[0:2]]=[5,4,3];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that also arrays with floating values can be created by the very similar syntax:  &amp;lt;code&amp;gt;[a:b:c]&amp;lt;/code&amp;gt; creates an array with values &amp;lt;code&amp;gt;[a, a+c, a+2*c,...]&amp;lt;/code&amp;gt;, such that the last value is still lower than b. Even more comfortable is the syntax &amp;lt;code&amp;gt;[a:b:#n]&amp;lt;/code&amp;gt;, which creates exactly an array of length n, with equally spaced values ranging from a to b.&lt;br /&gt;
&lt;br /&gt;
== Lists == &lt;br /&gt;
&lt;br /&gt;
Lists are ordered lists of things that can be of different data type. They are declared using curly brackets:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable lis={1,2,3};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Accessing the list elements uses the standard bracket syntax:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=lis[1];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Lists are important whenever you want to store different things in one variable. For example, the following is legal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable lis2={1,[&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;,&amp;quot;c&amp;quot;],3.2};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Operators ====&lt;br /&gt;
&lt;br /&gt;
Binary operators combine two expressions, &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; are constants, variables, functions and so on. The most important operators are:&lt;br /&gt;
&lt;br /&gt;
* '''arithmetic operators''': &lt;br /&gt;
** &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;: basic arithmetic operators, the usual priority rules apply,&lt;br /&gt;
** &amp;lt;code&amp;gt;^&amp;lt;/code&amp;gt;: exponentiation (&amp;lt;code&amp;gt;2^3&amp;lt;/code&amp;gt; is two to the power of three),&lt;br /&gt;
** &amp;lt;code&amp;gt;mod&amp;lt;/code&amp;gt;: modulo operation&lt;br /&gt;
* ''' string concatenation''' is done with the &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; operator.&lt;br /&gt;
* ''' comparison ''': is done with &amp;lt;code&amp;gt;&amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;=&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;==&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;gt;=&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;.  Note that like in all programming languages, you should ''never'' test two floating point variables for equality, this will most often not work in the way you expect...&lt;br /&gt;
&lt;br /&gt;
All of these operators can be used not only on scalar values but also on arrays. They are then used on an element basis. The resulting code is very fast. For example, to add two arrays:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=[1,2,3];&lt;br /&gt;
variable b=[6,5,3];&lt;br /&gt;
variable c=a+b;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As an aside, one often wants to add/subtract something from a variable. S-Lang allows the following C-like shortcuts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a+=5;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
is equivalent to&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a=a+5;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and similar &amp;lt;code&amp;gt;-=&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;*=&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;/=&amp;lt;/code&amp;gt; (I don't think I've ever used the last one, though...).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Program flow control ====&lt;br /&gt;
&lt;br /&gt;
=== Conditional execution ===&lt;br /&gt;
&lt;br /&gt;
Conditional execution is done with the &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt;-statement:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if ( condition ) {&lt;br /&gt;
   true-code;&lt;br /&gt;
} else {&lt;br /&gt;
   false-code;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=+1;&lt;br /&gt;
variable b;&lt;br /&gt;
if ( a&amp;lt;0 ) {&lt;br /&gt;
  b=-1;&lt;br /&gt;
} else {&lt;br /&gt;
  b=+1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt;-branch is optional.&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
&lt;br /&gt;
== for-loop ==&lt;br /&gt;
&lt;br /&gt;
The syntax of the for loop is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for( initialize ; condition ; increment ) {&lt;br /&gt;
   code ;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where usually in &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt; a loop control variable is, well, initialized, and then incremented as long as condition is valid. An example would be &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable i;&lt;br /&gt;
variable npt=10;&lt;br /&gt;
for (i=0; i&amp;lt;npt; i++) {&lt;br /&gt;
    print (i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which counts from 0 to 9 (a count down is also possible, use &amp;lt;code&amp;gt;i-&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt;). Obviously, more than one line of code is possible...&lt;br /&gt;
&lt;br /&gt;
''Note:'' even though syntactically possible, never ever use anything else than an integer variable as the loop counter, unless explicitly necessary. &lt;br /&gt;
&lt;br /&gt;
== while loop ==&lt;br /&gt;
&lt;br /&gt;
The while loop is done while a condition is met:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
while ( condition ) {&lt;br /&gt;
  code ;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that if &amp;lt;code&amp;gt;condition&amp;lt;/code&amp;gt; is not met when the while loop is hit first, &amp;lt;code&amp;gt;code&amp;lt;/code&amp;gt; is not executed at all. &lt;br /&gt;
&lt;br /&gt;
The above counting example can be implemented as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable i=0;&lt;br /&gt;
variable npt=10;&lt;br /&gt;
while ( i&amp;lt;npt ) {&lt;br /&gt;
  print(i);&lt;br /&gt;
  i++;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== do...while loop ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;do...while&amp;lt;/code&amp;gt;-loop is a loop where the body of the loop is executed at least once, since the condition is only tested at the end of the first passage through the loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
do {&lt;br /&gt;
  code ;&lt;br /&gt;
} while (condition);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Functions ====&lt;br /&gt;
&lt;br /&gt;
Functions are subroutines which execute a sequence of instructions whenever they are called (i.e., whenever their name appears in a program). Functions ''can'', but do not have to, have arguments, i.e., variables that control the behavior of the routine. &lt;br /&gt;
&lt;br /&gt;
=== Intrinsic functions ===&lt;br /&gt;
&lt;br /&gt;
''Note 1:'' More information about individual functions can be obtained with isis' &amp;lt;code&amp;gt;help&amp;lt;/code&amp;gt;-function.&lt;br /&gt;
&lt;br /&gt;
''Note 2:'' Most simple functions also work on arrays.&lt;br /&gt;
&lt;br /&gt;
== Mathematical functions ==&lt;br /&gt;
&lt;br /&gt;
* sign functions: &amp;lt;code&amp;gt;abs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sign&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_diff&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_max&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_min&amp;lt;/code&amp;gt;&lt;br /&gt;
* rounding functions: &amp;lt;code&amp;gt;ceil&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;floor&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;nint&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;round&amp;lt;/code&amp;gt;&lt;br /&gt;
* basic algebraic functions: &amp;lt;code&amp;gt;sqr&amp;lt;/code&amp;gt; (square!), &amp;lt;code&amp;gt;sqrt&amp;lt;/code&amp;gt; (square-root), &amp;lt;code&amp;gt;hypot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;polynom&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mul2&amp;lt;/code&amp;gt;&lt;br /&gt;
* exponential and logarithm: &amp;lt;code&amp;gt;exp&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;expm1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;log10&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;log1p&amp;lt;/code&amp;gt;&lt;br /&gt;
* trigonometric functions (argument is in radian!): &amp;lt;code&amp;gt;sin&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;cos&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tan&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;asin&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;acos&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;atan&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;atan2&amp;lt;/code&amp;gt;&lt;br /&gt;
* hyperbolic functions: &amp;lt;code&amp;gt;sinh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;cosh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tanh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;asinh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;acosh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;atanh&amp;lt;/code&amp;gt;&lt;br /&gt;
* complex numbers: &amp;lt;code&amp;gt;Real&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Imag&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Conj&amp;lt;/code&amp;gt;&lt;br /&gt;
* tests: &amp;lt;code&amp;gt;isinf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;isnan&amp;lt;/code&amp;gt; (nan: not a number), &amp;lt;code&amp;gt;_ispos&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_isneg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_isnoneg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Array functions ==&lt;br /&gt;
&lt;br /&gt;
* number of elements in an array: &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;&lt;br /&gt;
* extrema: &amp;lt;code&amp;gt;max&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;min&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;maxabs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;minabs&amp;lt;/code&amp;gt;&lt;br /&gt;
* summing array elements: &amp;lt;code&amp;gt;sum&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sumsq&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;cumsum&amp;lt;/code&amp;gt;&lt;br /&gt;
* tests: &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;any&amp;lt;/code&amp;gt;&lt;br /&gt;
* get the indices for all or some elements for which a condition is met: &amp;lt;code&amp;gt;where&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wherenot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wherefirst&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wherelast&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Printing ==&lt;br /&gt;
&lt;br /&gt;
Output is done with the &amp;lt;code&amp;gt;print&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;vmessage&amp;lt;/code&amp;gt; functions. &amp;lt;code&amp;gt;vmessage&amp;lt;/code&amp;gt; uses a format similar to the C &amp;lt;code&amp;gt;printf&amp;lt;/code&amp;gt;-function to format the output. Examples include:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=1.2347;&lt;br /&gt;
vmessage(&amp;quot;%f&amp;quot;,a);   % print with full precision, note the roundoff error!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=25;&lt;br /&gt;
vmessage(&amp;quot;%05d&amp;quot;,a); % print 5 digits, zero padded&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Note'': &amp;lt;code&amp;gt;vmessage&amp;lt;/code&amp;gt; works very similar to the function &amp;lt;code&amp;gt;printf&amp;lt;/code&amp;gt;, which exists in many programming languages (and also in S-Lang).&lt;br /&gt;
&lt;br /&gt;
=== user-defined functions ===&lt;br /&gt;
&lt;br /&gt;
your own function can be defined with the syntax&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define functionname (arguments) {&lt;br /&gt;
   code;&lt;br /&gt;
   :&lt;br /&gt;
   code;&lt;br /&gt;
   return value;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where the return value statement is optional.&lt;br /&gt;
&lt;br /&gt;
Functions are very useful to structure your program. Use them liberally! An example would be that for a given data set, you write a function to load the data and do the rebinning. Additionally, giving useful names to your functions improves the readability of your code.&lt;br /&gt;
&lt;br /&gt;
A more silly example is the following, which returns the sum and difference of two numbers:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define adddiff(a,b) {&lt;br /&gt;
   % return the sum and difference of two numbers.&lt;br /&gt;
   variable sum=a+b;&lt;br /&gt;
   variable diff=a-b;&lt;br /&gt;
   return [sum,diff];&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note the comments. It is good style to comment your code well in order to allow you and others later to understand what the code is doing. You should always comment your code while writing, do not only do it at the end because somebody told you so, make the writing of comments part of your coding practice!&lt;br /&gt;
&lt;br /&gt;
'''Exercise 2'''&lt;br /&gt;
&lt;br /&gt;
Write a slang function 'midnight' which returns the roots of a quadratic equation &amp;lt;latex&amp;gt;$ax^2+bx+c$&amp;lt;/latex&amp;gt;. The routine should work for all possible values of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
=== libraries ===&lt;br /&gt;
&lt;br /&gt;
Libraries are collections of S-Lang functions. They get loaded with the statement&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require(&amp;quot;libraryname&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Afterwards, all functions in &amp;quot;libraryname&amp;quot; are available. &lt;br /&gt;
&lt;br /&gt;
==== Isis programs ====&lt;br /&gt;
&lt;br /&gt;
Isis programs consist of a sequence of function declarations and a main program, stored in a file that can be written with any editor of your choice. To execute a program you have several choices. In the following, let's assume the program's filename is &amp;lt;code&amp;gt;test.sl&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
  - you can execute the program from the Linux command line, by issuing the command &amp;lt;code&amp;gt;isis test.sl&amp;lt;/code&amp;gt;;&lt;br /&gt;
  - if you want to execute the program from within isis (e.g., because you want to work on its output interactively, use &amp;lt;code&amp;gt;()=evalfile(&amp;quot;test.sl&amp;quot;);&amp;lt;/code&amp;gt;.&lt;br /&gt;
  - to run a program under isis and immediately exit isis, use the &amp;quot;shebang&amp;quot; notation. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env isis&lt;br /&gt;
&lt;br /&gt;
% stupid count down example&lt;br /&gt;
variable i;&lt;br /&gt;
variable npt=10;&lt;br /&gt;
for (i=0; i&amp;lt;npt; i++) {&lt;br /&gt;
    print (i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
then make the code executable under Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hde226868:~/&amp;gt; chmod ugo+x ./test.sl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After this you can execute the code with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hde226868:~/&amp;gt; ./test.sl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The name &amp;quot;shebang&amp;quot;-notation comes from the pronounciation of the hash-sign '#' as &amp;quot;she&amp;quot; and the exclamation mark as &amp;quot;bang&amp;quot;. yes, really.&lt;br /&gt;
&lt;br /&gt;
''' Exercise 3'''&lt;br /&gt;
&lt;br /&gt;
Write a S-Lang program that loads the gratings data from Exercise 3 of [[isis:tutorial:fitting1|Advanced Fitting Techniques, 1]]. The program should have functions that&lt;br /&gt;
# load the data, ignore the appropriate energy channels and rebin it. The function should return the indices of the PCA, HEXTE A, and HEXTE B data.&lt;br /&gt;
# setup the fit function and set the parameters to reasonable starting values&lt;br /&gt;
# call the above functions from a main program and perform the fit&lt;br /&gt;
# call a third function that makes a plot of the best-fit with residuals. Use the same color for the HEXTE A and B data points. ''Hint:'' note that the call to the plot functions is a list. The colors assigned to the data points through the &amp;lt;code&amp;gt;dcol&amp;lt;/code&amp;gt; qualifiers apply to the individual list elements. For example, if &amp;lt;code&amp;gt;dcol=[1,2]&amp;lt;/code&amp;gt; then the spectra corresponding to the  2nd list element are plotted in color number 2. The list describing the spectra is a ''list'', i.e., it can contain arrays as list elements...  In other words: call the plot functions such that all color qualifiers have only two elements. &lt;br /&gt;
# call a fourth function which calculates a 2D-error contour for &amp;lt;latex&amp;gt;$N_H$&amp;lt;/latex&amp;gt; and &amp;lt;latex&amp;gt;$\Gamma$&amp;lt;/latex&amp;gt; (NOTE: the relevant information for this last point is not yet there and, because of carpal tunnel syndrome, will only be available on Tuesday).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Isis / Slang]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Isis:tutorial:slang&amp;diff=1087</id>
		<title>Isis:tutorial:slang</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Isis:tutorial:slang&amp;diff=1087"/>
		<updated>2018-04-13T20:34:56Z</updated>

		<summary type="html">&lt;p&gt;Lang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====== Programming in S-Lang ======&lt;br /&gt;
&lt;br /&gt;
''Remark:'' This brief introduction into S-Lang is primarily a translation of the German-language introduction to S-Lang used in the Remeis astronomy lab, which was mainly written by Manfred Hanke.&lt;br /&gt;
&lt;br /&gt;
===== Introduction =====&lt;br /&gt;
&lt;br /&gt;
The underlying engine of Isis is S-Lang, an interpreted language that is similar to other modern scripting languages such as Perl or python. All of these languages are &amp;quot;Algol-like&amp;quot;, therefore, if you know how to program in C or any other of these scripting languages, you should not have a problem to program in S-Lang as well. &lt;br /&gt;
&lt;br /&gt;
The big advantage of having a scripting language as part of a data analysis package is that many things that are &amp;quot;routine&amp;quot; work can be automated, increasing your efficiency. This includes things like loading the data set that you're working with, e.g., in the case you are working with many spectra from different instruments, and need to do some specific ignoring and rebinning, or the calculation of errors. It also allows you to access all internal structures used in doing your best fit, such that you can prepare very nice figures our output your best fit parameters in a way that is better suited to publication than the standard isis routines. Historically, many astronomers (yours truly included) did this last step in IDL. While that language is very nice, it is also very expensive, with educational licenses costing around 1000 EUR ''per year''. It thus makes a lot of sense to move away from this and use a cheaper and more integrated approach to data analysis.&lt;br /&gt;
&lt;br /&gt;
''A comment to future data analysts:'' Scripting is very good, however, do not try to script everything. Many points of data analysis have to do with understanding your data set and here it is often much better to play with it by hand than to automatize things. Get a &amp;quot;feel&amp;quot; for your data first before trusting the computer to do everything right...&lt;br /&gt;
&lt;br /&gt;
''A comment to the language-warriors:'' Often people will ask why S-Lang was chosen as the interface and not, e.g., python. The reason is simple: because it was there. The important thing is that a scripting language is there at all. The main difficulty in learning how to program is not the programming syntax - if you think so, then you are not a good programmer - but rather to think in an algorithmic way. And this type of thinking is difficult to learn. Learning a new syntax isn't. The author of these lines (not M. Hanke ;-) ) started his life with a simple form of Amstrad Basic, followed by Omikron Basic, PASCAL, Turbo Pascal, Fortran-77(yes, it really is spelled &amp;quot;Fortran&amp;quot;, not &amp;quot;FORTRAN&amp;quot;. The only FORTRAN in existence was FORTRAN 66, since the 1977 standard, that language was spelled &amp;quot;Fortran&amp;quot;...), Fortran-90, IDL, C, C++, Perl, javascript, and I am sure some more languages that I have forgotten (plus all of the assembly languages that were useful when one was still programming in assembly, i.e., 80x86, 68xxxx, and so on). Historically, all of these languages have a syntax that goes back to Algol in the 1960s, and thus in the core they are all the same. For this reason, do not worry about having to learn yet another scripting language, it's just a little bit of syntax. And, if you don't know how to program, start now. Because of the languages are all the same, it does not matter that S-Lang might be seen as obscure by some people, once you know how to think algorithmically, switching over to another language won't cost you too much time. This also means that if you are applying to jobs and somebody claims that you must know java or any other language, stay away from these jobs - knowing how to program is what makes you interesting, not the specific language...&lt;br /&gt;
&lt;br /&gt;
In contrast to compiled languages such as C, C++ or Fortran, scripting languages such as IDL, Perl, python, have the advantage that one can also work with them interactively and thus write small &amp;quot;programs&amp;quot; directly on the command line. We are using this feature all the time when doing data analysis by hand.&lt;br /&gt;
&lt;br /&gt;
In the following we assume that you had at least some previous exposure to programming, and just give a list of the most important language structures. &lt;br /&gt;
&lt;br /&gt;
===== S-Lang Language elements =====&lt;br /&gt;
&lt;br /&gt;
S-Lang consists of the following language elements that allow you to structure your programs. Note that in S-Lang programs ''all'' statements must be ending with a semicolon.&lt;br /&gt;
&lt;br /&gt;
==== Variable Declarations and Assignments ====&lt;br /&gt;
&lt;br /&gt;
In S-Lang programs, variables must be declared (this is optional on the command line). This is done with the instruction&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable var_1, var_2, ... ;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
you then assign values to a variable with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var_1=value;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is a valid S-Lang statement. It is possible to combine the variable declaration and assignment, e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable a=2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or more complicated expressions such as&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var_1 = sin(a)+sqrt(25.);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Variable names may consist of any combination of the standard ASCII characters &amp;lt;code&amp;gt;a-zA-Z0-9&amp;lt;/code&amp;gt; as well as the underscore &amp;lt;code&amp;gt;_&amp;lt;/code&amp;gt;  and the dollar sign &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt;. A variable is not allowed to start with a number.&lt;br /&gt;
&lt;br /&gt;
==== Data Types ====&lt;br /&gt;
&lt;br /&gt;
=== Simple Data Types ===&lt;br /&gt;
&lt;br /&gt;
S-Lang variables are generally weakly typed, that is the type of a variable is defined by the type of whatever is assigned to it. For example&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=2;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
means that after the assignment ''a'' is an integer. While&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=2.;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
means that ''a'' is a floating point number. Strings are assigned with&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=&amp;quot;abcd&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However, note that a variable can easily change its type, because the weak typing will mean that after the execution of&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=&amp;quot;abcd&amp;quot;; % String_Type&lt;br /&gt;
a=2.3;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
''a'' will have the type ''Double_Type''.  You can check this by printing the type of the variable:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
typeof(a);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Exercise 1:'''&lt;br /&gt;
&lt;br /&gt;
Assign the result of ''typeof(a)'' to some other variable. What is the datatype of that other variable?&lt;br /&gt;
&lt;br /&gt;
=== An aside on integer and floating point arithmetic ===&lt;br /&gt;
&lt;br /&gt;
Note that while weak typing usually speeds up code development, it does not preserve you from the pitfalls that go hand in hand with integer and floating point arithmetic. Consider the following classical example:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=5;&lt;br /&gt;
variable b=10;&lt;br /&gt;
variable c=a/b;&lt;br /&gt;
print(c);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note that ''c'' is 0 because of the rules of integer arithmetic (everything after the &amp;quot;.&amp;quot; is cut away). The correct result is obtained when doing floating point arithmetic:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=5.;&lt;br /&gt;
variable b=10.;&lt;br /&gt;
variable c=a/b;&lt;br /&gt;
print(c);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Even worse is the following often encountered example:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=1000;&lt;br /&gt;
variable b=6500;&lt;br /&gt;
variable c=a*b;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
and because of the rules of integer arithmetic you will have an integer overflow and ''c'' might even be negative.&lt;br /&gt;
&lt;br /&gt;
The rule in arithmetic expressions is that the &amp;quot;strongest&amp;quot; data type wins, i.e., in&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=10000000.0;&lt;br /&gt;
variable b=65000000;&lt;br /&gt;
variable c=a*b;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
''c'' will have the correct data type since the multiplication is performed in double precision.&lt;br /&gt;
&lt;br /&gt;
If you need to be 100 percent sure that a calculation needs to be done in a certain data type and you have no control that the variables entering an expression have that type (this is, e.g., the case in functions that are called by somebody else), you can force S-Lang to convert (&amp;quot;typecast&amp;quot;) a variable to a certain type:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
a=double(a);&lt;br /&gt;
b=int(b);&lt;br /&gt;
c=string(c);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Arrays and Lists ===&lt;br /&gt;
&lt;br /&gt;
You can combine the above simple data types into more complicated ones. The most important of these are&lt;br /&gt;
&lt;br /&gt;
== Arrays==&lt;br /&gt;
&lt;br /&gt;
Arrays are ordered lists of things of the same data type and are declared using brackets:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable arr=[1,2,3];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Content of arrays is accessed by giving the index in brackets:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable c=arr[1];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note that arrays are zero based, i.e., the above returns ''2'';&lt;br /&gt;
It is possible to access more than one element at the same time by using an array as the argument of the brackets:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable c=arr[[0,1]];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which produces an array containing two elements. If you want larger parts of an array, there is a very powerful &amp;quot;slicing&amp;quot; syntax that makes use of the fact that ''[a:b]'' defines the array ''[a,a+1,a+2,..,b]'' (for b&amp;gt;a and a,b Integers):&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable b=arr[[0:1]];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
(which is a somewhat silly example...).&lt;br /&gt;
&lt;br /&gt;
Arrays can be multi-dimensional, but the definition is not as nice as in other scripting languages:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable arr=Array_Type[2,3];&lt;br /&gt;
arr[0,[0:2]]=[1,2,3];&lt;br /&gt;
arr[1,[0:2]]=[5,4,3];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that also arrays with floating values can be created by the very similar syntax:  ''[a:b:c]'' creates an array with values ''[a, a+c, a+2*c,...]'', such that the last value is still lower than b. Even more comfortable is the syntax ''[a:b:#n]'', which creates exactly an array of length n, with equally spaced values ranging from a to b.&lt;br /&gt;
&lt;br /&gt;
== Lists == &lt;br /&gt;
&lt;br /&gt;
Lists are ordered lists of things that can be of different data type. They are declared using curly brackets:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable lis={1,2,3};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Accessing the list elements uses the standard bracket syntax:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=lis[1];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Lists are important whenever you want to store different things in one variable. For example, the following is legal:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable lis2={1,[&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;,&amp;quot;c&amp;quot;],3.2};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Operators ====&lt;br /&gt;
&lt;br /&gt;
Binary operators combine two expressions, ''x'' and ''y'', where ''x'' and ''y'' are constants, variables, functions and so on. The most important operators are:&lt;br /&gt;
&lt;br /&gt;
* '''arithmetic operators''': &lt;br /&gt;
 * ''+'', ''-'', ''*'', ''/'': basic arithmetic operators, the usual priority rules apply,&lt;br /&gt;
 * ''^'': exponentiation (''2^3'' is two to the power of three),&lt;br /&gt;
 * ''mod'': modulo operation&lt;br /&gt;
* ''' string concatenation''' is done with the ''+'' operator.&lt;br /&gt;
* ''' comparison ''': is done with ''&amp;lt;'', ''&amp;lt;='', ''=='', ''&amp;gt;='', and ''&amp;gt;''.  Note that like in all programming languages, you should ''never'' test two floating point variables for equality, this will most often not work in the way you expect...&lt;br /&gt;
&lt;br /&gt;
All of these operators can be used not only on scalar values but also on arrays. They are then used on an element basis. The resulting code is very fast. For example, to add two arrays:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=[1,2,3];&lt;br /&gt;
variable b=[6,5,3];&lt;br /&gt;
variable c=a+b;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As an aside, one often wants to add/subtract something from a variable. S-Lang allows the following C-like shortcuts:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
a+=5;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
is equivalent to&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
a=a+5;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
and similar ''-='', ''*='', and ''/='' (I don't think I've ever used the last one, though...).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Program flow control ====&lt;br /&gt;
&lt;br /&gt;
=== Conditional execution ===&lt;br /&gt;
&lt;br /&gt;
Conditional execution is done with the ''if''-statement:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
if ( condition ) {&lt;br /&gt;
   true-code;&lt;br /&gt;
} else {&lt;br /&gt;
   false-code;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=+1;&lt;br /&gt;
variable b;&lt;br /&gt;
if ( a&amp;lt;0 ) {&lt;br /&gt;
  b=-1;&lt;br /&gt;
} else {&lt;br /&gt;
  b=+1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note that the ''else''-branch is optional.&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
&lt;br /&gt;
== for-loop ==&lt;br /&gt;
&lt;br /&gt;
The syntax of the for loop is&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
for( initialize ; condition ; increment ) {&lt;br /&gt;
   code ;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
where usually in ''initialize'' a loop control variable is, well, initialized, and then incremented as long as condition is valid. An example would be &lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable i;&lt;br /&gt;
variable npt=10;&lt;br /&gt;
for (i=0; i&amp;lt;npt; i++) {&lt;br /&gt;
    print (i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which counts from 0 to 9 (a count down is also possible, use ''i-''''-''). Obviously, more than one line of code is possible...&lt;br /&gt;
&lt;br /&gt;
''Note:'' even though syntactically possible, never ever use anything else than an integer variable as the loop counter, unless explicitly necessary. &lt;br /&gt;
&lt;br /&gt;
== while loop ==&lt;br /&gt;
&lt;br /&gt;
The while loop is done while a condition is met:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
while ( condition ) {&lt;br /&gt;
  code ;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note that if ''condition'' is not met when the while loop is hit first, ''code'' is not executed at all. &lt;br /&gt;
&lt;br /&gt;
The above counting example can be implemented as follows:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable i=0;&lt;br /&gt;
variable npt=10;&lt;br /&gt;
while ( i&amp;lt;npt ) {&lt;br /&gt;
  print(i);&lt;br /&gt;
  i++;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== do...while loop ==&lt;br /&gt;
&lt;br /&gt;
The ''do...while''-loop is a loop where the body of the loop is executed at least once, since the condition is only tested at the end of the first passage through the loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
do {&lt;br /&gt;
  code ;&lt;br /&gt;
} while (condition);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Functions ====&lt;br /&gt;
&lt;br /&gt;
Functions are subroutines which execute a sequence of instructions whenever they are called (i.e., whenever their name appears in a program). Functions ''can'', but do not have to, have arguments, i.e., variables that control the behavior of the routine. &lt;br /&gt;
&lt;br /&gt;
=== Intrinsic functions ===&lt;br /&gt;
&lt;br /&gt;
''Note 1:'' More information about individual functions can be obtained with isis' ''help''-function.&lt;br /&gt;
&lt;br /&gt;
''Note 2:'' Most simple functions also work on arrays.&lt;br /&gt;
&lt;br /&gt;
== Mathematical functions ==&lt;br /&gt;
&lt;br /&gt;
* sign functions: ''abs'', ''sign'', ''_diff'', ''_max'', ''_min''&lt;br /&gt;
* rounding functions: ''ceil'', ''floor'', ''nint'', ''round''&lt;br /&gt;
* basic algebraic functions: ''sqr'' (square!), ''sqrt'' (square-root), ''hypot'', ''polynom'', ''mul2''&lt;br /&gt;
* exponential and logarithm: ''exp'', ''expm1'', ''log'', ''log10'', ''log1p''&lt;br /&gt;
* trigonometric functions (argument is in radian!): ''sin'', ''cos'', ''tan'', ''asin'', ''acos'', ''atan'', ''atan2''&lt;br /&gt;
* hyperbolic functions: ''sinh'', ''cosh'', ''tanh'', ''asinh'', ''acosh'', ''atanh''&lt;br /&gt;
* complex numbers: ''Real'', ''Imag'', ''Conj''&lt;br /&gt;
* tests: ''isinf'', ''isnan'' (nan: not a number), ''_ispos'', ''_isneg'', ''_isnoneg''&lt;br /&gt;
&lt;br /&gt;
== Array functions ==&lt;br /&gt;
&lt;br /&gt;
* number of elements in an array: ''length''&lt;br /&gt;
* extrema: ''max'', ''min'', ''maxabs'', ''minabs''&lt;br /&gt;
* summing array elements: ''sum'', ''sumsq'', ''cumsum''&lt;br /&gt;
* tests: ''all'', ''any''&lt;br /&gt;
* get the indices for all or some elements for which a condition is met: ''where'', ''wherenot'', ''wherefirst'', ''wherelast''&lt;br /&gt;
&lt;br /&gt;
== Printing ==&lt;br /&gt;
&lt;br /&gt;
Output is done with the ''print'' and the ''vmessage'' functions. ''vmessage'' uses a format similar to the C ''printf''-function to format the output. Examples include:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=1.2347;&lt;br /&gt;
vmessage(&amp;quot;%f&amp;quot;,a);   % print with full precision, note the roundoff error!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=25;&lt;br /&gt;
vmessage(&amp;quot;%05d&amp;quot;,a); % print 5 digits, zero padded&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Note'': ''vmessage'' works very similar to the function ''printf'', which exists in many programming languages (and also in S-Lang).&lt;br /&gt;
&lt;br /&gt;
=== user-defined functions ===&lt;br /&gt;
&lt;br /&gt;
your own function can be defined with the syntax&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
define functionname (arguments) {&lt;br /&gt;
   code;&lt;br /&gt;
   :&lt;br /&gt;
   code;&lt;br /&gt;
   return value;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
where the return value statement is optional.&lt;br /&gt;
&lt;br /&gt;
Functions are very useful to structure your program. Use them liberally! An example would be that for a given data set, you write a function to load the data and do the rebinning. Additionally, giving useful names to your functions improves the readability of your code.&lt;br /&gt;
&lt;br /&gt;
A more silly example is the following, which returns the sum and difference of two numbers:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
define adddiff(a,b) {&lt;br /&gt;
   % return the sum and difference of two numbers.&lt;br /&gt;
   variable sum=a+b;&lt;br /&gt;
   variable diff=a-b;&lt;br /&gt;
   return [sum,diff];&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note the comments. It is good style to comment your code well in order to allow you and others later to understand what the code is doing. You should always comment your code while writing, do not only do it at the end because somebody told you so, make the writing of comments part of your coding practice!&lt;br /&gt;
&lt;br /&gt;
'''Exercise 2'''&lt;br /&gt;
&lt;br /&gt;
Write a slang function 'midnight' which returns the roots of a quadratic equation &amp;lt;latex&amp;gt;$ax^2+bx+c$&amp;lt;/latex&amp;gt;. The routine should work for all possible values of ''a'', ''b'', and ''c''. &lt;br /&gt;
&lt;br /&gt;
=== libraries ===&lt;br /&gt;
&lt;br /&gt;
Libraries are collections of S-Lang functions. They get loaded with the statement&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
require(&amp;quot;libraryname&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Afterwards, all functions in &amp;quot;libraryname&amp;quot; are available. &lt;br /&gt;
&lt;br /&gt;
==== Isis programs ====&lt;br /&gt;
&lt;br /&gt;
Isis programs consist of a sequence of function declarations and a main program, stored in a file that can be written with any editor of your choice. To execute a program you have several choices. In the following, let's assume the program's filename is ''test.sl'':&lt;br /&gt;
&lt;br /&gt;
  - you can execute the program from the Linux command line, by issuing the command ''isis test.sl'';&lt;br /&gt;
  - if you want to execute the program from within isis (e.g., because you want to work on its output interactively, use ''()=evalfile(&amp;quot;test.sl&amp;quot;);''.&lt;br /&gt;
  - to run a program under isis and immediately exit isis, use the &amp;quot;shebang&amp;quot; notation. For example:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
#!/usr/bin/env isis&lt;br /&gt;
&lt;br /&gt;
% stupid count down example&lt;br /&gt;
variable i;&lt;br /&gt;
variable npt=10;&lt;br /&gt;
for (i=0; i&amp;lt;npt; i++) {&lt;br /&gt;
    print (i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
then make the code executable under Linux:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
hde226868:~/&amp;gt; chmod ugo+x ./test.sl&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
After this you can execute the code with&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
hde226868:~/&amp;gt; ./test.sl&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The name &amp;quot;shebang&amp;quot;-notation comes from the pronounciation of the hash-sign '#' as &amp;quot;she&amp;quot; and the exclamation mark as &amp;quot;bang&amp;quot;. yes, really.&lt;br /&gt;
&lt;br /&gt;
''' Exercise 3'''&lt;br /&gt;
&lt;br /&gt;
Write a S-Lang program that loads the gratings data from Exercise 3 of [[isis:tutorial:fitting1|Advanced Fitting Techniques, 1]]. The program should have functions that&lt;br /&gt;
# load the data, ignore the appropriate energy channels and rebin it. The function should return the indices of the PCA, HEXTE A, and HEXTE B data.&lt;br /&gt;
# setup the fit function and set the parameters to reasonable starting values&lt;br /&gt;
# call the above functions from a main program and perform the fit&lt;br /&gt;
# call a third function that makes a plot of the best-fit with residuals. Use the same color for the HEXTE A and B data points. ''Hint:'' note that the call to the plot functions is a list. The colors assigned to the data points through the ''dcol'' qualifiers apply to the individual list elements. For example, if ''dcol=[1,2]'' then the spectra corresponding to the  2nd list element are plotted in color number 2. The list describing the spectra is a ''list'', i.e., it can contain arrays as list elements...  In other words: call the plot functions such that all color qualifiers have only two elements. &lt;br /&gt;
# call a fourth function which calculates a 2D-error contour for &amp;lt;latex&amp;gt;$N_H$&amp;lt;/latex&amp;gt; and &amp;lt;latex&amp;gt;$\Gamma$&amp;lt;/latex&amp;gt; (NOTE: the relevant information for this last point is not yet there and, because of carpal tunnel syndrome, will only be available on Tuesday).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Isis / Slang]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Software_at_the_Remeis-Observatory&amp;diff=975</id>
		<title>Software at the Remeis-Observatory</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Software_at_the_Remeis-Observatory&amp;diff=975"/>
		<updated>2018-04-13T08:59:03Z</updated>

		<summary type="html">&lt;p&gt;Lang: Created page with &amp;quot;====== Software at the Remeis-Observatory ======  For many software and scripts which are developed at our observatory, for example the ''isisscripts'', a GIT repository exist...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====== Software at the Remeis-Observatory ======&lt;br /&gt;
&lt;br /&gt;
For many software and scripts which are developed at our observatory, for example the ''isisscripts'', a GIT repository exists. You can reach it via the internal link [[http://www/git]].&lt;br /&gt;
&lt;br /&gt;
To clone the repository you are interested in type&lt;br /&gt;
  git clone ssh://account@crux.sternwarte.uni-erlangen.de/data/git/repositoryname&lt;br /&gt;
where you have to replace ''account'' with your account name in Bamberg and ''repositoryname'' with the repository you are interested in.&lt;br /&gt;
&lt;br /&gt;
A more detailed description of basic GIT usage is found [[git_use|here]].&lt;br /&gt;
&lt;br /&gt;
[[Category:GIT]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Advanced_IRC_Chat_Guide&amp;diff=973</id>
		<title>Advanced IRC Chat Guide</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Advanced_IRC_Chat_Guide&amp;diff=973"/>
		<updated>2018-04-13T08:53:55Z</updated>

		<summary type="html">&lt;p&gt;Lang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====== Advanced IRC Chat Guide ======&lt;br /&gt;
&lt;br /&gt;
This article describes, how to set up the [[http://irssi.org/|Irssi]] IRC client to join the [[irc:introduction|Remeis-chat]] at startup. In addition, the Irssi session is embedded within a [[http://www.gnu.org/software/screen/|screen]] session in order to avoid joining and leaving the chat (if one uses a computer at the observatory or, in general, one which is never powered off). As an advantage, messages in the chat, which has been sent &amp;quot;over night&amp;quot;, can be read the next day. Finally as the cherry on top, a simple [[http://www.gnu.org/software/bash/|Bash]] script will either create a new screen-Irssi session or use a running one. This script is at the end executed automatically after starting a new [[http://www.kde.org/|KDE]] session.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is recommended to read [[http://quadpoint.org/articles/irssi/|A Guide to Efficiently Using Irssi and Screen]] for further informations and to even do more tricks.&lt;br /&gt;
&lt;br /&gt;
===== Irssi autojoin at startup =====&lt;br /&gt;
&lt;br /&gt;
In the following, an Irssi-configuration file will be described, which allows to automatically join the Remeis-chat. Further informations about the configuration files can be found in the [[http://irssi.org/documentation|Irssi documentation]].&lt;br /&gt;
&lt;br /&gt;
''' Create a default configuration ''' &amp;lt;br /&amp;gt;&lt;br /&gt;
First of all, configuration files are saved in the hidden folder ''.irssi'' in the user's home directory. If it does not exist, don't worry. Irssi will create it automatically if we call it to explicitly use a configuration file:&lt;br /&gt;
  irssi --config=~/.irssi/remeis&lt;br /&gt;
This will create a default configuration file ''remeis'', which will be edited to automatically join the Remeis-chat. But first of all, the opened Irssi session has to be closed by, e.g., entering&lt;br /&gt;
  /exit&lt;br /&gt;
into the Irssi command line.&lt;br /&gt;
&lt;br /&gt;
''' Setting up autojoin '''&amp;lt;br /&amp;gt;&lt;br /&gt;
Once the previously created configuration file ''remeis'' is opened with an editor of choice, several lines has to be added and/or modified. By default, the file contains several configurations already. The goal is to add a ''server'', a ''chatnet'', a ''channel'' and a ''window'' to the file. Each of these are configured similar to a structure in S-Lang. Those structures can be grouped to an array also:&lt;br /&gt;
  configuration = {&lt;br /&gt;
    field1 = value1;&lt;br /&gt;
    ...&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  array_of_configurations = (&lt;br /&gt;
    { field = value; ... },&lt;br /&gt;
    ...&lt;br /&gt;
  );&lt;br /&gt;
&lt;br /&gt;
To get the Remeis-chat working, the server ''irc.freenode.net'' has to be added first to the ''servers'' array:&lt;br /&gt;
  servers = (&lt;br /&gt;
    ...&lt;br /&gt;
    { address = &amp;quot;irc.freenode.net&amp;quot;; chatnet = &amp;quot;freenode&amp;quot;; port = &amp;quot;6667&amp;quot;; autoconnect = &amp;quot;yes&amp;quot;; }&lt;br /&gt;
  )&lt;br /&gt;
The field ''autoconnect = &amp;quot;yes&amp;quot;'' causes Irssi to connect to that server at startup. This server is also assign to the ''chatnet = &amp;quot;freenode&amp;quot;'', which has to be added to the corresponding structure:&lt;br /&gt;
  chatnets = {&lt;br /&gt;
    ...&lt;br /&gt;
    freenode = { type = &amp;quot;IRC&amp;quot;; };&lt;br /&gt;
  };&lt;br /&gt;
Here, the freenode chatnet itself is a structure, making ''chatnets'' a structure of structures. Now that a chatnet exists, which will be applied to the server irc.freenode.net, we can add channels to it via the ''channels'' array:&lt;br /&gt;
  channels = (&lt;br /&gt;
    ...&lt;br /&gt;
    { name = &amp;quot;#remeis&amp;quot;; chatnet = &amp;quot;freenode&amp;quot;; autojoin = &amp;quot;yes&amp;quot;; }&lt;br /&gt;
  )&lt;br /&gt;
The last thing one has to do now, is to create a new window at startup via the ''windows'' structure, which will join the previously defined channel ''#remeis'':&lt;br /&gt;
  windows = {&lt;br /&gt;
    1 = {&lt;br /&gt;
      items = (&lt;br /&gt;
        {&lt;br /&gt;
          type = &amp;quot;CHANNEL&amp;quot;;&lt;br /&gt;
          chat_type = &amp;quot;IRC&amp;quot;;&lt;br /&gt;
          name = &amp;quot;#remeis&amp;quot;;&lt;br /&gt;
          tag = &amp;quot;freenode&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
      );&lt;br /&gt;
    }&lt;br /&gt;
This will use the first window in Irssi (the dafault one) to connect to the Remeis-chat. Finally, one should set a proper nickname within the ''core'' structure, which itself is found within the ''settings'' structure. That's it! But remember, Irssi has to be called with this configuration file as parameter:&lt;br /&gt;
  irssi --config=~/.irssi/remeis&lt;br /&gt;
  &lt;br /&gt;
===== Irssi in a screen session =====&lt;br /&gt;
&lt;br /&gt;
''Screen'' can be used to open one or multiple virtual shells within an active shell. Each virtuell shell can be detached from the active shell, which sends it into the background. Even more, the virtual shell is independent from the active shell, which means that it is '''not terminated''' after active shell is closed! In combination with Irssi (or any other IRC client), the user will stay in the chat even he or she logs out from the system! This has several advantages:&lt;br /&gt;
  * messages sent after the user logged out can still be read after the screen session is attached again&lt;br /&gt;
  * reduces the join/left messages within the chat (reduces spam for the user users, doesn't it?)&lt;br /&gt;
The command to create a new screen session, where itself Irssi is used to connect to the Remeis-chat using the configuration file above, is simply:&lt;br /&gt;
  screen irssi --config=~/.irssi/remeis&lt;br /&gt;
The Irssi session will not look different compared if one does not use screen, but there is, among others, a shortcut available, which detaches the virtual shell:&lt;br /&gt;
  Ctrl + A + D&lt;br /&gt;
Now, Irssi will continue working in the background and independent from the active shell.&lt;br /&gt;
To attach this virtual shell again, one may use&lt;br /&gt;
  screen -r -d&lt;br /&gt;
in '''any other active shell'''. This will bring up the Irssi session and one is able to read, what happened since the session was detached.&lt;br /&gt;
&lt;br /&gt;
===== screen-Irssi Bash-script =====&lt;br /&gt;
&lt;br /&gt;
Now, it would be very comfortable to simply run one command, which either creates a new screen-Irssi session or detaches an existing one. Here, the script is not described step by step, instead the full (and hopefully working) code is shown in the following. Simple copy and paste it into any file, e.g., ''~/bin/runIrcChat'':&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  # runs either irssi in a screen session or (re)attaches an active one&lt;br /&gt;
  set irssi_session_name=remeis_irssi_$USER&lt;br /&gt;
  #only execute on ara&lt;br /&gt;
  #if [[ &amp;quot;$HOST&amp;quot; != &amp;quot;ara&amp;quot; ]]; then exit; fi&lt;br /&gt;
  # run screen if no session exists&lt;br /&gt;
  run=`screen -list | grep .$irssi_session_name`&lt;br /&gt;
  if [[ &amp;quot;$run&amp;quot; == &amp;quot;&amp;quot; ]]; then&lt;br /&gt;
    echo &amp;quot;running new irssi screen session: $irssi_session_name&amp;quot;&lt;br /&gt;
    xterm -title '#remeis@irc.freenode.net' -e &amp;quot;screen -S $irssi_session_name irssi --config=~/.irssi/remeis&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
  # otherwise, attach the session&lt;br /&gt;
    echo &amp;quot;attaching irssi screen session: $irssi_session_name&amp;quot;&lt;br /&gt;
    xterm -title '#remeis@irc.freenode.net' -e &amp;quot;screen -r -d $irssi_session_name&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
Finally, the above script file has to be made executable:&lt;br /&gt;
  chmod +x ~/bin/runIrcChat&lt;br /&gt;
Note, that for personal liking and hostoric reasons, the screen session is created in an ''xterm'' session. Who doesn't like xterm may modify the corresponding lines, of course.&lt;br /&gt;
&lt;br /&gt;
===== KDE autostart of Bash-script =====&lt;br /&gt;
&lt;br /&gt;
To execute the above script automatically after the user logs into KDE, a symbolic link has to be created in the KDE-autostart folder:&lt;br /&gt;
  ln -s ~/bin/runIrcChat ~/.kde/Autostart/&lt;br /&gt;
Unbelievable, but that's all! Now each time the user logs into KDE, a window will open showing the Remeis-IRC-chat! To even configure the stuff further, one may right-click on the window's title, select ''Advanced'' -&amp;gt; ''Special Window Settings...'' Using the slide ''Geometry'', the xterm window titled &amp;quot;#remeis@irc.freenode.net&amp;quot; can be configured such, that it will appear, e.g., on Desktop 4 always at initialization or with a different window size, like 800x600 pixels. There are many possibilities for personal likings...&lt;br /&gt;
&lt;br /&gt;
To prevent the script to be executed on another host than ones (usual) working machine, the following line may be added to the beginning of the script:&lt;br /&gt;
  if [[ &amp;quot;$HOST&amp;quot; != &amp;quot;ara&amp;quot; ]]; then exit; fi&lt;br /&gt;
Here, 'ara' has to be replaced with the proper hostname of the working machine. This modifications is quite useful, if you log into several machines simultaneously.&lt;br /&gt;
&lt;br /&gt;
[[Category:Current Members]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Advanced_IRC_Chat_Guide&amp;diff=971</id>
		<title>Advanced IRC Chat Guide</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Advanced_IRC_Chat_Guide&amp;diff=971"/>
		<updated>2018-04-13T08:50:01Z</updated>

		<summary type="html">&lt;p&gt;Lang: Created page with &amp;quot;====== Advanced IRC Chat Guide ======  This article describes, how to set up the Irssi IRC client to join the Remeis-chat at startup...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====== Advanced IRC Chat Guide ======&lt;br /&gt;
&lt;br /&gt;
This article describes, how to set up the [[http://irssi.org/|Irssi]] IRC client to join the [[irc:introduction|Remeis-chat]] at startup. In addition, the Irssi session is embedded within a [[http://www.gnu.org/software/screen/|screen]] session in order to avoid joining and leaving the chat (if one uses a computer at the observatory or, in general, one which is never powered off). As an advantage, messages in the chat, which has been sent &amp;quot;over night&amp;quot;, can be read the next day. Finally as the cherry on top, a simple [[http://www.gnu.org/software/bash/|Bash]] script will either create a new screen-Irssi session or use a running one. This script is at the end executed automatically after starting a new [[http://www.kde.org/|KDE]] session.\\&lt;br /&gt;
It is recommended to read [[http://quadpoint.org/articles/irssi/|A Guide to Efficiently Using Irssi and Screen]] for further informations and to even do more tricks.&lt;br /&gt;
&lt;br /&gt;
===== Irssi autojoin at startup =====&lt;br /&gt;
&lt;br /&gt;
In the following, an Irssi-configuration file will be described, which allows to automatically join the Remeis-chat. Further informations about the configuration files can be found in the [[http://irssi.org/documentation|Irssi documentation]].&lt;br /&gt;
&lt;br /&gt;
''' Create a default configuration ''' \\&lt;br /&gt;
First of all, configuration files are saved in the hidden folder ''.irssi'' in the user's home directory. If it does not exist, don't worry. Irssi will create it automatically if we call it to explicitly use a configuration file:&lt;br /&gt;
  irssi --config=~/.irssi/remeis&lt;br /&gt;
This will create a default configuration file ''remeis'', which will be edited to automatically join the Remeis-chat. But first of all, the opened Irssi session has to be closed by, e.g., entering&lt;br /&gt;
  /exit&lt;br /&gt;
into the Irssi command line.&lt;br /&gt;
&lt;br /&gt;
''' Setting up autojoin '''\\&lt;br /&gt;
Once the previously created configuration file ''remeis'' is opened with an editor of choice, several lines has to be added and/or modified. By default, the file contains several configurations already. The goal is to add a ''server'', a ''chatnet'', a ''channel'' and a ''window'' to the file. Each of these are configured similar to a structure in S-Lang. Those structures can be grouped to an array also:&lt;br /&gt;
  configuration = {&lt;br /&gt;
    field1 = value1;&lt;br /&gt;
    ...&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  array_of_configurations = (&lt;br /&gt;
    { field = value; ... },&lt;br /&gt;
    ...&lt;br /&gt;
  );&lt;br /&gt;
&lt;br /&gt;
To get the Remeis-chat working, the server ''irc.freenode.net'' has to be added first to the ''servers'' array:&lt;br /&gt;
  servers = (&lt;br /&gt;
    ...&lt;br /&gt;
    { address = &amp;quot;irc.freenode.net&amp;quot;; chatnet = &amp;quot;freenode&amp;quot;; port = &amp;quot;6667&amp;quot;; autoconnect = &amp;quot;yes&amp;quot;; }&lt;br /&gt;
  )&lt;br /&gt;
The field ''autoconnect = &amp;quot;yes&amp;quot;'' causes Irssi to connect to that server at startup. This server is also assign to the ''chatnet = &amp;quot;freenode&amp;quot;'', which has to be added to the corresponding structure:&lt;br /&gt;
  chatnets = {&lt;br /&gt;
    ...&lt;br /&gt;
    freenode = { type = &amp;quot;IRC&amp;quot;; };&lt;br /&gt;
  };&lt;br /&gt;
Here, the freenode chatnet itself is a structure, making ''chatnets'' a structure of structures. Now that a chatnet exists, which will be applied to the server irc.freenode.net, we can add channels to it via the ''channels'' array:&lt;br /&gt;
  channels = (&lt;br /&gt;
    ...&lt;br /&gt;
    { name = &amp;quot;#remeis&amp;quot;; chatnet = &amp;quot;freenode&amp;quot;; autojoin = &amp;quot;yes&amp;quot;; }&lt;br /&gt;
  )&lt;br /&gt;
The last thing one has to do now, is to create a new window at startup via the ''windows'' structure, which will join the previously defined channel ''#remeis'':&lt;br /&gt;
  windows = {&lt;br /&gt;
    1 = {&lt;br /&gt;
      items = (&lt;br /&gt;
        {&lt;br /&gt;
          type = &amp;quot;CHANNEL&amp;quot;;&lt;br /&gt;
          chat_type = &amp;quot;IRC&amp;quot;;&lt;br /&gt;
          name = &amp;quot;#remeis&amp;quot;;&lt;br /&gt;
          tag = &amp;quot;freenode&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
      );&lt;br /&gt;
    }&lt;br /&gt;
This will use the first window in Irssi (the dafault one) to connect to the Remeis-chat. Finally, one should set a proper nickname within the ''core'' structure, which itself is found within the ''settings'' structure. That's it! But remember, Irssi has to be called with this configuration file as parameter:&lt;br /&gt;
  irssi --config=~/.irssi/remeis&lt;br /&gt;
  &lt;br /&gt;
===== Irssi in a screen session =====&lt;br /&gt;
&lt;br /&gt;
''Screen'' can be used to open one or multiple virtual shells within an active shell. Each virtuell shell can be detached from the active shell, which sends it into the background. Even more, the virtual shell is independent from the active shell, which means that it is '''not terminated''' after active shell is closed! In combination with Irssi (or any other IRC client), the user will stay in the chat even he or she logs out from the system! This has several advantages:&lt;br /&gt;
  * messages sent after the user logged out can still be read after the screen session is attached again&lt;br /&gt;
  * reduces the join/left messages within the chat (reduces spam for the user users, doesn't it?)&lt;br /&gt;
The command to create a new screen session, where itself Irssi is used to connect to the Remeis-chat using the configuration file above, is simply:&lt;br /&gt;
  screen irssi --config=~/.irssi/remeis&lt;br /&gt;
The Irssi session will not look different compared if one does not use screen, but there is, among others, a shortcut available, which detaches the virtual shell:&lt;br /&gt;
  Ctrl + A + D&lt;br /&gt;
Now, Irssi will continue working in the background and independent from the active shell.&lt;br /&gt;
To attach this virtual shell again, one may use&lt;br /&gt;
  screen -r -d&lt;br /&gt;
in '''any other active shell'''. This will bring up the Irssi session and one is able to read, what happened since the session was detached.&lt;br /&gt;
&lt;br /&gt;
===== screen-Irssi Bash-script =====&lt;br /&gt;
&lt;br /&gt;
Now, it would be very comfortable to simply run one command, which either creates a new screen-Irssi session or detaches an existing one. Here, the script is not described step by step, instead the full (and hopefully working) code is shown in the following. Simple copy and paste it into any file, e.g., ''~/bin/runIrcChat'':&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  # runs either irssi in a screen session or (re)attaches an active one&lt;br /&gt;
  set irssi_session_name=remeis_irssi_$USER&lt;br /&gt;
  #only execute on ara&lt;br /&gt;
  #if [[ &amp;quot;$HOST&amp;quot; != &amp;quot;ara&amp;quot; ]]; then exit; fi&lt;br /&gt;
  # run screen if no session exists&lt;br /&gt;
  run=`screen -list | grep .$irssi_session_name`&lt;br /&gt;
  if [[ &amp;quot;$run&amp;quot; == &amp;quot;&amp;quot; ]]; then&lt;br /&gt;
    echo &amp;quot;running new irssi screen session: $irssi_session_name&amp;quot;&lt;br /&gt;
    xterm -title '#remeis@irc.freenode.net' -e &amp;quot;screen -S $irssi_session_name irssi --config=~/.irssi/remeis&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
  # otherwise, attach the session&lt;br /&gt;
    echo &amp;quot;attaching irssi screen session: $irssi_session_name&amp;quot;&lt;br /&gt;
    xterm -title '#remeis@irc.freenode.net' -e &amp;quot;screen -r -d $irssi_session_name&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
Finally, the above script file has to be made executable:&lt;br /&gt;
  chmod +x ~/bin/runIrcChat&lt;br /&gt;
Note, that for personal liking and hostoric reasons, the screen session is created in an ''xterm'' session. Who doesn't like xterm may modify the corresponding lines, of course.&lt;br /&gt;
&lt;br /&gt;
===== KDE autostart of Bash-script =====&lt;br /&gt;
&lt;br /&gt;
To execute the above script automatically after the user logs into KDE, a symbolic link has to be created in the KDE-autostart folder:&lt;br /&gt;
  ln -s ~/bin/runIrcChat ~/.kde/Autostart/&lt;br /&gt;
Unbelievable, but that's all! Now each time the user logs into KDE, a window will open showing the Remeis-IRC-chat! To even configure the stuff further, one may right-click on the window's title, select ''Advanced'' -&amp;gt; ''Special Window Settings...'' Using the slide ''Geometry'', the xterm window titled &amp;quot;#remeis@irc.freenode.net&amp;quot; can be configured such, that it will appear, e.g., on Desktop 4 always at initialization or with a different window size, like 800x600 pixels. There are many possibilities for personal likings...&lt;br /&gt;
&lt;br /&gt;
To prevent the script to be executed on another host than ones (usual) working machine, the following line may be added to the beginning of the script:&lt;br /&gt;
  if [[ &amp;quot;$HOST&amp;quot; != &amp;quot;ara&amp;quot; ]]; then exit; fi&lt;br /&gt;
Here, 'ara' has to be replaced with the proper hostname of the working machine. This modifications is quite useful, if you log into several machines simultaneously.&lt;br /&gt;
&lt;br /&gt;
[[Category:Current Members]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Functions_within_structures&amp;diff=967</id>
		<title>Functions within structures</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Functions_within_structures&amp;diff=967"/>
		<updated>2018-04-13T08:42:33Z</updated>

		<summary type="html">&lt;p&gt;Lang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====== functions within structures ======&lt;br /&gt;
&lt;br /&gt;
'''Please note:''' this tutorial is a modified copy of the [[isis:slxfig#object-oriented_programming|object-oriented programming]] part of the [[isis:slxfig|slxfig]] tutorial.&lt;br /&gt;
&lt;br /&gt;
Fields within a structure can hold any type of a variable. In particular, if a field is a reference to a function, this function can be used to operate on the host structure. Imagine a structure defining a car with its plate and a current place:&lt;br /&gt;
&amp;lt;code&amp;gt;variable acar = struct {&lt;br /&gt;
  plate = &amp;quot;GX 304-1&amp;quot;,&lt;br /&gt;
  place = &amp;quot;Bamberg&amp;quot;&lt;br /&gt;
};&amp;lt;/code&amp;gt;&lt;br /&gt;
The following function takes a given car structure and sets the place to a new one:&lt;br /&gt;
&amp;lt;code&amp;gt;define drive_car(car, dest) {&lt;br /&gt;
  vmessage(&amp;quot;%s drives from %s to %s&amp;quot;, car.plate, car.place, dest);&lt;br /&gt;
  car.place = dest;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;&lt;br /&gt;
slsh&amp;gt; drive_car(acar, &amp;quot;Erlangen&amp;quot;);&lt;br /&gt;
GX 304-1 drives from Bamberg to Erlangen&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
\\&lt;br /&gt;
It would be much easier, if the car-structure contains a drive-function itself. This is done by a field pointing to the previously defined function:&lt;br /&gt;
&amp;lt;code&amp;gt;variable acar = struct {&lt;br /&gt;
  plate = &amp;quot;GX 304-1&amp;quot;,&lt;br /&gt;
  place = &amp;quot;Bamberg&amp;quot;,&lt;br /&gt;
  drive = &amp;amp;drive_car  % &amp;lt;-- this value is a reference (Ref_Type) to the function drive_car&lt;br /&gt;
};&amp;lt;/code&amp;gt;&lt;br /&gt;
If the function is now called directly via the structure's field&lt;br /&gt;
&amp;lt;code&amp;gt;acar.drive(&amp;quot;Erlangen&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
the structure is automatically passed as first argument to the defined function.&lt;br /&gt;
&lt;br /&gt;
\\&lt;br /&gt;
'''Technical details about how this works'''&lt;br /&gt;
&lt;br /&gt;
If a field of a structure, which is a reference to a function, is accessed, the structure itself is pushed onto the stack first. Right after that, the parameters given to the function are pushed onto the stack also. To get the passed parameters and the structure within the function, the objects have to be pulled from the stack. This can be done, e.g., by simply defining the functions parameter accordingly as done above:&lt;br /&gt;
&amp;lt;code&amp;gt;define drive_car(car, dest)&amp;lt;/code&amp;gt;&lt;br /&gt;
This pulls the given parameter &amp;quot;dest&amp;quot; from the stack first (because it is pushed onto it ''last'') and at least pulls the structure from the stack into the variable &amp;quot;car&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Summarized:&lt;br /&gt;
&amp;lt;code&amp;gt;car.drive(&amp;quot;Erlangen&amp;quot;);&lt;br /&gt;
  --&amp;gt; S-Lang pushes the structure &amp;quot;car&amp;quot; onto the stack&lt;br /&gt;
  --&amp;gt; S-Lang pushes the string &amp;quot;Erlangen&amp;quot; onto the stack&lt;br /&gt;
  --&amp;gt; S-Lang calls drive_car&lt;br /&gt;
  --&amp;gt; drive_car pulls the string &amp;quot;Erlangen&amp;quot; from the stack and assignes it to &amp;quot;dest&amp;quot;&lt;br /&gt;
  --&amp;gt; drive_car pulls the structure &amp;quot;car&amp;quot; from the stack and assignes it to &amp;quot;car&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;del&amp;gt;But '''be aware''', that the _NARGS variable holding the passed number of arguments does not count the structure on the stack! In the above example, _NARGS = 1&amp;lt;/del&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This statement is not true any more, see example below (We do not now what has changed!):&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
private define vsm_fkt(){&lt;br /&gt;
&lt;br /&gt;
  vmessage(&amp;quot;_NARGS = %d&amp;quot;,_NARGS);&lt;br /&gt;
  _print_stack();&lt;br /&gt;
  variable vsm, arg1, arg2;&lt;br /&gt;
&lt;br /&gt;
  switch(_NARGS)&lt;br /&gt;
  { case 2: (vsm,arg1) = ();&lt;br /&gt;
    set_struct_field( vsm, &amp;quot;field1&amp;quot;, arg1 );&lt;br /&gt;
  }&lt;br /&gt;
  { case 3: (vsm,arg1,arg2)=();&lt;br /&gt;
    set_struct_field( vsm, &amp;quot;field1&amp;quot;, arg1 );&lt;br /&gt;
    set_struct_field( vsm, &amp;quot;field2&amp;quot;, arg2 );&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
define vsm_init(){&lt;br /&gt;
  return struct{&lt;br /&gt;
    field1 = 1,&lt;br /&gt;
    field2 = 2,&lt;br /&gt;
    fkt    = &amp;amp;vsm_fkt&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
variable v = vsm_init();&lt;br /&gt;
v.fkt(&amp;quot;A&amp;quot;);&lt;br /&gt;
v.fkt(&amp;quot;B&amp;quot;,&amp;quot;C&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Isis / Slang]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Functions_within_structures&amp;diff=966</id>
		<title>Functions within structures</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Functions_within_structures&amp;diff=966"/>
		<updated>2018-04-13T08:42:03Z</updated>

		<summary type="html">&lt;p&gt;Lang: Created page with &amp;quot;Migration in progress (Melanie)  ====== functions within structures ======  '''Please note:''' this tutorial is a modified copy of the isis:slxfig#object-oriented_programmin...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Migration in progress (Melanie)&lt;br /&gt;
&lt;br /&gt;
====== functions within structures ======&lt;br /&gt;
&lt;br /&gt;
'''Please note:''' this tutorial is a modified copy of the [[isis:slxfig#object-oriented_programming|object-oriented programming]] part of the [[isis:slxfig|slxfig]] tutorial.&lt;br /&gt;
&lt;br /&gt;
Fields within a structure can hold any type of a variable. In particular, if a field is a reference to a function, this function can be used to operate on the host structure. Imagine a structure defining a car with its plate and a current place:&lt;br /&gt;
&amp;lt;code&amp;gt;variable acar = struct {&lt;br /&gt;
  plate = &amp;quot;GX 304-1&amp;quot;,&lt;br /&gt;
  place = &amp;quot;Bamberg&amp;quot;&lt;br /&gt;
};&amp;lt;/code&amp;gt;&lt;br /&gt;
The following function takes a given car structure and sets the place to a new one:&lt;br /&gt;
&amp;lt;code&amp;gt;define drive_car(car, dest) {&lt;br /&gt;
  vmessage(&amp;quot;%s drives from %s to %s&amp;quot;, car.plate, car.place, dest);&lt;br /&gt;
  car.place = dest;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;&lt;br /&gt;
slsh&amp;gt; drive_car(acar, &amp;quot;Erlangen&amp;quot;);&lt;br /&gt;
GX 304-1 drives from Bamberg to Erlangen&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
\\&lt;br /&gt;
It would be much easier, if the car-structure contains a drive-function itself. This is done by a field pointing to the previously defined function:&lt;br /&gt;
&amp;lt;code&amp;gt;variable acar = struct {&lt;br /&gt;
  plate = &amp;quot;GX 304-1&amp;quot;,&lt;br /&gt;
  place = &amp;quot;Bamberg&amp;quot;,&lt;br /&gt;
  drive = &amp;amp;drive_car  % &amp;lt;-- this value is a reference (Ref_Type) to the function drive_car&lt;br /&gt;
};&amp;lt;/code&amp;gt;&lt;br /&gt;
If the function is now called directly via the structure's field&lt;br /&gt;
&amp;lt;code&amp;gt;acar.drive(&amp;quot;Erlangen&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
the structure is automatically passed as first argument to the defined function.&lt;br /&gt;
&lt;br /&gt;
\\&lt;br /&gt;
'''Technical details about how this works'''&lt;br /&gt;
&lt;br /&gt;
If a field of a structure, which is a reference to a function, is accessed, the structure itself is pushed onto the stack first. Right after that, the parameters given to the function are pushed onto the stack also. To get the passed parameters and the structure within the function, the objects have to be pulled from the stack. This can be done, e.g., by simply defining the functions parameter accordingly as done above:&lt;br /&gt;
&amp;lt;code&amp;gt;define drive_car(car, dest)&amp;lt;/code&amp;gt;&lt;br /&gt;
This pulls the given parameter &amp;quot;dest&amp;quot; from the stack first (because it is pushed onto it ''last'') and at least pulls the structure from the stack into the variable &amp;quot;car&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Summarized:&lt;br /&gt;
&amp;lt;code&amp;gt;car.drive(&amp;quot;Erlangen&amp;quot;);&lt;br /&gt;
  --&amp;gt; S-Lang pushes the structure &amp;quot;car&amp;quot; onto the stack&lt;br /&gt;
  --&amp;gt; S-Lang pushes the string &amp;quot;Erlangen&amp;quot; onto the stack&lt;br /&gt;
  --&amp;gt; S-Lang calls drive_car&lt;br /&gt;
  --&amp;gt; drive_car pulls the string &amp;quot;Erlangen&amp;quot; from the stack and assignes it to &amp;quot;dest&amp;quot;&lt;br /&gt;
  --&amp;gt; drive_car pulls the structure &amp;quot;car&amp;quot; from the stack and assignes it to &amp;quot;car&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;del&amp;gt;But '''be aware''', that the _NARGS variable holding the passed number of arguments does not count the structure on the stack! In the above example, _NARGS = 1&amp;lt;/del&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This statement is not true any more, see example below (We do not now what has changed!):&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
private define vsm_fkt(){&lt;br /&gt;
&lt;br /&gt;
  vmessage(&amp;quot;_NARGS = %d&amp;quot;,_NARGS);&lt;br /&gt;
  _print_stack();&lt;br /&gt;
  variable vsm, arg1, arg2;&lt;br /&gt;
&lt;br /&gt;
  switch(_NARGS)&lt;br /&gt;
  { case 2: (vsm,arg1) = ();&lt;br /&gt;
    set_struct_field( vsm, &amp;quot;field1&amp;quot;, arg1 );&lt;br /&gt;
  }&lt;br /&gt;
  { case 3: (vsm,arg1,arg2)=();&lt;br /&gt;
    set_struct_field( vsm, &amp;quot;field1&amp;quot;, arg1 );&lt;br /&gt;
    set_struct_field( vsm, &amp;quot;field2&amp;quot;, arg2 );&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
define vsm_init(){&lt;br /&gt;
  return struct{&lt;br /&gt;
    field1 = 1,&lt;br /&gt;
    field2 = 2,&lt;br /&gt;
    fkt    = &amp;amp;vsm_fkt&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
variable v = vsm_init();&lt;br /&gt;
v.fkt(&amp;quot;A&amp;quot;);&lt;br /&gt;
v.fkt(&amp;quot;B&amp;quot;,&amp;quot;C&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Isis / Slang]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Isis:tutorial:slang&amp;diff=953</id>
		<title>Isis:tutorial:slang</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Isis:tutorial:slang&amp;diff=953"/>
		<updated>2018-04-13T08:07:12Z</updated>

		<summary type="html">&lt;p&gt;Lang: Created page with &amp;quot;====== Programming in S-Lang ======  ''Remark:'' This brief introduction into S-Lang is primarily a translation of the German-language introduction to S-Lang used in the Remei...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====== Programming in S-Lang ======&lt;br /&gt;
&lt;br /&gt;
''Remark:'' This brief introduction into S-Lang is primarily a translation of the German-language introduction to S-Lang used in the Remeis astronomy lab, which was mainly written by Manfred Hanke.&lt;br /&gt;
&lt;br /&gt;
===== Introduction =====&lt;br /&gt;
&lt;br /&gt;
The underlying engine of Isis is S-Lang, an interpreted language that is similar to other modern scripting languages such as Perl or python. All of these languages are &amp;quot;Algol-like&amp;quot;, therefore, if you know how to program in C or any other of these scripting languages, you should not have a problem to program in S-Lang as well. &lt;br /&gt;
&lt;br /&gt;
The big advantage of having a scripting language as part of a data analysis package is that many things that are &amp;quot;routine&amp;quot; work can be automated, increasing your efficiency. This includes things like loading the data set that you're working with, e.g., in the case you are working with many spectra from different instruments, and need to do some specific ignoring and rebinning, or the calculation of errors. It also allows you to access all internal structures used in doing your best fit, such that you can prepare very nice figures our output your best fit parameters in a way that is better suited to publication than the standard isis routines. Historically, many astronomers (yours truly included) did this last step in IDL. While that language is very nice, it is also very expensive, with educational licenses costing around 1000 EUR ''per year''. It thus makes a lot of sense to move away from this and use a cheaper and more integrated approach to data analysis.&lt;br /&gt;
&lt;br /&gt;
''A comment to future data analysts:'' Scripting is very good, however, do not try to script everything. Many points of data analysis have to do with understanding your data set and here it is often much better to play with it by hand than to automatize things. Get a &amp;quot;feel&amp;quot; for your data first before trusting the computer to do everything right...&lt;br /&gt;
&lt;br /&gt;
''A comment to the language-warriors:'' Often people will ask why S-Lang was chosen as the interface and not, e.g., python. The reason is simple: because it was there. The important thing is that a scripting language is there at all. The main difficulty in learning how to program is not the programming syntax - if you think so, then you are not a good programmer - but rather to think in an algorithmic way. And this type of thinking is difficult to learn. Learning a new syntax isn't. The author of these lines (not M. Hanke ;-) ) started his life with a simple form of Amstrad Basic, followed by Omikron Basic, PASCAL, Turbo Pascal, Fortran-77((yes, it really is spelled &amp;quot;Fortran&amp;quot;, not &amp;quot;FORTRAN&amp;quot;. The only FORTRAN in existence was FORTRAN 66, since the 1977 standard, that language was spelled &amp;quot;Fortran&amp;quot;...)), Fortran-90, IDL, C, C++, Perl, javascript, and I am sure some more languages that I have forgotten (plus all of the assembly languages that were useful when one was still programming in assembly, i.e., 80x86, 68xxxx, and so on). Historically, all of these languages have a syntax that goes back to Algol in the 1960s, and thus in the core they are all the same. For this reason, do not worry about having to learn yet another scripting language, it's just a little bit of syntax. And, if you don't know how to program, start now. Because of the languages are all the same, it does not matter that S-Lang might be seen as obscure by some people, once you know how to think algorithmically, switching over to another language won't cost you too much time. This also means that if you are applying to jobs and somebody claims that you must know java or any other language, stay away from these jobs - knowing how to program is what makes you interesting, not the specific language...&lt;br /&gt;
&lt;br /&gt;
In contrast to compiled languages such as C, C++ or Fortran, scripting languages such as IDL, Perl, python, have the advantage that one can also work with them interactively and thus write small &amp;quot;programs&amp;quot; directly on the command line. We are using this feature all the time when doing data analysis by hand.&lt;br /&gt;
&lt;br /&gt;
In the following we assume that you had at least some previous exposure to programming, and just give a list of the most important language structures. &lt;br /&gt;
&lt;br /&gt;
===== S-Lang Language elements =====&lt;br /&gt;
&lt;br /&gt;
S-Lang consists of the following language elements that allow you to structure your programs. Note that in S-Lang programs ''all'' statements must be ending with a semicolon.&lt;br /&gt;
&lt;br /&gt;
==== Variable Declarations and Assignments ====&lt;br /&gt;
&lt;br /&gt;
In S-Lang programs, variables must be declared (this is optional on the command line). This is done with the instruction&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable var_1, var_2, ... ;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
you then assign values to a variable with&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
var_1=value;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
where ''value'' is a valid S-Lang statement. It is possible to combine the variable declaration and assignment, e.g.,&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=2;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
or more complicated expressions such as&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
var_1 = sin(a)+sqrt(25.);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Variable names may consist of any combination of the standard ASCII characters ''a-zA-Z0-9'' as well as the underscore ''_''  and the dollar sign ''$''. A variable is not allowed to start with a number.&lt;br /&gt;
&lt;br /&gt;
==== Data Types ====&lt;br /&gt;
&lt;br /&gt;
=== Simple Data Types ===&lt;br /&gt;
&lt;br /&gt;
S-Lang variables are generally weakly typed, that is the type of a variable is defined by the type of whatever is assigned to it. For example&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=2;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
means that after the assignment ''a'' is an integer. While&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=2.;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
means that ''a'' is a floating point number. Strings are assigned with&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=&amp;quot;abcd&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However, note that a variable can easily change its type, because the weak typing will mean that after the execution of&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=&amp;quot;abcd&amp;quot;; % String_Type&lt;br /&gt;
a=2.3;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
''a'' will have the type ''Double_Type''.  You can check this by printing the type of the variable:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
typeof(a);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Exercise 1:'''&lt;br /&gt;
&lt;br /&gt;
Assign the result of ''typeof(a)'' to some other variable. What is the datatype of that other variable?&lt;br /&gt;
&lt;br /&gt;
=== An aside on integer and floating point arithmetic ===&lt;br /&gt;
&lt;br /&gt;
Note that while weak typing usually speeds up code development, it does not preserve you from the pitfalls that go hand in hand with integer and floating point arithmetic. Consider the following classical example:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=5;&lt;br /&gt;
variable b=10;&lt;br /&gt;
variable c=a/b;&lt;br /&gt;
print(c);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note that ''c'' is 0 because of the rules of integer arithmetic (everything after the &amp;quot;.&amp;quot; is cut away). The correct result is obtained when doing floating point arithmetic:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=5.;&lt;br /&gt;
variable b=10.;&lt;br /&gt;
variable c=a/b;&lt;br /&gt;
print(c);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Even worse is the following often encountered example:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=1000;&lt;br /&gt;
variable b=6500;&lt;br /&gt;
variable c=a*b;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
and because of the rules of integer arithmetic you will have an integer overflow and ''c'' might even be negative.&lt;br /&gt;
&lt;br /&gt;
The rule in arithmetic expressions is that the &amp;quot;strongest&amp;quot; data type wins, i.e., in&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=10000000.0;&lt;br /&gt;
variable b=65000000;&lt;br /&gt;
variable c=a*b;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
''c'' will have the correct data type since the multiplication is performed in double precision.&lt;br /&gt;
&lt;br /&gt;
If you need to be 100 percent sure that a calculation needs to be done in a certain data type and you have no control that the variables entering an expression have that type (this is, e.g., the case in functions that are called by somebody else), you can force S-Lang to convert (&amp;quot;typecast&amp;quot;) a variable to a certain type:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
a=double(a);&lt;br /&gt;
b=int(b);&lt;br /&gt;
c=string(c);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Arrays and Lists ===&lt;br /&gt;
&lt;br /&gt;
You can combine the above simple data types into more complicated ones. The most important of these are&lt;br /&gt;
&lt;br /&gt;
== Arrays==&lt;br /&gt;
&lt;br /&gt;
Arrays are ordered lists of things of the same data type and are declared using brackets:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable arr=[1,2,3];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Content of arrays is accessed by giving the index in brackets:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable c=arr[1];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note that arrays are zero based, i.e., the above returns ''2'';&lt;br /&gt;
It is possible to access more than one element at the same time by using an array as the argument of the brackets:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable c=arr[[0,1]];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which produces an array containing two elements. If you want larger parts of an array, there is a very powerful &amp;quot;slicing&amp;quot; syntax that makes use of the fact that ''[a:b]'' defines the array ''[a,a+1,a+2,..,b]'' (for b&amp;gt;a and a,b Integers):&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable b=arr[[0:1]];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
(which is a somewhat silly example...).&lt;br /&gt;
&lt;br /&gt;
Arrays can be multi-dimensional, but the definition is not as nice as in other scripting languages:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable arr=Array_Type[2,3];&lt;br /&gt;
arr[0,[0:2]]=[1,2,3];&lt;br /&gt;
arr[1,[0:2]]=[5,4,3];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that also arrays with floating values can be created by the very similar syntax:  ''[a:b:c]'' creates an array with values ''[a, a+c, a+2*c,...]'', such that the last value is still lower than b. Even more comfortable is the syntax ''[a:b:#n]'', which creates exactly an array of length n, with equally spaced values ranging from a to b.&lt;br /&gt;
&lt;br /&gt;
== Lists == &lt;br /&gt;
&lt;br /&gt;
Lists are ordered lists of things that can be of different data type. They are declared using curly brackets:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable lis={1,2,3};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Accessing the list elements uses the standard bracket syntax:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=lis[1];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Lists are important whenever you want to store different things in one variable. For example, the following is legal:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable lis2={1,[&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;,&amp;quot;c&amp;quot;],3.2};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Operators ====&lt;br /&gt;
&lt;br /&gt;
Binary operators combine two expressions, ''x'' and ''y'', where ''x'' and ''y'' are constants, variables, functions and so on. The most important operators are:&lt;br /&gt;
&lt;br /&gt;
* '''arithmetic operators''': &lt;br /&gt;
 * ''+'', ''-'', ''*'', ''/'': basic arithmetic operators, the usual priority rules apply,&lt;br /&gt;
 * ''^'': exponentiation (''2^3'' is two to the power of three),&lt;br /&gt;
 * ''mod'': modulo operation&lt;br /&gt;
* ''' string concatenation''' is done with the ''+'' operator.&lt;br /&gt;
* ''' comparison ''': is done with ''&amp;lt;'', ''&amp;lt;='', ''=='', ''&amp;gt;='', and ''&amp;gt;''.  Note that like in all programming languages, you should ''never'' test two floating point variables for equality, this will most often not work in the way you expect...&lt;br /&gt;
&lt;br /&gt;
All of these operators can be used not only on scalar values but also on arrays. They are then used on an element basis. The resulting code is very fast. For example, to add two arrays:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=[1,2,3];&lt;br /&gt;
variable b=[6,5,3];&lt;br /&gt;
variable c=a+b;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As an aside, one often wants to add/subtract something from a variable. S-Lang allows the following C-like shortcuts:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
a+=5;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
is equivalent to&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
a=a+5;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
and similar ''-='', ''*='', and ''/='' (I don't think I've ever used the last one, though...).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Program flow control ====&lt;br /&gt;
&lt;br /&gt;
=== Conditional execution ===&lt;br /&gt;
&lt;br /&gt;
Conditional execution is done with the ''if''-statement:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
if ( condition ) {&lt;br /&gt;
   true-code;&lt;br /&gt;
} else {&lt;br /&gt;
   false-code;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=+1;&lt;br /&gt;
variable b;&lt;br /&gt;
if ( a&amp;lt;0 ) {&lt;br /&gt;
  b=-1;&lt;br /&gt;
} else {&lt;br /&gt;
  b=+1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note that the ''else''-branch is optional.&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
&lt;br /&gt;
== for-loop ==&lt;br /&gt;
&lt;br /&gt;
The syntax of the for loop is&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
for( initialize ; condition ; increment ) {&lt;br /&gt;
   code ;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
where usually in ''initialize'' a loop control variable is, well, initialized, and then incremented as long as condition is valid. An example would be &lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable i;&lt;br /&gt;
variable npt=10;&lt;br /&gt;
for (i=0; i&amp;lt;npt; i++) {&lt;br /&gt;
    print (i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which counts from 0 to 9 (a count down is also possible, use ''i-''''-''). Obviously, more than one line of code is possible...&lt;br /&gt;
&lt;br /&gt;
''Note:'' even though syntactically possible, never ever use anything else than an integer variable as the loop counter, unless explicitly necessary. &lt;br /&gt;
&lt;br /&gt;
== while loop ==&lt;br /&gt;
&lt;br /&gt;
The while loop is done while a condition is met:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
while ( condition ) {&lt;br /&gt;
  code ;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note that if ''condition'' is not met when the while loop is hit first, ''code'' is not executed at all. &lt;br /&gt;
&lt;br /&gt;
The above counting example can be implemented as follows:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable i=0;&lt;br /&gt;
variable npt=10;&lt;br /&gt;
while ( i&amp;lt;npt ) {&lt;br /&gt;
  print(i);&lt;br /&gt;
  i++;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== do...while loop ==&lt;br /&gt;
&lt;br /&gt;
The ''do...while''-loop is a loop where the body of the loop is executed at least once, since the condition is only tested at the end of the first passage through the loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
do {&lt;br /&gt;
  code ;&lt;br /&gt;
} while (condition);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Functions ====&lt;br /&gt;
&lt;br /&gt;
Functions are subroutines which execute a sequence of instructions whenever they are called (i.e., whenever their name appears in a program). Functions ''can'', but do not have to, have arguments, i.e., variables that control the behavior of the routine. &lt;br /&gt;
&lt;br /&gt;
=== Intrinsic functions ===&lt;br /&gt;
&lt;br /&gt;
''Note 1:'' More information about individual functions can be obtained with isis' ''help''-function.&lt;br /&gt;
&lt;br /&gt;
''Note 2:'' Most simple functions also work on arrays.&lt;br /&gt;
&lt;br /&gt;
== Mathematical functions ==&lt;br /&gt;
&lt;br /&gt;
* sign functions: ''abs'', ''sign'', ''_diff'', ''_max'', ''_min''&lt;br /&gt;
* rounding functions: ''ceil'', ''floor'', ''nint'', ''round''&lt;br /&gt;
* basic algebraic functions: ''sqr'' (square!), ''sqrt'' (square-root), ''hypot'', ''polynom'', ''mul2''&lt;br /&gt;
* exponential and logarithm: ''exp'', ''expm1'', ''log'', ''log10'', ''log1p''&lt;br /&gt;
* trigonometric functions (argument is in radian!): ''sin'', ''cos'', ''tan'', ''asin'', ''acos'', ''atan'', ''atan2''&lt;br /&gt;
* hyperbolic functions: ''sinh'', ''cosh'', ''tanh'', ''asinh'', ''acosh'', ''atanh''&lt;br /&gt;
* complex numbers: ''Real'', ''Imag'', ''Conj''&lt;br /&gt;
* tests: ''isinf'', ''isnan'' (nan: not a number), ''_ispos'', ''_isneg'', ''_isnoneg''&lt;br /&gt;
&lt;br /&gt;
== Array functions ==&lt;br /&gt;
&lt;br /&gt;
* number of elements in an array: ''length''&lt;br /&gt;
* extrema: ''max'', ''min'', ''maxabs'', ''minabs''&lt;br /&gt;
* summing array elements: ''sum'', ''sumsq'', ''cumsum''&lt;br /&gt;
* tests: ''all'', ''any''&lt;br /&gt;
* get the indices for all or some elements for which a condition is met: ''where'', ''wherenot'', ''wherefirst'', ''wherelast''&lt;br /&gt;
&lt;br /&gt;
== Printing ==&lt;br /&gt;
&lt;br /&gt;
Output is done with the ''print'' and the ''vmessage'' functions. ''vmessage'' uses a format similar to the C ''printf''-function to format the output. Examples include:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=1.2347;&lt;br /&gt;
vmessage(&amp;quot;%f&amp;quot;,a);   % print with full precision, note the roundoff error!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
variable a=25;&lt;br /&gt;
vmessage(&amp;quot;%05d&amp;quot;,a); % print 5 digits, zero padded&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Note'': ''vmessage'' works very similar to the function ''printf'', which exists in many programming languages (and also in S-Lang).&lt;br /&gt;
&lt;br /&gt;
=== user-defined functions ===&lt;br /&gt;
&lt;br /&gt;
your own function can be defined with the syntax&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
define functionname (arguments) {&lt;br /&gt;
   code;&lt;br /&gt;
   :&lt;br /&gt;
   code;&lt;br /&gt;
   return value;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
where the return value statement is optional.&lt;br /&gt;
&lt;br /&gt;
Functions are very useful to structure your program. Use them liberally! An example would be that for a given data set, you write a function to load the data and do the rebinning. Additionally, giving useful names to your functions improves the readability of your code.&lt;br /&gt;
&lt;br /&gt;
A more silly example is the following, which returns the sum and difference of two numbers:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
define adddiff(a,b) {&lt;br /&gt;
   % return the sum and difference of two numbers.&lt;br /&gt;
   variable sum=a+b;&lt;br /&gt;
   variable diff=a-b;&lt;br /&gt;
   return [sum,diff];&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note the comments. It is good style to comment your code well in order to allow you and others later to understand what the code is doing. You should always comment your code while writing, do not only do it at the end because somebody told you so, make the writing of comments part of your coding practice!&lt;br /&gt;
&lt;br /&gt;
'''Exercise 2'''&lt;br /&gt;
&lt;br /&gt;
Write a slang function 'midnight' which returns the roots of a quadratic equation &amp;lt;latex&amp;gt;$ax^2+bx+c$&amp;lt;/latex&amp;gt;. The routine should work for all possible values of ''a'', ''b'', and ''c''. &lt;br /&gt;
&lt;br /&gt;
=== libraries ===&lt;br /&gt;
&lt;br /&gt;
Libraries are collections of S-Lang functions. They get loaded with the statement&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
require(&amp;quot;libraryname&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Afterwards, all functions in &amp;quot;libraryname&amp;quot; are available. &lt;br /&gt;
&lt;br /&gt;
==== Isis programs ====&lt;br /&gt;
&lt;br /&gt;
Isis programs consist of a sequence of function declarations and a main program, stored in a file that can be written with any editor of your choice. To execute a program you have several choices. In the following, let's assume the program's filename is ''test.sl'':&lt;br /&gt;
&lt;br /&gt;
  - you can execute the program from the Linux command line, by issuing the command ''isis test.sl'';&lt;br /&gt;
  - if you want to execute the program from within isis (e.g., because you want to work on its output interactively, use ''()=evalfile(&amp;quot;test.sl&amp;quot;);''.&lt;br /&gt;
  - to run a program under isis and immediately exit isis, use the &amp;quot;shebang&amp;quot; notation. For example:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
#!/usr/bin/env isis&lt;br /&gt;
&lt;br /&gt;
% stupid count down example&lt;br /&gt;
variable i;&lt;br /&gt;
variable npt=10;&lt;br /&gt;
for (i=0; i&amp;lt;npt; i++) {&lt;br /&gt;
    print (i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
then make the code executable under Linux:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
hde226868:~/&amp;gt; chmod ugo+x ./test.sl&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
After this you can execute the code with&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
hde226868:~/&amp;gt; ./test.sl&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The name &amp;quot;shebang&amp;quot;-notation comes from the pronounciation of the hash-sign '#' as &amp;quot;she&amp;quot; and the exclamation mark as &amp;quot;bang&amp;quot;. yes, really.&lt;br /&gt;
&lt;br /&gt;
''' Exercise 3'''&lt;br /&gt;
&lt;br /&gt;
Write a S-Lang program that loads the gratings data from Exercise 3 of [[isis:tutorial:fitting1|Advanced Fitting Techniques, 1]]. The program should have functions that&lt;br /&gt;
# load the data, ignore the appropriate energy channels and rebin it. The function should return the indices of the PCA, HEXTE A, and HEXTE B data.&lt;br /&gt;
# setup the fit function and set the parameters to reasonable starting values&lt;br /&gt;
# call the above functions from a main program and perform the fit&lt;br /&gt;
# call a third function that makes a plot of the best-fit with residuals. Use the same color for the HEXTE A and B data points. ''Hint:'' note that the call to the plot functions is a list. The colors assigned to the data points through the ''dcol'' qualifiers apply to the individual list elements. For example, if ''dcol=[1,2]'' then the spectra corresponding to the  2nd list element are plotted in color number 2. The list describing the spectra is a ''list'', i.e., it can contain arrays as list elements...  In other words: call the plot functions such that all color qualifiers have only two elements. &lt;br /&gt;
# call a fourth function which calculates a 2D-error contour for &amp;lt;latex&amp;gt;$N_H$&amp;lt;/latex&amp;gt; and &amp;lt;latex&amp;gt;$\Gamma$&amp;lt;/latex&amp;gt; (NOTE: the relevant information for this last point is not yet there and, because of carpal tunnel syndrome, will only be available on Tuesday).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Isis / Slang]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Remeis_Hotel_Recommendations&amp;diff=865</id>
		<title>Remeis Hotel Recommendations</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Remeis_Hotel_Recommendations&amp;diff=865"/>
		<updated>2018-04-11T15:45:29Z</updated>

		<summary type="html">&lt;p&gt;Lang: Created page with &amp;quot;====== Remeis Hotel Recommendations  ======  Hotels which have been visited by us and can be recommended.   ===== Almeria =====  * '''Hotel Costa Sol''' &amp;amp;minus; very good and...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====== Remeis Hotel Recommendations  ======&lt;br /&gt;
&lt;br /&gt;
Hotels which have been visited by us and can be recommended. &lt;br /&gt;
&lt;br /&gt;
===== Almeria =====&lt;br /&gt;
&lt;br /&gt;
* '''Hotel Costa Sol''' &amp;amp;minus; very good and quite cheap (50€ per night). Free WLAN on all floors, Clean rooms and in walking distance to the beach and the good restaurants ''(Markus)''&lt;br /&gt;
&lt;br /&gt;
===== Amsterdam =====&lt;br /&gt;
&lt;br /&gt;
* ''' AirBnB ''' &amp;amp;minus; no really good+affordable hotels really close to science park, but I have good experience finding places over AirBnB ''(Victoria)''&lt;br /&gt;
&lt;br /&gt;
* ''' Hotel Rembrandt ''' close to the zoo, usually affordable. Getting to UvA requires taking the tram and then either the bus or a 1.5km walk. Still less overpriced than hotels in the center, though '' (Joern)''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Bonn =====&lt;br /&gt;
&lt;br /&gt;
* ''' Altes Treppchen ''' 10 min walk to the MPIfR. Good breakfast. Cheaper conditions for visitors from the MPIfR. The institut has its own guest house but one has to book it very early.&lt;br /&gt;
===== Boston/Cambridge, MA =====&lt;br /&gt;
&lt;br /&gt;
* ''' John Jeffries House Boston ''': usually the best deal in the greater Boston area if you can get it. In walking distance to MIT, only three subway stops from Harvard. They are bookable by phone, check http://www.johnjeffrieshouse.com/ for rates and then call (note: all rates are without tax), or use expedia.'' (Joern)''&lt;br /&gt;
&lt;br /&gt;
* ''' Doubletree Suites by Hilton Hotel Boston - Cambridge ''': WLAN only if one knows the password (warmcookie); prices on the high side (but all of Boston is expensive), worth checking for offers; half an hour walk to MIT through a rather safe area; one of the best options in Boston'' (Victoria)''&lt;br /&gt;
&lt;br /&gt;
===== Berkeley =====&lt;br /&gt;
&lt;br /&gt;
* ''' DoubleTree by Hilton Berkeley Marina ''': At the water/bay, great setting, quite luxurious, still often affordable (check). The city of Berkeley and the University of California Berkeley stretch up the mountain behind it (not really in walking distance but straight forward), SSL is on the top of the mountain. '' (Katja)''&lt;br /&gt;
&lt;br /&gt;
===== Frascati =====&lt;br /&gt;
* '''Bellavista ''': Next to the train station (and their park and ride parking lot &amp;amp;minus; don't try to find parking in Frascati itself...). Very nice rooms, acceptable WLAN. Like with all Frascati hotels, you need a car or taxi to get to Esrin or INFN/IASF. ''(Joern)''&lt;br /&gt;
* '''Colonna ''': Nice rooms, good breakfast, in downtown Frascati. WLAN is almost non-existent, as is mobile phone reception. Choose this if the Bellavista is sold out.''(Joern)''&lt;br /&gt;
* '''Hotel Villa Veccia ''': This is my favorite place in Frascati, but it is somewhat special. A cheap (often cheaper than the Bellavista or the Colonna) four star hotel with low-quality WLAN in the 16th century villa of a cardinal. The hotel has a piece of Roman road in its yard and a good restaurant. It is on the road towards the observatory. Go there for the ambiance, avoid if you want dinner (or anything else) anywhere else.''(Joern)''&lt;br /&gt;
===== Garching =====&lt;br /&gt;
* '''Koenig Ludwig II ''': nice rooms, good breakfast. MPE typically books you into this place. ''(Joern)''&lt;br /&gt;
* '''Marias Inn ''': Used to be the best price/value in Garching, however, not so much in the past years (they've been replaced by the Coro in that respect). Important: they have parking. Walking distance to MPE/MPA/ESO. ''(Joern)''&lt;br /&gt;
* '''Hoyacker Hof''': The most Bavarian of all Bavarian hotels in Garching. Typically on the pricey side. Best breakfast in Garching, however. ''(Joern)'' &lt;br /&gt;
* '''Hotel Coro''': Nice middle class hotel, outside of downtown Garching (inasmuch this is possible...). I like it. ''(Joern)'' Has very good breakfast. There is a direct bus connection from the Hotel to ESO/MPA (bus number 292, Kurzstrecke). ''(Eugenia)''&lt;br /&gt;
* '''Hotel am Park ''': Dark rooms, not so good breakfast. I only go there as the last resort. ''(Joern)''&lt;br /&gt;
* '''Ibis ''': Out of downtown Garching in Hochbrueck. It's an ibis, enough said. ''(Joern)''&lt;br /&gt;
&lt;br /&gt;
===== Greenbelt/Washington =====&lt;br /&gt;
&lt;br /&gt;
* '''Holiday Inn Washington D.C.-Greenbelt Md''': WLAN OK, good for GSFC visits (bus to GSFC around the corner), a small shopping center (supermarket, drugstore, several small restaurants and fast food places) around the corner, breakfast not included but they did give it to me anyway, free bearable coffee in the lobby $80-90 ''(Victoria)''&lt;br /&gt;
&lt;br /&gt;
===== Hamburg/Desy =====&lt;br /&gt;
&lt;br /&gt;
* '''Mercure Hotel Hamburg am Volkspark''': The only hotel in walking distance from Desy and XFEL. Insofar you have no choice anyway, unless you want to stay in downtown and treck out to the site with the metro and the bus. Good breakfast, bad WLAN.''(Joern)''&lt;br /&gt;
===== Livermore =====&lt;br /&gt;
* '''Doubletree Livermore''': one of the lower quality Doubletree hotels I've stayed in, but perfectly fine and safe. Outside of the town, but due to non-existent public transportation you'll need a rental car anyway.&lt;br /&gt;
* '''Motel 6 Livermore''': a two-star chain motel. Quiet and clean rooms, but without a fridge. Next to the Doubletree (and significantly cheaper). No breakfast, but I recommend the breakfast places in downtown Livermore anyway and for a quick breakfast there is a Panera and a Starbucks on the way to LLNL anyway.&lt;br /&gt;
===== Madrid =====&lt;br /&gt;
&lt;br /&gt;
* '''NH Alberto Aguilera''': WLAN okay (good for Madrid!), good for ESAC visits, 80-90€ (2015), Tapas/Restaurants very close, inner city not far away ''(Thomas / Jörn)''&lt;br /&gt;
&lt;br /&gt;
===== Noordwijk =====&lt;br /&gt;
&lt;br /&gt;
* '''Hotel de Admiraal''': Usually the best price/value ratio in Noordwijk. Taxi to ESTEC is around 15 EUR, or walk for a few km aong the beach. Check this hotel before any other when going to ESTEC.&lt;br /&gt;
&lt;br /&gt;
* '''Zorn Hotel Duinlust''': Cheap. But clean. '' (Jörn)''&lt;br /&gt;
&lt;br /&gt;
* '''Prominent Inn''': If the cheap hotels are gone, this four star typically might still be free and not outrageously expensive'' (Jörn)''&lt;br /&gt;
===== Palermo =====&lt;br /&gt;
* '''Hotel Porta Felice''': Hotel close to the harbor and the university administration (Palazzo Chiaramonte Stevi) where the observatory likes to have its conferences. NOT good for meetings in Mondello! This is a very nice hotel with beautiful rooms and good WLAN. We got rooms for 60 EUR/night through a booking service, you might also want to check their www pages (http://hotelportafelice.it).'' (Thomas/Jörn)''&lt;br /&gt;
&lt;br /&gt;
===== Pasadena =====&lt;br /&gt;
&lt;br /&gt;
* '''Saga Motor Inn''': Felix pointed me to this hotel. Can only be booked via their web page (http://www.thesagamotorhotel.com/). The rooms have a (nice) 50s feeling (but WLAN), definitively not a chain, very nice place with ok breakfast and a sufficient number of dinner options around (plus two Starbucks). Walking distance to Caltech. Only look for other options in the Pasadena area if this one is fully booked.'' (Jörn)''&lt;br /&gt;
&lt;br /&gt;
===== Potsdam =====&lt;br /&gt;
* The nH hotel in downtown Potsdam (Dutch quarter, http://www.nh-hotels.com/hotel/nh-potsdam) is pretty nice, but WLAN is slow (faster WLAN is EUR 10/day as of summer 2015). Going to Golm (where the physics/astro department of the university is), is about a 30min bike ride through a beautiful park. AIP is about 20min. Rental bikes available on per 30min basis with stations at most major POI.  &amp;amp;minus;- ''[[Felix.Fuerst@sternwarte.uni-erlangen.de|Felix Fürst]] 2015-09-24 21:37''&lt;br /&gt;
* '''Apart Hotel Vivaldi''': Hotel with nice rooms in Babelsberg, in walking distance from AIP. Take this one if you go to Potsdam by car (the nH is better if you go to Potsdam by public transport).''(Joern)''&lt;br /&gt;
* '''Filmhotel Lili Marleen''': Good three star-Hotel with nice, modern rooms. A tad bit far away from AIP, however, so not recommended if you do not have a car.''(Joern)''&lt;br /&gt;
&lt;br /&gt;
===== San Diego =====&lt;br /&gt;
&lt;br /&gt;
* '''Travelodge San Diego Mission Valley''': like almost all San Diego Hotels, you will need a car to get anywhere. The Travelodge has nice rooms and can be on the affordable side.'' (Jörn)''&lt;br /&gt;
&lt;br /&gt;
* ''' Howard Johnson Inn San Diego Circle ''': Also in Mission Valley. Somewhat rundown, but at least not overpriced.'' (Jörn)''&lt;br /&gt;
&lt;br /&gt;
* ''' California Suites Clairemont Mesa Boulevard ''': Typical US chain hotel. Not too expensive, with breakfast according to Tobi. One of the few hotels on the bus route to UCSD. And it's very close to one of the best SciFi book stores in the US.'' (Jörn)''&lt;br /&gt;
===== Toulouse =====&lt;br /&gt;
* ''' Hotel Castellane ''': decent middle-class hotel close to the Metro station Jean Jaures, i.e., close to inner city and also Metro to IRAP good ''(Jörn)''&lt;br /&gt;
* ''' Appart City Toulouse Labege ''': quite close to IRAP, but industrial area, rental car necessary (good if hotels in Toulouse booked out)  ''(Jörn)''&lt;br /&gt;
* ''' Best Western Hôtel Les Capitouls ''': very nice 4 star hotel, very close to Hotel Castellane / Jean Jaures; sometimes with a similar/cheaper price as Hotel Castellane ''Thomas''&lt;br /&gt;
===== Utrecht =====&lt;br /&gt;
* ''' Hotel Oorsprongpark ''': good three-star hotel on the bus line to SRON, in a quiet residential area but still in walking distance to the city center (on the cheaper side for Utrecht - typically it is around 90 EUR plus breakfast) ''(Jörn)''&lt;br /&gt;
* ''' Hampshire Hotel - Malie Utrecht ''': Close to the Hotel Oorsprongpark, but significantly better. Every now and then they have a sale and are comparable in price to the Oorsprongpark. In this case, I'd prefer this hotel over the Oorsprongpark ''(Jörn)''&lt;br /&gt;
* ''' Van der Valk Hotel De Bilt ''': Good hotel in the middle of nowhere, close to Utrecht's de Bilt suburb. Getting from here to the University/SRON is difficult with public transportation. On foot it's about half an hour. &lt;br /&gt;
&lt;br /&gt;
[[Category:Current Members]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Remeis_English_Checklist&amp;diff=863</id>
		<title>Remeis English Checklist</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Remeis_English_Checklist&amp;diff=863"/>
		<updated>2018-04-11T15:26:54Z</updated>

		<summary type="html">&lt;p&gt;Lang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====== The Remeis English Checklist ======&lt;br /&gt;
&lt;br /&gt;
(by J. Wilms and K. Pottschmidt)&lt;br /&gt;
&lt;br /&gt;
''First of all and most importantly:''&lt;br /&gt;
&lt;br /&gt;
* did you read the instructions to authors of the journal? If you are working on a thesis, did you read those of [[http://www.aanda.org/doc_journal/instructions/aadoc.pdf|Astronomy and Astrophysics]]?&lt;br /&gt;
* did you read appendix A of the [[https://journals.aps.org/files/rmpguide.pdf|instructions to authors]] of Rev Mod Phys?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Punctuation ====&lt;br /&gt;
&lt;br /&gt;
* did you remove all commas before &amp;quot;that&amp;quot;?&lt;br /&gt;
* did you end your footnotes and captions with a full stop (&amp;quot;.&amp;quot;)?&lt;br /&gt;
* did you make sure that your use of &amp;quot;data&amp;quot; is correct and uses plural verbs?&lt;br /&gt;
* did you make sure that you do not have a &amp;quot;:&amp;quot; anywhere before an equation, but that your equations are seen as part of your sentences?&lt;br /&gt;
* did you make sure that you have commas surrounding &amp;quot;i.e.&amp;quot; and &amp;quot;e.g.&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
==== Spelling and Word usage ====&lt;br /&gt;
&lt;br /&gt;
* do you consistently use either British or American spelling?&lt;br /&gt;
* did you run a spell checker over your manuscript? For TeX, use &amp;quot;ispell&amp;quot; or the built in spell checker in emacs.&lt;br /&gt;
* did you make sure not to use country prefixes in addresses in the author list?&lt;br /&gt;
* did you avoid passive voice as much as possible?&lt;br /&gt;
* did you make sure that you are //not// using &amp;quot;The found results are...&amp;quot; and similar German constructs in your text?&lt;br /&gt;
* did you make sure that everything in your text that is not your original result is accompanied by proper citations?&lt;br /&gt;
* did you make sure that you distinguish between &amp;quot;estimate&amp;quot; and &amp;quot;estimation&amp;quot; by replacing all &amp;quot;estimation&amp;quot; with &amp;quot;estimate&amp;quot;?&lt;br /&gt;
* did you replace all uses of &amp;quot;exemplary&amp;quot; by &amp;quot;example&amp;quot;?&lt;br /&gt;
* did you replace all uses of &amp;quot;the actual value&amp;quot; by &amp;quot;the real value&amp;quot;? (if you are German, &amp;quot;actual&amp;quot; does not mean &amp;quot;aktuell&amp;quot;!)&lt;br /&gt;
* did you remove all uses of &amp;quot;hence&amp;quot; and &amp;quot;thereby&amp;quot;?&lt;br /&gt;
* did you make sure that you use &amp;quot;however&amp;quot; as sparingly as possible?&lt;br /&gt;
* did you make sure that you did not use &amp;quot;the equation reads..&amp;quot;, but rather used &amp;quot;the equation is...&amp;quot; or &amp;quot;the equation is given by...&amp;quot;?&lt;br /&gt;
* did you avoid split infinitives? (&amp;quot;to boldly go...&amp;quot; is wrong; yes, in many cases split infinitives are ok in current English, but they tend to be so often used wrongly by non-native speakers that it is best to avoid them)&lt;br /&gt;
* did you make sure that you distinguish properly between &amp;quot;this&amp;quot; and &amp;quot;these&amp;quot;?&lt;br /&gt;
* did you make use of the &amp;quot;Oxford comma&amp;quot;, i.e., do you have a comma before &amp;quot;and&amp;quot; in lists?&lt;br /&gt;
* did you use &amp;quot;i.e.&amp;quot; and &amp;quot;e.g.&amp;quot; correctly, i.e., using &amp;quot;i.e.&amp;quot; for a specific clarification or definition and &amp;quot;e.g.&amp;quot; where you would otherwise use &amp;quot;for example&amp;quot;?&lt;br /&gt;
* did you use the IAU recommended year - month - day sequences (2016 March 15)?&lt;br /&gt;
* did you make sure that you did not use contractions such as &amp;quot;didn't&amp;quot; or &amp;quot;you're&amp;quot;?&lt;br /&gt;
* did you replace &amp;quot;cf.&amp;quot; with &amp;quot;see&amp;quot; everywhere since you know that &amp;quot;cf.&amp;quot; means &amp;quot;compare&amp;quot;?&lt;br /&gt;
* did you make sure that the reader will understand what thing you refer to when using &amp;quot;it&amp;quot; rather than naming it? &lt;br /&gt;
* did you make sure that all uses of &amp;quot;this&amp;quot; are followed by the object you are referring to? &lt;br /&gt;
* did you use &amp;quot;led&amp;quot; rather than &amp;quot;lead&amp;quot; when using the past tense of the verb &amp;quot;to lead&amp;quot;?&lt;br /&gt;
* did you reread the manuscript for internal consistency after you added comments from your coauthors?&lt;br /&gt;
* did you make sure that your sentences are short (rule of thumb: if a sentence goes over more than three lines it is probably too long)?&lt;br /&gt;
* did you check that you did not combine two sentences that could be separate sentences with &amp;quot;and&amp;quot;?&lt;br /&gt;
* did you avoid abbreviations as much as possible and only used them when they are really, really common (HST, AGN, XMM,...)?&lt;br /&gt;
* did you check that you defined all abbreviations that you used at their first usage? (&amp;quot;...Active Galactic Nucleus (AGN)...&amp;quot; //not// &amp;quot;...AGN (Active Galactic Nucleus)...&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
==== Citations ====&lt;br /&gt;
&lt;br /&gt;
* did you add the journal to all publications where you list the arXiv-reference and not just blindly copy the erroneous ADS bibtex entry?&lt;br /&gt;
* did you make sure that you distinguished between arXiv references where a paper is submitted and references where a paper is already accepted by checking the paper author's comment on the arXiv-page for that article?&lt;br /&gt;
* did you remove the page number for all ATEL-references downloaded from ADS and changed the journal name to &amp;quot;Astron. Tel.&amp;quot; or &amp;quot;ATEL&amp;quot;? (and similar for IAU telegrams)&lt;br /&gt;
* did you add editors and the title of the conference publication to all conference publications?&lt;br /&gt;
* did you add the publisher and place information (city only) to all books, conference publications, and other book-like publications that you are citing?&lt;br /&gt;
* did you check that your references are correct in that you are using ''\citet{biblabel}'' for references in the text and ''\citep{biblabel}'' for references in parentheses?&lt;br /&gt;
* did you make sure that none of your ''\citet{..}'' commands refer to more than one biblabel?&lt;br /&gt;
&lt;br /&gt;
==== Typesetting (mainly in TeX) ====&lt;br /&gt;
&lt;br /&gt;
* did you check for missing spaces between values and units?&lt;br /&gt;
* did you make sure that all scientific units are typeset in ''\mathrm''?&lt;br /&gt;
* did you make sure not to use constructs such as ''$\mathrm{m}/\mathrm{s}$'' by using ''$\mathrm{m}\,\mathrm{s}^{-1}$'' instead?&lt;br /&gt;
* did you make sure that almost all of your error bars are rounded up to only one significant digit rather than following the DIN-norm (which is not applied in astronomical journals)?&lt;br /&gt;
* did you make sure that you are not using any positioning commands for the table or figure environment such as ''\begin{table}[htpb]''?&lt;br /&gt;
* did you make sure that your tables have captions above the table, and figures have captions below the figure or next to it (where allowed by the style)?&lt;br /&gt;
* did you make sure that you use empty lines to denote the start of a new paragraph rather than the ''\\''-command? (use ''\parindent{0pt}'' if you do not want to indent paragraphs)&lt;br /&gt;
* did you make sure that there are no paragraph endings above or below ''\begin{equation}...\end{equation}'' by ensuring that there is no empty line above or below the ''equation''-environment?&lt;br /&gt;
* did you make sure that you are not using ''$\frac{a}{b}$'' in normal text, but use ''$a/b$'' instead?&lt;br /&gt;
* did you make sure that you are not using the ''displaymath''-environment and that all equations are numbered?&lt;br /&gt;
* did you make sure that all of your sections, subsections, paragraphs and so on are numbered?&lt;br /&gt;
* did you avoid any and all uses of ''\bf'', ''\it'', ''\sl'', or ''\em'' and use the proper commands ''\textbf'', ''\textit'', ''\textsl'', and ''\emph'' instead?&lt;br /&gt;
* did you use the en-dash of TeX for ranges, even if they occur in math, by using ''%%--%%'' in text mode rather than a minus sign? (that is, did you typeset a range in an equation as ''%%$3x$--$5x$%%'' or ''%%$3x\mbox{--}5x$%%'' rather than, erroneously, ''$3x-5x$''?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Current Members]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Remeis_English_Checklist&amp;diff=859</id>
		<title>Remeis English Checklist</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Remeis_English_Checklist&amp;diff=859"/>
		<updated>2018-04-11T15:20:34Z</updated>

		<summary type="html">&lt;p&gt;Lang: Created page with &amp;quot;====== The Remeis English Checklist ======  (by J. Wilms and K. Pottschmidt)  //First of all and most importantly://    * did you read the instructions to authors of the journ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====== The Remeis English Checklist ======&lt;br /&gt;
&lt;br /&gt;
(by J. Wilms and K. Pottschmidt)&lt;br /&gt;
&lt;br /&gt;
//First of all and most importantly://&lt;br /&gt;
&lt;br /&gt;
  * did you read the instructions to authors of the journal? If you are working on a thesis, did you read those of [[http://www.aanda.org/doc_journal/instructions/aadoc.pdf|Astronomy and Astrophysics]]?&lt;br /&gt;
  * did you read appendix A of the [[https://journals.aps.org/files/rmpguide.pdf|instructions to authors]] of Rev Mod Phys?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Punctuation ====&lt;br /&gt;
&lt;br /&gt;
  * did you remove all commas before &amp;quot;that&amp;quot;?&lt;br /&gt;
  * did you end your footnotes and captions with a full stop (&amp;quot;.&amp;quot;)?&lt;br /&gt;
  * did you make sure that your use of &amp;quot;data&amp;quot; is correct and uses plural verbs?&lt;br /&gt;
  * did you make sure that you do not have a &amp;quot;:&amp;quot; anywhere before an equation, but that your equations are seen as part of your sentences?&lt;br /&gt;
  * did you make sure that you have commas surrounding &amp;quot;i.e.&amp;quot; and &amp;quot;e.g.&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
==== Spelling and Word usage ====&lt;br /&gt;
&lt;br /&gt;
  * do you consistently use either British or American spelling?&lt;br /&gt;
  * did you run a spell checker over your manuscript? For TeX, use &amp;quot;ispell&amp;quot; or the built in spell checker in emacs.&lt;br /&gt;
  * did you make sure not to use country prefixes in addresses in the author list?&lt;br /&gt;
  * did you avoid passive voice as much as possible?&lt;br /&gt;
  * did you make sure that you are //not// using &amp;quot;The found results are...&amp;quot; and similar German constructs in your text?&lt;br /&gt;
  * did you make sure that everything in your text that is not your original result is accompanied by proper citations?&lt;br /&gt;
  * did you make sure that you distinguish between &amp;quot;estimate&amp;quot; and &amp;quot;estimation&amp;quot; by replacing all &amp;quot;estimation&amp;quot; with &amp;quot;estimate&amp;quot;?&lt;br /&gt;
  * did you replace all uses of &amp;quot;exemplary&amp;quot; by &amp;quot;example&amp;quot;?&lt;br /&gt;
  * did you replace all uses of &amp;quot;the actual value&amp;quot; by &amp;quot;the real value&amp;quot;? (if you are German, &amp;quot;actual&amp;quot; does not mean &amp;quot;aktuell&amp;quot;!)&lt;br /&gt;
  * did you remove all uses of &amp;quot;hence&amp;quot; and &amp;quot;thereby&amp;quot;?&lt;br /&gt;
  * did you make sure that you use &amp;quot;however&amp;quot; as sparingly as possible?&lt;br /&gt;
  * did you make sure that you did not use &amp;quot;the equation reads..&amp;quot;, but rather used &amp;quot;the equation is...&amp;quot; or &amp;quot;the equation is given by...&amp;quot;?&lt;br /&gt;
  * did you avoid split infinitives? (&amp;quot;to boldly go...&amp;quot; is wrong; yes, in many cases split infinitives are ok in current English, but they tend to be so often used wrongly by non-native speakers that it is best to avoid them)&lt;br /&gt;
  * did you make sure that you distinguish properly between &amp;quot;this&amp;quot; and &amp;quot;these&amp;quot;?&lt;br /&gt;
  * did you make use of the &amp;quot;Oxford comma&amp;quot;, i.e., do you have a comma before &amp;quot;and&amp;quot; in lists?&lt;br /&gt;
  * did you use &amp;quot;i.e.&amp;quot; and &amp;quot;e.g.&amp;quot; correctly, i.e., using &amp;quot;i.e.&amp;quot; for a specific clarification or definition and &amp;quot;e.g.&amp;quot; where you would otherwise use &amp;quot;for example&amp;quot;?&lt;br /&gt;
  * did you use the IAU recommended year - month - day sequences (2016 March 15)?&lt;br /&gt;
  * did you make sure that you did not use contractions such as &amp;quot;didn't&amp;quot; or &amp;quot;you're&amp;quot;?&lt;br /&gt;
  * did you replace &amp;quot;cf.&amp;quot; with &amp;quot;see&amp;quot; everywhere since you know that &amp;quot;cf.&amp;quot; means &amp;quot;compare&amp;quot;?&lt;br /&gt;
  * did you make sure that the reader will understand what thing you refer to when using &amp;quot;it&amp;quot; rather than naming it? &lt;br /&gt;
  * did you make sure that all uses of &amp;quot;this&amp;quot; are followed by the object you are referring to? &lt;br /&gt;
  * did you use &amp;quot;led&amp;quot; rather than &amp;quot;lead&amp;quot; when using the past tense of the verb &amp;quot;to lead&amp;quot;?&lt;br /&gt;
  * did you reread the manuscript for internal consistency after you added comments from your coauthors?&lt;br /&gt;
  * did you make sure that your sentences are short (rule of thumb: if a sentence goes over more than three lines it is probably too long)?&lt;br /&gt;
  * did you check that you did not combine two sentences that could be separate sentences with &amp;quot;and&amp;quot;?&lt;br /&gt;
  * did you avoid abbreviations as much as possible and only used them when they are really, really common (HST, AGN, XMM,...)?&lt;br /&gt;
  * did you check that you defined all abbreviations that you used at their first usage? (&amp;quot;...Active Galactic Nucleus (AGN)...&amp;quot; //not// &amp;quot;...AGN (Active Galactic Nucleus)...&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
==== Citations ====&lt;br /&gt;
&lt;br /&gt;
  * did you add the journal to all publications where you list the arXiv-reference and not just blindly copy the erroneous ADS bibtex entry?&lt;br /&gt;
  * did you make sure that you distinguished between arXiv references where a paper is submitted and references where a paper is already accepted by checking the paper author's comment on the arXiv-page for that article?&lt;br /&gt;
  * did you remove the page number for all ATEL-references downloaded from ADS and changed the journal name to &amp;quot;Astron. Tel.&amp;quot; or &amp;quot;ATEL&amp;quot;? (and similar for IAU telegrams)&lt;br /&gt;
  * did you add editors and the title of the conference publication to all conference publications?&lt;br /&gt;
  * did you add the publisher and place information (city only) to all books, conference publications, and other book-like publications that you are citing?&lt;br /&gt;
  * did you check that your references are correct in that you are using ''\citet{biblabel}'' for references in the text and ''\citep{biblabel}'' for references in parentheses?&lt;br /&gt;
  * did you make sure that none of your ''\citet{..}'' commands refer to more than one biblabel?&lt;br /&gt;
&lt;br /&gt;
==== Typesetting (mainly in TeX) ====&lt;br /&gt;
&lt;br /&gt;
  * did you check for missing spaces between values and units?&lt;br /&gt;
  * did you make sure that all scientific units are typeset in ''\mathrm''?&lt;br /&gt;
  * did you make sure not to use constructs such as ''$\mathrm{m}/\mathrm{s}$'' by using ''$\mathrm{m}\,\mathrm{s}^{-1}$'' instead?&lt;br /&gt;
  * did you make sure that almost all of your error bars are rounded up to only one significant digit rather than following the DIN-norm (which is not applied in astronomical journals)?&lt;br /&gt;
  * did you make sure that you are not using any positioning commands for the table or figure environment such as ''\begin{table}[htpb]''?&lt;br /&gt;
  * did you make sure that your tables have captions above the table, and figures have captions below the figure or next to it (where allowed by the style)?&lt;br /&gt;
  * did you make sure that you use empty lines to denote the start of a new paragraph rather than the ''\\''-command? (use ''\parindent{0pt}'' if you do not want to indent paragraphs)&lt;br /&gt;
  * did you make sure that there are no paragraph endings above or below ''\begin{equation}...\end{equation}'' by ensuring that there is no empty line above or below the ''equation''-environment?&lt;br /&gt;
  * did you make sure that you are not using ''$\frac{a}{b}$'' in normal text, but use ''$a/b$'' instead?&lt;br /&gt;
  * did you make sure that you are not using the ''displaymath''-environment and that all equations are numbered?&lt;br /&gt;
  * did you make sure that all of your sections, subsections, paragraphs and so on are numbered?&lt;br /&gt;
  * did you avoid any and all uses of ''\bf'', ''\it'', ''\sl'', or ''\em'' and use the proper commands ''\textbf'', ''\textit'', ''\textsl'', and ''\emph'' instead?&lt;br /&gt;
  * did you use the en-dash of TeX for ranges, even if they occur in math, by using ''%%--%%'' in text mode rather than a minus sign? (that is, did you typeset a range in an equation as ''%%$3x$--$5x$%%'' or ''%%$3x\mbox{--}5x$%%'' rather than, erroneously, ''$3x-5x$''?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Current Members]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Installation_and_configuration_of_the_FPIPE&amp;diff=854</id>
		<title>Installation and configuration of the FPIPE</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Installation_and_configuration_of_the_FPIPE&amp;diff=854"/>
		<updated>2018-04-11T15:13:55Z</updated>

		<summary type="html">&lt;p&gt;Lang: Created page with &amp;quot;===== Installation and configuration of the FPIPE =====  ==== Checkout and installation ====  In the following, we assume that the http://heasarc.nasa.gov/docs/software/fits...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== Installation and configuration of the FPIPE =====&lt;br /&gt;
&lt;br /&gt;
==== Checkout and installation ====&lt;br /&gt;
&lt;br /&gt;
In the following, we assume that the [[http://heasarc.nasa.gov/docs/software/fitsio/fitsio.html|CFITSIO library]] has been installed and configured correctly as this condition is mandatory for a successful installation of the FPIPE.&lt;br /&gt;
&lt;br /&gt;
The FPIPE can be obtained via [[http://en.wikipedia.org/wiki/Git_%28software%29|Git]] with the following command:&lt;br /&gt;
  git clone git://git.tokkee.org/fpipe.git&lt;br /&gt;
NOTE: this URL is due to change in the future.&lt;br /&gt;
&lt;br /&gt;
The repository will then be checked out into your current directory (for some useful commands for GIT you can look at the [[remeis:software:git_use|Short introduction to GIT]]).&lt;br /&gt;
&lt;br /&gt;
As soon as the checkout process is completed, you will find a new directory named ''fpipe'' in your current directory. For the next steps, we change to the directory ''fpipe/software'', which contains installation scripts, configuration files etc.&lt;br /&gt;
  cd fpipe/software&lt;br /&gt;
&lt;br /&gt;
In order to create the ''configure'' file which we need for doing system checks and preparing the library for installation, we invoke&lt;br /&gt;
  ./bootstrap.sh&lt;br /&gt;
&lt;br /&gt;
Having done that, a script named ''configure'' should have been created in the current directory, which we will start now. In order to enable debugging messages which are very useful for developing software with the FPIPE, we use the parameter ''enable-debug''. Moreover we want the script to install the compiled library in ''fpipe/target'' instead of the default system path as we probably wouldn't have the appropriate permission to do so.&lt;br /&gt;
  ./configure --prefix=PATH_TO_YOUR_FPIPE_DIR/fpipe/target --enable-debug=10&lt;br /&gt;
Of course, you have to replace ''PATH_TO_YOUR_FPIPE_DIR'' by the appropriate path which will in most cases be the path to your home directory or just ''$HOME''.&lt;br /&gt;
&lt;br /&gt;
Once the configure script is finished without errors, we run a simple&lt;br /&gt;
  make&lt;br /&gt;
followed by a&lt;br /&gt;
  make install&lt;br /&gt;
In case you didn't specify a ''prefix'' when invoking the ''configure'' script and don't have write permissions to the system directories you will most probably encounter errors in this step. However, you can easily correct this by going back to the ''configure'' step and running it again with an appropriate ''prefix''.&lt;br /&gt;
&lt;br /&gt;
Once having completed all steps without encountering any errors, the FPIPE is installed correctly.&lt;br /&gt;
If you have any further questions or run into problems, there exist much more sophisticated documentations than this one in ''fpipe/software/README'' and ''fpipe/software/INSTALL''.&lt;br /&gt;
&lt;br /&gt;
==== Configuration ====&lt;br /&gt;
&lt;br /&gt;
Basically there is no need to do any changes to the configuration if you just want to play around with the existing tools. However, as soon as you write your own program which makes use of fpipe libraries and which should be built with and integrated in the fpipe later on you have to modify a few things.&lt;br /&gt;
&lt;br /&gt;
Let's assume that you've written the program fpBooFoo whose source files reside in&lt;br /&gt;
  FPIPEDIR/software/pipeline_ftools/fpboofoo&lt;br /&gt;
This is the standard directory for all fpipe tools, so most of the time you will be working there (again, replace FPIPEDIR with the corresponding path where the fpipe main directory can be found, e.g. /home/myuser/fpipe).&lt;br /&gt;
&lt;br /&gt;
First of all you have to modify&lt;br /&gt;
  FPIPEDIR/software/configure.ac&lt;br /&gt;
so grab an editor of your choice and open it. Then look for something that looks like the following code block:&lt;br /&gt;
&amp;lt;code make&amp;gt;&lt;br /&gt;
AC_FTOOL([fpapplygain], [yes])&lt;br /&gt;
AC_FTOOL([fpcalcgain], [yes])&lt;br /&gt;
AC_FTOOL([fpcalcnoise], [yes])&lt;br /&gt;
AC_FTOOL([fpcalcoffset], [yes])&lt;br /&gt;
AC_FTOOL([fpcalcresidualoffset], [yes])&lt;br /&gt;
AC_FTOOL([fpcmsimulator], [no])&lt;br /&gt;
AC_FTOOL([fpcommonmode], [yes])&lt;br /&gt;
AC_FTOOL([fpcopycontrol], [yes])&lt;br /&gt;
AC_FTOOL([fpeventfeeder], [yes])&lt;br /&gt;
AC_FTOOL([fpfindevents], [yes])&lt;br /&gt;
AC_FTOOL([fpfitseventfeeder], [yes])&lt;br /&gt;
AC_FTOOL([fpcopyfitseventfeeder], [yes])&lt;br /&gt;
AC_FTOOL([fpframes2fits], [yes])&lt;br /&gt;
AC_FTOOL([fpraw2fits], [yes])&lt;br /&gt;
AC_FTOOL([fpimage], [yes])&lt;br /&gt;
AC_FTOOL([fpipeservercmd], [yes])&lt;br /&gt;
AC_FTOOL([fpintensity], [yes])&lt;br /&gt;
AC_FTOOL([fpixoacm2fits], [no])&lt;br /&gt;
AC_FTOOL([fpixosvm2fits], [no])&lt;br /&gt;
AC_FTOOL([fplightcurve], [yes])&lt;br /&gt;
AC_FTOOL([fpmakebadpixel], [yes])&lt;br /&gt;
AC_FTOOL([fpplot2], [yes])&lt;br /&gt;
AC_FTOOL([fpspectrum], [yes])&lt;br /&gt;
AC_FTOOL([fptests], [yes])&lt;br /&gt;
AC_FTOOL([fptemplate], [no])&lt;br /&gt;
AC_FTOOL([fputils], [yes])&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
These lines tell the compiler which programs to build. The yes/no-tags additionally tell whether the program should be built when doing a 'final build'. First of all you want the compiler to include your program at least in the experimental builds, so you append the line&lt;br /&gt;
&amp;lt;code make&amp;gt;AC_FTOOL([fpboofoo], [no])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Having done that, watch out for the following rather longish block of code:&lt;br /&gt;
&amp;lt;code make&amp;gt;&lt;br /&gt;
AC_CONFIG_FILES([Makefile &lt;br /&gt;
                 fpipelib/Makefile &lt;br /&gt;
                 utils/Makefile&lt;br /&gt;
                 pipeline_driver/Makefile&lt;br /&gt;
                 pipeline_ftools/Makefile &lt;br /&gt;
                 pipeline_ftools/fpspectrum/Makefile &lt;br /&gt;
                 pipeline_ftools/fplightcurve/Makefile &lt;br /&gt;
                 pipeline_ftools/fpcopycontrol/Makefile &lt;br /&gt;
                 pipeline_ftools/fpintensity/Makefile &lt;br /&gt;
                 pipeline_ftools/fpplot2/Makefile&lt;br /&gt;
                 pipeline_ftools/fpplot2/gtk_fp_spec_plot/Makefile&lt;br /&gt;
                 pipeline_ftools/fpeventfeeder/Makefile &lt;br /&gt;
                 pipeline_ftools/fpfitseventfeeder/Makefile&lt;br /&gt;
                 pipeline_ftools/fpcopyfitseventfeeder/Makefile&lt;br /&gt;
                 pipeline_ftools/fpframes2fits/Makefile&lt;br /&gt;
                 pipeline_ftools/fpframes2fits/tests/Makefile&lt;br /&gt;
                 pipeline_ftools/fpraw2fits/Makefile&lt;br /&gt;
                 pipeline_ftools/fpixosvm2fits/Makefile&lt;br /&gt;
                 pipeline_ftools/fpixoacm2fits/Makefile&lt;br /&gt;
                 pipeline_ftools/fpcommonmode/Makefile&lt;br /&gt;
                 pipeline_ftools/fpcalcoffset/Makefile&lt;br /&gt;
                 pipeline_ftools/fpcalcnoise/Makefile&lt;br /&gt;
                 pipeline_ftools/fpfindevents/Makefile&lt;br /&gt;
                 pipeline_ftools/fpcalcgain/Makefile&lt;br /&gt;
                 pipeline_ftools/fptests/Makefile&lt;br /&gt;
                 pipeline_ftools/fputils/Makefile&lt;br /&gt;
                 pipeline_ftools/fpapplygain/Makefile&lt;br /&gt;
                 pipeline_ftools/fpcalcresidualoffset/Makefile&lt;br /&gt;
                 pipeline_ftools/fpmakebadpixel/Makefile&lt;br /&gt;
                 pipeline_ftools/fpcmsimulator/Makefile&lt;br /&gt;
                 pipeline_ftools/fptemplate/Makefile&lt;br /&gt;
                 pipeline_ftools/fpfindbadpixel/Makefile&lt;br /&gt;
                 pipeline_ftools/fpfindcoldpixel/Makefile&lt;br /&gt;
                 pipeline_ftools/fpimage/Makefile&lt;br /&gt;
                 pipeline_ftools/fpipeservercmd/Makefile ])&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we define the locations of all makefiles which are needed in order to get the compilation and building process running. As your programm will get its own makefile too (this will be done automatically as soon as we have done all the configuration stuff) we need to insert somewhere in the middle (or append at the end - but watch out for the brackets!) the following line:&lt;br /&gt;
&amp;lt;code make&amp;gt;pipeline_ftools/fpboofoo/Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The third (and - for this file - the last) bunch of code you have to look for is this:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  fpapplygain:          $enable_fpapplygain&lt;br /&gt;
  fpcalcgain:           $enable_fpcalcgain&lt;br /&gt;
  fpcalcnoise:          $enable_fpcalcnoise&lt;br /&gt;
  fpcalcoffset:         $enable_fpcalcoffset&lt;br /&gt;
  fpcalcresidualoffset: $enable_fpcalcresidualoffset&lt;br /&gt;
  fpcmsimulator:        $enable_fpcmsimulator&lt;br /&gt;
  fpcommonmode:         $enable_fpcommonmode&lt;br /&gt;
  fpcopycontrol:        $enable_fpcopycontrol&lt;br /&gt;
  fpcopyfitseventfeeder:$enable_fpcopyfitseventfeeder&lt;br /&gt;
  fpeventfeeder:        $enable_fpeventfeeder&lt;br /&gt;
  fpfindevents:         $enable_fpfindevents&lt;br /&gt;
  fpfitseventfeeder:    $enable_fpfitseventfeeder&lt;br /&gt;
  fpframes2fits:        $enable_fpframes2fits&lt;br /&gt;
  fpimage:              $enable_fpimage&lt;br /&gt;
  fpipeservercmd:       $enable_fpipeservercmd&lt;br /&gt;
  fpintensity:          $enable_fpintensity&lt;br /&gt;
  fpixoacm2fits:        $enable_fpixoacm2fits&lt;br /&gt;
  fpixosvm2fits:        $enable_fpixosvm2fits&lt;br /&gt;
  fplightcurve:         $enable_fplightcurve&lt;br /&gt;
  fpmakebadpixel:       $enable_fpmakebadpixel&lt;br /&gt;
  fpraw2fits:           $enable_fpraw2fits&lt;br /&gt;
  fpplot2:              $enable_fpplot2&lt;br /&gt;
  fpspectrum:           $enable_fpspectrum&lt;br /&gt;
  fptemplate:           $enable_fptemplate&lt;br /&gt;
  fptests:              $enable_fptests&lt;br /&gt;
  fputils:              $enable_fputils&lt;br /&gt;
  fpfindbadpixel:       $enable_fpfindbadpixel&lt;br /&gt;
  fpfindcoldpixel:      $enable_fpfindcoldpixel&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Actually it is not necessary to do any modifications here as this will just generate a nice output when invoking the configure-script but won't have any effect on the building process. But as we don't want to work sleazily we insert **before the EOF** the following line:&lt;br /&gt;
  fpboofoo: $enable_fpboofoo&lt;br /&gt;
&lt;br /&gt;
For the next step you have to switch to the directory ''fpipe/software/pipeline_ftools'', so most probably you now want to do a&lt;br /&gt;
  cd pipeline_ftools&lt;br /&gt;
Open the file&lt;br /&gt;
  Makefile.am&lt;br /&gt;
with the editor of your choice and append the following lines to the end of the file:&lt;br /&gt;
&amp;lt;code make&amp;gt;&lt;br /&gt;
if ENABLE_FTOOL_fpboofoo&lt;br /&gt;
SUBDIRS += fpboofoo&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
These lines are used by ''make'' in order to set its variables correctly which are needed in the build process.&lt;br /&gt;
&lt;br /&gt;
Having saved the modified ''Makefile.am'' there is just one last thing to do. In order to tell the program ''make'' what to do with our source code we need another ''Makefile.am'' (with different contents than the one we just saw) in the directory of our program. Instead of writing it by ourselves we can just copy it from one of the other fpipe tools and modify it to fit our needs. So for example do a&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  cd fplightcurve&lt;br /&gt;
  cp Makefile.am ../fpboofoo/&lt;br /&gt;
  cd ../fpboofoo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
and open the freshly copied ''Makefile.am'' with an editor.&lt;br /&gt;
You will see something like&lt;br /&gt;
&amp;lt;code make&amp;gt;&lt;br /&gt;
AM_CFLAGS = -Wall -Werror&lt;br /&gt;
AM_CPPFLAGS = -I${HEADAS}/include -I@top_srcdir@/fpipelib&lt;br /&gt;
&lt;br /&gt;
bin_PROGRAMS = FPLightcurve&lt;br /&gt;
FPLightcurve_SOURCES = FPLightcurve.c  FPLightcurve.h&lt;br /&gt;
FPLightcurve_LDFLAGS = @lib_cfitsio@&lt;br /&gt;
FPLightcurve_LDADD = @top_builddir@/fpipelib/libfpipe.la @top_builddir@/fpipelib/libfpRWlock.la&lt;br /&gt;
&lt;br /&gt;
pfilesdir = @PFILESDIR@&lt;br /&gt;
dist_pfiles_DATA = FPLightcurve.par&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Replace all occurrences of ''FPLightcurve'' with ''FPBooFoo'' such that the final ''Makefile.am'' looks like this:&lt;br /&gt;
&amp;lt;code make&amp;gt;&lt;br /&gt;
AM_CFLAGS = -Wall -Werror&lt;br /&gt;
AM_CPPFLAGS = -I${HEADAS}/include -I@top_srcdir@/fpipelib&lt;br /&gt;
&lt;br /&gt;
bin_PROGRAMS = FPBooFoo&lt;br /&gt;
FPBooFoo_SOURCES = FPBooFoo.c  FPBooFoo.h&lt;br /&gt;
FPBooFoo_LDFLAGS = @lib_cfitsio@&lt;br /&gt;
FPBooFoo_LDADD = @top_builddir@/fpipelib/libfpipe.la @top_builddir@/fpipelib/libfpRWlock.la&lt;br /&gt;
&lt;br /&gt;
pfilesdir = @PFILESDIR@&lt;br /&gt;
dist_pfiles_DATA = FPBooFoo.par&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Of course you have to leave the respective entries away if you don't have these files (e.g. you wouldn't write ''FPBooFoo.h'' if you had no corresponding header-file).&lt;br /&gt;
&lt;br /&gt;
Finally, switch back to the main directory and re-build everything, i.e.:&lt;br /&gt;
  cd ../..&lt;br /&gt;
  ./bootstrap.sh&lt;br /&gt;
  ./configure --prefix=PATH_TO_YOUR_FPIPE_DIR/fpipe/target --enable-debug=10&lt;br /&gt;
  make&lt;br /&gt;
  make install&lt;br /&gt;
  &lt;br /&gt;
Given that no errors occurred you have integrated your program successfully into the fpipe. For each and every new tool you will have to repeat this process.&lt;br /&gt;
&lt;br /&gt;
==== Additional important configuration information for Mac Users ====&lt;br /&gt;
&lt;br /&gt;
Requirements for the fpipe:&lt;br /&gt;
&lt;br /&gt;
**cfitsio library installed** (Headas) - follow the description [[http://www.black-hole.eu/index.php/schools-workshops-and-conferences/2nd-school-on-multiwavelength-astronomy/course-materials/142-software-instructions-for-mac0s-105-a-106 | here]] \\&lt;br /&gt;
(get gktimageview from http://trac.bjourne.webfactional.com/chrome/common/releases/&lt;br /&gt;
configure and install gtkimageview (default configuration))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to install ===&lt;br /&gt;
You most likely have to change the ''configure.ac'' in the software directory of the fpipe \\&lt;br /&gt;
Replace the search for ''.so'' files in a search for ''.dylib'' - you have to do that for cfitsio and xpalib\\&lt;br /&gt;
Replace the %5lu in'' /Path/to/fpipe/software/pipeline_ftools/fpplot2/test.c'' in all lines with %p or blockcomment the //printf// functions. This is due to the fact that in some environments (e.g. some versions of HPUX, Mac OS X) //pthread_t// is defined as a&lt;br /&gt;
structure, not an integer. \\&lt;br /&gt;
In ''/Path/to/fpipe/software/configure.ac'' **turn off** the fpfitseventfeeder tool and fpimage.\\&lt;br /&gt;
In ''/Path/to/fpipe/software/get-revision.sh'' delete the ''-n'' of ''echo &amp;quot;-n\&amp;quot;$rev\&amp;quot;&amp;quot;'' \\&lt;br /&gt;
As already shown in the general configuration chapter, run the following commands:&lt;br /&gt;
  /Path/to/fpipe/software/bootstrap.sh&lt;br /&gt;
  /Path/to/fpipe/software/configure (PKG_CONFIG_PATH=/usr/local/lib/pkgconfig &lt;br /&gt;
(only when you did the default installation like shown in requirements - otherwise you have to adopt) + e.g ''--prefix'' or ''--enable-debug''&lt;br /&gt;
  make&lt;br /&gt;
  make install&lt;br /&gt;
&lt;br /&gt;
If you want to run that in eclipse you have to compile it the first time in terminal, then it should work.\\&lt;br /&gt;
If you want to use the binaries from inside eclipse you have to use the apple development tools ''/Developer/Applications/Utilities/'' and start the Property List Editor and create a ''.plist'' file with the child(key) ''DYLD_LIBRARY_PATH /path/to/headas/platform/lib''. The reason for that is that environment variables are not set in applications started via finder on Mac OS X. \\&lt;br /&gt;
Alternative: Start Eclipse via terminal (''/Applications/Eclipse/Eclipse.app/Contents/MacOS/eclipse''). The environment variables should now be found by eclipse.&lt;br /&gt;
&lt;br /&gt;
[[Category:CFITSIO / FPIPE]]&lt;/div&gt;</summary>
		<author><name>Lang</name></author>
	</entry>
</feed>