diff --git a/examples/COMPFID.py b/examples/COMPFID.py index ca11c27..741c0dc 100644 --- a/examples/COMPFID.py +++ b/examples/COMPFID.py @@ -10,9 +10,8 @@ This also works for Samples with spin > 1. import logging +from quackseq.sequences.COMPFID import create_COMPFID from quackseq_simulator.simulator import Simulator -from quackseq.pulsesequence import QuackSequence -from quackseq.functions import RectFunction from matplotlib import pyplot as plt if __name__ == "__main__": @@ -20,24 +19,14 @@ if __name__ == "__main__": logger = logging.getLogger(__name__) - seq = QuackSequence("COMPFID") - seq.add_pulse_event("tx1", "3u", 100, 0, RectFunction()) - seq.add_pulse_event("tx2", "6u", 100, 45, RectFunction()) - # This makes the phase 45, 135, 225, 315 - seq.set_tx_n_phase_cycles("tx2", 4) - seq.add_blank_event("blank", "5u") - - seq.add_readout_event("rx", "100u") - - # No phase shifiting of the receive data but weighting of -1 for the 45 degree pulse, +1 for the 135 degree pulse, -1 for the 225 degree pulse and +1 for the 315 degree pulse - readout_scheme = [[1, 0], [-1, 0], [1, 0], [-1, 0]] - sim = Simulator() sim.set_averages(100) - sim.settings.noise = 1 # microvolts + sim.settings.noise = 1 # microvolts - result = sim.run_sequence(seq) + COMPFID = create_COMPFID() + + result = sim.run_sequence(COMPFID) # Plot time and frequency domain next to each other plt.subplot(1, 2, 1) plt.title("Time domain Simulation of BiPh3 COMPFID") @@ -56,4 +45,4 @@ if __name__ == "__main__": plt.plot(result.fdx[-1], abs(result.fdy[-1]), label="abs") plt.legend() - plt.show() \ No newline at end of file + plt.show() diff --git a/examples/FID.py b/examples/FID.py index 13c4dd5..95950ae 100644 --- a/examples/FID.py +++ b/examples/FID.py @@ -5,9 +5,8 @@ The sample is the default BiPh3 NQR sample. import logging +from quackseq.sequences.FID import create_FID from quackseq_simulator.simulator import Simulator -from quackseq.pulsesequence import QuackSequence -from quackseq.functions import RectFunction from matplotlib import pyplot as plt if __name__ == "__main__": @@ -15,18 +14,16 @@ if __name__ == "__main__": logger = logging.getLogger(__name__) - seq = QuackSequence("FID") - seq.add_pulse_event("tx", "3u", 100, 0, RectFunction()) - seq.add_blank_event("blank", "5u") - seq.add_readout_event("rx", "100u") - seq.add_blank_event("TR", "1m") - sim = Simulator() sim.set_averages(100) - sim.settings.noise = 1 # microvolts + sim.settings.noise = 1 # microvolts + + FID = create_FID() + + # Run the imported FID sequence + result = sim.run_sequence(FID) - result = sim.run_sequence(seq) # Plot time and frequency domain next to each other plt.subplot(1, 2, 1) plt.title("Time domain Simulation of BiPh3 FID") diff --git a/examples/SE.py b/examples/SE.py index 8c18266..fe4af57 100644 --- a/examples/SE.py +++ b/examples/SE.py @@ -5,9 +5,8 @@ The sample is the default BiPh3 NQR sample. import logging +from quackseq.sequences.SE import create_SE from quackseq_simulator.simulator import Simulator -from quackseq.pulsesequence import QuackSequence -from quackseq.functions import RectFunction from matplotlib import pyplot as plt if __name__ == "__main__": @@ -15,19 +14,14 @@ if __name__ == "__main__": logger = logging.getLogger(__name__) - seq = QuackSequence("SE") - seq.add_pulse_event("pi-half", "3u", 100, 0, RectFunction()) - seq.add_blank_event("te-half", "150u") - seq.add_pulse_event("pi", "6u", 100, 0, RectFunction()) - seq.add_blank_event("blank", "50u") - seq.add_readout_event("rx", "200u") - sim = Simulator() sim.set_averages(100) sim.settings.noise = 1 # microvolts - result = sim.run_sequence(seq) + SE = create_SE() + + result = sim.run_sequence(SE) # Plot time and frequency domain next to each other plt.subplot(1, 2, 1) plt.title("Time domain Simulation of BiPh3 SE") diff --git a/examples/SEPC.py b/examples/SEPC.py index 822aadf..07073c8 100644 --- a/examples/SEPC.py +++ b/examples/SEPC.py @@ -5,9 +5,8 @@ The sample is the default BiPh3 NQR sample. import logging +from quackseq.sequences.SEPC import create_SEPC from quackseq_simulator.simulator import Simulator -from quackseq.pulsesequence import QuackSequence -from quackseq.functions import RectFunction from matplotlib import pyplot as plt if __name__ == "__main__": @@ -15,28 +14,14 @@ if __name__ == "__main__": logger = logging.getLogger(__name__) - seq = QuackSequence("SEPC") - seq.add_pulse_event("pi-half", "3u", 100, 0, RectFunction()) - # This causes the phase to cycle through 0, 90, 180, 270 - seq.set_tx_n_phase_cycles("pi-half", 4) - - seq.add_blank_event("te-half", "150u") - # For the second pulse we just need a phase of 180 - seq.add_pulse_event("pi", "6u", 100, 180, RectFunction()) - seq.add_blank_event("blank", "50u") - - seq.add_readout_event("rx", "200u") - # Readout scheme for phase cycling TX pulses have the scheme 0 90 180 270 for the first pulse and 180 always for the second pulse - readout_scheme = [[1, 0], [1, 90], [1, 180], [1, 270]] - - seq.set_rx_readout_scheme("rx", readout_scheme) - sim = Simulator() sim.set_averages(100) sim.settings.noise = 1 # microvolts - result = sim.run_sequence(seq) + SEPC = create_SEPC() + + result = sim.run_sequence(SEPC) # Plot time and frequency domain next to each other plt.subplot(1, 2, 1) plt.title("Time domain Simulation of BiPh3 SEPC")