aps-8id-dys / ipython-8idiuser

8-ID-I ipython configuration for bluesky (and other)
1 stars 1 forks source link

for testing next week #93

Closed prjemian closed 4 years ago

prjemian commented 5 years ago

@suresh emailed:

In the dir below, I am adding some spec macros that need to be made for Bluesky: /home/beams/8IDIUSER/Stuff_needed_for_Bluesky

I am suggesting that we try to do a mock test on Monday and see what is missing and how long it takes:

  • pre_align (involves a few PVs, as in align_sample.mac)
  • bluesky rel scan in samx,z
  • set lakeshore temperature (would be nice to have the "te" command)
  • set up sample grid positions (movesample)
  • lambda meas.
  • Rigaku meas.

Depending on how it goes, we can do a second demo on Tuesday (no beam day) and then do a 30 min (max) on Wednesday.

prjemian commented 5 years ago

@sureshnaps Sounds good. I'll start on this today.

@qzhang234 : We talked about test work yesterday or today. Let's do that next week. Most important is (#92) to set the scan_id register without any troubles.

sureshnaps commented 5 years ago

the rdef inside the def's can be ignored, i cleaned up a lot of stuff but there are still some unwanted stuff there. Once we see this code from you, some of the other similar looking stuff can be handled by us. I was imagining that there could be a xx-controls.py where all these could go. Ofcourse you would know better.

prjemian commented 5 years ago

Sounds good to me.

prjemian commented 4 years ago

@qzhang234 emailed:

Attached is my Spec-to-BlueSky translation for the start-up of a regular user week of user operation based on the email instruction Suresh sent me last month (also attached). So it seems like the macros we are missing are:

  1. move_pind1z_in / move_pind1z_out; Spec macro that moves the pin diode in and out of the beam. We have three pind that are currently in use (pind1, pind2, and pind4) and we need macro for moving all three of them;

  2. flux pind1 xxxx: A mathematical calculation embedded in spec that takes the reading from pind1 (after ct), multiply that by a certain coefficient to convert it into photon counts. Trivial to write but very handy during beamtimes.

  3. sb / bb: Open and close the fast shutter, if the detector is not controlling it.

    @sureshnaps : Do you think these macros would be useful to have?

    @prjemian : Am I right in assuming that currently the most effective way to browse through scans is to save the Bluesky scans into Spec format and load them in Matlab?

Suresh_Email_Alignment.pdf 11_03_BlueSky_Todo_List.pptx

prjemian commented 4 years ago

@qzhang234 : The most effective way to browse through scans is with tools you know how to use. In the future, the bluesky browser may become more useful. It certainly sounds promising.

An additional aspect to consider is to adding metadata to the scans that you will use in the future to identify particular scans when browsing. That's the most forward-thinking action you can take now.

qzhang234 commented 4 years ago

@prjemian @sureshnaps Sorry, I didn't realize that Suresh has already documented the needed macros. His list is more complete than mine. We'll go with Suresh's list.

Also @prjemian adding metadata to indicate the type of scan is definitely a great idea

prjemian commented 4 years ago

pind1z & pind2z -- any other diodes to move in/out?

prjemian commented 4 years ago

You'll need to modify 50-controls.py and add the values for in and out positions for each diode.

On Sun, Nov 3, 2019, 5:33 PM qzhang234 notifications@github.com wrote:

@prjemian https://github.com/prjemian @sureshnaps https://github.com/sureshnaps Sorry, I didn't realize that Suresh has already documented the needed macros. His list is more complete than mine. We'll go with Suresh's list.

Also @prjemian https://github.com/prjemian adding metadata to indicate the type of scan is definitely a great idea

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aps-8id-trr/ipython-8idiuser/issues/93?email_source=notifications&email_token=AARMUMHXV6OSWTEHOX4BCWLQR5GRZA5CNFSM4JHOPBL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC573JY#issuecomment-549191079, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARMUMA7UV7IOJYXZJZ2F4TQR5GRZANCNFSM4JHOPBLQ .

qzhang234 commented 4 years ago

@prjemian There's also pind4. 3 in total I think.

prjemian commented 4 years ago

PV for that?

On Sun, Nov 3, 2019, 6:39 PM qzhang234 notifications@github.com wrote:

@prjemian https://github.com/prjemian There's also pind4. 3 in total I think.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aps-8id-trr/ipython-8idiuser/issues/93?email_source=notifications&email_token=AARMUMEFRJU3JYWBVVZHD2DQR5OK7A5CNFSM4JHOPBL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC6BHOA#issuecomment-549196728, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARMUMCSGDZGDU42LGKGJUTQR5OK7ANCNFSM4JHOPBLQ .

qzhang234 commented 4 years ago

pvFLUX_PIND, 0 is out and 1 is in.

prjemian commented 4 years ago

need an EPICS process variable name for that

prjemian commented 4 years ago

Refactored to make the presets easier to use. In a plan:

yield from pind1z_in()

On command line (it's mov, not mv or move):

mov pind1z presets.pind1z.in

Change the preset (in a plan or on command line):

presets.pind1z = (-25.1, 1)  # (in, out) - must provide both since it's a tuple
prjemian commented 4 years ago

In Bluesky, use mov as you would SPEC's umv. This shows a progress bar, current position, and percent complete if the move takes longer than a short time to complete.

Similar for umvr. This table:

SPEC Bluesky description
mv mov move motor (absolute positioning)
umv mov move motor (absolute positioning) and show position while moving
mvr movr move motor (relative positioning)
umvr movr move motor (relative positioning) and show position while moving

Syntax example: mov m1 1

In Bluesky, can set any signal on command line with this same syntax:

mov m1 1
mov temperature 251
mov sample_title "aluminum foil"
prjemian commented 4 years ago
tw ta2fine 2 to maximize
sb; lup samx -3 3 30 0.2; bb;
prjemian commented 4 years ago

Perhaps, tw means move this motor to the chosen position?

prjemian commented 4 years ago

NOTE: in is a Python keyword

... and it cannot be re-used in our namedtuple

We switch to insert and remove, screaming Aw, nuts! all the way.

sureshnaps commented 4 years ago

In 15-spec-config.py, pind1z and pind2z can go. They used to be motor driven pin diode actuators but now they are pneumatic and you already did that in 50-controls.py

prjemian commented 4 years ago

@sureshnaps , @qzhang234 @ericmdufresne : What is PV for motor ta2fine?

756.SPEC8IDI> wm ta2fine

         ta2fine 
         ta2fine 
User
 High   3808.000 
 Current3227.130 
 Low    1428.000 
Dial
 High   3808.000 
 Current3227.130 
 Low    1428.000 
prjemian commented 4 years ago

@ericmdufresne : Thanks! You showed me it is 8ida:sm9. That motor is already defined as the theta axis of the FOEmirrorDevice: foemirror.theta is the same thing.

In [131]: foemirror.theta                                                                                                                                                      
Out[131]: EpicsMotor(prefix='8ida:sm9', name='foemirror_theta', parent='foemirror', settle_time=0.0, timeout=None, read_attrs=['user_readback', 'user_setpoint'], configuration_attrs=['user_offset', 'user_offset_dir', 'velocity', 'acceleration', 'motor_egu'])
prjemian commented 4 years ago

The lineup_and_center() plan takes a counter as input but assumes that the associated scaler is named scaler. That's not right for this beam line. Let's make this more robust by checking if the counter is actually part of a scaler. It might be some other signal, such as a calcout or ao record. Only apply scaler configurations when appropriate.

prjemian commented 4 years ago

Tested everything but the tw macro. That one will need more thought to implement.