To run this program run idl, then compile and run the program as follows.

```
idl
IDL> .r max
IDL> max
```

This starts the program. Then .r compiles the program, max.pro; and finally typing "max" executes the program.

```
pro max
readcol,'noI2345B67.ascii',F='i,D,D,D,D,D',null,niw,nif,nie,nfit,ncontin
; divide out contin
;nie=nie/ncontin
;nfit=nfit/ncontin
```

This part just says what the program is called and reads in the file "noI2345B67.ascii".

The data is read in as doubles and is called;

niw (for no I2 wavelength)

nif (for no I2 flux)

nie (for no I2 error)

nfit (for dude fit)

ncontin (for dude continuum)

The lines with ";" preceeding it are commented out.

```
min = 1750; array position of the min. wavelength
max = 2500; array position of the max. wavelength
c=2.99e5;km/s
print,"starting wavelength=",niw[min]
print,"ending wavelength=",niw[max]
totoptweight=0
tvp=0
h=niw[min+1]-niw[min]
partial=MAKE_ARRAY(5000,2,VALUE=0.)
mpvubp=MAKE_ARRAY(5000,VALUE=0.)
optweight=MAKE_ARRAY(5000,VALUE=0.)
```

getting my arrays and constants set.

```
FOR i=min,max DO BEGIN
partial[i,0] = niw[i]
partial[i,1] = 1/(12.*h)*(-nfit[i+2]+8*nfit[i+1]-8*nfit[i-1]+nfit[i-2])
```

I used a 5 point method for figuring out the derivative at a point. Specifically: (1)

```
;minimum possible velocity uncertainty by pixel i is:
mpvubp[i]= nie[i]/(niw[i]*partial[i,1])
```

This comes from the Murphy paper:

"the minimum possible velocity uncertainty contributed by pixel *i* is given by:"

with

(3)Possible spot for errors — does the units on the spectrum matter?

```
;optimal weight
optweight[i]=(mpvubp[i])^(-2)
endfor
```

Optimal weight is defined in the paper as:

(4)(This graph is plotted with y axis data divided by a factor of 1e7)

```
FOR i=min,max DO BEGIN
totoptweight+=(optweight(i))
endfor
;total velocity precision available all pixels in a portion of spectrum
tvp=c*(1./(sqrt(totoptweight)))
```

"The total velocity precision available from all pixels in a portion of the spectrum then is:"(5)

```
print,"total velocity precision available from portion in km/s= ", tvp
stop
end
```

**total velocity precision available from portion in km/s = 0.0313597 km/s**

**which means total velocity precision available in m/s = 31.359 m/s**

**For the 2002 data: total velocity precision available = 72 m/s**