Exemplo n.º 1
0
	        print "- Last week plot"
	        subset_expr = radius_expr + " && ml > -2 && time > " + str(epoch1weekago)
	        print "- subsetting with\n\t" + subset_expr
	        dictorigin = dict();
      		dictorigin, n_week[record['place']] = dbgetorigins(db, subset_expr)
        	if n_week[record['place']] > 0:
			binsize = 1.0
                        #locator = mpl.dates.AutoDateLocator()
                        locator = mpl.dates.DayLocator()
                        #formatter = mpl.dates.AutoDateFormatter(locator)
                        formatter = mpl.dates.DateFormatter('%d\n%b')
			bin_edges = np.arange(snum1weekago, enum, binsize)
        	        ax1 = fig1.add_subplot(221)
        	        giseis.plot_time_ml(ax1, dictorigin, locator, formatter, snum1weekago, enum)
        	        ax2 = fig1.add_subplot(222)
        	        giseis.plot_counts(ax2, dictorigin, locator, formatter, bin_edges, snum1weekago, enum)
	
	        ### Last year plot
	        print "- Last year plot"
	        subset_expr = radius_expr + " && ml > -2 && time > " + str(epoch1yearago)
	        print "- subsetting with\n\t" + subset_expr
	        dictorigin = dict();
	        dictorigin, n_year[record['place']] = dbgetorigins(db, subset_expr)
	        if n_year[record['place']] > 0:
			binsize = 7.0
	                #locator = mpl.dates.AutoDateLocator()
	                locator = mpl.dates.MonthLocator()
                	#formatter = mpl.dates.AutoDateFormatter(locator)
			formatter = mpl.dates.DateFormatter('%b\n%Y')
			bin_edges = np.arange(snum1yearago, enum, binsize)
                	ax3 = fig1.add_subplot(223)
Exemplo n.º 2
0
		# create the figure canvas
		fig1 = plt.figure()

		# add subplot - ml versus time
		ax1 = fig1.add_subplot(311)
		modgiseis.plot_time_ml(ax1, dictorigin, locator, formatter, snum, enum)

		if numevents > 1:

			# Compute bin_edges based on the first and last event times
			bin_edges, snum, enum = modgiseis.compute_bins(dictorigin, snum, enum)
	
			# add subplot - counts versus time
			ax2 = fig1.add_subplot(312)
			modgiseis.plot_counts(ax2, dictorigin, locator, formatter, bin_edges, snum, enum)
		
			# add subplot - energy versus time
			ax3 = fig1.add_subplot(313)
			modgiseis.plot_energy(ax3, dictorigin, locator, formatter, bin_edges, snum, enum)

		####### SAVE FIGURE

		# save the figure to outfile
		print "- saving to " + outfile
		fig1.savefig(outfile)




if __name__ == "__main__":
Exemplo n.º 3
0
        # create the figure canvas
        fig1 = plt.figure()

        # add subplot - ml versus time
        ax1 = fig1.add_subplot(311)
        modgiseis.plot_time_ml(ax1, dictorigin, locator, formatter, snum, enum)

        if numevents > 1:

            # Compute bin_edges based on the first and last event times
            bin_edges, snum, enum = modgiseis.compute_bins(
                dictorigin, snum, enum)

            # add subplot - counts versus time
            ax2 = fig1.add_subplot(312)
            modgiseis.plot_counts(ax2, dictorigin, locator, formatter,
                                  bin_edges, snum, enum)

            # add subplot - energy versus time
            ax3 = fig1.add_subplot(313)
            modgiseis.plot_energy(ax3, dictorigin, locator, formatter,
                                  bin_edges, snum, enum)

        ####### SAVE FIGURE

        # save the figure to outfile
        print "- saving to " + outfile
        fig1.savefig(outfile)


if __name__ == "__main__":
    if len(sys.argv) > 1: