"""
Relabels for the MEX1 data.
"""

RELABELS = {
    # -------------------MDA File-------------------
    # 'MEX1SSCAN01:saveData_comment1':,
    # 'MEX1SSCAN01:saveData_comment2':,
    # 'MEX1SSCAN01:saveData_realTime1D':,
    # 'MEX1SSCAN01:saveData_fileSystem':,
    # 'MEX1SSCAN01:saveData_subDir':,
    # 'MEX1SSCAN01:saveData_fileName':,
    # 'MEX1SSCAN01:scan1.P1SM':,
    # 'MEX1SSCAN01:scan1.P2SM':,
    # 'MEX1SSCAN01:scan1.P3SM':,
    # 'MEX1SSCAN01:scan1.P4SM':,
    # 'MEX1SSCAN01:scanTypeSpec':,
    # 'MEX1SSCAN01:scan1.BSPV':,
    # 'MEX1SSCAN01:scan1.BSCD':,
    # 'MEX1SSCAN01:scan1.BSWAIT':,
    # 'MEX1SSCAN01:scan1.ASPV':,
    # 'MEX1SSCAN01:scan1.ASCD':,
    # 'MEX1SSCAN01:scan1.ASWAIT':,
    # 'MEX1SSCAN01:scan1.PDLY':,
    # 'MEX1SSCAN01:scan1.DDLY':,
    # 'TS01:SECONDS_MONITOR':,
    # 'MEX1ES01GLU01:MEX_TIME':,
    # 'MEX1SLT01:VSIZE.RBV':,
    # 'MEX1SLT01:VCENTRE.RBV':,
    # 'MEX1SLT01:HSIZE.RBV':,
    # 'MEX1SLT01:HCENTRE.RBV':,
    # 'MEX1SLT01:VSIZE.OFF':,
    # 'MEX1SLT01:VCENTRE.OFF':,
    # 'MEX1SLT01:HSIZE.OFF':,
    # 'MEX1SLT01:HCENTRE.OFF':,
    # 'MEX1SLT01MOT01.RBV':,
    # 'MEX1SLT01MOT03.RBV':,
    # 'MEX1SLT01MOT02.RBV':,
    # 'MEX1SLT01MOT04.RBV':,
    # 'MEX1SCRN01LGHT01:BRIGHTNESS_MONITOR':,
    # 'MEX1SCRN01ACTP01:INSERT_WITHDRAW_STATUS':,
    # 'MEX1MIR01:POSITIONER:select.RVAL':,
    # 'MEX1MIR01:TRANS.RBV':,
    # 'MEX1MIR01:YAW.RBV':,
    # 'MEX1MIR01MOT06.RBV':,
    # 'MEX1MIR01:HEIGHT.RBV':,
    # 'MEX1MIR01:ROLL.RBV':,
    # 'MEX1MIR01:PITCH.RBV':,
    # 'MEX1MIR01MOT01.RBV':,
    # 'MEX1MIR01MOT02.RBV':,
    # 'MEX1MIR01MOT03.RBV':,
    # 'MEX1MIR01MOT04.RBV':,
    # 'MEX1MIR01MOT05.RBV':,
    # 'MEX1DCM01:ENERGY_RBV':,
    # 'MEX1DCM01:ENERGY_EV_RBV':,
    # 'MEX1DCM01:OFFSET_RBV':,
    # 'MEX1DCM01:XTAL_INBEAM.RVAL':,
    # 'MEX1DCM01:FINE_PITCH_MRAD_RBV':,
    # 'MEX1DCM01:FINE_ROLL_MRAD_RBV':,
    # 'MEX1DCM01MOT01.RBV':,
    # 'MEX1DCM01MOT02.RBV':,
    # 'MEX1DCM01MOT05.RBV':,
    # 'MEX1DCM01MOT03.RBV':,
    # 'MEX1DCM01MOT04.RBV':,
    # 'MEX1DCM01MOT01.OFF':,
    # 'MEX1DCM01MOT02.OFF':,
    # 'MEX1DCM01:y2_track':,
    # 'MEX1DCM01:y2_mvmin':,
    # 'MEX1DCM01:th_mvmin':,
    # 'MEX1DCM01:Dspace':,
    # 'MEX1DCM01:Mono1110DSpace':,
    # 'MEX1DCM01:Mono1110ThetaOffset':,
    # 'MEX1DCM01:Mono1110HeightOffset':,
    # 'MEX1DCM01:Mono1110Pitch':,
    # 'MEX1DCM01:Mono1110Roll':,
    # 'MEX1DCM01:Mono1110Centre':,
    # 'MEX1DCM01:Mono11130DSpace':,
    # 'MEX1DCM01:Mono11130ThetaOffset':,
    # 'MEX1DCM01:Mono11130HeightOffset':,
    # 'MEX1DCM01:Mono11130Pitch':,
    # 'MEX1DCM01:Mono11130Roll':,
    # 'MEX1DCM01:Mono11130Centre':,
    "MEX1ES01DET01:MCA1:ArrayData": "MCA Ch1",
    "MEX1ES01DET01:MCA2:ArrayData": "MCA Ch2",
    "MEX1ES01DET01:MCA3:ArrayData": "MCA Ch3",
    "MEX1ES01DET01:MCA4:ArrayData": "MCA Ch4",
    # -------------------XDI File-------------------
    # 'Facility.name':,
    # 'Beamline.name':,
    # 'Mono.d_spacing':,
    # 'Element.symbol':,
    # 'Element.edge':,
    # 'Processing.version':,
    # 'Reference.Element':,
    # 'ROI.start_bin':,
    # 'ROI.end_bin':,
    # 'File.Name':,
    "MEX1ES01ZEB01:CALC_ENERGY_EV": "energy",
    "MEX1ES01ZEB01:BRAGG_WITH_OFFSET": "bragg",
    "SR11BCM01:CURRENT_MONITOR": "ring_current",
    "MEX1ES01ZEB01:GATE_TIME_SET": "count_time",
    "MEX1ES01DAQ01:ch1:S:MeanValue_RBV": "i0",
    "MEX1ES01DAQ01:ch2:S:MeanValue_RBV": "i1",
    "MEX1ES01DAQ01:ch3:S:MeanValue_RBV": "i2",
    "MEX1ES01DET01:C1SCA:0:Value_RBV": "S1_clock_ticks",
    "MEX1ES01DET01:C2SCA:0:Value_RBV": "S2_clock_ticks",
    "MEX1ES01DET01:C3SCA:0:Value_RBV": "S3_clock_ticks",
    "MEX1ES01DET01:C4SCA:0:Value_RBV": "S4_clock_ticks",
    "MEX1ES01DET01:C1SCA:5:Value_RBV": "S1_window1",
    "MEX1ES01DET01:C2SCA:5:Value_RBV": "S2_window1",
    "MEX1ES01DET01:C3SCA:5:Value_RBV": "S3_window1",
    "MEX1ES01DET01:C4SCA:5:Value_RBV": "S4_window1",
    "MEX1ES01DET01:C1SCA:8:Value_RBV": "S1_DTFactor",
    "MEX1ES01DET01:C2SCA:8:Value_RBV": "S2_DTFactor",
    "MEX1ES01DET01:C3SCA:8:Value_RBV": "S3_DTFactor",
    "MEX1ES01DET01:C4SCA:8:Value_RBV": "S4_DTFactor",
    "S1_real_time - S1_clock_ticks / 80MHz (clock rate xspress3 mini)": "S1_real_time (clock_ticks / 80MHz)",
    "S2_real_time - S2_clock_ticks / 80MHz (clock rate xspress3 mini)": "S2_real_time",
    "S3_real_time - S3_clock_ticks / 80MHz (clock rate xspress3 mini)": "S3_real_time",
    "S4_real_time - S4_clock_ticks / 80MHz (clock rate xspress3 mini)": "S4_real_time",
    "S1_ifluor - S1_window1 * S1_DTFactor / S1_real_time": "S1_ifluor (window * dead_time / real_time)",
    "S2_ifluor - S2_window1 * S2_DTFactor / S2_real_time": "S2_ifluor",
    "S3_ifluor - S3_window1 * S3_DTFactor / S3_real_time": "S3_ifluor",
    "S4_ifluor - S4_window1 * S4_DTFactor / S4_real_time": "S4_ifluor",
    "avg_ifluor - (ifluor_S1 + ifluor_S2 + ifluor_S3 + ifluor_S4)/4 -- deadtime correction and time normalisation per sensor": "ifluor_avg_corr",
    "S1_mufluor - S1_ifluor / i0": "S1_mufluor (normalised by i0)",
    "S2_mufluor - S2_ifluor / i0": "S2_mufluor",
    "S3_mufluor - S3_ifluor / i0": "S3_mufluor",
    "S4_mufluor - S4_ifluor / i0": "S4_mufluor",
    "avg_mufluor - ifluor_avg_corr / i0 -- deadtime correction and time normalisation per sensor, normalised by i0": "mufluor_avg_corr",
}
