In [1]:
%run basics
%matplotlib


Using matplotlib backend: Qt4Agg

In [2]:
cf = {"Files":{},"Options":{}}
cf["Options"]["Filterist"] = ["Fc"]
cf["Options"]["TurbulenceFilter"] = "ustar"
cf["Options"]["DayNightFilter"] = "Fsd"
cf["Options"]["UseFsdsyn_threshold"] = "No"
cf["Options"]["AcceptDayTimes"] = "Yes"
cf["Options"]["UseEveningFilter"] = "No"
cf["Options"]["EveningFilterLength"] = 3
cf["Options"]["Fsd_threshold"] = 10
cf["Options"]["sa_threshold"] = -5

In [3]:
site_name_list = ["AdelaideRiver","Calperum","CapeTribulation","CowBay","CumberlandPlains",
                  "DalyPasture","DalyUncleared","DryRiver","Emerald","FoggDam","Gingin",
                  "GreatWesternWoodlands","HowardSprings","Otway","RedDirtMelonFarm","RiggsCreek",
                  "RobsonCreek","Samford","SturtPlains","Tumbarumba","Whroo","WombatStateForest",
                  "Yanco"]

In [5]:
for site_name in site_name_list:
    cf["Files"]["file_path"] = "/mnt/OzFlux/Sites/"+site_name+"/Data/Portal/"
    cf["Files"]["in_filename"] = site_name+"_L3.nc"
    cf["Files"]["cpd_filename"] = site_name+"_L3_CPD.xls"
    in_name = qcio.get_infilenamefromcf(cf)
    cpd_name = os.path.join(cf["Files"]["file_path"],cf["Files"]["cpd_filename"])
    if not os.path.exists(in_name):
        print " netCDF file not found: ",in_name
        continue
    if not os.path.exists(cpd_name):
        print " CPD file not found: ",cpd_name
        continue
    ds = qcio.nc_read_series(in_name)
    qcck.ApplyTurbulenceFilter(cf,ds)
    ldt = ds.series["DateTime"]["Data"]
    Fc_nf_data,Fc_nf_flag,attr = qcutils.GetSeriesasMA(ds,"Fc_nofilter")
    Fc_f_data,Fc_f_flag,attr = qcutils.GetSeriesasMA(ds,"Fc_filtered")
    dind,f,a = qcutils.GetSeries(ds,"day_indicator")
    tind,f,a = qcutils.GetSeries(ds,"turbulence_indicator")
    idx_nt = numpy.where((dind==0)&(tind==1))[0]
    idx_n = numpy.where(dind==0)[0]
    nRecs = len(ldt)
    print "Processing: ",site_name,int(100*float(numpy.ma.count(Fc_nf_data))/nRecs),\
          int(100*float(numpy.ma.count(Fc_f_data))/nRecs),int(100*float(len(idx_nt))/nRecs)


WARNING:qc.utils:get_UTCfromlocaltime: time_zone not in global attributes, checking elsewhere ...
Processing:  AdelaideRiver 86 62 21
Processing:  Calperum 88 65 23
Processing:  CapeTribulation 72 50 18
Processing:  CowBay 71 54 22
Processing:  CumberlandPlains 83 53 13
Processing:  DalyPasture 71 48 13
Processing: 
WARNING:qc.utils:get_UTCfromlocaltime: time_zone not in global attributes, checking elsewhere ...
 DalyUncleared 80 50 11
Processing: 
WARNING:qc.utils:get_UTCfromlocaltime: time_zone not in global attributes, checking elsewhere ...
 DryRiver 71 46 11
Processing: 
WARNING:qc.utils:get_UTCfromlocaltime: time_zone not in global attributes, checking elsewhere ...
 Emerald 78 54 21
 CPD file not found:  /mnt/OzFlux/Sites/FoggDam/Data/Portal/FoggDam_L3_CPD.xls
Processing:  Gingin 75 52 14
Processing:  GreatWesternWoodlands 89 58 17
 CPD file not found:  /mnt/OzFlux/Sites/HowardSprings/Data/Portal/HowardSprings_L3_CPD.xls
Processing: 
WARNING:qc.utils:get_UTCfromlocaltime: time_zone not in global attributes, checking elsewhere ...
 Otway 79 60 19
Processing:  RedDirtMelonFarm 84 57 15
Processing:  RiggsCreek 75 60 20
Processing: 
WARNING:qc.utils:get_UTCfromlocaltime: time_zone not in global attributes, checking elsewhere ...
 RobsonCreek 77 48 13
Processing:  Samford 53 41 13
Processing:  SturtPlains 83 53 12
Processing:  Tumbarumba 44 36 16
Processing: 
WARNING:qc.utils:get_UTCfromlocaltime: time_zone not in global attributes, checking elsewhere ...
 Whroo 88 61 18
Processing:  WombatStateForest 64 47 15
Processing:  Yanco 78 49 12

In [ ]: