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

add object_explorer from APS/8-ID-I #288

Closed
prjemian opened this issue Feb 15, 2020 · 5 comments
Closed

add object_explorer from APS/8-ID-I #288

prjemian opened this issue Feb 15, 2020 · 5 comments
Assignees
Milestone

Comments

@prjemian
Copy link
Contributor

prjemian commented Feb 15, 2020

The object_explorer() utility function was developed for APS 8-ID-I to diagnose an ophyd support problem with their Lambda 750K detector. It walks through an ophyd Device and prints the ophyd name and value (and EPICS PV name) of each EpicsSignal.

@prjemian prjemian added this to the 1.2.0 milestone Feb 15, 2020
@prjemian prjemian self-assigned this Feb 15, 2020
@prjemian
Copy link
Contributor Author

Examples

EpicsMotor

In [1]: object_explorer(m5)                                                                                                                 
==================== ============ ========
name                 PV reference value   
==================== ============ ========
acceleration         sky:m5.ACCL  0.2     
direction_of_travel  sky:m5.TDIR  0       
high_limit_switch    sky:m5.HLS   0       
home_forward         sky:m5.HOMF  0       
home_reverse         sky:m5.HOMR  0       
low_limit_switch     sky:m5.LLS   0       
motor_done_move      sky:m5.DMOV  1       
motor_egu            sky:m5.EGU   degrees 
motor_is_moving      sky:m5.MOVN  0       
motor_stop           sky:m5.STOP  0       
offset_freeze_switch sky:m5.FOFF  0       
set_use_switch       sky:m5.SET   0       
soft_limit_hi        sky:m5.HLM   32000.0 
soft_limit_lo        sky:m5.LLM   -32000.0
steps_per_rev        sky:m5.SREV  8000    
user_offset          sky:m5.OFF   0.0     
user_offset_dir      sky:m5.DIR   0       
user_readback        sky:m5.RBV   0.0     
user_setpoint        sky:m5.VAL   0.0     
velocity             sky:m5.VELO  1.0     
==================== ============ ========

Out[1]: <pyRestTable.rest_table.Table at 0x7fb06f581190>

EpicsSignal

In [3]: object_explorer(m5.velocity)                                                                                                        
======== ============ =====
name     PV reference value
======== ============ =====
velocity sky:m5.VELO  1.0  
======== ============ =====

Out[3]: <pyRestTable.rest_table.Table at 0x7fb06eb6bd50>

SwaitRecord (includes sub-devices)

In [4]: object_explorer(calcs.calc1)                                                                                                        
=================================== ================== ===============================
name                                PV reference       value                          
=================================== ================== ===============================
calc1.alarm_severity                sky:userCalc1.SEVR 0                              
calc1.alarm_status                  sky:userCalc1.STAT 0                              
calc1.calculated_value              sky:userCalc1.VAL  23.894955584830175             
calc1.calculation                   sky:userCalc1.CALC D*(0.95+E*RNDM)/(1+((A-b)/c)^2)
calc1.channels.A.input_pv           sky:userCalc1.INAN sky:m1.RBV                     
calc1.channels.A.input_trigger      sky:userCalc1.INAP 1                              
calc1.channels.A.input_value        sky:userCalc1.A    0.0                            
calc1.channels.B.input_pv           sky:userCalc1.INBN                                
calc1.channels.B.input_trigger      sky:userCalc1.INBP 1                              
calc1.channels.B.input_value        sky:userCalc1.B    -0.6215460022691224            
calc1.channels.C.input_pv           sky:userCalc1.INCN                                
calc1.channels.C.input_trigger      sky:userCalc1.INCP 1                              
calc1.channels.C.input_value        sky:userCalc1.C    0.010109924461586196           
calc1.channels.D.input_pv           sky:userCalc1.INDN                                
calc1.channels.D.input_trigger      sky:userCalc1.INDP 1                              
calc1.channels.D.input_value        sky:userCalc1.D    93403.93389337506              
calc1.channels.E.input_pv           sky:userCalc1.INEN                                
calc1.channels.E.input_trigger      sky:userCalc1.INEP 1                              
calc1.channels.E.input_value        sky:userCalc1.E    0.05                           
calc1.channels.F.input_pv           sky:userCalc1.INFN                                
calc1.channels.F.input_trigger      sky:userCalc1.INFP 1                              
calc1.channels.F.input_value        sky:userCalc1.F    0.0                            
calc1.channels.G.input_pv           sky:userCalc1.INGN                                
calc1.channels.G.input_trigger      sky:userCalc1.INGP 1                              
calc1.channels.G.input_value        sky:userCalc1.G    0.0                            
calc1.channels.H.input_pv           sky:userCalc1.INHN                                
calc1.channels.H.input_trigger      sky:userCalc1.INHP 1                              
calc1.channels.H.input_value        sky:userCalc1.H    0.0                            
calc1.channels.I.input_pv           sky:userCalc1.ININ                                
calc1.channels.I.input_trigger      sky:userCalc1.INIP 1                              
calc1.channels.I.input_value        sky:userCalc1.I    0.0                            
calc1.channels.J.input_pv           sky:userCalc1.INJN                                
calc1.channels.J.input_trigger      sky:userCalc1.INJP 1                              
calc1.channels.J.input_value        sky:userCalc1.J    0.0                            
calc1.channels.K.input_pv           sky:userCalc1.INKN                                
calc1.channels.K.input_trigger      sky:userCalc1.INKP 1                              
calc1.channels.K.input_value        sky:userCalc1.K    0.0                            
calc1.channels.L.input_pv           sky:userCalc1.INLN                                
calc1.channels.L.input_trigger      sky:userCalc1.INLP 1                              
calc1.channels.L.input_value        sky:userCalc1.L    0.0                            
calc1.description                   sky:userCalc1.DESC noisy Lorentzian curve         
calc1.device_type                   sky:userCalc1.DTYP 0                              
calc1.disable_alarm_severity        sky:userCalc1.DISS 0                              
calc1.disable_value                 sky:userCalc1.DISV 0                              
calc1.event_to_issue                sky:userCalc1.OEVT 0                              
calc1.forward_link                  sky:userCalc1.FLNK 0                              
calc1.high_operating_range          sky:userCalc1.HOPR 0.0                            
calc1.low_operating_range           sky:userCalc1.LOPR 0.0                            
calc1.new_alarm_severity            sky:userCalc1.NSEV 0                              
calc1.new_alarm_status              sky:userCalc1.NSTA 0                              
calc1.output_data_option            sky:userCalc1.DOPT 0                              
calc1.output_execute_option         sky:userCalc1.OOPT 0                              
calc1.output_execution_delay        sky:userCalc1.ODLY 0.0                            
calc1.output_link_pv                sky:userCalc1.OUTN                                
calc1.output_location_data          sky:userCalc1.DOLD 0.0                            
calc1.output_location_name          sky:userCalc1.DOLN                                
calc1.precision                     sky:userCalc1.PREC 5                              
calc1.process_record                sky:userCalc1.PROC 0                              
calc1.processing_active             sky:userCalc1.PACT 0                              
calc1.scan_disable_input_link_value sky:userCalc1.DISA 1                              
calc1.scan_disable_value_input_link sky:userCalc1.SDIS sky:userCalcEnable.VAL CA MS   
calc1.scanning_rate                 sky:userCalc1.SCAN 2                              
calc1.trace_processing              sky:userCalc1.TPRO 0                              
=================================== ================== ===============================

Out[4]: <pyRestTable.rest_table.Table at 0x7fb06eb72310>

@prjemian
Copy link
Contributor Author

The implementation at 8-ID-I only reports instances of EpicsSignal:

In [12]: class MyDevice(Device): 
    ...:     price = Component(Signal, value="not available") 
    ...:                                                                                                                                    

In [13]: ticker = MyDevice(name="ticker")                                                                                                   

In [14]: object_explorer(ticker)                                                                                                            
==== ============ =====
name PV reference value
==== ============ =====
==== ============ =====

Out[14]: <pyRestTable.rest_table.Table at 0x7fb06e192b90>

That could be changed.

prjemian added a commit that referenced this issue Feb 15, 2020
@prjemian
Copy link
Contributor Author

prjemian commented Feb 15, 2020

needs:

  • unit tests
  • connect into package documentation

prjemian added a commit that referenced this issue Feb 15, 2020
prjemian added a commit that referenced this issue Feb 15, 2020
prjemian added a commit that referenced this issue Feb 15, 2020
prjemian added a commit that referenced this issue Feb 15, 2020
prjemian added a commit that referenced this issue Feb 15, 2020
prjemian added a commit that referenced this issue Feb 15, 2020
prjemian added a commit that referenced this issue Feb 17, 2020
prjemian added a commit that referenced this issue Feb 17, 2020
prjemian added a commit that referenced this issue Feb 17, 2020
prjemian added a commit that referenced this issue Feb 17, 2020
@prjemian
Copy link
Contributor Author

With unit tests (per #288 (comment)), this issue can be closed.

@prjemian
Copy link
Contributor Author

unit tests for this function must wait for #235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant