climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject [31/50] [abbrv] git commit: mccserach - some linting
Date Thu, 16 Oct 2014 17:17:27 GMT
mccserach - some linting


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/99f6e36c
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/99f6e36c
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/99f6e36c

Branch: refs/heads/master
Commit: 99f6e36c2945d3de544221794df675ac8e6045f3
Parents: 91eafd0
Author: kwhitehall <k_whitehall@yahoo.com>
Authored: Sun Apr 13 09:09:25 2014 -0400
Committer: Lewis John McGibbney <lewis.j.mcgibbney@jpl.nasa.gov>
Committed: Wed Oct 15 15:18:04 2014 -0700

----------------------------------------------------------------------
 mccsearch/code/mainProg.py | 84 +++++++++++------------------------------
 1 file changed, 22 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/99f6e36c/mccsearch/code/mainProg.py
----------------------------------------------------------------------
diff --git a/mccsearch/code/mainProg.py b/mccsearch/code/mainProg.py
index 90fb76d..9be65b5 100644
--- a/mccsearch/code/mainProg.py
+++ b/mccsearch/code/mainProg.py
@@ -1,14 +1,10 @@
 '''
 # running the program
-# Kim Whitehall Nov 2012
-# Last updated: 15 May 2013
 '''
 
-#import rcmes
 import sys
 import networkx as nx
 import mccSearch
-#import cloudclusters
 import numpy as np
 import numpy.ma as ma
 import files
@@ -24,43 +20,43 @@ def main():
     MCSMCCNodesList =[]
     allMCSsList =[]
     allCETRMMList =[]
+
+    #for GrADs
     subprocess.call('export DISPLAY=:0.0', shell=True)
 
-    mainDirStr= "/Users/kimwhitehall/Documents/HU/research/thesis/presentation/caseStudies/BFStudy1"
-    #mainDirStr= "/home/whitehal/mccsearch/caseStudy2"
-    #directories for the original data
-    #TRMMdirName ="/home/whitehal/summer2006TRMM"
-    #CEoriDirName = "/home/whitehal/17Jul30Sep/mergNETCDF" 
-    TRMMdirName = "/Users/kimwhitehall/Documents/HU/research/DATA/TRMM" #compSciPaper/case2/TRMM"
-    CEoriDirName = "/Users/kimwhitehall/Documents/HU/research/DATA/mergNETCDF"
-    #allMCSsDict ={{}}
+    mainDirStr= "/directory/to/where/to/store/outputs"
+    TRMMdirName = "/directory/to/the/TRMM/netCDF/files" 
+    CEoriDirName = "/directory/to/the/MERG/netCDF/files"
 
+    #for first time working with the raw MERG zipped files 
     # mccSearch.preprocessingMERG("/Users/kimwhitehall/Documents/HU/research/DATA")
-    # sys.exit()
+    # ---------------------------------------------------------------------------------
 
-    # # mccSearch.plotAccTRMM(TRMMCEdirName)
-    # sys.exit()
 
     #create main directory and file structure for storing intel
     mccSearch.createMainDirectory(mainDirStr)
     TRMMCEdirName = mainDirStr+'/TRMMnetcdfCEs'
     CEdirName = mainDirStr+'/MERGnetcdfCEs'
 
-    # #mccSearch.postProcessingNetCDF(3,CEoriDirName)
+    # for doing some postprocessing with the clipped datasets instead of running the full
program, e.g.
+    # mccSearch.postProcessingNetCDF(3,CEoriDirName)
     # mccSearch.postProcessingNetCDF(2)
-    # sys.exit()
+    # -------------------------------------------------------------------------------------------------
 
-    #using merg data ***********
+    #let's go!
     print "\n -------------- Read MERG Data ----------"
     mergImgs, timeList = mccSearch.readMergData(CEoriDirName)
     print ("-"*80)
 
+    print 'in main', len(mergImgs)
+    #print 'timeList', timeList
+    print 'TRMMdirName ', TRMMdirName
     print "\n -------------- TESTING findCloudElements ----------"
     CEGraph = mccSearch.findCloudElements(mergImgs,timeList,TRMMdirName)
-    #if the TRMMdirName isnt entered for what ever reason
+    #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(TRMMdirName,timeList)
-    #sys.exit()
+    # ----------------------------------------------------------------------------------------------
     print ("-"*80)
     print "number of nodes in CEGraph is: ", CEGraph.number_of_nodes()
     print ("-"*80)    
@@ -74,32 +70,15 @@ def main():
     MCCList,MCSList = mccSearch.findMCC(prunedGraph)
     print ("-"*80)
     print "MCC List has been acquired ", len(MCCList)
-    # for eachList in MCCList:
-    #     print eachList
-    #     for eachNode in eachList:
-    #         print eachNode, mccSearch.thisDict(eachNode)['nodeMCSIdentifier']
     print "MCS List has been acquired ", len(MCSList)
-    # for eachList in MCSList:
-    #     print eachList
-    #     for eachNode in eachList:
-    #         print eachNode, mccSearch.thisDict(eachNode)['nodeMCSIdentifier']
     print ("-"*80)
-    #sys.exit()
-    print "\n -------------- TESTING TRMM ----------"
     #now ready to perform various calculations/metrics
     print "\n -------------- TESTING METRICS ----------"
-    #MCCTimes, tdelta = mccSearch.temporalAndAreaInfoMetric(MCCList)
-    print ("-"*80)
-    #print "MCCTimes is: ", MCCTimes
-    #mccSearch.plotAccTRMM(MCCList)
-    # mccSearch.displayPrecip(MCCList)
-    # mccSearch.plotAccuInTimeRange('2009-09-01_00:00:00', '2009-09-01_23:00:00')
-    # mccSearch.displaySize(MCCList)
-    # mccSearch.displayPrecip(MCCList)
-    # mccSearch.plotHistogram(MCCList)
-    print "creating the MCC userfile ", mccSearch.createTextFile(MCCList,1)
-    print "creating the MCS userfile ", mccSearch.createTextFile(MCSList,2)
 
+    #some calculations/metrics that work that work
+    # print "creating the MCC userfile ", mccSearch.createTextFile(MCCList,1)
+    # print "creating the MCS userfile ", mccSearch.createTextFile(MCSList,2)
+    # MCCTimes, tdelta = mccSearch.temporalAndAreaInfoMetric(MCCList)
     # print "number of MCCs is: ", mccSearch.numberOfFeatures(MCCList)
     # print "longest duration is: ", mccSearch.longestDuration(MCCTimes), "hrs"
     # print "shortest duration is: ", mccSearch.shortestDuration(MCCTimes), "hrs"
@@ -107,33 +86,14 @@ def main():
     # print "Average duration is: ", mccSearch.averageDuration(MCCTimes), "hrs"
     # print "Average size is: ", mccSearch.averageFeatureSize(MCCList), "km^2" 
     
-    # #print "Average duration is: ", mccSearch.convert_timedelta(mccSearch.averageMCCLength(MCCTimes))
-    # hist, bin_edges = mccSearch.commonFeatureSize(allMCSsList)
-    # print "Histogram is ", hist, bin_edges
-    # plt.bar(bin_edges[:-1], hist, width = 10)
-    # plt.xlim(min(bin_edges), max(bin_edges))
-    # plt.show()   
-
     #some plots that work
     # mccSearch.plotAccTRMM(MCCList)
     # mccSearch.displayPrecip(MCCList)
-    # mccSearch.plotAccuInTimeRange('2009-09-01_00:00:00', '2009-09-01_23:00:00')
+    # mccSearch.plotAccuInTimeRange('2009-09-01_00:00:00', '2009-09-01_09:00:00')
     # mccSearch.displaySize(MCCList)
     # mccSearch.displayPrecip(MCCList)
-    # mccSearch.plotHistograms(MCCList)
-    #sys.exit()
+    # mccSearch.plotHistogram(MCCList)
     #
     print ("-"*80)
-
-    # allCETRMMList = mccSearch.precipTotals(MCCList) #allMCSsList)
-    # print "********** findPrecipRate found"
-    # allCETRMMList = mccSearch.findPrecipRate(CEdirName,TRMMdirName)
-    # allCETRMMList = mccSearch.precipTotals(MCCList) #allMCSsList)
-    
-    # allCETRMMList = mccSearch.precipTotals(MCCList) #allMCSsList)
-    # print ("-"*80)
-    # print "allCETRMMList List has been aquired ", len(allCETRMMList), allCETRMMList
-    # print ("-"*80)
-    # # sys.exit()
     
 main()
\ No newline at end of file


Mime
View raw message