# Emile's procedure for maps

Download the Igor procedure here (later can be a link to repository):

{% file src="<https://1019940988-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4xyQ1EYH71vPc02yXQ%2F-MVMA5GNpHV2W4zm67cp%2F-MVMAndzYubMDArBCMl0%2FEmile's%20procedures%20modified.zip?alt=media&token=b2a34418-c20e-4392-9752-2d02c2c11a81>" %}

Extract everything in the same place, then load InclAll.ipf and compile it.\
We recommend to use a separate Igor experiment for maps and load this procedure first. After it is loaded, you can drag and drop the wave containing the map inside the experiment window.\
\
&#x20;After the wave is loaded a three-panel interactive window should appear:

1. energy -vs- slit angle ("front-view");
2. energy -vs- polar angle ("side-view");
3. slit angle -vs- polar angle ("top-view")

In the top row of the panel there are boxes (with up-down arrows), the values in these boxes control the third coordinate for each corresponding panel.

{% hint style="info" %}
&#x20;**Troubleshooting:**\
&#x20;If the panels are blank, please check that the wavename in the data browser starts with a letter (e.g. "001r" is not a valid wavename). If not, you can add some letters in front (e.g. "001" -> "w001"), then go to Macros -> "Create Slice Panel ..." and select your wave.
{% endhint %}

#### Rotation of azimuth based on the map to orient the sample

Use cursors (**Ctrl+i**) and put them in "top-view" image to determine the high-symmetry direction that you want to be parallel to the slit. The following code will give you the angle of rotation.

```
print atan( (vcsr(A)-vcsr(B))/(hcsr(A)-hcsr(B)))*180/pi
```

{% hint style="danger" %}
**! Important !**\
&#x20;If you are using mapping to orient the sample and in the third image it looks like map is rotated azimuthally clockwise, then actually you need to rotate azimuth counter-clockwise by the same value (*subtract* misorientation angle from the current value).
{% endhint %}

### &#x20;Some often used features

#### &#x20;1) Conversion to k-space:

&#x20;From the Igor command line you can call function **kWarp(w, Ek0, alpha)**\
\
&#x20;    `wave w                  //    name of your map-wave (3D (phi, Ek, theta) wave)`\
&#x20;    `variable Ek0            //    kinetic energy at which k-range boundaries are defined`\
&#x20;    `variable alpha          //    tilt angle in degrees`\
\
You can put Ek0 equal to max. kinetic energy and alpha should be equal to the angular position of Г point along the slit.\
Normal emission is supposed to be at polar angle = 0, if it is not the case, you can shift it by changing the Start value of the polar angle axis of the map wave. \
The converted wave will have the same name as the original one, but with "kw" on the end, you can plot it using Macros -> "Create Slice Panel ..." -> select this wave.

#### &#x20;2) Compressing maps measured in fixed mode:

Maps measured in fixed mode have very small step in energy, which makes it difficult to work with them. It is possible to "condense" such maps summing up the values in each N energy steps to one single point.\
This can be done from Igor command line with function **condensefixed(wname, Nrows, Ncolumns, Nlayers)**\
It will condense the wave corresponding number of times along three directions. Rows=angle along slit; Columns=kinetic energy; Layers=polar angle.\
Example: `condensefixed(w001r,1,10,1)` will condense wave *w001r* 10 times along energy axis while keeping two other directions intact.\
\
The Slice Panel with condensed wave should appear. The condensed wave will have the same name as the original one, but with "rdx" on the end.

{% hint style="success" %}
**Tip**: To reduce disk space occupied by the maps experiment one can use `Killmaps(map_wave_name)` to get rid of the non-compressed map measured in fixed mode. All the panels displaying this wave should be closed in advance.
{% endhint %}

#### &#x20;3) Extracting slices in specific directions:

Press Ctrl+I when Slice Panel is in focus to show the cursors panel.\
Put A and B cursors in the first image to specify energy range that you are interested in (for example somewhere at the top and somewhere at the bottom to have full range).\
Right-click the cursors panel -> "Show cursors pair" -> "C D".\
Put C and D cursors in the third ("top-view") image to specify the cut direction.\
\
&#x20;After that in Igor command line write `ExtractCsrSlice()`\
\
&#x20;This should produce a window with spectrum extracted along C-D in energy range specified by A-B.

#### 4) Plotting kz-dependence

To convert kz-dependent measurements to k-space use `kzWarp(w)`.

The function transforms 3D wave measured as (phi, Eb, hv) to (kx, Eb, kz). Assumes phi = 0 corresponds to normal emission.

You can see that the Fermi level drifts slowly with hv, to compensate this beamline energy drift you can estimate the drift (e.g. 2 meV/eV) value duplicate the wave (e.g. w -> w\_t) and do the following:

```
w_t()()() = w(x)(y+0.002*z)(z)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://arpes-1-2.gitbook.io/arpes-1-2/data-analysis/emiles-procedure-maps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
