CampbellGroup / common

Shared campbell lab code.
GNU Lesser General Public License v3.0
8 stars 5 forks source link

read programmed pulse sequence in pulser server #213

Closed fanmingyu212 closed 6 years ago

fanmingyu212 commented 6 years ago

If we can read the current programmed sequence in pulser, then we can plot the pulse sequence as a chart. Please see https://github.com/CampbellGroup/common/tree/mf/pulser_get_programmed_sequence?files=1 for a possible solution.

aransfor commented 6 years ago

I think a plotter exists.

fanmingyu212 commented 6 years ago

@aransfor Do you possibly know where is the plotter located? Is it in common?

aransfor commented 6 years ago

https://github.com/CampbellGroup/common/tree/master/lib/servers/Pulser2/pulse_sequences

aransfor commented 6 years ago

There's a file called plot sequence not sure how it works

fanmingyu212 commented 6 years ago

@aransfor Thanks! I believe this file can only be used by a client to plot the sequence the same client added to the pulser. However, it would not work for the situation that one client (or experiment) sets up a pulse sequence, and we want to access the sequence in another client.

I will test whether the file works tomorrow and then I will add a comment about it.

aransfor commented 6 years ago

I see, you should check out the get human readable function in the pulser server. I imagine you could parse and plot that assuming it the server gives you the sequence list (I think it does)

fanmingyu212 commented 6 years ago

I think human readable function can only return the sequence the same client connection added. It cannot return a sequence added by a different client connection.

fanmingyu212 commented 6 years ago

Please see https://github.com/CampbellGroup/common/blob/master/lib/servers/Pulser2/pulser_ok.py#L214. The output is dependent on connection c. sequence = c.get('sequence')

aransfor commented 6 years ago

I see, not sure why you would need another clients pulse sequence (this is how contexts should work) however you can just pass human readable ttl the context of the client whose pulse sequence you are interested in

fanmingyu212 commented 6 years ago

I agree that we can pass context when possible. However, I think it is difficult to get the context passed when we try to plot the sequence set in an experiment. Also I did not find public methods in Pulser server that allows us to get a list of contexts.

I understand contexts allow us to save a different pulse sequence for every client/experiment. But there might be cases that we need another client to access the sequenced currently programmed in the pulser, such as debugging the pulse sequence in an experiment.

aransfor commented 6 years ago

You can try but I believe once the pulse sequence is sent to the FPGA there is no way to extract that. I suppose you can have the pulser server 'remember' the last uploaded sequence and create a @setting function that returns the last programmed sequence

fanmingyu212 commented 6 years ago

Okay. That is what I am trying to do here: https://github.com/CampbellGroup/common/commit/26efa2b36c086891bb4b6a3156852a7b147b7858. If you think the code here makes sense, I will make a PR about it.