当前位置: 首页>>代码示例>>Python>>正文


Python DataQualityFlag.query方法代码示例

本文整理汇总了Python中gwpy.segments.DataQualityFlag.query方法的典型用法代码示例。如果您正苦于以下问题:Python DataQualityFlag.query方法的具体用法?Python DataQualityFlag.query怎么用?Python DataQualityFlag.query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gwpy.segments.DataQualityFlag的用法示例。


在下文中一共展示了DataQualityFlag.query方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: check_flag

# 需要导入模块: from gwpy.segments import DataQualityFlag [as 别名]
# 或者: from gwpy.segments.DataQualityFlag import query [as 别名]
def check_flag(flag, gpstime, duration, pad):
    """Check that a state flag is active during an entire analysis segment

    Parameters
    ----------
    flag : `str`
        state flag to check

    gpstime : `float`
        GPS time of required data

    duration : `float`
        duration (in seconds) of required data

    pad : `float`
        amount of extra data to read in at the start and end for filtering

    Returns
    -------
    check : `bool`
        Boolean switch to pass (`True`) or fail (`False`) depending on whether
        the given flag is active
    """
    # set GPS start and end time
    start = gpstime - duration/2. - pad
    end = gpstime + duration/2. + pad
    seg = Segment(start, end)
    # query for state segments
    active = DataQualityFlag.query(flag, start, end,
                                   url=DEFAULT_SEGMENT_SERVER).active
    # check that state flag is active during the entire analysis
    if (not active.intersects_segment(seg)) or (abs(active[0]) < abs(seg)):
        return False
    return True
开发者ID:ligovirgo,项目名称:gwdetchar,代码行数:36,代码来源:datafind.py

示例2: query_state_segments

# 需要导入模块: from gwpy.segments import DataQualityFlag [as 别名]
# 或者: from gwpy.segments.DataQualityFlag import query [as 别名]
def query_state_segments(flag, start, end, url=DEFAULT_SEGMENT_SERVER,
                         pad=(0, 0)):
    """Query a segment database for active segments associated with a flag
    """
    # NOTE: DQF.pad pads forward in time at end
    return DataQualityFlag.query(
        flag, start-pad[0], end+pad[1], url=url,
    ).coalesce().pad(pad[0], -pad[1]).active
开发者ID:ligovirgo,项目名称:pyomicron,代码行数:10,代码来源:segments.py

示例3: query

# 需要导入模块: from gwpy.segments import DataQualityFlag [as 别名]
# 或者: from gwpy.segments.DataQualityFlag import query [as 别名]
def query(flag, start, end, url=DEFAULT_SEGMENT_SERVER):
    """Query a segment database for active segments associated with a flag
    """
    return DataQualityFlag.query(flag, start, end, url=url)
开发者ID:duncanmmacleod,项目名称:hveto,代码行数:6,代码来源:segments.py

示例4: get_triggers

# 需要导入模块: from gwpy.segments import DataQualityFlag [as 别名]
# 或者: from gwpy.segments.DataQualityFlag import query [as 别名]
def get_triggers():

    # Obtain segments that are analysis ready
    analysis_ready = DataQualityFlag.query('{0}:DMT-ANALYSIS_READY:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)

    # Display segments for which this flag is true
    print "Segments for which the ANALYSIS READY Flag is active: {0}".format(analysis_ready.active)

    if opts.applyallDQ:
        print("We are finding all previously created DQ cuts")
        # Obtain segments of all DQ cuts if requested DQ list can be found
        # https://code.pycbc.phy.syr.edu/detchar/veto-definitions/blob/master/burst/O1/H1L1-HOFT_C02_O1_BURST.xml
        # First obtain those flags that are for both H1 and L1
        O1_MISSING_HOFT_C02 = DataQualityFlag.query('{0}:DCS-MISSING_{0}_HOFT_C02:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
        O1_ETMY_ESD_DAC_OVERFLOW = DataQualityFlag.query('{0}:DMT-ETMY_ESD_DAC_OVERFLOW:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
        O1_OMC_DCPD_A_SATURATION = DataQualityFlag.query('{0}:DCH-OMC_DCPD_A_SATURATION:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
        O1_OMC_DCPD_ADC_OVERFLOW = DataQualityFlag.query('{0}:DMT-OMC_DCPD_ADC_OVERFLOW:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
        O1_ETMY_SATURATION_SNR200 = DataQualityFlag.query('{0}:DCH-ETMY_SATURATION_SNR200:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
        O1_CW_INJECTION_TRANSITION = DataQualityFlag.query('{0}:DCH-CW_INJECTION_TRANSITION:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
        O1_BAD_KAPPA_BASIC_CUT_HOFT_C02 = DataQualityFlag.query('{0}:DCS-BAD_KAPPA_BASIC_CUT_{0}_HOFT_C02:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
        O1_PARTIAL_FRAME_LOSS_HOFT_C02 = DataQualityFlag.query('{0}:DCS-PARTIAL_FRAME_LOSS_{0}_HOFT_C02:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)

        # Obtain detector specific flags
        if opts.detector == "H1":
            O1_RF45_AM_STABILIZATION = DataQualityFlag.query('{0}:DCH-RF45_AM_STABILIZATION:4'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
            O1_ETMY_SATURATION = DataQualityFlag.query('{0}:DCH-ETMY_SATURATION:2'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
            O1_BAD_DATA_BEFORE_LOCKLOSS = DataQualityFlag.query('{0}:DCH-BAD_DATA_BEFORE_LOCKLOSS:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
            O1_ETMY_VIOLIN_MODE_2NDHARMONIC_RINGING = DataQualityFlag.query('{0}:DCH-ETMY_VIOLIN_MODE_2NDHARMONIC_RINGING:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
            O1_RF45_SEVERE_GLITCHING = DataQualityFlag.query('{0}:DCH-RF45_SEVERE_GLITCHING:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
            O1_EY_BECKHOFF_CHASSIS_PROBLEM = DataQualityFlag.query('{0}:DCH-EY_BECKHOFF_CHASSIS_PROBLEM:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
            O1_ASC_AS_B_RF36_GLITCHING = DataQualityFlag.query('{0}:DCH-ASC_AS_B_RF36_GLITCHING:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
            O1_BAD_STRAIN_HOFT_C02 = DataQualityFlag.query('{0}:DCS-BAD_STRAIN_{0}_HOFT_C02:2'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
            O1_TOGGLING_BAD_KAPPA_HOFT_C02= DataQualityFlag.query('{0}:DCS-TOGGLING_BAD_KAPPA_{0}_HOFT_C02:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
        else:
            O1_ETMY_SATURATION = DataQualityFlag.query('{0}:DCH-ETMY_SATURATION:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
            O1_BAD_DATA_BEFORE_LOCKLOSS = DataQualityFlag.query('{0}:DCH-BAD_DATA_BEFORE_LOCKLOSS:2'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
            O1_PCAL_GLITCHES_GT_20P = DataQualityFlag.query('{0}:DCH-PCAL_GLITCHES_GT_20P:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
            O1_SUDDEN_PSD_CHANGE = DataQualityFlag.query('{0}:DCH-SUDDEN_PSD_CHANGE:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
            O1_BAD_VCO_OFFSET = DataQualityFlag.query('{0}:DCH-BAD_VCO_OFFSET:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)
            O1_SEVERE_60_200_HZ_NOISE = DataQualityFlag.query('{0}:DCH-SEVERE_60_200_HZ_NOISE:1'.format(opts.detector),opts.gpsStart,opts.gpsEnd)

    # Fetch raw omicron triggers and apply filter which is defined in a function above.
    omicrontriggers = SnglBurstTable.fetch(detchannelname,'Omicron',\
    opts.gpsStart,opts.gpsEnd,filt=threshold)

    print "List of available metadata information for a given glitch provided by omicron: {0}".format(omicrontriggers.columnnames)

    print "Number of triggers after SNR and Freq cuts but before ANALYSIS READY flag filtering: {0}".format(len(omicrontriggers))

    # Filter the raw omicron triggers against the ANALYSIS READY flag.
    omicrontriggers = omicrontriggers.vetoed(analysis_ready.active)
    # If requested filter out DQ flags
    if opts.applyallDQ:
        print("We are applying all previously created DQ cuts")
        # Obtain segments of all DQ cuts if requested DQ list can be found
        # https://code.pycbc.phy.syr.edu/detchar/veto-definitions/blob/master/burst/O1/H1L1-HOFT_C02_O1_BURST.xml
        # First obtain those flags that are for both H1 and L1
        omicrontriggers = omicrontriggers.veto(O1_MISSING_HOFT_C02.active)
        omicrontriggers = omicrontriggers.veto(O1_ETMY_ESD_DAC_OVERFLOW.active)
        omicrontriggers = omicrontriggers.veto(O1_OMC_DCPD_A_SATURATION.active)
        omicrontriggers = omicrontriggers.veto(O1_OMC_DCPD_ADC_OVERFLOW.active)
        omicrontriggers = omicrontriggers.veto(O1_ETMY_SATURATION_SNR200.active)
        omicrontriggers = omicrontriggers.veto(O1_CW_INJECTION_TRANSITION.active)
        omicrontriggers = omicrontriggers.veto(O1_BAD_KAPPA_BASIC_CUT_HOFT_C02.active)
        omicrontriggers = omicrontriggers.veto(O1_PARTIAL_FRAME_LOSS_HOFT_C02.active)

        # Obtain detector specific flags
        if opts.detector == "H1":
            omicrontriggers = omicrontriggers.veto(O1_RF45_AM_STABILIZATION.active)
            omicrontriggers = omicrontriggers.veto(O1_ETMY_SATURATION.active)
            omicrontriggers = omicrontriggers.veto(O1_BAD_DATA_BEFORE_LOCKLOSS.active)
            omicrontriggers = omicrontriggers.veto(O1_ETMY_VIOLIN_MODE_2NDHARMONIC_RINGING.active)
            omicrontriggers = omicrontriggers.veto(O1_RF45_SEVERE_GLITCHING.active)
            omicrontriggers = omicrontriggers.veto(O1_EY_BECKHOFF_CHASSIS_PROBLEM.active)
            omicrontriggers = omicrontriggers.veto(O1_ASC_AS_B_RF36_GLITCHING.active)
            omicrontriggers = omicrontriggers.veto(O1_BAD_STRAIN_HOFT_C02.active)
            omicrontriggers = omicrontriggers.veto(O1_TOGGLING_BAD_KAPPA_HOFT_C02.active)
        else:
            omicrontriggers = omicrontriggers.veto(O1_ETMY_SATURATION.active)
            omicrontriggers = omicrontriggers.veto(O1_BAD_DATA_BEFORE_LOCKLOSS.active)
            omicrontriggers = omicrontriggers.veto(O1_PCAL_GLITCHES_GT_20P.active)
            omicrontriggers = omicrontriggers.veto(O1_SUDDEN_PSD_CHANGE.active)
            omicrontriggers = omicrontriggers.veto(O1_BAD_VCO_OFFSET.active)
            omicrontriggers = omicrontriggers.veto(O1_SEVERE_60_200_HZ_NOISE.active)
        


    print "Final trigger length: {0}".format(len(omicrontriggers))

    return omicrontriggers
开发者ID:mzevin1,项目名称:GravitySpy,代码行数:92,代码来源:gettriggers.py

示例5: query

# 需要导入模块: from gwpy.segments import DataQualityFlag [as 别名]
# 或者: from gwpy.segments.DataQualityFlag import query [as 别名]
def query(flag, start, end, url='https://segments.ligo.org'):
    """Query a segment database for active segments associated with a flag
    """
    return DataQualityFlag.query(flag, start, end, url=url)
开发者ID:andrew-lundgren,项目名称:hveto,代码行数:6,代码来源:segments.py


注:本文中的gwpy.segments.DataQualityFlag.query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。