[INSTRM-976] Provide functional requirement and use cases of the opDB standard library from the viewpoint of SpS actors Created: 11/May/20  Updated: 10/Nov/20  Resolved: 10/Nov/20

Status: Done
Project: Instrument control development
Component/s: spt_operational_database
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Normal
Reporter: Kiyoto Yabe Assignee: arnaud.lefur
Resolution: Done Votes: 0
Labels: opDB
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks INSTRM-735 Establish a library for database inte... Done

 Description   

Description: As we discussed in previous ICS/MCS-PFI telecon, I will collect the functional requirements and possible use cases in each site of software development to figure out what kind of function we need in the standard library to access opDB and how we should generalized it. Please provide a list of your required function for this library and example of major use cases from the view point of SpS actors.
 
Below are possible examples for MCS/PFI-related tables: *
 insert (pandas/numpy/…) array of measured data into `mcs_data`

  •  get information from `cobra_geometry`

  •  get target information joining `cobra_status`, `pfs_config_fiber`, and `target`

  • ...

 
If you can provide any performance requirements (speed/stability/…), that would be great.
 
I will compile the requirements and update the proposal of the standard library:
https://sumire.pbworks.com/w/file/fetch/139861650/PFS-DAT-IPM003007-01_opdb_proposal_library.pdf



 Comments   
Comment by arnaud.lefur [ 11/May/20 ]

here's the usecases from spsActor :

opDB.insert('sps_visit', pfs_visit_id=visit, exp_type=self.exptype)
opDB.insert('sps_exposure', pfs_visit_id=visit, sps_camera_id=camera_id, exptime=self.exptime,
            time_exp_start=self.time_exp_start, time_exp_end=self.time_exp_end)

here's the usecases from iicActor:

opDB.insert('sps_sequence', visit_set_id=self.visit_set_id, sequence_type=self.seqtype, name=self.name,
            comments=self.comments, cmd_str=self.rawCmd, status=self.status)
opDB.insert('visit_set', pfs_visit_id=visit, visit_set_id=self.visit_set_id)

visit_set_id, = opDB.fetchone('select max(visit_set_id) from sps_sequence')

There are not much entries, I don't think there are strong performance requirements.

Comment by Kiyoto Yabe [ 13/May/20 ]

Thank you for your feedback!

Comment by arnaud.lefur [ 27/May/20 ]

Kiyoto Yabe a few other usecases from our data acquisition GUI:

 

visits = opDB.fetchall(f'select pfs_visit_id from visit_set where visit_set_id={visit_set_id}')

exposures = opDB.fetchall(f'select sps_exposure.pfs_visit_id,exp_type,sps_module_id,arm,sps_exposure.sps_camera_id from sps_exposure inner join sps_visit on sps_exposure.pfs_visit_id=sps_visit.pfs_visit_id inner join sps_camera on sps_exposure.sps_camera_id = sps_camera.sps_camera_id where sps_exposure.pfs_visit_id={visit}')

dataFlag, notes = opDB.fetchone(f'select data_flag, notes from sps_annotation where pfs_visit_id={exp.visit} and sps_camera_id={exp.camId}')

opDB.insert('sps_annotation', data_flat=data_flat, notes=notes)

 

 

Generated at Sat Feb 10 16:30:36 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.