Commit cb287172 authored by Lucas Giardino's avatar Lucas Giardino

limpio algunos archivos que fueron quedando

parent 2fed3ca3
from time import sleep, time
from scipy.stats import poisson
import numpy as np
from artiq.experiment import *
class MockPMT(): #{{{
def __init__(self, mean=20):
self.mean = mean
def count(self):
return poisson.rvs(self.mean)
def change_mean(self, new_mean):
self.mean = new_mean
# }}}
class Histograms(EnvExperiment):
"""Histograms mockpmt simulation"""
def build(self):
self.setattr_argument("npoints", NumberValue(100, ndecimals=0, step=5))
self.setattr_argument("chunks", NumberValue(5, ndecimals=0, step=1))
self.setattr_argument("bin_init", NumberValue(-10, ndecimals=0, step=1), "Binning parameters")
self.setattr_argument("bin_end", NumberValue(30, ndecimals=0, step=1), "Binning parameters")
self.setattr_argument("bin_step", NumberValue(1, ndecimals=0, step=1), "Binning parameters")
self.setattr_argument("nbins", NumberValue(100, ndecimals=0, step=10))
self.setattr_argument("histo_delay", NumberValue(0.6, ndecimals=2, step=0.01))
self.setattr_device("ccb")
def run(self):
self.pmt = MockPMT()
# Custom histogram plot creator (needs a reasonable --update-delay)
self.ccb.issue("create_applet", "mockpmt_histogram",
"${artiq_applet}plot_hist "
"histo --x hd_bins --title mockpmt "
f"--update-delay {self.histo_delay}",
group="ExampleHistogram")
bin_boundaries = np.arange(self.bin_init, self.bin_end, self.bin_step)
self.set_dataset("hd_bins", bin_boundaries,
broadcast=True, archive=False)
self.set_dataset("histo", np.zeros(len(bin_boundaries)-1, dtype=int), broadcast=True, archive=False)
self.set_dataset("medidas", np.empty(self.npoints*self.chunks), broadcast=True, archive=False)
self.set_dataset("partial_chunk", np.empty(self.chunks), broadcast=True, archive=False)
for i in range(self.npoints):
for j in range(self.chunks):
self.mutate_dataset("partial_chunk", j, self.pmt.count())
print(1)
histogram_partial, _ = np.histogram(self.partial_chunk,
bin_boundaries)
print(2)
for k in range(len(histo)):
self.mutate_dataset("histo", k, self.histo[k]+histogram_partial[k])
print(3)
sleep(0.5)
sleep(0.3)
$timescale 1000ps $end
$var wire 1 ! ttl/led0 $end
$var wire 1 " ttl/led1 $end
$scope module spi2/spi_urukul0 $end
$var wire 1 # spi_urukul0/stb $end
$var wire 8 $ spi_urukul0/flags $end
$var wire 5 % spi_urukul0/length $end
$var wire 8 & spi_urukul0/div $end
$var wire 8 ' spi_urukul0/chip_select $end
$var wire 32 ( spi_urukul0/write $end
$var wire 32 ) spi_urukul0/read $end
$upscope $end
$var wire 1 * ttl/ttl0 $end
$var wire 1 + ttl/ttl1 $end
$var wire 1 , ttl/ttl2 $end
$var wire 1 - ttl/ttl3 $end
$var wire 1 . ttl/ttl4 $end
$var wire 1 / ttl/ttl5 $end
$var wire 1 0 ttl/ttl6 $end
$var wire 1 1 ttl/ttl7 $end
$var wire 1 2 ttl/ttl_urukul0_io_update $end
$var wire 1 3 ttl/ttl_urukul0_sw0 $end
$var wire 1 4 ttl/ttl_urukul0_sw1 $end
$var wire 1 5 ttl/ttl_urukul0_sw2 $end
$var wire 1 6 ttl/ttl_urukul0_sw3 $end
$var wire 64 7 rtio_slack $end
#0
1#
0#
1#
0#
1#
0#
1#
0#
1#
0#
1#
0#
1#
0#
1#
0#
1#
0#
1#
0#
1#
0#
1#
0#
X*
b0011111100011111110101110100111110100001011011001011101110000100 7
#100000000
1.
b0011111110111001101000010101110100111010111101110010101001110111 7
#1100000000
b0011111111110001100110100001010011101101111001111001001101100111 7
#1100000170
1*
#1100000187
0*
#1100003672
#2100000000
b0100000000000000110011010000101000011011101011110010101001110010 7
#63341167032
X*
b0011111100011111110101110100111110100001011011001011101110000100 7
#63441167032
1.
b0011111110111001101000010101110100111010111101110010101001110111 7
#64441167032
b0011111111110001100110100001010011101101111001111001001101100111 7
#64441167124
0*
#64441172488
#64442167032
b0011111111110001100111100010110010011011100101000111000010010000 7
#128943831936
X*
b0011111100011111110101111101100100010001110010111111110010111011 7
#129043831936
1.
b0011111110111001101000010101110101011101010100110100001001001000 7
#130043831936
b0011111111110001100110100001010011110000000011010101010011100100 7
#130043832051
1*
#130043832069
0*
#130043832151
1*
#130043832169
0*
#130043832251
1*
#130043832269
0*
#130043832351
1*
#130043832368
0*
#130043832451
1*
#130043832468
0*
#130043832550
1*
#130043832568
0*
#130043832651
1*
#130043832668
0*
#130043832751
1*
#130043832768
0*
#130043832851
1*
#130043832869
0*
#130043832936
b0011111111110001100110100001010101000101111100111001000001101100 7
0.
b1011111011110001110100010100000101011001010001000100011110001100 7
#130043832950
1*
#130043832968
0*
#130043849936
#206513433872
X*
b0011111100011111110010000100011101010111000000011001100110001001 7
#206613433872
1.
b0011111110111001101000010101110011010011111000101110001100000111 7
#207613433872
b0011111111110001100110100001010011100111011101100100111011110000 7
#207613433965
0*
#207613437384
#207613443872
b0011111111110001100110100001111010101101010001111101010011011111 7
#224773659856
X*
b0011111100011111110000000011100111000001011011001100011101010100 7
#224873659856
1.
b0011111110111001101000010101101101011001111011011101110100010011 7
#225873659856
b0011111111110001100110100001010011001111110101101111111010010000 7
#225873659989
1*
#225873663240
#225873664856
b0011111111110001100110100001100101010111011110110010001001000111 7
#237896043952
X*
b0011111100011111110100000101010011101100100101100110101110111101 7
#237996043952
1.
b0011111110111001101000010101111010010010100100000001100010011010 7
#238996043952
b0011111111110001100110100001010100000011011000010010001001001001 7
#238996044096
1*
#238996044114
0*
#238996044196
1*
#238996044214
0*
#238996044296
1*
#238996044314
0*
#238996044396
1*
#238996044414
0*
#238996044496
1*
#238996044514
0*
#238996044596
1*
#238996044614
0*
#238996044696
1*
#238996044714
0*
#238996044796
1*
#238996044814
0*
#238996044896
1*
#238996044914
0*
#238996044996
1*
#238996045014
0*
#238996045096
1*
#238996045114
0*
#238996045196
1*
#238996045214
0*
#238996045296
1*
#238996045314
0*
#238996045396
1*
#238996045414
0*
#238996045496
1*
#238996045514
0*
#238996045596
1*
#238996045614
0*
#238996045696
1*
#238996045714
0*
#238996045796
1*
#238996045814
0*
#238996045896
1*
#238996045914
0*
#238996045996
1*
#238996046014
0*
#238996046096
1*
#238996046114
0*
#238996046196
1*
#238996046214
0*
#238996046296
1*
#238996046314
0*
#238996046396
1*
#238996046414
0*
#238996046496
1*
#238996046514
0*
#238996046596
1*
#238996046614
0*
#238996046696
1*
#238996046714
0*
#238996046796
1*
#238996046814
0*
#238996046896
1*
#238996046914
0*
#238996046952
b0011111111110001100110100001011101110010001001100101000111101000 7
0.
b1011111100000100111010101100000000011111001101101100100101100011 7
#238996046996
1*
#238996047014
0*
#238996086856
#249120996304
X*
b0011111100011111110101110100111110100001011011001011101110000100 7
#249220996304
1.
b0011111110111001101000010101110110100010000010110111000111101000 7
#250220996304
b0011111111110001100110100001010011110100010110001101011111011110 7
#250220996452
1*
#250220996470
0*
#250220996552
1*
#250221000304
b0011111111110001100110100001100001101111100011011000000110001001 7
#250221000368
#253650742240
X*
b0011111100011111110000100101111110000010111010011100110000101111 7
#253750742240
1.
b0011111110111001101000010101101101011001111011011101110100010011 7
#254750742240
b0011111111110001100110100001010011001111110101101111111010010000 7
#254750742402
1*
#254750745640
#254750746240
b0011111111110001100110100001100001001011000010111010100000111011 7
#283169727256
X*
b0011111100011111110010000100011101010111000000011001100110001001 7
#283269727256
1.
b0011111110111001101000010101110011110110001111101111101011010111 7
#284269727256
b0011111111110001100110100001010011100111011101100100111011110000 7
#284269727347
0*
#284269727429
1*
#284269727448
0*
#284269727530
1*
#284269727548
0*
#284269727630
1*
#284269727648
0*
#284269727730
1*
#284269727748
0*
#284269727830
1*
#284269727847
0*
#284269727930
1*
#284269727947
0*
#284269728029
1*
#284269728047
0*
#284269728130
1*
#284269728147
0*
#284269728229
1*
#284269728247
0*
#284269728330
1*
#284269728348
0*
#284269728430
1*
#284269728448
0*
#284269728529
1*
#284269728547
0*
#284269728630
1*
#284269728647
0*
#284269728730
1*
#284269728748
0*
#284269728829
1*
#284269728847
0*
#284269728930
1*
#284269728948
0*
#284269729030
1*
#284269729048
0*
#284269729130
1*
#284269729147
0*
#284269729230
1*
#284269729247
0*
#284269729330
1*
#284269729348
0*
#284269729429
1*
#284269729447
0*
#284269729530
1*
#284269729548
0*
#284269729629
1*
#284269729647
0*
#284269729730
1*
#284269729748
0*
#284269729829
1*
#284269729848
0*
#284269729930
1*
#284269729948
0*
#284269730029
1*
#284269730047
0*
#284269730130
1*
#284269730148
0*
#284269730229
1*
#284269730248
0*
#284269730256
b0011111111110001100110100001011101011000011000010100000000001100 7
0.
b1011111100000101010110110111111001001101010110100100100001000011 7
#284269730330
1*
#284269771000
#308955859536
X*
b0011111100011111110010000100011101010111000000011001100110001001 7
#309055859536
1.
b0011111110111001101000010101110011010011111000101110001100000111 7
#310055859536
b0011111111110001100110100001010011100001000001010000101001111001 7
#310055859640
0*
#310055859722
1*
#310055859740
0*
#310055859822
1*
#310055859840
0*
#310055859922
1*
#310055859940
0*
#310055860022
1*
#310055860040
0*
#310055860122
1*
#310055860140
0*
#310055860222
1*
#310055860240
0*
#310055860322
1*
#310055860340
0*
#310055860422
1*
#310055860440
0*
#310055860522
1*
#310055860539
0*
#310055860622
1*
#310055860640
0*
#310055860722
1*
#310055860740
0*
#310055860822
1*
#310055860839
0*
#310055860922
1*
#310055860940
0*
#310055861022
1*
#310055861040
0*
#310055861122
1*
#310055861140
0*
#310055861222
1*
#310055861240
0*
#310055861322
1*
#310055861340
0*
#310055861422
1*
#310055861440
0*
#310055861522
1*
#310055861540
0*
#310055861622
1*
#310055861640
0*
#310055861722
1*
#310055861740
0*
#310055861822
1*
#310055861840
0*
#310055861922
1*
#310055861940
0*
#310055862022
1*
#310055862040
0*
#310055862122
1*
#310055862140
0*
#310055862222
1*
#310055862240
0*
#310055862322
1*
#310055862340
0*
#310055862422
1*
#310055862440
0*
#310055862522
1*
#310055862536
b0011111111110001100110100001011101001111110010100011101000011000 7
#310055862539
0*
#310055862622
1*
#310058862536
0.
b0011111101101000001110101110110000110001100011100110010011010101 7
#324501768616
X*
b0011111100011111101110100101000111101101010101001111100111111010 7
#324601768616
1.
b0011111110111001101000010101101101111100010010011111010011100100 7
#325601768616
b0011111111110001100110100001010010110011111011000010101100110111 7
#325601768708
1*
#325601768726
0*
#325601768808
1*
#325601768826
0*
#325601768908
1*
#325601768926
0*
#325601769008
1*
#325601769026
0*
#325601769108
1*
#325601769126
0*
#325601769208
1*
#325601769226
0*
#325601769308
1*
#325601769326
0*
#325601769408
1*
#325601769426
0*
#325601769508
1*
#325601769526
0*
#325601769608
1*
#325601769626
0*
#325601769708
1*
#325601769726
0*
#325601769808
1*
#325601769826
0*
#325601769908
1*
#325601769926
0*
#325601770008
1*
#325601770026
0*
#325601770108
1*
#325601770126
0*
#325601770208
1*
#325601770226
0*
#325601770308
1*
#325601770326
0*
#325601770408
1*
#325601770426
0*
#325601770508
1*
#325601770526
0*
#325601770608
1*
#325601770626
0*
#325601770708
1*
#325601770726
0*
#325601770808
1*
#325601770826
0*
#325601770908
1*
#325601770926
0*
#325601771008
1*
#325601771026
0*
#325601771108
1*
#325601771126
0*
#325601771208
1*
#325601771226
0*
#325601771308
1*
#325601771326
0*
#325601771409
1*
#325601771426
0*
#325601771508
1*
#325601771526
0*
#325601771608
1*
#325601771616
b0011111111110001100110100001011100000000010101010100001100000110 7
#325601771626
0*
#325604771616
0.
b0011111101101000001110101111010011001000100101000101100011101000 7
#469930952112
X*
b0011111100011111011110011110010101000000101011100110100001010110 7
1#
0#
b00000001 '
b00001110 &
b00010111 %
b00001110 $
b0011111100011101110001000101100010000001011011011100101100101101 7
#469930952120
1#
0#
b00110000000000000000000000000000 (
b0011111100011100001111011000000011110010100011000101011110011011 7
#469931055328
1#
0#
b00000001 '
b00000000 &
b00010111 %
b00001010 $
b00000000000010000000111100000001 )
b0011111100011001100001100100000110000000101100010111001111011111 7
#469931055336
1#
0#
b00100000000000000000000000000000 (
b0011111100011001000010000001011101011001010000001001011010100111 7
#469982055744
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111110101010001010000011100010010100100000100011111011000110 7
#469982055752
1#
0#
b00000000000000000000000000000000 (
b0011111110101010001001111100101110011000011001101011011000001111 7
#469982055904
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111110101010001001111011010100001011111101110001010101011100 7
#469982055912
1#
0#
b00000000000000000000000000000010 (
b0011111110101010001001110111100000011100101001001101100111110011 7
#469982056448
12
b0011111110101010001001110110011100110011010100010010000101101100 7
#469982057448
02
b0011111110101010001001110111001010111110010000010010000101100110 7
#469983057448
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111110101010101010100110011101100000111111000000100000010011 7
#469983057456
1#
0#
b10000011000000000000000000000000 (
b0011111110101010101010100010011101111101101111111100000011000011 7
#469983057608
1#
0#
b00000100 '
b00001110 &
b00011111 %
b00001110 $
b0011111110101010101010100001010111000110010000110111100101011011 7
#469983057616
1#
0#
b00000000000000000000000000000000 (
b0011111110101010101010011110001100001010010010000100111111001000 7
#469983111848
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b00000000000000000111111101111111 )
b0011111100000111101101001100100111101110000101111001011110011001 7
#469983111856
1#
0#
b00000001000000000000000000000000 (
b0011111100000101110100001000011111111110011101111101000011011001 7
#469983112008
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111100000100111101010111110011100110101001111110000110101001 7
#469983112016
1#
0#
b00000001000000010000000000100000 (
b0011111100000011011110010110001000011111001101111000011001011101 7
#469983112552
12
b0011111100000010101010010001001111001110110110001010111101110011 7
#469983113552
02
b0011111100000010100111010100010000100110101010010001010011000000 7
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111100000001101110111100011111001010011000100001011011111111 7
#469983113560
1#
0#
b00000010000000000000000000000000 (
b0011111011111111010000111010101111101011000110011010110111000000 7
#469983113712
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111011111100101111010100011101101011000110101111100001110111 7
#469983113720
1#
0#
b00001101001111111100010101000000 (
b0011111011110110000101100101001100001110110101101110111010100000 7
#469983114256
12
b0011111011110011110001011001111001110100000011011011001010110101 7
#469983115256
02
b0011111011110010001000101101110000010001110100110000000000000111 7
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111011101110111011111110101101110001000011011111000001101010 7
#469983115264
1#
0#
b00000010000000000000000000000000 (
b0011111011100111001110000011110000010111110001000111111000000101 7
#469983115416
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111011100011101111110010110100101111100101101010010000100101 7
#469983115424
1#
0#
b00001101001111111100000101000000 (
b0011111011010111000011010100100011111010000000000001110011101101 7
#469983115960
12
b0011111011001100001011111000101110001000110111111011100000001100 7
#469983116960
02
b0011111011000101001101001101011010110010100011111111000011100000 7
1#
0#
b00000001 '
b00001110 &
b00010111 %
b00001110 $
b1011111010111110010101010100110100000101111001001001001011011111 7
#469983118776
1#
0#
#518186523536
X*
b0011111100011111011000001010100110011111001100010110111101001011 7
1#
0#
b00000001 '
b00001110 &
b00010111 %
b00001110 $
b0011111100011101101000110000111101001010010110111111111111101101 7
#518186523544
1#
0#
b00110000000000000000000000000000 (
b0011111100011100000111010100101010011100001110010000111011001000 7
#518186626752
1#
0#
b00000001 '
b00000000 &
b00010111 %
b00001010 $
b00000000000010000000111100000001 )
b0011111100011001011110011110100001101000001000101001011111110101 7
#518186626760
1#
0#
b00100000000000000000000000000000 (
b0011111100011000110000001010111111110111110000111011010100111011 7
#518237627168
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111110101010001010000010011111101111111001101011010111100000 7
#518237627176
1#
0#
b00000000000000000000000000000000 (
b0011111110101010001001111100100100101101111011010000100101101010 7
#518237627328
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111110101010001001111010111111110010010010111000110001110001 7
#518237627336
1#
0#
b00000000000000000000000000000010 (
b0011111110101010001001110110010101010010010001111101010000001000 7
#518237627872
12
b0011111110101010001001110100100110101100001011001010101001101010 7
#518237628872
02
b0011111110101010001001110100111100001010100100000110001011110110 7
#518238628872
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111110101010101010100100001101101000100100110001101000000010 7
#518238628880
1#
0#
b10000011000000000000000000000000 (
b0011111110101010101010100000000111101001000001011011010011101110 7
#518238629032
1#
0#
b00000100 '
b00001110 &
b00011111 %
b00001110 $
b0011111110101010101010011110101010001110011011011000010101011001 7
#518238629040
1#
0#
b00000000000000000000000000000000 (
b0011111110101010101010010011101110001001010101000011100001001101 7
#518238683272
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b00000000000000000111111101111111 )
b0011111100000110111100111000001111101000001000111110001010101011 7
#518238683280
1#
0#
b00000001000000000000000000000000 (
b0011111100000001000011001100001010110001000101010000101101010101 7
#518238683432
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111011111111100101010100011010100011101010000110011000111100 7
#518238683440
1#
0#
b00000001000000010000000000100000 (
b0011111011111011010111110011110100111000100000001110000100100011 7
#518238683976
12
b0011111011111000111101001100001110001011110110110110101011110110 7
#518238684976
02
b0011111011111000100001110011110111111111111100110111001101011110 7
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111011110110011010100001001110001000111000101010101111110110 7
#518238684984
1#
0#
b00000010000000000000000000000000 (
b0011111011110010010011011100111100101111100101110110000100011111 7
#518238685136
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111011110000010101110100110001010011010100001111000100011011 7
#518238685144
1#
0#
b00001101001111111100010101000000 (
b0011111011100110010100000100111001110111000001100111000110110101 7
#518238685680
12
b0011111011100011111110110100111001011001010000110010110000010100 7
#518238686680
02
b0011111011100010110001100001000110000010111100000111000011111101 7
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111011011101000011101110001000100011101010011011000011110010 7
#518238686688
1#
0#
b00000010000000000000000000000000 (
b0011111011001111100010101000100111011100001101110100110111110110 7
#518238686840
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111011000011011101100010100101111100111110111111111100010101 7
#518238686848
1#
0#
b00001101001111111100000101000000 (
b1011111010101011000111001010101011001010010111010100101010100011 7
#518238687664
1#
0#
#531305474360
X*
b0011111100011111011001000110101110110001110011000011011111001001 7
1#
0#
b00000001 '
b00001110 &
b00010111 %
b00001110 $
b0011111100011101101001001010101110011011011110011100001110010001 7
#531305474368
1#
0#
b00110000000000000000000000000000 (
b0011111100011100001100111101011100001011110110011100000111000010 7
#531305577576
1#
0#
b00000001 '
b00000000 &
b00010111 %
b00001010 $
b00000000000010000000111000000001 )
b0011111100011001011000001010110011000110101001011001111011101010 7
#531305577584
1#
0#
b00100000000000000000000000000000 (
b0011111100011000101010001000011100110111000001010011111010011101 7
#531356577992
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111110101010001010000000101001101000110000100011111011011101 7
#531356578000
1#
0#
b00000000000000000000000000000000 (
b0011111110101010001001111011011000011110110101111101001111011111 7
#531356578152
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111110101010001001111001100100100001001000111011110000011101 7
#531356578160
1#
0#
b00000000000000000000000000000010 (
b0011111110101010001001110100110101101110001111110100010100110010 7
#531356578696
12
b0011111110101010001001110010110111000001010110010101000100101011 7
#531356579696
02
b0011111110101010001001110011100100000111100100010010000110000100 7
#531357579696
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111110101010101010100010110111101111000001000011011111010001 7
#531357579704
1#
0#
b10000011000000000000000000000000 (
b0011111110101010101010011111000000110001100010010110110110000110 7
#531357579856
1#
0#
b00000100 '
b00001110 &
b00011111 %
b00001110 $
b0011111110101010101010011101001011101111000111010010011000100011 7
#531357579864
1#
0#
b00000000000000000000000000000000 (
b0011111110101010101010010100101101011111110001110011001001010001 7
#531357634096
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b00000000000000000111111101111111 )
b0011111100000111101111000100111000010011010011010010100010010111 7
#531357634104
1#
0#
b00000001000000000000000000000000 (
b0011111100000100010001111000101010101110000110010101100001101100 7
#531357634256
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111100000011011000101101010110101111100101101101001101100011 7
#531357634264
1#
0#
b00000001000000010000000000100000 (
b0011111100000001101101110111110001000111011010000000110101001010 7
#531357634800
12
b0011111100000000110011010110100011100101001011001111110000011110 7
#531357635800
02
b0011111100000000101110100001010100010111110001111101000001101101 7
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111011111111001011100011001001011100001101110111110100110100 7
#531357635808
1#
0#
b00000010000000000000000000000000 (
b0011111011111100010101000000110101100010001011010000101010010100 7
#531357635960
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111011111010110110100001100001011100001110011011010000100100 7
#531357635968
1#
0#
b00001101001111111100010101000000 (
b0011111011110101111011011000010110110010100011111001001001100011 7
#531357636504
12
b0011111011110100010110011100101110011010110000000000000110110000 7
#531357637504
02
b0011111011110100001110011001010101000100011011001011100011011110 7
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111011110001110001000101111011010000010101100010101001101011 7
#531357637512
1#
0#
b00000010000000000000000000000000 (
b0011111011101101101110101010111010011010101110110011010101010100 7
#531357637664
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111011101010011111011100000011011100001110011110001101100010 7
#531357637672
1#
0#
b00001101001111111100000101000000 (
b0011111011100001001111110011100111110100000011101111110101101100 7
#531357638208
12
b0011111011011100010100011110011110100000101100000000010110111010 7
#531357639208
02
b0011111011011011100000111011111100010001110011100011001110101011 7
1#
0#
b00000001 '
b00001110 &
b00010111 %
b00001110 $
b0011111011001000101000010000001100010001110011111010110110100000 7
#531357639216
1#
0#
b00100000000000000000000000000000 (
b0011111010001100111111011011010000010111110000011000101000011011 7
#531358642424
1#
0#
b00000001 '
b00001110 &
b00010111 %
b00001110 $
b00000000000010000000111000000001 )
b0011111101010000010011001001100000100010111001011100110011101000 7
#531358642432
1#
0#
b00100000000000000000000000000000 (
b0011111101010000010001101111110110011110000000111001010000111101 7
#531370655640
1#
0#
b00000010 '
b00000100 &
b00011111 %
b00001010 $
b00000000000010000000111100000001 )
b0011111110001000011110101111000010110111000011001100011100001110 7
#531370655648
1#
0#
b00000000000000000000000011111111 (
b0011111110001000011101111111100110010100010111101010010011011010 7
#531370657240
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111110001000001000110100011110000010110010110111011011100010 7
#531370657248
1#
0#
b00001110000000000000000000000000 (
b0011111110001000001000000001011101110111100101011110001110101101 7
#531370657400
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001000 $
b0011111110001000000111110100111111000000010010110111100011101001 7
#531370657408
1#
0#
b00011111111111110000000000000000 (
b0011111110001000000111010011101000011001111110011001110110110011 7
#531370657944
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111110001000000111000111001001100010101011110011001011110000 7
#531370657952
1#
0#
b00110011001100110011001100110011 (
b0011111110001000000110110000011101110101111100111010101010111011 7
#531370658488
12
b0011111110001000000110011110111000100011111100001011000100111111 7
#531370658496
02
b0011111110001000000110010010110111110000110010110111110000001101 7
13
b0011111110001000000101000000101110101110001111001001110001110010 7
04
b0011111110001000000100100001110111000010011001100100101000010101 7
05
b0011111110001000000100010011001110101111000001000000111100000100 7
06
b0011111110001000000100001001000001111001100100101111000110010011 7
#605724852128
X*
b0011111100011111011110111000000110010001110011000010101111111010 7
1#
0#
b00000001 '
b00001110 &
b00010111 %
b00001110 $
b0011111100011101101111101111101000011101101101010011111100001001 7
#605724852136
1#
0#
b00110000000000000000000000000000 (
b0011111100011100001101011111110011001101010101101100011010011101 7
#605724955344
1#
0#
b00000001 '
b00000000 &
b00010111 %
b00001010 $
b00000000000010000000111100000001 )
b0011111100011001100001101100101011110001000100001011010100010110 7
#605724955352
1#
0#
b00100000000000000000000000000000 (
b0011111100011001000010011011001110101010010111100101101001001011 7
#605775955760
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111110101010001010000011110101101001011101011001100000010001 7
#605775955768
1#
0#
b00000000000000000000000000000000 (
b0011111110101010001001111101001111101010101101000111101010000010 7
#605775955920
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111110101010001001111011110101011110010001001101100111001111 7
#605775955928
1#
0#
b00000000000000000000000000000010 (
b0011111110101010001001111000010110001000100111100010011101010001 7
#605775956464
12
b0011111110101010001001110111001010111110010000010010000101100110 7
#605775957464
02
b0011111110101010001001111000000110000001110100110101110011101000 7
#605776957464
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111110101010101010100111011000100100100011100100001110010100 7
#605776957472
1#
0#
b10000011000000000000000000000000 (
b0011111110101010101010100011011111011101101000110001101000001000 7
#605776957624
1#
0#
b00000100 '
b00001110 &
b00011111 %
b00001110 $
b0011111110101010101010100010010000000000011001010101010110011011 7
#605776957632
1#
0#
b00000000000000000000000000000000 (
b0011111110101010101010011111000010111010111110011100110011000111 7
#605777011864
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b00000000000000000111111101111111 )
b0011111100000110101000101111110000010000010100111010110010011101 7
#605777011872
1#
0#
b00000001000000000000000000000000 (
b0011111100000100100101001101100111100011101011100000011100110010 7
#605777012024
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111100000011100100110010011100110001000100111100000010011111 7
#605777012032
1#
0#
b00000001000000010000000000100000 (
b0011111100000001100100001101010010101100100111011011010111100111 7
#605777012568
12
b0011111100000000001000001000100110001101010111001111010101001111 7
#605777013568
02
b0011111011111111110001001000010101000100011001101101000100001010 7
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111011111101100111001001111000000101111001001111000101011100 7
#605777013576
1#
0#
b00000010000000000000000000000000 (
b0011111011111010100111011111011100110010100011010010110000110101 7
#605777013728
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111011111001000111011001000011101000001000101100011100110011 7
#605777013736
1#
0#
b00001101001111111100010101000000 (
b0011111011110100100010010000101000111011011111100110110001111110 7
#605777014272
12
b0011111011110010110000011100010111111111111101100110011101001000 7
#605777015272
02
b0011111011110010100011100011101111011100001111011111001011000100 7
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111011101111100110111011011111101000000111110111010011001100 7
#605777015280
1#
0#
b00000010000000000000000000000000 (
b0011111011101001110111101101011011101110000101100111110000100001 7
#605777015432
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111011100110110111100000101001011001010000011011001000011111 7
#605777015440
1#
0#
b00001101001111111100000101000000 (
b0011111011100000100101111011100011111111111101111000001010111111 7
#605777015976
12
b0011111011011010001101001011110100101001100111110011111001010010 7
#605777016976
02
b0011111011011001100000000101100110101100100110011010011010000101 7
1#
0#
b00000001 '
b00001110 &
b00010111 %
b00001110 $
b0011111011000100011001101010111000100011101011100001111011010001 7
#605777016984
1#
0#
b00100000000000000000000000000000 (
b1011111010101010110101111111001010011010101111001010111101001001 7
#605777017792
1#
0#
#740731215928
X*
b0011111100011111100010010111011011111011011110001100101110001000 7
1#
0#
b00000001 '
b00001110 &
b00010111 %
b00001110 $
b0011111100011101110110110110111001100001011011011011111101011101 7
#740731215936
1#
0#
b00110000000000000000000000000000 (
b0011111100011100010010010101000010011010101110111111001001001110 7
#740731319144
1#
0#
b00000001 '
b00000000 &
b00010111 %
b00001010 $
b00000000000010000000111100000000 )
b0011111100011001100000001110001100011100111110001110011110111100 7
#740731319152
1#
0#
b00100000000000000000000000000000 (
b0011111100011001000001010110100000100111011001000101000010010110 7
#740782319560
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111110101010001010000011100001001111110010100000111100100101 7
#740782319568
1#
0#
b00000000000000000000000000000000 (
b0011111110101010001001111101000011110110110010100110111010011100 7
#740782319720
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111110101010001001111011111111001000101111101000011001110101 7
#740782319728
1#
0#
b00000000000000000000000000000010 (
b0011111110101010001001111000100011000001010000000110001011011000 7
#740782320264
12
b0011111110101010001001110111010100101000101110101100111000001100 7
#740782321264
02
b0011111110101010001001111000001110100111100101001101100111101101 7
#740783321264
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111110101010101010100111100010001111000001111111000000111010 7
#740783321272
1#
0#
b10000011000000000000000000000000 (
b0011111110101010101010100011101001001000000111001100011010101101 7
#740783321424
1#
0#
b00000100 '
b00001110 &
b00011111 %
b00001110 $
b0011111110101010101010100010011000100110001001101101001010100000 7
#740783321432
1#
0#
b00000000000000000000000000000000 (
b0011111110101010101010011110010110111001011110100010110000001110 7
#740783375664
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b00000000000000000111111101111111 )
b0011111100001000000010001000101001101000001000110101010011101111 7
#740783375672
1#
0#
b00000001000000000000000000000000 (
b0011111100000110001011001101111101111110011101111010000110011010 7
#740783375824
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111100000101100010011010101000001101010110100011000010100011 7
#740783375832
1#
0#
b00000001000000010000000000100000 (
b0011111100000011011101010001011010011100001111010111110010100111 7
#740783376368
12
b0011111100000001110000000001001101001101010111000010000010110101 7
#740783377368
02
b0011111100000001000110011010010100111010000000110010100001110110 7
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111011111110101001001100000111111100111101100100011010000000 7
#740783377376
1#
0#
b00000010000000000000000000000000 (
b0011111011111010101010001011001111111001111111100100010001111011 7
#740783377528
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111011111000101110001010001001100010001011101110001100000111 7
#740783377536
1#
0#
b00001101001111111100010101000000 (
b0011111011110011010000101001111101011001010000111000101010010001 7
#740783378072
12
b0011111011110001100101010010000000101111100101111011111110011100 7
#740783379072
02
b0011111011110001000011011101010110010001110100111000110111000011 7
1#
0#
b00000100 '
b00000000 &
b00000111 %
b00001000 $
b0011111011101010101100010100101011111111111100100101011111100110 7
#740783379080
1#
0#
b00000010000000000000000000000000 (
b0011111011100100100011010101010110111110011110000111011000110100 7
#740783379232
1#
0#
b00000100 '
b00000000 &
b00011111 %
b00001010 $
b0011111011100000010010100110100111001010011000101101001111111010 7
#740783379240
1#
0#
b00001101001111111100000101000000 (
b0011111011010010101100001001011111110100000011100100000001110001 7
#740783379776
12
b0011111011001000110000110101111100101001100111111111101101001101 7
#740783380776
02
b0011111011000111000101011101111111111111111101000011000001011000 7
1#
0#
b00000001 '
b00001110 &
b00010111 %
b00001110 $
b1011111010110110001001010101101101011001010000100001000010011100 7
#740783382104
1#
0#
from artiq.experiment import *
class Set_All_Urukul_Freqs(EnvExperiment):
"""Exp1_test
Set the frecuencies/amplitudes of every Urukul channel
"""
def build(self):
# sets core device drivers as attributes
self.setattr_device("core")
self.pmt = self.get_device("ttl0")
# global attenuation
self.setattr_argument("attenuation",
NumberValue(0*dB, unit='dB', scale=dB, min=0*dB, max=31*dB),
)
for ch in range(4):
# sets urukul0, channel 0-3 device drivers as attributes
self.setattr_device(f"urukul0_ch{ch}")
### This two attributes will be shown in the GUI grouped by channel
# use/don't use each channel
self.setattr_argument(f"state_ch{ch}", BooleanValue(ch==0), f"canal_{ch}")
# each channel's frequency
self.setattr_argument(f"freq_ch{ch}",
NumberValue(200.0*MHz, unit='MHz', scale=MHz, min=1*MHz, max=400*MHz),
f"canal_{ch}")
# each channel's amplitude
self.setattr_argument(f"amp_ch{ch}",
NumberValue(0.5, min=0., max=1.),
f"canal_{ch}")
self.all_amps = [self.amp_ch0, self.amp_ch1, self.amp_ch2, self.amp_ch3]
self.all_freqs = [self.freq_ch0, self.freq_ch1, self.freq_ch2, self.freq_ch3]
self.states = [self.state_ch0, self.state_ch1, self.state_ch2, self.state_ch3]
self.all_channels = [self.urukul0_ch0, self.urukul0_ch1, self.urukul0_ch2, self.urukul0_ch3]
self.use_amps = []
self.use_freqs = []
self.use_channels = []
for state, ch_n, freq_n, amp_n in zip(self.states, self.all_channels,
self.all_freqs, self.all_amps):
if state:
self.use_channels.append(ch_n)
self.use_freqs.append(freq_n)
self.use_amps.append(amp_n)
@kernel
def run(self):
self.core.reset()
# self.pmt.reset()
self.pmt.input()
# initialises CPLD all the selected channels
for channel in self.use_channels:
channel.cpld.init()
channel.init()
delay(10 * ms)
for i in range(len(self.use_channels)):
# writes global attenuation and specific
# frequency and amplitude variables to each
# urukul channel outputting function
self.use_channels[i].set_att(self.attenuation)
#self.use_channels[i].set_amplitude(self.use_amps[i])
self.use_channels[i].set(self.use_freqs[i], amplitude=self.use_amps[i])
# turn on every selected channel
for i in range(4):
if self.states[i] == True:
self.all_channels[i].sw.on()
else:
self.all_channels[i].sw.off()
delay(2*s)
pulsos=self.pmt.count(self.pmt.gate_both(3*us))
delay(2*s)
print(pulsos)
#!/usr/bin/env python3
import numpy as np
import PyQt5 # make sure pyqtgraph imports Qt5
import pyqtgraph
from artiq.applets.simple import TitleApplet
class MakeHistogramAndPlot(pyqtgraph.PlotWidget):
def __init__(self, args):
pyqtgraph.PlotWidget.__init__(self)
self.args = args
def data_changed(self, data, mods, title):
#print(data)
try:
y = data[self.args.y][1]
y = y[~np.isnan(y)]
#print(self.args.x)
#if len(y[~np.isnan(y)]) > 5: return
if self.args.x is None:
x = 'auto'
else:
x = data[self.args.x][1]
except KeyError:
return
# This makes the histogram with the full datasets
# may be slow so it should be run with a reasonable
# --update-delay value
heigs, binsides = np.histogram(y, bins=x, density=True)
self.clear()
self.plot(binsides, heigs, stepMode=True, fillLevel=0,
brush=(0, 0, 255, 150))
self.setTitle(title)
def main():
applet = TitleApplet(MakeHistogramAndPlot)
applet.add_dataset("y", "Y values")
applet.add_dataset("x", "Bin boundaries", required=False)
applet.run()
if __name__ == "__main__":
main()
from artiq.experiment import *
class Set_All_Urukul_Freqs(EnvExperiment):
"""Exp1_test
Set the frecuencies/amplitudes of every Urukul channel
"""
def build(self):
# sets core device drivers as attributes
self.setattr_device("core")
self.pmt = self.get_device("ttl0")
# global attenuation
self.setattr_argument("attenuation",
NumberValue(0*dB, unit='dB', scale=dB, min=0*dB, max=31*dB),
)
for ch in range(4):
# sets urukul0, channel 0-3 device drivers as attributes
self.setattr_device(f"urukul0_ch{ch}")
### This two attributes will be shown in the GUI grouped by channel
# use/don't use each channel
self.setattr_argument(f"state_ch{ch}", BooleanValue(ch==0), f"canal_{ch}")
# each channel's frequency
self.setattr_argument(f"freq_ch{ch}",
NumberValue(200.0*MHz, unit='MHz', scale=MHz, min=1*MHz, max=400*MHz),
f"canal_{ch}")
# each channel's amplitude
self.setattr_argument(f"amp_ch{ch}",
NumberValue(0.5, min=0., max=1.),
f"canal_{ch}")
self.all_amps = [self.amp_ch0, self.amp_ch1, self.amp_ch2, self.amp_ch3]
self.all_freqs = [self.freq_ch0, self.freq_ch1, self.freq_ch2, self.freq_ch3]
self.states = [self.state_ch0, self.state_ch1, self.state_ch2, self.state_ch3]
self.all_channels = [self.urukul0_ch0, self.urukul0_ch1, self.urukul0_ch2, self.urukul0_ch3]
self.use_amps = []
self.use_freqs = []
self.use_channels = []
for state, ch_n, freq_n, amp_n in zip(self.states, self.all_channels,
self.all_freqs, self.all_amps):
if state:
self.use_channels.append(ch_n)
self.use_freqs.append(freq_n)
self.use_amps.append(amp_n)
@kernel
def run(self):
self.core.reset()
# self.pmt.reset()
self.pmt.input()
delay(1*s)
pulsos=self.pmt.count(self.pmt.gate_both(1*s))
delay(1*s)
# initialises CPLD all the selected channels
for channel in self.use_channels:
channel.cpld.init()
channel.init()
delay(10 * ms)
for i in range(len(self.use_channels)):
# writes global attenuation and specific
# frequency and amplitude variables to each
# urukul channel outputting function
self.use_channels[i].set_att(self.attenuation)
#self.use_channels[i].set_amplitude(self.use_amps[i])
self.use_channels[i].set(self.use_freqs[i], amplitude=self.use_amps[i])
# turn on every selected channel
for i in range(4):
if self.states[i] == True:
self.all_channels[i].sw.on()
else:
self.all_channels[i].sw.off()
print("AAAAA")
delay(1*s)
# self.core.break_realtime()
# print("BBBBBBBBBBB")
print(pulsos)
from artiq.experiment import *
# EXTRACTED LOOSELY FROM: https://github.com/cnourshargh/Bham-ARTIQ-examples/blob/master/Urukul_SingleOutput.py
class Urukul_Frequency_Pulse(EnvExperiment):
"""Urukul Single Frequency Pulse:
Initial Urukul test:
Outputs a single sine wave of specified frecuency and duration.
"""
def build(self):
# sets core device drivers as attributes
self.setattr_device("core")
# sets urukul0, channel 0 device drivers as attributes
# this name is the same as seen in the device_db.py
self.setattr_device("urukul0_ch0")
# This is not the 'Urukul' phy, but actually is the one corresponding to
# the inside DDS chip, which has the methods described in:
# https://m-labs.hk/artiq/manual-legacy/core_drivers_reference.html#artiq.coredevice.ad9910.AD9910
# BEWARE the manual-legacy thing.
# self.freq = NumberValue(21, unit='MHz', scale=1e6)
self.setattr_argument("freq", NumberValue(21, unit='MHz', scale=1e6))
@kernel
def run(self):
self.core.reset()
# initialises CPLD on channel 0
self.urukul0_ch0.cpld.init()
self.urukul0_ch0.init()
### Variable declaration:
# Defines frequency variable, range: 1 MHz - 400MHz
# defines amplitude variable as an amplitude scale factor(0 to 1)
amp = 1.0
# defines attenuation variable from 0 (no attenuation) to max val (check) -31,5dB
attenuation= 3.0*dB
duration = 10 * (1/self.freq)
delay(10 * ms)
# writes attenuation to urukul channel
self.urukul0_ch0.set_att(attenuation)
#self.urukul0_ch0.set_phase(0.0)
# writes frequency and amplitude variables to urukul channel thus outputting function
self.urukul0_ch0.set(self.freq, amplitude = amp)
# We can access this switch thanks to the entry in this constructor method:
# ...
# sw_device – Name of the RF switch device. The RF switch is a TTLOut channel available as the sw attribute of this instance.
# ...
self.urukul0_ch0.sw.on()
delay(duration)
delay(20*s)
self.urukul0_ch0.sw.off()
delay(duration)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment