77 lines
3.1 KiB
Python
77 lines
3.1 KiB
Python
# *****************************************************************************
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify it under
|
|
# the terms of the GNU General Public License as published by the Free Software
|
|
# Foundation; either version 2 of the License, or (at your option) any later
|
|
# version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
# details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License along with
|
|
# this program; if not, write to the Free Software Foundation, Inc.,
|
|
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
#
|
|
# Module authors:
|
|
# Tina Arh <tina.arh@psi.ch>
|
|
#
|
|
# *****************************************************************************
|
|
|
|
# Select the parameters that are written under environment in HDF file at every write
|
|
SetEnvironment(tt, mf, nmr_TSSOP16, nmr_RP100Node_CH1, nmr_RP100Node_CH2, r1, tps)#, ZVLNode)
|
|
|
|
# PPMS: Set field & temperature
|
|
|
|
#maw(tt, 3) # set PPMS temperature (in Kelvin)
|
|
#maw(mf, 3) # set the starting PPMS field (in Tesla)
|
|
#nicossleep(20*60) # 20 minutes
|
|
# ...
|
|
|
|
# Create the pulse sequence
|
|
|
|
pw90 = 2.5 # us
|
|
amp = 40 # percent
|
|
tau = 50 # us
|
|
|
|
# generate_pulse(pulse_width, amplitude, delay_time, pulse_cycle)
|
|
p90 = generate_pulse(pw90, amp, tau, '0 0 2 2 1 1 3 3 0 0 2 2 1 1 3 3')
|
|
p180_2 = generate_pulse(2*pw90, amp, 0, '1 3 3 1 2 0 0 2 0 2 2 0 3 1 1 3')
|
|
|
|
seq = [ p90, p180_2 ]
|
|
|
|
# Set some parameters independent of pulse sequence
|
|
globalparams = {
|
|
'acq_phase_cycle': '0 0 2 2 1 1 3 3 2 2 0 0 3 3 1 1',
|
|
'acquisition_time': 204.8, # us
|
|
'num_acqs': 16, # "1D scans" in TNMR. Our 16-fold phase cycling means this should be a multiple of 16 for proper averaging
|
|
'ringdown_time': 15, # us
|
|
'post_acquisition_time': 100, # ms
|
|
# 'obs_freq': 45.5, # MHz
|
|
'nucleus': 'NUCMgReS', # For example, 139La. Will be used in a filename!
|
|
'comments': 'An example of a frequency scan with manual tuning',
|
|
'title': 'FRscan', # Goes at the beginning of a filename!
|
|
}
|
|
update_device_parameters(nmr_daq_scout, globalparams)
|
|
|
|
# Choose the frequencies (in MHz)
|
|
central_frequency = 45.50 # MHz
|
|
frequency_range = 0.6 # MHz
|
|
half_N = 3
|
|
frequencies = [ central_frequency - frequency_range/2 + frequency_range * (i/(2*half_N)) for i in range(0, 2*half_N+1) ]
|
|
|
|
# Estimate the length of scan and multiply by number of frequencies
|
|
print(f'Beginning scan. ETA: {timestring(estimate_sequence_length_from_device(nmr_daq_scout, seq)*len(frequencies))}')
|
|
|
|
with tnmr_scan(): # Enters a mode of manual file control. Values will now be written into a single file until the context is lost
|
|
for fr in frequencies:
|
|
globalparams['obs_freq']=fr
|
|
update_device_parameters(nmr_daq_scout, globalparams)
|
|
|
|
# Pause to manually tune the frequency
|
|
print(f'New frequency: {fr:.2f} MHz')
|
|
pause(f'Tune the resonance circuit to {fr:.2f} MHz and click \'Continue script\' when you are done!')
|
|
|
|
scan_sequence(nmr_daq_scout, seq) # Acquire data
|