コード例 #1
0
ax.set_xlabel ("Seeing")
ax.set_ylabel ("Count".title ())
ax.legend ()

pdfPages.savefig (fig)
plt.close (fig)
pdfPages.close ()

#get list of (day, day, pc)
correlations = ambient.selfCorrelate (seeingDays, args.start_minutes*60, args.stop_minutes*60, args.past_midnight, args.min_points)
#sort on pc
correlations = sorted (correlations, key=lambda x: x[2], reverse=not args.worst)

utils.dumpList (os.path.join (args.outdir, "SxS.corr"), correlations,
               lambda out, item: out.write ("{:%m/%d/%y} {:%m/%d/%y} {:.5f} ({:d}, {:d}, {:d})\n".format (item[0].datetime, item[1].datetime, item [2],
                                                                                        item[3][0],
                                                                                        item[3][1],
                                                                                        item[3][2])))

#remove rows with nonsense pc values
#leave them in and they'll be colored white
#correlations = [t for t in correlations if t[2] <= 1.0]

#make a matrix instead of a list so we can do a matrix plot of everything
corrMatrix = ambient.makeCorrelationMatrix (seeingDays, correlations)
pdfPages = PdfPages (os.path.join (args.outdir, "SxS.pdf"))

utils.plot2dArray (corrMatrix, pdfPages,
                  "self correlation of \"seeing\" at {}\n{:%m/%d/%Y} - {:%m/%d/%Y}".
                  format (os.path.basename (args.indir), seeingDays[0].datetime, seeingDays[-1].datetime),
                  "day", "day", "pearson coefficient")
コード例 #2
0
    return

  if not day1 or not day0.good:
    out.write ("{:%m/%d/%y}\n".format (day0.datetime))
  else:
    out.write ("{:%m/%d/%y} {:%m/%d/%y} {:.5f} \
    ({} {}) ({} {}))\n".format (day0.datetime,
                            day1.datetime,
                            c[2],
                            day0.firstGoodMeasurement[0],
                            day1.lastGoodMeasurement[0],
                            day1.firstGoodMeasurement[0],
                            day1.lastGoodMeasurement[0]))


utils.dumpList (os.path.join (args.outdir, "{}-{}.corr").format (args.indirs [0].name, args.indirs [1].name), correlations, writeCorr)

pdfPages = PdfPages (os.path.join (args.outdir, "seeing-{}x{}.pdf").format (args.indirs [0].name, args.indirs [1].name))
matrix = ambient.goodSquareCorrelate (seeing [0], seeing [1], args.min_points)
utils.plot2dArray (matrix, pdfPages,
                  "correlation of \"seeing\" {} &\n {}".format (args.indirs [0], args.indirs [1]),
                  "day", "day", "pearson coefficient")
pdfPages.close ()



# p1. plot days across X axis, and 5 sensors ‘X’ on Y axis, like pc-seeing+all.pdf., except color
#missing data points white to distinguish no data from zero correlation data
#make a 2d color plot of days on the x axis and sensors names on the Y axis and each
#grid point (x,y) is pc seeing vs y at day x