Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Individual slits as devices #88

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Individual slits as devices #88

wants to merge 7 commits into from

Conversation

MDecarabas
Copy link
Collaborator

After a lot of testing I believe that the best way forward is just creating a separate device for the individual slits. OPHYD does not lend itself to what we are trying to do. Open to others solutions

@MDecarabas MDecarabas self-assigned this Oct 17, 2024
@prjemian
Copy link
Contributor

Might be best we can do, given ophyd.

@prjemian
Copy link
Contributor

Because of the problem with the main branch, please do not merge at this time.

@MDecarabas
Copy link
Collaborator Author

All good, just ping me when it's good to go

super().__init__(prefix, *args, **kwargs)

# Real motors that directly control the slits
hp = FCpt(EpicsMotor, "{motor_prefix}:{_h_positive_motor}", labels={"motors"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following a BCDA convention, the : is defined by the prefix. Several suggestions follow:

Suggested change
hp = FCpt(EpicsMotor, "{motor_prefix}:{_h_positive_motor}", labels={"motors"})
hp = FCpt(EpicsMotor, "{motor_prefix}{_h_positive_motor}", labels={"motors"})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump


# Real motors that directly control the slits
hp = FCpt(EpicsMotor, "{motor_prefix}:{_h_positive_motor}", labels={"motors"})
hn = FCpt(EpicsMotor, "{motor_prefix}:{_h_negative_motor}", labels={"motors"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hn = FCpt(EpicsMotor, "{motor_prefix}:{_h_negative_motor}", labels={"motors"})
hn = FCpt(EpicsMotor, "{motor_prefix}{_h_negative_motor}", labels={"motors"})

# Real motors that directly control the slits
hp = FCpt(EpicsMotor, "{motor_prefix}:{_h_positive_motor}", labels={"motors"})
hn = FCpt(EpicsMotor, "{motor_prefix}:{_h_negative_motor}", labels={"motors"})
vp = FCpt(EpicsMotor, "{motor_prefix}:{_v_positive_motor}", labels={"motors"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
vp = FCpt(EpicsMotor, "{motor_prefix}:{_v_positive_motor}", labels={"motors"})
vp = FCpt(EpicsMotor, "{motor_prefix}{_v_positive_motor}", labels={"motors"})

hp = FCpt(EpicsMotor, "{motor_prefix}:{_h_positive_motor}", labels={"motors"})
hn = FCpt(EpicsMotor, "{motor_prefix}:{_h_negative_motor}", labels={"motors"})
vp = FCpt(EpicsMotor, "{motor_prefix}:{_v_positive_motor}", labels={"motors"})
vn = FCpt(EpicsMotor, "{motor_prefix}:{_v_negative_motor}", labels={"motors"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
vn = FCpt(EpicsMotor, "{motor_prefix}:{_v_negative_motor}", labels={"motors"})
vn = FCpt(EpicsMotor, "{motor_prefix}{_v_negative_motor}", labels={"motors"})



i_sl9 = IndividualSlits(
prefix="8ideSoft:CR8-I2:US",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
prefix="8ideSoft:CR8-I2:US",
prefix="8ideSoft:CR8-I2:US:",

)

i_sl5 = IndividualSlits(
prefix="8idiSoft:CR8-E2:US",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
prefix="8idiSoft:CR8-E2:US",
prefix="8idiSoft:CR8-E2:US:",

vn = FCpt(EpicsMotor, "{motor_prefix}:{_v_negative_motor}", labels={"motors"})


i_sl9 = IndividualSlits(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name here does not suggest that this object contains the motors.

Suggested change
i_sl9 = IndividualSlits(
sl9_motors = IndividualSlits(

and make the name= match on Line 57. Same for other(s) below.

logger.info(__file__)


class IndividualSlits(Device):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an MotorBundle object that is often overlooked. It might be appropriate to switch to that here from Device. It's docs state:

This provides better default behavior for 'hints'.

@prjemian
Copy link
Contributor

Could not test this at the beamline. Could not connect with the EPICS motor PVs.

In [9]: i_sl9.hp
Out[9]: EpicsMotor(prefix='8ideSoft:CR8-I2:m12', name='i_sl9_hp', parent='i_sl9', settle_time=0.0, timeout=None, read_attrs=['user_readback', 'user_setpoint'], configuration_attrs=['user_offset', 'user_offset_dir', 'velocity', 'acceleration', 'motor_egu'])

In [10]: !caget 8ideSoft:CR8-I2:m12
Channel connect timed out: '8ideSoft:CR8-I2:m12' not found.

In [11]: !cainfo 8idiSoft:CR8-E2:US:m4
Channel connect timed out: '8idiSoft:CR8-E2:US:m4' not found.

@MDecarabas MDecarabas changed the base branch from main to dev-mc2 October 24, 2024 16:25
Base automatically changed from dev-mc2 to main October 24, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants