In [1]:
%run basics
%matplotlib


Using matplotlib backend: Qt4Agg

In [5]:
site_list = ["AdelaideRiver","AliceSpringsMulga","Calperum","CapeTribulation",
             "CumberlandPlains","DalyUncleared","Gingin",
             "GreatWesternWoodlands","HowardSprings","RiggsCreek","RobsonCreek",
             "Samford","SturtPlains","TiTreeEast","Tumbarumba","Whroo"]

In [6]:
for site in site_list:
    print "Processing "+site
    # file names
    access_archive_mame = "../Sites/"+site+"/Data/ACCESS/"+site+"_ACCESS.nc"
    access_dap_name = "../ACCESS/201505/"+site+"_ACCESS_201505.nc"
    # read the files
    ds_archive = qcio.nc_read_series(access_archive_mame)
    ds_dap = qcio.nc_read_series(access_dap_name)
    site_name = ds_archive.globalattributes["site_name"]
    # get the start and end datetimes of the overlap period
    dt_archive = ds_archive.series["DateTime"]["Data"]
    dt_dap = ds_dap.series["DateTime"]["Data"]
    start_date = max([dt_archive[0],dt_dap[0]])
    end_date = min([dt_archive[-1],dt_dap[-1]])
    print start_date,end_date
    # get the indices of the overlap period
    si_archive = qcutils.GetDateIndex(dt_archive,str(start_date))
    ei_archive = qcutils.GetDateIndex(dt_archive,str(end_date))
    si_dap = qcutils.GetDateIndex(dt_dap,str(start_date))
    ei_dap = qcutils.GetDateIndex(dt_dap,str(end_date))
    # get the data for the overlap period
    ldt_archive = dt_archive[si_archive:ei_archive+1]
    ldt_dap = dt_dap[si_dap:ei_dap+1]
    archive = {}
    dap = {}
    series_list = ["Fsd","Ta","Ah","Ws","Precip"]
    for item in series_list:
        label = item+"_11"
        archive[item],flag,attr = qcutils.GetSeriesasMA(ds_archive,label,si=si_archive,ei=ei_archive)
        dap[item],flag,attr = qcutils.GetSeriesasMA(ds_dap,label,si=si_dap,ei=ei_dap)
    # plot
    title = site+": ACCESS Archive versus DAP"
    fig = plt.figure()
    plt.figtext(0.5,0.95,title,ha='center',size=16)
    ax1 = plt.subplot(511)
    ax1.plot(ldt_archive,archive["Fsd"],'b.',label="Archive")
    ax1.plot(ldt_dap,dap["Fsd"],'r+',label="DAP")
    plt.ylabel("Fsd (W/m2)")
    ax2 = plt.subplot(512,sharex=ax1)
    ax2.plot(ldt_archive,archive["Ta"],'b.',label="Archive")
    ax2.plot(ldt_dap,dap["Ta"],'r+',label="DAP")
    plt.ylabel("Ta (C)")
    ax3 = plt.subplot(513,sharex=ax1)
    ax3.plot(ldt_archive,archive["Ah"],'b.',label="Archive")
    ax3.plot(ldt_dap,dap["Ah"],'r+',label="DAP")
    plt.ylabel("Ah (g/m3)")
    ax4 = plt.subplot(514,sharex=ax1)
    ax4.plot(ldt_archive,archive["Ws"],'b.',label="Archive")
    ax4.plot(ldt_dap,dap["Ws"],'r+',label="DAP")
    plt.ylabel("Ws (m/s)")
    ax5 = plt.subplot(515,sharex=ax1)
    ax5.plot(ldt_archive,archive["Precip"],'b.',label="Archive")
    ax5.plot(ldt_dap,dap["Precip"],'r+',label="DAP")
    plt.ylabel("Precip (mm)")
    plt.legend(loc='upper left',frameon=False,prop={'size':10})
    figname = "plots/"+site+"_DAP_vs_Archive.png"
    fig.savefig(figname,format='png')
    plt.show()


Processing AdelaideRiver
2015-05-11 15:30:00 2015-06-01 08:30:00
Processing AliceSpringsMulga
2015-05-11 15:30:00 2015-06-01 08:30:00
Processing Calperum
2015-05-11 15:30:00 2015-06-01 08:30:00
Processing CapeTribulation
2015-05-11 16:00:00 2015-06-01 09:00:00
Processing CumberlandPlains
2015-05-11 16:00:00 2015-06-01 09:00:00
Processing DalyUncleared
2015-05-11 15:30:00 2015-06-01 08:30:00
Processing Gingin
2015-05-11 14:00:00 2015-06-01 07:00:00
Processing GreatWesternWoodlands
2015-05-11 14:00:00 2015-06-01 07:00:00
Processing HowardSprings
2015-05-11 15:30:00 2015-06-01 08:30:00
Processing RiggsCreek
2015-05-11 16:00:00 2015-06-01 09:00:00
Processing RobsonCreek
2015-05-11 16:00:00 2015-06-01 09:00:00
Processing Samford
2015-05-11 16:00:00 2015-06-01 09:00:00
Processing SturtPlains
2015-05-11 15:30:00 2015-06-01 08:30:00
Processing TiTreeEast
2015-05-11 15:30:00 2015-06-01 08:30:00
Processing Tumbarumba
2015-05-11 16:00:00 2015-06-01 09:00:00
Processing Whroo
2015-05-11 16:00:00 2015-06-01 09:00:00

In [ ]: