예제 #1
0
def run_evt_script(lev="Lev1"):
    """
    extract sib data from acis event  data
    input: lev  --- lev of the data to be processed; either "Lev1" or "Lev2"
    output: extracted data in Outdir/
    """
    #
    #--- find today's date information (in local time)
    #
    tlist = time.localtime()

    eyear = tlist[0]
    emon = tlist[1]
    eday = tlist[2]
    #
    #--- if today is before the 5th day of the month, complete the last month
    #
    if eday <= 4:
        eday = 1
        syear = eyear
        smon = emon - 1
        if smon < 1:
            syear -= 1
            smon = 12
    else:
        syear = eyear
        smon = emon
#
#--- find the last date of the previous data analyzed
#
    sday = find_prev_date(smon, lev)
    #
    #--- now convert the date format
    #
    lemon = mcf.add_leading_zero(emon)
    leday = mcf.add_leading_zero(eday)
    stop = str(eyear) + '-' + lemon + '-' + leday + 'T00:00:00'

    lsmon = mcf.add_leading_zero(smon)
    lsday = mcf.add_leading_zero(sday)
    start = str(syear) + '-' + lsmon + '-' + lsday + 'T00:00:00'
    #
    #--- extract obsid list for the period
    #
    xxx = 999
    if xxx == 999:
        #try:
        scf.find_observation(start, stop, lev=lev)
        #
        #---  run the main script
        #
        process_evt(lev)
예제 #2
0
def run_evt_script(lev="Lev1"):
    """
    extract sib data from acis event  data
    input: lev  --- lev of the data to be processed; either "Lev1" or "Lev2"
    output: extracted data in Outdir/
    """
    #
    #--- find today's date information (in local time)
    #
    tlist = time.localtime()

    eyear = tlist[0]
    emon = tlist[1]
    eday = tlist[2]
    #
    #--- if today is before the 5th day of the month, complete the last month
    #
    if eday <= 4:
        eday = 1
        syear = eyear
        smon = emon - 1
        if smon < 1:
            syear -= 1
            smon = 12
    else:
        syear = eyear
        smon = emon
#
#--- find the last date of the previous data anlyzed
#
    sday = find_prev_date(smon, lev)
    #
    #--- now convert the date format
    #
    temp = str(eyear)
    leyear = temp[2] + temp[3]
    lemon = str(emon)
    if emon < 10:
        lemon = '0' + lemon
    leday = str(eday)
    if eday < 10:
        leday = '0' + leday

    #stop = lemon + '/' + leday + '/'  + leyear + ',00:00:00'
    stop = temp + '-' + lemon + '-' + leday + 'T00:00:00'

    temp = str(syear)
    lsyear = temp[2] + temp[3]
    lsmon = str(smon)
    if smon < 10:
        lsmon = '0' + lsmon
    lsday = str(sday)
    if int(float(sday)) < 10:
        lsday = '0' + lsday

    #start = lsmon + '/' + lsday + '/' + lsyear + ',00:00:00'
    start = temp + '-' + lsmon + '-' + lsday + 'T00:00:00'

    #
    #--- extract obsid list for the period
    #
    try:
        scf.find_observation(start, stop, lev=lev)
        #
        #---  run the main script
        #
        process_evt(lev)
    except:
        pass
예제 #3
0
def run_evt_script(lev="Lev1"):
    """
    extract sib data from acis event  data
    input: lev  --- lev of the data to be processed; either "Lev1" or "Lev2"
    output: extracted data in Outdir/
    """
#
#--- find today's date information (in local time)
#
    tlist = time.localtime()

    eyear  = tlist[0]
    emon   = tlist[1]
    eday   = tlist[2]
#
#--- if today is before the 5th day of the month, complete the last month
#
    if eday < 3:
        eday = 1
        syear = eyear
        smon  = emon -1
        if smon < 1:
            syear -= 1
            smon   = 12
    else:
        syear = eyear
        smon  = emon
#
#--- find the last date of the previous data anlyzed
#
    sday   = find_prev_date(smon, lev)
#
#--- now convert the date format 
#
    temp   = str(eyear)
    leyear = temp[2] + temp[3]
    lemon  = str(emon)
    if emon < 10:
        lemon = '0' + lemon
    leday  = str(eday)
    if eday < 10:
        leday = '0' + leday

    #stop = lemon + '/' + leday + '/'  + leyear + ',00:00:00'
    stop = temp + '-' +  lemon + '-' + leday + 'T00:00:00'


    temp   = str(syear)
    lsyear = temp[2] + temp[3]
    lsmon  = str(smon)
    if smon < 10:
        lsmon = '0' + lsmon
    lsday  = str(sday)
    if int(float(sday)) < 10:
        lsday = '0' + lsday

    #start = lsmon + '/' + lsday + '/' + lsyear + ',00:00:00'
    start = temp + '-' + lsmon + '-' + lsday + 'T00:00:00'

#
#--- extract obsid list for the period
#
    try:
        scf.find_observation(start, stop, lev=lev)
#
#---  run the main script
#
        process_evt(lev)
    except:
        pass