<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Density of States Analysis Example
Given sample and empty-can data, compute phonon DOS
To use this notebook, first click jupyter menu File->Make a copy
Click the title of the copied jupyter notebook and change it to a new title
Start executing cells
Preparation
Step1:  Run GetDOS
Step2:  Check output
Step3:  Refine GetDOS
<ASSISTANT_TASK:>
Python Code:
# where am I now?
!pwd
# create a new working directory and change into it
workdir = '~/reduction/ARCS/getdos-multiple-Ei-demo'
!mkdir -p {workdir}
%cd {workdir}
# Data to reduce. Change the IPTS number and run numbers to suit your need
samplenxs = "/SNS/ARCS/IPTS-15398/shared/mantid_reduce/non-radC/non-radC_130p00.nxspe"
mtnxs = "/SNS/ARCS/IPTS-15398/shared/mantid_reduce/MT/MT_130p00.nxspe"
initdos = '/SNS/ARCS/IPTS-15398/shared/getdos/graphite-Ei_300-dos.h5'
Explanation: Density of States Analysis Example
Given sample and empty-can data, compute phonon DOS
To use this notebook, first click jupyter menu File->Make a copy
Click the title of the copied jupyter notebook and change it to a new title
Start executing cells
Preparation
End of explanation
# import tools
import os, numpy as np
from multiphonon.getdos import notebookUI
import histogram.hdf as hh, histogram as H
%matplotlib notebook
from matplotlib import pyplot as plt
# create the UI for the first time
notebookUI(samplenxs, mtnxs, initdos=initdos, load_options_path='/SNS/ARCS/IPTS-15398/shared/getdos/130meV-getdos-opts.yaml')
Explanation: Run GetDOS
End of explanation
ls work/
dos0= hh.load(initdos)
plt.plot(dos0.E, dos0.I, '+', label='DOS from Ei=300meV data')
dos = hh.load('work/final-dos.h5')
plt.plot(dos.E, dos.I, label='new DOS')
plt.xlim(0, 230)
plt.legend(loc='top left')
Explanation: Check output
End of explanation
# if you need to run getdos again with slightly modified options
# you can start from the previous settings
notebookUI(samplenxs, mtnxs, load_options_path="./work/getdos-opts.yaml")
Explanation: Refine GetDOS
End of explanation
<END_TASK>