NSLS-II-CSX / profile_collection

BSD 3-Clause "New" or "Revised" License
0 stars 5 forks source link

implement standard AD PV in metadata?? What does DAMA recommend #31

Open ambarb opened 4 years ago

ambarb commented 4 years ago

Frame type is not used. Instead we have, for the dark images, created custom md keys for the start document. Maybe this is not needed if we use FrameType and the existing md key 'fccd_cam_fcric_gain', which is in the descriptors document.

[xf23id1@xf23id-ws3 ~]$ caget -d24 XF:23ID1-ES{FCCD}cam1:FrameType
Options t,d,a are mutually exclusive. ('caget -h' for help.)
XF:23ID1-ES{FCCD}cam1:FrameType
    Native data type: DBF_ENUM
    Request type:     DBR_GR_ENUM
    Element count:    1
    Value:            Normal
    Status:           NO_ALARM
    Severity:         NO_ALARM
    Enums:            ( 4)
                      [ 0] Normal
                      [ 1] Background
                      [ 2] FlatField
                      [ 3] DblCorrelation

@johnsinsheimer do you have any idea what DblCorrelation is?

ambarb commented 3 years ago

@stuwilkins do you know DblCorrelation should be of the top of your head?

stuwilkins commented 3 years ago

@ambarb as far as I know, this whole PV is not used by this driver, so I have no idea what DblCorrelation is ... I would just ignore this.

ambarb commented 3 years ago

The reason why I am asking is we can use this to label "intent" from the IOC level by using Bluesky plans appropriately instead of randomly labeling the intent of the data in 5000 different ways with 5000 unique field or key names

johnsinsheimer commented 3 years ago

I don't think this PV has any default behavior, and needs to given a function by the driver. For another detector, the MarCCD for example, this PV does have a use defined in the driver, but it does not for the ADFastCCD driver.

But the PV itself is part of ADCore or ADBase, and is of type mbbo. mbbo has fields with indexes, 0-15 and can have strings associated each index.

record(mbbo, "$(P)$(R)FrameType")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))FRAME_TYPE")
   field(ZRST, "Normal")
   field(ZRVL, "0")
   field(ONST, "Background")
   field(ONVL, "1")
   field(TWST, "FlatField")
   field(TWVL, "2")
   field(THST, "DblCorrelation")
   field(THVL, "3")
   field(VAL,  "0")
   info(autosaveFields, "VAL")
}

Are you looking to define a PV to store additional meta data? the strings in mbbo might be limited to 16 characters. You could make a new PV stringout, but that is limited to 40 characters. Or an array could be used for longer strings.

ambarb commented 3 years ago

possibly. we have plans for counting darks so it would be easy to either use the default settings found here or make customized strings as you indicate. we should also make a flatfield plan and can consider how to do this. the alternative is to fully commit to the bluesky dark frames model and also develop a similar model for flat field results that bluesky would "calculate" and then write as part of the data. If users want to customize later, they still can.

https://github.com/NSLS-II-CSX/csxtools/issues/55 what we decide to do affects csxtools.

and also there is a better explanation of dark frames here NSLS-II-CSX/xf23id1_profiles#32