# -*- coding: utf-8 -*-"""Created on Wed Nov 28 18:34:30 2012@author: tillsten"""from__future__importprint_functionimportrefrompathlibimportPathimportpoochimportnumpyasnp
[docs]defsave_txt_das(name,fitter):""" Saves the das of a fitter-obj in name.txt """f=fitterspec=f.c[:,:-3]iff.model_cohelsef.carr=np.column_stack((f.wl,spec))offset=f.model_disp+1taus=np.hstack((0,f.last_para[offset:]))arr=np.vstack((taus,arr))np.savetxt(name,arr)
[docs]defload_example():""" Returns a tuple containing the example data shipped with skultrafast. Returns ------- tuple of ndarrys Tuple with wavelengths, t and data-array. """importskultrafasta=np.load(skultrafast.__path__[0]+'/examples/data/test.npz')wl,data,t=a['wl'],a['data'],a['t']returnwl,t*1000-2,data/3.
[docs]defmesspy_example_path():""" Returns the path to the messpy example data shipped with skultrafast. Returns ------- str The full path """importskultrafastreturnskultrafast.__path__[0]+'/examples/data/messpyv1_data.npz'
[docs]defget_example_path(kind):"""Returns the path a example data-file. Parameters ---------- kind : ('sys_response', 'messpy', 'vapor', 'ir_polyfilm', 'quickcontrol') Which path to return. """importskultrafastroot=skultrafast.__path__[0]+'/examples/data/'file_dict={"messpy":'messpyv1_data.npz',"sys_response":'germanium.npz',"vapor":'ir_waterabs.npy',"ir_polyfilm":"PolystyreneFilm_spectrum.npz","quickcontrol":"quickcontrol.zip"}returnroot+file_dict[kind]
[docs]POOCH=pooch.create(path=pooch.os_cache("skultrafast"),# Use the figshare DOIbase_url="doi:10.6084/m9.figshare.25745715",registry={"MeSCN_2D_data.zip":"md5:6ca0942395a8b1be17b57a2b3c27ac5b",},)