コード例 #1
0
def seeingCorrelations (seeingDays, otherDays):
  """
  :param seeingDays: a list of Day objects for seeing
  :param otherDays: a list of Day objects for some sensor
  :return: correlation list of 3-tuples of pc's
  """
  correlations = ambient.crossCorrelate (seeingDays, otherDays, args.start_minutes*60, args.stop_minutes*60, args.past_midnight, args.min_points)

  #this is a 3-tuple (day, otherDay, pc), day is in seeingDays, otherDay is in otherDays

  #remove rows with nonsense pc values
  correlations = [t for t in correlations if t[2] <= 1.0]

  #filter just pcs in the range we want
  correlations = [t for t in correlations if t [2] >= args.start_pc and t [2] <= args.stop_pc]

  return correlations
コード例 #2
0
  #remove rows with nonsense pc values
  correlations = [t for t in correlations if t[2] <= 1.0]

  #filter just pcs in the range we want
  correlations = [t for t in correlations if t [2] >= args.start_pc and t [2] <= args.stop_pc]

  return correlations

#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
yTicks = []
correlationsArray = []
for p in ambient.parameterBasenames [1:]:
  otherDays = ambient.Days (os.path.join (args.indir, p + ".orig"), args.start_date, args.stop_date, allSeeingDays)
  yTicks.append (p)
  correlations = ambient.crossCorrelate (seeingDays, otherDays.days, args.start_minutes*60, args.stop_minutes*60, args.past_midnight, args.min_points)
  correlationsArray.append (correlations)

ambient.plotSensorSeeingPC (os.path.join (args.outdir, "pc-seeing+all.pdf"), correlationsArray, yTicks, seeingDays, os.path.basename (args.indir))

#make histogram of seeing for all seconds of days and
#seeing for start/stop seconds of all days
pdfPages = PdfPages (os.path.join (args.outdir, "seeing.histogram.pdf"))
fig = plt.figure ()
ax = fig.add_subplot (1, 1, 1)

allSeeing = []
periodSeeing = []
for day in seeingDays:
  values = [m [1] for m in day.measurements]
  allSeeing.extend (values)