<jupyter_start><jupyter_text>Table of Contents1&nbsp;&nbsp;per region2&nbsp;&nbsp;per image_name (= hirise obs_id)3&nbsp;&nbsp;Figure for HiRISE meeting<jupyter_code>from planet4 import region_data, io, stats<jupyter_output><empty_output><jupyter_text>per region<jupyter_code>def process_region(args):
    from planet4 import region_data, io, stats
    regionclass, season = args
    try:
        image_names = getattr(regionclass, season)
    except AttributeError:
        print("No data for that season found.")
        return None
    results = []
    for image_name in image_names:
        df = io.DBManager(s23=False).get_image_name_markings(image_name)
        results.append(stats.get_status_per_classifications(df))
    resdf = pd.DataFrame(dict(image_name=image_names, completion=results))
    resdf['season'] = season
    resdf['region'] = regionclass.__name__
    return resdf
def get_process_list():
    processlist = []
    for season in ['season'+str(i) for i in range(1,5)]:
        for region in region_data.regions:
            processlist.append((region, season))
    return processlist
get_process_list()
from ipyparallel import Client
c = Client()
lbview = c.load_balanced_view()
from nbtools import display_multi_progress
import sys
processlist = get_process_list()
results = lbview.map_async(process_region, processlist)
display_multi_progress(results, processlist)
statusdf = pd.concat(results.result(), ignore_index=True)
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
statusdf[statusdf.completion < 110].hist(bins=50)
get_process_list()
statusdf[statusdf.completion < 95]<jupyter_output><empty_output><jupyter_text>per image_name (= hirise obs_id)<jupyter_code>from planet4 import io
# image_names = io.get_all_image_names()
# image_names = image_names.image_name.unique()
# with open('current_image_names.pkl', 'wb') as f:
#     pickle.dump(image_names, f)
image_names = io.get_image_names_from_db(io.get_current_database_fname())
from planet4 import helper_functions as hf
def process_image_name(image_name):
    from planet4 import helper_functions as hf
    from planet4 import io
    df = io.get_image_name_data(image_name)
    status = hf.get_status_per_classifications(df)
    return image_name, status
def process_image_name(image_name):
    from planet4 import helper_functions as hf
    from planet4 import io
    df = io.get_image_name_data(image_name)
    no_done = hf.get_no_tiles_done(df)
    return {'image_name': image_name, 'no_done': no_done}
from ipyparallel import Client
c = Client()
lbview = c.load_balanced_view()
results = lbview.map_async(process_image_name, image_names)
for result in results:
    print(result)
df = pd.DataFrame(results.result)
df = df.set_index('image_name')
df
df.no_done.sum()
%matplotlib nbagg
df = df.drop('tutorial')
df.plot(kind='hist',bins=30)
df = pd.read_hdf('image_name_status.h5','df')
df.head()<jupyter_output><empty_output><jupyter_text>Figure for HiRISE meeting<jupyter_code>import helper_functions as hf
reload(hf)

pd.__version__

df = hf.get_current_cleaned()

users_work = hf.classification_counts_per_user(df)
topten = users_work.order(ascending=False)[:10]

topten

hf.classification_counts_for_user('Kitharode',df)

for user in topten.index:
    print user
    print df[df.user_name==user].marking.value_counts()

df.marking.value_counts().plot?

s = df.marking.value_counts()

s.plot(kind='bar')
title('Marking stats')

savefig("marking_stats.png",dpi=200)

df.columns

no_nones = df[df.marking != 'None']

hf.get_top_ten_users(no_nones)

topten = hf.get_top_ten_users(df)

topten.plot(kind='bar')
title("Top ten citizens, submissions")
savefig('top_ten_submitters.png',dpi=200)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10887096774193548, 'fraction_numerical': 0.008870967741935484, 'mean_word_length': 5.890740740740741, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '635476', 'license': '0BSD', 'n_tokens_mistral': 1318, 'n_tokens_neox': 1298, 'n_words': 250, 'path': 'notebooks/2015-03-26 General Status.ipynb', 'repo_name': 'CitizenScienceInAstronomyWorkshop/P4_sandbox', 'size': '3720'}