示例#1
0
def main():
    sys.setrecursionlimit(5000)

    CEGraph = nx.DiGraph()
    prunedGraph = nx.DiGraph()
    MCCList = []
    MCSList = []
    MCSMCCNodesList = []
    allMCSsList = []
    allCETRMMList = []
    
    # For GrADs
    subprocess.call('export DISPLAY=:0.0', shell=True)

    # For first time working with the raw MERG zipped files
    # rawMERG = "/directory/to/the/raw/MERGfiles"
    # utils.preprocessing_merg(rawMERG)
    # ---------------------------------------------------------------------------------
    # ---------------------------------- user inputs --------------------------------------
    userVariables = variables.UserVariables(useJSON=False)
    graphVariables = variables.define_graph_variables()
    # ---------------------------------- end user inputs --------------------------------------
    
    # Create main directory and file structure for storing intel
    userVariables.DIRS['mainDirStr'] = iomethods.create_main_directory(userVariables.DIRS['mainDirStr'])
    TRMMCEdirName = userVariables.DIRS['mainDirStr']+'/TRMMnetcdfCEs'
    CEdirName = userVariables.DIRS['mainDirStr']+'/MERGnetcdfCEs'

    # -------------------------------------------------------------------------------------------------
    # Getting started. Make it so number one!
    print ("-"*80)
    print "\t\t Starting the MCCSearch Analysis "
    print ("-"*80)
    print "\n -------------- Reading MERG Data ----------"
    mergImgs, timeList, LAT, LON, userVariables = iomethods.read_data('ch4', 'latitude', 'longitude', userVariables)
    print "\n -------------- findCloudElements ----------"
    CEGraph, _ = mccSearch.find_cloud_elements(mergImgs, timeList, LAT, LON, userVariables, graphVariables, userVariables.DIRS['TRMMdirName'])
    # theList = CEGraph.successors(node)
    # If the TRMMdirName wasnt entered for whatever reason, you can still get the TRMM data this way
    # CEGraph = mccSearch.findCloudElements(mergImgs,timeList)
    # allCETRMMList=mccSearch.findPrecipRate(DIRS['TRMMdirName'],timeList)
    # ----------------------------------------------------------------------------------------------
    print "\n -------------- findCloudClusters ----------"
    prunedGraph = mccSearch.find_cloud_clusters(CEGraph, userVariables, graphVariables)
    print "\n -------------- findMCCs ----------"
    MCCList, MCSList = mccSearch.find_MCC(prunedGraph, userVariables, graphVariables)
    # Now ready to perform various calculations/metrics
    print ("-"*80)
    print "\n -------------- METRICS ----------"
    print ("-"*80)
    # Some calculations/metrics that work that work
    print "creating the MCC userfile ", metrics.create_text_file(MCCList, 1, userVariables, graphVariables)
    print "creating the MCS userfile ", metrics.create_text_file(MCSList, 2, userVariables, graphVariables)
    plot_menu(MCCList, MCSList, userVariables.DIRS)

    # Let's get outta here! Engage!
    print ("-"*80)
def main():
    sys.setrecursionlimit(5000)

    CEGraph = nx.DiGraph()
    prunedGraph = nx.DiGraph()
    MCCList = []
    MCSList = []
    MCSMCCNodesList = []
    allMCSsList = []
    allCETRMMList = []
    DIRS = {}

    # For GrADs
    subprocess.call('export DISPLAY=:0.0', shell=True)

    userVariables = variables.define_user_variables(useJSON=True)
    graphVariables = variables.define_graph_variables()

    # Create main directory and file structure for storing intel
    userVariables.DIRS['mainDirStr'] = iomethods.create_main_directory(userVariables.DIRS['mainDirStr'])
    TRMMCEdirName = userVariables.DIRS['mainDirStr']+'/TRMMnetcdfCEs'
    CEdirName = userVariables.DIRS['mainDirStr']+'/MERGnetcdfCEs'
    
    # Let's go!
    # ----------------------------------CORE GTG STEPS------------------------------------------------
    print "\n -------------- Read MERG Data ----------"
    mergImgs, timeList, LAT, LON, userVariables = iomethods.read_data('ch4', 'latitude', 'longitude', userVariables)
    print ("-"*80)
    print "\n -------------- TESTING findCloudElements ----------"
    CEGraph, _ = mccSearch.find_cloud_elements(mergImgs, timeList, LAT, LON, userVariables, graphVariables, userVariables.DIRS['TRMMdirName'])
    # #********* OR *******
    # CEGraph = mccSearch.find_cloud_elements(mergImgs,timeList,LAT, LON, userVariables, graphVariables)
    # allCETRMMList = mccSearch.find_precip_rate(userVariables.DIRS['TRMMdirName'],timeList)
    # #********************
    print ("-"*80)
    print "number of nodes in CEGraph is: ", CEGraph.number_of_nodes()
    print ("-"*80)
    print "\n -------------- TESTING findCloudClusters ----------"
    prunedGraph = mccSearch.find_cloud_clusters(CEGraph, userVariables, graphVariables)
    print ("-"*80)
    print "number of nodes in prunedGraph is: ", prunedGraph.number_of_nodes()
    print ("-"*80)
    print "\n -------------- TESTING findMCCs ----------"
    MCCList, MCSList = mccSearch.find_MCC(prunedGraph, userVariables, graphVariables)
    print ("-"*80)
    print "MCC List has been acquired ", len(MCCList)
    print "MCS List has been acquired ", len(MCSList)
    print ("-"*80)
    # ---------------------------------END CORE GTG STEPS----------------------------------------------
    # Now ready to perform various calculations/metrics
    print "\n -------------- TESTING METRICS ----------"
    # Some calculations/metrics that work that work
    # print "creating the MCC userfile ", metrics.createTextFile(MCCList,1)
    # print "creating the MCS userfile ", metrics.createTextFile(MCSList,2)
    # MCCTimes, tdelta = metrics.temporalAndAreaInfoMetric(MCCList)
    # print "number of MCCs is: ", metrics.numberOfFeatures(MCCList)
    # print "longest duration is: ", metrics.longestDuration(MCCTimes), "hrs"
    # print "shortest duration is: ", metrics.shortestDuration(MCCTimes), "hrs"
    # print "Average duration is: ", metrics.averageDuration(MCCTimes), "hrs"
    # print "Average size is: ", metrics.averageFeatureSize(MCCList), "km^2"

    # Some plots that work
    # plotting.plotAccTRMM(MCCList)
    # plotting.displayPrecip(MCCList)
    # plotting.plotAccuInTimeRange('yyyy-mm-dd_hh:mm:ss', 'yyyy-mm-dd_hh:mm:ss')
    # plotting.displaySize(MCCList)
    # plotting.displayPrecip(MCCList)
    # plotting.plotHistogram(MCCList)
    #
    print ("-"*80)
def main():
    sys.setrecursionlimit(5000)

    CEGraph = nx.DiGraph()
    prunedGraph = nx.DiGraph()
    MCCList =[]
    MCSList=[]
    MCSMCCNodesList =[]
    allMCSsList =[]
    allCETRMMList =[]
    DIRS={}

    #for GrADs
    subprocess.call('export DISPLAY=:0.0', shell=True)

    #for first time working with the raw MERG zipped files
    # rawMERG = "/directory/to/the/raw/MERGfiles"
    # utils.preprocessing_merg(rawMERG)
    # ---------------------------------------------------------------------------------
    # ---------------------------------- user inputs --------------------------------------
    DIRS['mainDirStr'] = "/Users/kwhitehall/Documents/capstones/usc2015/baselineTimings/test"#"/directory/to/where/to/store/outputs"
    DIRS['TRMMdirName'] = "/Users/kwhitehall/Documents/capstones/usc2015/baselineTimings/datadir/TRMM"#"/directory/to/the/TRMM/netCDF/files"
    DIRS['CEoriDirName'] = "/Users/kwhitehall/Documents/capstones/usc2015/baselineTimings/datadir/MERG"#"/directory/to/the/MERG/netCDF/files"
    #get the dates for analysis
    startDateTime = "200908310000" #"yyyymmddhrmm"
    endDateTime = "200908312100"
    # ---------------------------------- end user inputs --------------------------------------
    # Checks that inputs are ok
    try:
        if not os.path.exists(DIRS['CEoriDirName']):
            print "Error! MERG invalid path!"
            DIRS['CEoriDirName'] = raw_input("> Please enter the directory to the MERG netCDF files: \n")
    except:
        print "..."

    try:
        if not os.path.exists(DIRS['TRMMdirName']):
            print "Error: TRMM invalid path!"
            DIRS['TRMMdirName'] = raw_input("> Please enter the location to the raw TRMM netCDF files: \n")
    except:
        pass

    try:
        if not os.path.exists(DIRS['CEoriDirName']):
            print "Error! MERG invalid path!"
            DIRS['CEoriDirName'] = raw_input("> Please enter the directory to the MERG netCDF files: \n")
    except:
        print "..."   

    #check validity of time
    while utils.valid_date(startDateTime) != True:
        print "Invalid time entered for startDateTime!"

    while utils.valid_date(endDateTime) != True:
        print "Invalid time entered for endDateTime!"
        
    #check if all the files exisits in the MERG and TRMM directories entered
    test,_ = iomethods.check_for_files(DIRS['TRMMdirName'], startDateTime, endDateTime, 3, 'hour')
    if test == False:
        print "Error with files in the TRMM directory entered. Please check your files before restarting. "
        return
    #test,filelist = iomethods.check_for_files(startDateTime, endDateTime, DIRS['CEoriDirName'],1)
    test,filelist = iomethods.check_for_files(DIRS['CEoriDirName'], startDateTime, endDateTime, 1, 'hour')

    if test == False:
        print "Error with files in the original MERG directory entered. Please check your files before restarting. "
        return
    # end checks 

    # create main directory and file structure for storing intel
    DIRS['mainDirStr'] = iomethods.create_main_directory(DIRS['mainDirStr'])
    TRMMCEdirName = DIRS['mainDirStr']+'/TRMMnetcdfCEs'
    CEdirName = DIRS['mainDirStr']+'/MERGnetcdfCEs'
    
    # for doing some postprocessing with the clipped datasets instead of running the full program, e.g.
    # mccSearch.post_processing_netcdf(3,CEoriDirName)
    # mccSearch.post_processing_netcdf(2)
    # -------------------------------------------------------------------------------------------------

    #let's go!
    print "\n -------------- Read MERG Data ----------"
    mergImgs, timeList, LAT, LON = iomethods.read_data(DIRS['CEoriDirName'],'ch4','latitude','longitude', filelist)
    print ("-"*80)

    print "\n -------------- TESTING findCloudElements ----------"
    CEGraph = mccSearch.find_cloud_elements(mergImgs,timeList,DIRS['mainDirStr'], LAT,LON,DIRS['TRMMdirName'])
    #if the TRMMdirName wasnt entered for whatever reason, you can still get the TRMM data this way
    # CEGraph = mccSearch.findCloudElements(mergImgs,timeList,DIRS['mainDirStr'], LAT,LON)
    # allCETRMMList=mccSearch.findPrecipRate(DIRS['TRMMdirName'],timeList)
    # ----------------------------------------------------------------------------------------------
    print ("-"*80)
    print "number of nodes in CEGraph is: ", CEGraph.number_of_nodes()
    print ("-"*80)
    print "\n -------------- TESTING findCloudClusters ----------"
    prunedGraph = mccSearch.find_cloud_clusters(CEGraph)
    print ("-"*80)
    print "number of nodes in prunedGraph is: ", prunedGraph.number_of_nodes()
    print ("-"*80)
    #sys.exit()
    print "\n -------------- TESTING findMCCs ----------"
    MCCList,MCSList = mccSearch.find_MCC(prunedGraph)
    print ("-"*80)
    print "MCC List has been acquired ", len(MCCList)
    print "MCS List has been acquired ", len(MCSList)
    print ("-"*80)
    #now ready to perform various calculations/metrics
    print "\n -------------- TESTING METRICS ----------"

    #some calculations/metrics that work that work
    # print "creating the MCC userfile ", metrics.createTextFile(MCCList,1)
    # print "creating the MCS userfile ", metrics.createTextFile(MCSList,2)
    # MCCTimes, tdelta = metrics.temporalAndAreaInfoMetric(MCCList)
    # print "number of MCCs is: ", metrics.numberOfFeatures(MCCList)
    # print "longest duration is: ", metrics.longestDuration(MCCTimes), "hrs"
    # print "shortest duration is: ", metrics.shortestDuration(MCCTimes), "hrs"
    # print "Average duration is: ", metrics.averageDuration(MCCTimes), "hrs"
    # print "Average size is: ", mmetrics.averageFeatureSize(MCCList), "km^2"

    #some plots that work
    # plotting.plotAccTRMM(MCCList)
    # plotting.displayPrecip(MCCList)
    # plotting.plotAccuInTimeRange('yyyy-mm-dd_hh:mm:ss', 'yyyy-mm-dd_hh:mm:ss')
    # plotting.displaySize(MCCList)
    # plotting.displayPrecip(MCCList)
    # plotting.plotHistogram(MCCList)
    #
    print ("-"*80)
示例#4
0
def main():
    CEGraph = nx.DiGraph()
    prunedGraph = nx.DiGraph()
    MCCList = []
    MCSList = []
    MCSMCCNodesList = []
    allMCSsList = []
    allCETRMMList = []
    DIRS = {}
    # DIRS={
    #          mainDirStr= "/directory/to/where/to/store/outputs"
    #          TRMMdirName = "/directory/to/the/TRMM/netCDF/files"
    #          CEoriDirName = "/directory/to/the/MERG/netCDF/files"
    #         }
    preprocessing = ""
    rawMERG = ""

    # for GrADs
    subprocess.call("export DISPLAY=:0.0", shell=True)

    print "Running MCCSearch ..... \n"
    DIRS["mainDirStr"] = raw_input("> Please enter working directory: \n")  # This is where data created will be stored

    preprocessing = raw_input("> Do you need to preprocess the MERG files? [y/n]: \n")
    while preprocessing.lower() != "n":
        if preprocessing.lower() == "y":
            # get location for raw files
            rawMERG = raw_input("> Please enter the directory to the RAW MERG (.Z) files: \n")
            # run preprocessing
            utils.preprocessing_merg(rawMERG)
            continue
        elif preprocessing.lower() == "n":
            pass
        else:
            print "Error! Invalid choice "
            preprocessing = raw_input("> Do you need to preprocess the MERG files? [y/n]: \n")

    # get the location of the MERG and TRMM data
    DIRS["CEoriDirName"] = raw_input("> Please enter the directory to the MERG netCDF files: \n")

    try:
        if not os.path.exists(DIRS["CEoriDirName"]):
            print "Error! MERG invalid path!"
            DIRS["CEoriDirName"] = raw_input("> Please enter the directory to the MERG netCDF files: \n")
    except:
        print "..."

    DIRS["TRMMdirName"] = raw_input("> Please enter the location to the raw TRMM netCDF files: \n")
    try:
        if not os.path.exists(DIRS["TRMMdirName"]):
            print "Error: TRMM invalid path!"
            DIRS["TRMMdirName"] = raw_input("> Please enter the location to the raw TRMM netCDF files: \n")
    except:
        pass

    # get the dates for analysis
    startDateTime = raw_input("> Please enter the start date and time yyyymmddhrmm: \n")
    # check validity of time
    while utils.valid_date(startDateTime) != True:
        print "Invalid time entered for startDateTime!"
        startDateTime = raw_input("> Please enter the start date and time yyyymmddhrmm: \n")

    endDateTime = raw_input("> Please enter the end date and time yyyymmddhrmm: \n")
    while utils.valid_date(endDateTime) != True:
        print "Invalid time entered for endDateTime!"
        endDateTime = raw_input("> Please enter the end date and time yyyymmddhrmm: \n")

    # check if all the files exisits in the MERG and TRMM directories entered
    # test,_ = iomethods.check_for_files(startDateTime, endDateTime, DIRS['TRMMdirName'], 2)
    test, _ = iomethods.check_for_files(DIRS["TRMMdirName"], startDateTime, endDateTime, 3, "hour")
    if test == False:
        print "Error with files in the original MERG directory entered. Please check your files before restarting. "
        return
    # test,filelist = iomethods.check_for_files(startDateTime, endDateTime, DIRS['CEoriDirName'],1)
    test, filelist = iomethods.check_for_files(DIRS["CEoriDirName"], startDateTime, endDateTime, 1, "hour")

    if test == False:
        print "Error with files in the original TRMM directory entered. Please check your files before restarting. "
        return

    # create main directory and file structure for storing intel
    DIRS["mainDirStr"] = iomethods.create_main_directory(DIRS["mainDirStr"])
    TRMMCEdirName = DIRS["mainDirStr"] + "/TRMMnetcdfCEs"
    CEdirName = DIRS["mainDirStr"] + "/MERGnetcdfCEs"

    # for doing some postprocessing with the clipped datasets instead of running the full program, e.g.
    postprocessing = raw_input("> Do you wish to postprocess data? [y/n] \n")
    while postprocessing.lower() != "n":
        if postprocessing.lower() == "y":
            option = postprocessing_plot_menu(DIRS)
            return
        elif postprocessing.lower() == "n":
            pass
        else:
            print "\n Invalid option."
            postprocessing = raw_input("> Do you wish to postprocess data? [y/n] \n")
    # -------------------------------------------------------------------------------------------------
    # Getting started. Make it so number one!
    print ("-" * 80)
    print "\t\t Starting the MCCSearch Analysis "
    print ("-" * 80)
    print "\n -------------- Reading MERG and TRMM Data ----------"
    mergImgs, timeList, LAT, LON = iomethods.read_data(DIRS["CEoriDirName"], "ch4", "latitude", "longitude", filelist)
    print "\n -------------- findCloudElements ----------"
    CEGraph = mccSearch.find_cloud_elements(mergImgs, timeList, DIRS["mainDirStr"], LAT, LON, DIRS["TRMMdirName"])
    # theList = CEGraph.successors(node)
    # if the TRMMdirName wasnt entered for whatever reason, you can still get the TRMM data this way
    # CEGraph = mccSearch.findCloudElements(mergImgs,timeList)
    # allCETRMMList=mccSearch.findPrecipRate(DIRS['TRMMdirName'],timeList)
    # ----------------------------------------------------------------------------------------------
    print "\n -------------- findCloudClusters ----------"
    prunedGraph = mccSearch.find_cloud_clusters(CEGraph)
    print "\n -------------- findMCCs ----------"
    MCCList, MCSList = mccSearch.find_MCC(prunedGraph)
    # now ready to perform various calculations/metrics
    print ("-" * 80)
    print "\n -------------- METRICS ----------"
    print ("-" * 80)
    # some calculations/metrics that work that work
    print "creating the MCC userfile ", metrics.create_text_file(MCCList, 1, DIRS["mainDirStr"], 80000.0, 1)
    print "creating the MCS userfile ", metrics.create_text_file(MCSList, 2, DIRS["mainDirStr"], 80000.0, 1)
    plot_menu(MCCList, MCSList, DIRS)

    # Let's get outta here! Engage!
    print ("-" * 80)
示例#5
0
def main():
    sys.setrecursionlimit(5000)

    CEGraph = nx.DiGraph()
    prunedGraph = nx.DiGraph()
    MCCList = []
    MCSList = []
    MCSMCCNodesList = []
    allMCSsList = []
    allCETRMMList = []
    DIRS = {}

    # For GrADs
    subprocess.call('export DISPLAY=:0.0', shell=True)

    # For first time working with the raw MERG zipped files
    # rawMERG = "/directory/to/the/raw/MERGfiles"
    # utils.preprocessing_merg(rawMERG)
    # ---------------------------------------------------------------------------------
    # ---------------------------------- user inputs --------------------------------------
    userVariables = variables.UserVariables(useJSON=False)
    graphVariables = variables.define_graph_variables()
    # ---------------------------------- end user inputs --------------------------------------
    
    # Create main directory and file structure for storing intel
    userVariables.DIRS['mainDirStr'] = iomethods.create_main_directory(userVariables.DIRS['mainDirStr'])
    TRMMCEdirName = userVariables.DIRS['mainDirStr']+'/TRMMnetcdfCEs'
    CEdirName = userVariables.DIRS['mainDirStr']+'/MERGnetcdfCEs'

    unittestFile = open(userVariables.DIRS['mainDirStr']+'/textFiles/unittestResults.txt', 'wb')
    unittestFile.write("\n Timing results for "+userVariables.startDateTime+" to "+userVariables.endDateTime)

    # Let's go!
    # Time how long it takes to complete reading in the data
    print "\n Start the timer "
    startTime = time.time()
    print "\n -------------- Read MERG Data ----------"
    print "\n Start the timer for the data ingest process"
    readMergStart = time.time()
    mergImgs, timeList, LAT, LON, userVariables = iomethods.read_data('ch4', 'latitude', 'longitude', userVariables)
    readMergEnd = time.time()
    print "\n End the timer for the data ingest process"
    print "\n Total time to complete data ingest is %g seconds" % (readMergEnd - readMergStart)
    unittestFile.write("\n 1. Total time to complete data ingest is %g seconds" % (readMergEnd - readMergStart))
    print ("-"*80)

    print "\n -------------- TESTING findCloudElements ----------"
    print "\n Start the timer for findCloudElements process"
    findCEsStart = time.time()
    print "\n Using both MERG and TRMM simultaneously "
    # CEGraph = mccSearch.find_cloud_elements(mergImgs,timeList,userVariables.DIRS['mainDirStr'], LAT,LON,userVariables, graphVariables, userVariables.DIRS['TRMMdirName'])
    CEGraph, _ = mccSearch.find_cloud_elements(mergImgs, timeList, LAT, LON, userVariables, graphVariables, userVariables. DIRS['TRMMdirName'])
    findCEsEnd = time.time()
    print "\n Number of cloud elements found is: ", CEGraph.number_of_nodes()
    print "\n End the timer for findCloudElements process"
    print "\n Total time to complete finding cloud elements is %g seconds" % (findCEsEnd - findCEsStart)
    unittestFile.write("\n 2. Total time to complete finding cloud elements is %g seconds" % (findCEsEnd - findCEsStart))
    
    # #********* OR *******
    # # #timing each separately
    # CEGraph = mccSearch.find_cloud_elements(mergImgs, timeList, DIRS['mainDirStr'], LAT, LON)
    # findCEsEnd = time.time()
    # print "\n End the timer for findCloudElements process using MERG only"
    # print "\n Total time to complete finding cloud elements in MERG only is %g seconds" % (findCEsEnd - findCEsStart)
    # unittestFile.write("\n Total time to complete finding cloud elements in MERG only is %g seconds" % (findCEsEnd - findCEsStart))
    
    # # *** TRMM DATA SET TIMINGS *** 
    # print "\n Start the timer for findCloudElements process using TRMM only"
    # findCETRMMStart = time.time()
    # allCETRMMList = mccSearch.find_precip_rate(DIRS['TRMMdirName'],timeList)
    # findCETRMMEnd = time.time()
    # print "\n End the timer for findCloudElements process using TRMM only"
    # print "\n Total time to complete finding cloud elements in TRMM only is %g seconds"%(findCETRMMEnd - findCETRMMStart)
    # unittestFile.write("\n Total time to complete finding cloud elements in TRMM only is %g seconds"%(findCETRMMEnd - findCETRMMStart))
    # print "\n Number of cloud elements found is: ", CEGraph.number_of_nodes()
    # print "\n Total time to complete finding cloud elements is %g seconds"%(findCETRMMEnd - findCEsStart)
    # unittestFile.write("\n Total time to complete finding cloud elements is %g seconds" % (findCETRMMEnd - findCEsStart))
    # print ("-"*80)

    print "\n -------------- TESTING findCloudClusters ----------"
    print "\n Start the timer for findCloudClusters process"
    findCloudClustersStart = time.time()
    prunedGraph = mccSearch.find_cloud_clusters(CEGraph, userVariables, graphVariables)
    print "The number of nodes in the prunedGraph is: ", prunedGraph.number_of_nodes()
    findCloudClustersEnd = time.time()
    print "\n End the timer for the findCloudClusters process"
    print "\n Total time to complete finding the cloud clusters is %g seconds" % (findCloudClustersEnd - findCloudClustersStart)
    unittestFile.write("\n 3. Total time to complete finding the cloud clusters is %g seconds" % (findCloudClustersEnd - findCloudClustersStart))
    print "\n The CEGraph nodes are: %s " % CEGraph.nodes()
    unittestFile.write("\n The CEGraph nodes are: %s " % CEGraph.nodes())
    print "\n The pruned graph nodes are: %s " % prunedGraph.nodes()
    unittestFile.write("\n\n The pruned graph nodes are: %s " % prunedGraph.nodes())
     
    print ("-"*80)
    
    print "\n -------------- TESTING findMCCs ----------"
    print "\n Start the timer for the findMCCs process"
    findMCCStart = time.time()
    MCCList, MCSList = mccSearch.find_MCC(prunedGraph, userVariables, graphVariables)
    print "\n MCC List has been acquired ", len(MCCList)
    print "\n MCS List has been acquired ", len(MCSList)
    findMCCEnd = time.time()
    print "\n End the timer for the findMCCs process"
    print "\n Total time to complete finding the MCCs is %g seconds" % (findMCCEnd - findMCCStart)
    unittestFile.write("\n 4. Total time to complete finding the MCCs is %g seconds" % (findMCCEnd - findMCCStart))
    print ("-"*80)
    # End the timer
    endTime = time.time()
    print ("*"*80)
    print "\n The entire evaluation took %g seconds to complete" % (endTime - startTime)
    unittestFile.write("\n The entire evaluation took %g seconds to complete" % (endTime - startTime))
    unittestFile.write("\n ----------------------------------------------------------------")
    unittestFile.write("\n Number of cloud elements found is: %d" % CEGraph.number_of_nodes())
    unittestFile.write("\n Number of edges (with the cloud elements) found is: %d" % CEGraph.number_of_edges())
    unittestFile.write("\n The number of nodes in the prunedGraph is: %d" % prunedGraph.number_of_nodes())
    unittestFile.write("\n The number of edges (with nodes) in the prunedGraph is: %d" % prunedGraph.number_of_edges())
    unittestFile.write("\n MCC List has been acquired %d" % len(MCCList))
    unittestFile.write("\n MCS List has been acquired %d" % len(MCSList))
    unittestFile.write("\n The CEGraph nodes are: %s" % CEGraph.nodes())
    unittestFile.write("\n The prunedGraph nodes are: %s" % prunedGraph.nodes())
    print ("-"*80)
    # TODO: report the domain

    unittestFile.close()
def main():
    sys.setrecursionlimit(5000)

    CEGraph = nx.DiGraph()
    prunedGraph = nx.DiGraph()
    MCCList =[]
    MCSList=[]
    MCSMCCNodesList =[]
    allMCSsList =[]
    allCETRMMList =[]
    DIRS={}

    #for GrADs
    subprocess.call('export DISPLAY=:0.0', shell=True)

    #for first time working with the raw MERG zipped files
    # rawMERG = "/directory/to/the/raw/MERGfiles"
    # utils.preprocessing_merg(rawMERG)
    # ---------------------------------------------------------------------------------
    # ---------------------------------- user inputs --------------------------------------
    DIRS['mainDirStr'] = "/Users/haignalbandian/grab-tag-graph/baselineTimings/testSeparate"#"/directory/to/where/to/store/outputs"
    DIRS['TRMMdirName'] = "/Users/haignalbandian/grab-tag-graph/datadir/TRMM"#"/directory/to/the/TRMM/netCDF/files"
    DIRS['CEoriDirName'] = "/Users/haignalbandian/grab-tag-graph/datadir/MERG"#"/directory/to/the/MERG/netCDF/files"
    #get the dates for analysis
    startDateTime = "200908310000" #"yyyymmddhrmm"
    endDateTime = "200908312100"
    # ---------------------------------- end user inputs --------------------------------------
    # Checks that inputs are ok
    try:
        if not os.path.exists(DIRS['CEoriDirName']):
            print "Error! MERG invalid path!"
            DIRS['CEoriDirName'] = raw_input("> Please enter the directory to the MERG netCDF files: \n")
    except:
        print "..."

    try:
        if not os.path.exists(DIRS['TRMMdirName']):
            print "Error: TRMM invalid path!"
            DIRS['TRMMdirName'] = raw_input("> Please enter the location to the raw TRMM netCDF files: \n")
    except:
        pass

    try:
        if not os.path.exists(DIRS['CEoriDirName']):
            print "Error! MERG invalid path!"
            DIRS['CEoriDirName'] = raw_input("> Please enter the directory to the MERG netCDF files: \n")
    except:
        print "..."   

    #check validity of time
    while utils.valid_date(startDateTime) != True:
        print "Invalid time entered for startDateTime!"

    while utils.valid_date(endDateTime) != True:
        print "Invalid time entered for endDateTime!"
        
    #check if all the files exisits in the MERG and TRMM directories entered
    test,_ = iomethods.check_for_files(DIRS['TRMMdirName'], startDateTime, endDateTime, 3, 'hour')
    if test == False:
        print "Error with files in the TRMM directory entered. Please check your files before restarting. "
        return
    #test,filelist = iomethods.check_for_files(startDateTime, endDateTime, DIRS['CEoriDirName'],1)
    test,filelist = iomethods.check_for_files(DIRS['CEoriDirName'], startDateTime, endDateTime, 1, 'hour')

    if test == False:
        print "Error with files in the original MERG directory entered. Please check your files before restarting. "
        return
    # end checks 

    # create main directory and file structure for storing intel
    DIRS['mainDirStr'] = iomethods.create_main_directory(DIRS['mainDirStr'])
    TRMMCEdirName = DIRS['mainDirStr']+'/TRMMnetcdfCEs'
    CEdirName = DIRS['mainDirStr']+'/MERGnetcdfCEs'

    unittestFile = open(DIRS['mainDirStr']+'/unittestResults.txt','wb')
    unittestFile.write("\n Timing results for "+startDateTime+" to "+endDateTime)

    #let's go!
    # time how long it takes to complete reading in the data
    print "\n Start the timer "
    starttime = time.time()
    print "\n -------------- Read MERG Data ----------"
    print "\n Start the timer for the data ingest process"
    readMergStart = time.time()
    mergImgs, timeList, LAT, LON = iomethods.read_data(DIRS['CEoriDirName'],'ch4','latitude','longitude', filelist)
    readMergEnd = time.time()
    print "\n End the timer for the data ingest process"
    print "\n Total time to complete data ingest is %g seconds"%(readMergEnd - readMergStart)
    unittestFile.write("\n 1. Total time to complete data ingest is %g seconds"%(readMergEnd - readMergStart))
    print ("-"*80)

    print "\n -------------- TESTING findCloudElements ----------"
    print "\n Start the timer for findCloudElements process"
    findCEsStart = time.time()
    # ********* EITHER *********
    # print "\n Using both MERG and TRMM simultaneously "
    # CEGraph = mccSearch.find_cloud_elements(mergImgs,timeList,DIRS['mainDirStr'], LAT,LON,DIRS['TRMMdirName'])
    # findCEsEnd = time.time()
    # print "\n Number of cloud elements found is: ", CEGraph.number_of_nodes()
    # print "\n End the timer for findCloudElements process"
    # print "\n Total time to complete finding cloud elements is %g seconds"%(findCEsEnd - findCEsStart)
    # unittestFile.write("\n 2. Total time to complete finding cloud elements is %g seconds"%(findCEsEnd - findCEsStart))
    # print ("-"*80)
    # #********* OR *******
    # #timing each separately
    CEGraph = mccSearch.find_cloud_elements(mergImgs,timeList,DIRS['mainDirStr'], LAT,LON)
    findCEsEnd = time.time()
    print "\n End the timer for findCloudElements process using MERG only"
    print "\n Total time to complete finding cloud elements in MERG only is %g seconds"%(findCEsEnd - findCEsStart)
    unittestFile.write("\n Total time to complete finding cloud elements in MERG only is %g seconds"%(findCEsEnd - findCEsStart))
    
    # *** TRMM DATA SET TIMINGS *** 
    print "\n Start the timer for findCloudElements process using TRMM only"
    findCETRMMStart = time.time()
    allCETRMMList = mccSearch.find_precip_rate(DIRS['TRMMdirName'],timeList)
    findCETRMMEnd = time.time()
    print "\n End the timer for findCloudElements process using TRMM only"
    print "\n Total time to complete finding cloud elements in TRMM only is %g seconds"%(findCETRMMEnd - findCETRMMStart)
    unittestFile.write("\n Total time to complete finding cloud elements in TRMM only is %g seconds"%(findCETRMMEnd - findCETRMMStart))
    print "\n Number of cloud elements found is: ", CEGraph.number_of_nodes()
    print "\n Total time to complete finding cloud elements is %g seconds"%(findCETRMMEnd - findCEsStart)
    unittestFile.write("\n Total time to complete finding cloud elements is %g seconds"%(findCETRMMEnd - findCEsStart))
    print ("-"*80)

    print "\n -------------- TESTING findCloudClusters ----------"
    print "\n Start the timer for findCloudClusters process"
    findCloudClustersStart = time.time()
    prunedGraph = mccSearch.find_cloud_clusters(CEGraph)
    print "The number of nodes in the prunedGraph is: ", prunedGraph.number_of_nodes()
    findCloudClustersEnd = time.time()
    print "\n End the timer for the findCloudClusters process"
    print "\n Total time to complete finding the cloud clusters is %g seconds"%(findCloudClustersEnd - findCloudClustersStart)
    unittestFile.write("\n 3. Total time to complete finding the cloud clusters is %g seconds"%(findCloudClustersEnd - findCloudClustersStart))
    print ("-"*80)
    
    print "\n -------------- TESTING findMCCs ----------"
    print "\n Start the timer for the findMCCs process"
    findMCCStart = time.time()
    MCCList,MCSList = mccSearch.find_MCC(prunedGraph)
    print "\n MCC List has been acquired ", len(MCCList)
    print "\n MCS List has been acquired ", len(MCSList)
    findMCCEnd = time.time()
    print "\n End the timer for the findMCCs process"
    print "\n Total time to complete finding the MCCs is %g seconds"%(findMCCEnd - findMCCStart)
    unittestFile.write("\n 4. Total time to complete finding the MCCs is %g seconds"%(findMCCEnd - findMCCStart))
    print ("-"*80)
    #end the timer
    endtime = time.time()
    print ("*"*80)
    print "\n The entire evaluation took %g seconds to complete" %(endtime - starttime)
    unittestFile.write("\n The entire evaluation took %g seconds to complete" %(endtime - starttime))
    unittestFile.write("\n ----------------------------------------------------------------")
    unittestFile.write("\n Number of cloud elements found is: %d"%CEGraph.number_of_nodes())
    unittestFile.write("\n Number of edges (with the cloud elements) found is: %d"%CEGraph.number_of_edges())
    unittestFile.write("\n The number of nodes in the prunedGraph is: %d" %prunedGraph.number_of_nodes())
    unittestFile.write("\n The number of edges (with nodes) in the prunedGraph is: %d" %prunedGraph.number_of_edges())
    unittestFile.write("\n MCC List has been acquired %d" %len(MCCList))
    unittestFile.write("\n MCS List has been acquired %d" %len(MCSList))
    # TODO: report the domain

    unittestFile.close()
示例#7
0
def main():
    sys.setrecursionlimit(5000)

    CEGraph = nx.DiGraph()
    prunedGraph = nx.DiGraph()
    MCCList = []
    MCSList = []
    MCSMCCNodesList = []
    allMCSsList = []
    allCETRMMList = []
    DIRS = {}

    # For GrADs
    subprocess.call('export DISPLAY=:0.0', shell=True)

    userVariables = variables.define_user_variables(useJSON=True)
    graphVariables = variables.define_graph_variables()

    # Create main directory and file structure for storing intel
    userVariables.DIRS['mainDirStr'] = iomethods.create_main_directory(
        userVariables.DIRS['mainDirStr'])
    TRMMCEdirName = userVariables.DIRS['mainDirStr'] + '/TRMMnetcdfCEs'
    CEdirName = userVariables.DIRS['mainDirStr'] + '/MERGnetcdfCEs'

    # Let's go!
    # ----------------------------------CORE GTG STEPS------------------------------------------------
    print "\n -------------- Read MERG Data ----------"
    mergImgs, timeList, LAT, LON, userVariables = iomethods.read_data(
        'ch4', 'latitude', 'longitude', userVariables)
    print("-" * 80)
    print "\n -------------- TESTING findCloudElements ----------"
    CEGraph, _ = mccSearch.find_cloud_elements(
        mergImgs, timeList, LAT, LON, userVariables, graphVariables,
        userVariables.DIRS['TRMMdirName'])
    # #********* OR *******
    # CEGraph = mccSearch.find_cloud_elements(mergImgs,timeList,LAT, LON, userVariables, graphVariables)
    # allCETRMMList = mccSearch.find_precip_rate(userVariables.DIRS['TRMMdirName'],timeList)
    # #********************
    print("-" * 80)
    print "number of nodes in CEGraph is: ", CEGraph.number_of_nodes()
    print("-" * 80)
    print "\n -------------- TESTING findCloudClusters ----------"
    prunedGraph = mccSearch.find_cloud_clusters(CEGraph, userVariables,
                                                graphVariables)
    print("-" * 80)
    print "number of nodes in prunedGraph is: ", prunedGraph.number_of_nodes()
    print("-" * 80)
    print "\n -------------- TESTING findMCCs ----------"
    MCCList, MCSList = mccSearch.find_MCC(prunedGraph, userVariables,
                                          graphVariables)
    print("-" * 80)
    print "MCC List has been acquired ", len(MCCList)
    print "MCS List has been acquired ", len(MCSList)
    print("-" * 80)
    # ---------------------------------END CORE GTG STEPS----------------------------------------------
    # Now ready to perform various calculations/metrics
    print "\n -------------- TESTING METRICS ----------"
    # Some calculations/metrics that work that work
    # print "creating the MCC userfile ", metrics.createTextFile(MCCList,1)
    # print "creating the MCS userfile ", metrics.createTextFile(MCSList,2)
    # MCCTimes, tdelta = metrics.temporalAndAreaInfoMetric(MCCList)
    # print "number of MCCs is: ", metrics.numberOfFeatures(MCCList)
    # print "longest duration is: ", metrics.longestDuration(MCCTimes), "hrs"
    # print "shortest duration is: ", metrics.shortestDuration(MCCTimes), "hrs"
    # print "Average duration is: ", metrics.averageDuration(MCCTimes), "hrs"
    # print "Average size is: ", metrics.averageFeatureSize(MCCList), "km^2"

    # Some plots that work
    # plotting.plotAccTRMM(MCCList)
    # plotting.displayPrecip(MCCList)
    # plotting.plotAccuInTimeRange('yyyy-mm-dd_hh:mm:ss', 'yyyy-mm-dd_hh:mm:ss')
    # plotting.displaySize(MCCList)
    # plotting.displayPrecip(MCCList)
    # plotting.plotHistogram(MCCList)
    #
    print("-" * 80)
示例#8
0
def main():
    sys.setrecursionlimit(5000)

    CEGraph = nx.DiGraph()
    prunedGraph = nx.DiGraph()
    MCCList = []
    MCSList = []
    MCSMCCNodesList = []
    allMCSsList = []
    allCETRMMList = []

    # For GrADs
    subprocess.call('export DISPLAY=:0.0', shell=True)

    # For first time working with the raw MERG zipped files
    # rawMERG = "/directory/to/the/raw/MERGfiles"
    # utils.preprocessing_merg(rawMERG)
    # ---------------------------------------------------------------------------------
    # ---------------------------------- user inputs --------------------------------------
    userVariables = variables.UserVariables(useJSON=False)
    graphVariables = variables.define_graph_variables()
    # ---------------------------------- end user inputs --------------------------------------

    # Create main directory and file structure for storing intel
    userVariables.DIRS['mainDirStr'] = iomethods.create_main_directory(
        userVariables.DIRS['mainDirStr'])
    TRMMCEdirName = userVariables.DIRS['mainDirStr'] + '/TRMMnetcdfCEs'
    CEdirName = userVariables.DIRS['mainDirStr'] + '/MERGnetcdfCEs'

    # -------------------------------------------------------------------------------------------------
    # Getting started. Make it so number one!
    print("-" * 80)
    print "\t\t Starting the MCCSearch Analysis "
    print("-" * 80)
    print "\n -------------- Reading MERG Data ----------"
    mergImgs, timeList, LAT, LON, userVariables = iomethods.read_data(
        'ch4', 'latitude', 'longitude', userVariables)
    print "\n -------------- findCloudElements ----------"
    CEGraph, _ = mccSearch.find_cloud_elements(
        mergImgs, timeList, LAT, LON, userVariables, graphVariables,
        userVariables.DIRS['TRMMdirName'])
    # theList = CEGraph.successors(node)
    # If the TRMMdirName wasnt entered for whatever reason, you can still get the TRMM data this way
    # CEGraph = mccSearch.findCloudElements(mergImgs,timeList)
    # allCETRMMList=mccSearch.findPrecipRate(DIRS['TRMMdirName'],timeList)
    # ----------------------------------------------------------------------------------------------
    print "\n -------------- findCloudClusters ----------"
    prunedGraph = mccSearch.find_cloud_clusters(CEGraph, userVariables,
                                                graphVariables)
    print "\n -------------- findMCCs ----------"
    MCCList, MCSList = mccSearch.find_MCC(prunedGraph, userVariables,
                                          graphVariables)
    # Now ready to perform various calculations/metrics
    print("-" * 80)
    print "\n -------------- METRICS ----------"
    print("-" * 80)
    # Some calculations/metrics that work that work
    print "creating the MCC userfile ", metrics.create_text_file(
        MCCList, 1, userVariables, graphVariables)
    print "creating the MCS userfile ", metrics.create_text_file(
        MCSList, 2, userVariables, graphVariables)
    plot_menu(MCCList, MCSList, userVariables.DIRS)

    # Let's get outta here! Engage!
    print("-" * 80)
示例#9
0
def main():
    sys.setrecursionlimit(5000)

    CEGraph = nx.DiGraph()
    prunedGraph = nx.DiGraph()
    MCCList = []
    MCSList = []
    MCSMCCNodesList = []
    allMCSsList = []
    allCETRMMList = []
    DIRS = {}

    # For GrADs
    subprocess.call('export DISPLAY=:0.0', shell=True)

    # For first time working with the raw MERG zipped files
    # rawMERG = "/directory/to/the/raw/MERGfiles"
    # utils.preprocessing_merg(rawMERG)
    # ---------------------------------------------------------------------------------
    # ---------------------------------- user inputs --------------------------------------
    userVariables = variables.UserVariables(useJSON=False)
    graphVariables = variables.define_graph_variables()
    # ---------------------------------- end user inputs --------------------------------------

    # Create main directory and file structure for storing intel
    userVariables.DIRS['mainDirStr'] = iomethods.create_main_directory(
        userVariables.DIRS['mainDirStr'])
    TRMMCEdirName = userVariables.DIRS['mainDirStr'] + '/TRMMnetcdfCEs'
    CEdirName = userVariables.DIRS['mainDirStr'] + '/MERGnetcdfCEs'

    unittestFile = open(
        userVariables.DIRS['mainDirStr'] + '/textFiles/unittestResults.txt',
        'wb')
    unittestFile.write("\n Timing results for " + userVariables.startDateTime +
                       " to " + userVariables.endDateTime)

    # Let's go!
    # Time how long it takes to complete reading in the data
    print "\n Start the timer "
    startTime = time.time()
    print "\n -------------- Read MERG Data ----------"
    print "\n Start the timer for the data ingest process"
    readMergStart = time.time()
    mergImgs, timeList, LAT, LON, userVariables = iomethods.read_data(
        'ch4', 'latitude', 'longitude', userVariables)
    readMergEnd = time.time()
    print "\n End the timer for the data ingest process"
    print "\n Total time to complete data ingest is %g seconds" % (
        readMergEnd - readMergStart)
    unittestFile.write(
        "\n 1. Total time to complete data ingest is %g seconds" %
        (readMergEnd - readMergStart))
    print("-" * 80)

    print "\n -------------- TESTING findCloudElements ----------"
    print "\n Start the timer for findCloudElements process"
    findCEsStart = time.time()
    print "\n Using both MERG and TRMM simultaneously "
    # CEGraph = mccSearch.find_cloud_elements(mergImgs,timeList,userVariables.DIRS['mainDirStr'], LAT,LON,userVariables, graphVariables, userVariables.DIRS['TRMMdirName'])
    CEGraph, _ = mccSearch.find_cloud_elements(
        mergImgs, timeList, LAT, LON, userVariables, graphVariables,
        userVariables.DIRS['TRMMdirName'])
    findCEsEnd = time.time()
    print "\n Number of cloud elements found is: ", CEGraph.number_of_nodes()
    print "\n End the timer for findCloudElements process"
    print "\n Total time to complete finding cloud elements is %g seconds" % (
        findCEsEnd - findCEsStart)
    unittestFile.write(
        "\n 2. Total time to complete finding cloud elements is %g seconds" %
        (findCEsEnd - findCEsStart))

    # #********* OR *******
    # # #timing each separately
    # CEGraph = mccSearch.find_cloud_elements(mergImgs, timeList, DIRS['mainDirStr'], LAT, LON)
    # findCEsEnd = time.time()
    # print "\n End the timer for findCloudElements process using MERG only"
    # print "\n Total time to complete finding cloud elements in MERG only is %g seconds" % (findCEsEnd - findCEsStart)
    # unittestFile.write("\n Total time to complete finding cloud elements in MERG only is %g seconds" % (findCEsEnd - findCEsStart))

    # # *** TRMM DATA SET TIMINGS ***
    # print "\n Start the timer for findCloudElements process using TRMM only"
    # findCETRMMStart = time.time()
    # allCETRMMList = mccSearch.find_precip_rate(DIRS['TRMMdirName'],timeList)
    # findCETRMMEnd = time.time()
    # print "\n End the timer for findCloudElements process using TRMM only"
    # print "\n Total time to complete finding cloud elements in TRMM only is %g seconds"%(findCETRMMEnd - findCETRMMStart)
    # unittestFile.write("\n Total time to complete finding cloud elements in TRMM only is %g seconds"%(findCETRMMEnd - findCETRMMStart))
    # print "\n Number of cloud elements found is: ", CEGraph.number_of_nodes()
    # print "\n Total time to complete finding cloud elements is %g seconds"%(findCETRMMEnd - findCEsStart)
    # unittestFile.write("\n Total time to complete finding cloud elements is %g seconds" % (findCETRMMEnd - findCEsStart))
    # print ("-"*80)

    print "\n -------------- TESTING findCloudClusters ----------"
    print "\n Start the timer for findCloudClusters process"
    findCloudClustersStart = time.time()
    prunedGraph = mccSearch.find_cloud_clusters(CEGraph, userVariables,
                                                graphVariables)
    print "The number of nodes in the prunedGraph is: ", prunedGraph.number_of_nodes(
    )
    findCloudClustersEnd = time.time()
    print "\n End the timer for the findCloudClusters process"
    print "\n Total time to complete finding the cloud clusters is %g seconds" % (
        findCloudClustersEnd - findCloudClustersStart)
    unittestFile.write(
        "\n 3. Total time to complete finding the cloud clusters is %g seconds"
        % (findCloudClustersEnd - findCloudClustersStart))
    print "\n The CEGraph nodes are: %s " % CEGraph.nodes()
    unittestFile.write("\n The CEGraph nodes are: %s " % CEGraph.nodes())
    print "\n The pruned graph nodes are: %s " % prunedGraph.nodes()
    unittestFile.write("\n\n The pruned graph nodes are: %s " %
                       prunedGraph.nodes())

    print("-" * 80)

    print "\n -------------- TESTING findMCCs ----------"
    print "\n Start the timer for the findMCCs process"
    findMCCStart = time.time()
    MCCList, MCSList = mccSearch.find_MCC(prunedGraph, userVariables,
                                          graphVariables)
    print "\n MCC List has been acquired ", len(MCCList)
    print "\n MCS List has been acquired ", len(MCSList)
    findMCCEnd = time.time()
    print "\n End the timer for the findMCCs process"
    print "\n Total time to complete finding the MCCs is %g seconds" % (
        findMCCEnd - findMCCStart)
    unittestFile.write(
        "\n 4. Total time to complete finding the MCCs is %g seconds" %
        (findMCCEnd - findMCCStart))
    print("-" * 80)
    # End the timer
    endTime = time.time()
    print("*" * 80)
    print "\n The entire evaluation took %g seconds to complete" % (endTime -
                                                                    startTime)
    unittestFile.write("\n The entire evaluation took %g seconds to complete" %
                       (endTime - startTime))
    unittestFile.write(
        "\n ----------------------------------------------------------------")
    unittestFile.write("\n Number of cloud elements found is: %d" %
                       CEGraph.number_of_nodes())
    unittestFile.write(
        "\n Number of edges (with the cloud elements) found is: %d" %
        CEGraph.number_of_edges())
    unittestFile.write("\n The number of nodes in the prunedGraph is: %d" %
                       prunedGraph.number_of_nodes())
    unittestFile.write(
        "\n The number of edges (with nodes) in the prunedGraph is: %d" %
        prunedGraph.number_of_edges())
    unittestFile.write("\n MCC List has been acquired %d" % len(MCCList))
    unittestFile.write("\n MCS List has been acquired %d" % len(MCSList))
    unittestFile.write("\n The CEGraph nodes are: %s" % CEGraph.nodes())
    unittestFile.write("\n The prunedGraph nodes are: %s" %
                       prunedGraph.nodes())
    print("-" * 80)
    # TODO: report the domain

    unittestFile.close()