def get_noaa_and_image_centroids(image_features_dict, noaa_data):
	'''
	Output: noaa_cents_labels, tuple
			my_cents, nested lists
	'''
	
	# For Local Series Computing, uncomment function 
	#noaa_data = load_noaa_data()
	
	
	# Cluster/Parallel computing 
	# noaa_data will have already been pushed  into each engine
	noaa_cents_labels_sameDay, \
	noaa_cents_labels_prevDay=\
	Centroid_Labeling.get_currentDay_previusDay_noaa_activeRegions(image_features_dict, noaa_data)

	_, hour, minute = image_features_dict["image_time"].split(":")

	# check if image occured in 1st or 2nd half of the day 
	if int(hour) >= 12:
		noaa_cents_labels = noaa_cents_labels_sameDay
	else:
		noaa_cents_labels = noaa_cents_labels_prevDay

	my_cents = extract_image_features.get_image_active_region_centroids(image_features_dict, split_centroids = False)
	
	return my_cents, noaa_cents_labels
Esempio n. 2
0
def plot_sunspots_and_active_regions(df, scan_year, features, time_slice):
    '''
        use scan_year to shift through noaa observations
        use time_slice to scan through image data
    '''
    
    noaa_cents, _  = extract.get_noaa_centroids(df, scan_year)
    noaa_x, noaa_y = unpack_noaa_cents(noaa_cents)
    x_cents, y_cents= extract.get_image_active_region_centroids(features[time_slice])
    plt.figure(figsize=(10,10))
    noaa = plt.scatter(noaa_x, noaa_y, c='b', marker='o');
    me = plt.scatter(x_cents, y_cents , c='r',marker='+');
    plt.title("Sunspots & Active Regions    " + scan_year);
    plt.legend((me, noaa),
               ('mydata-sunspots', 'noaa-AR'),
               scatterpoints=1,
               loc='lower right',
               ncol=2,
               fontsize=15);