-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathwrongsize.py
More file actions
38 lines (26 loc) · 861 Bytes
/
Copy pathwrongsize.py
File metadata and controls
38 lines (26 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from pymongo import MongoClient
client = MongoClient('localhost', 27017)
gz = client['galaxy_zoo']
subjects = gz['galaxy_zoo_subjects']
ouroboros = client['ouroboros']
discussions = ouroboros['discussions']
tags = ['wrongsize','wrong_size','imagesizewrong']
wstags = discussions.find({'comments.tags':{'$in':tags},'focus.type':'GalaxyZooSubject'})
zids = []
for tag in wstags:
zids.append(tag['focus']['_id'])
surveys = []
# Check to see what survey groups these are attached to
surveys = []
for zid in zids:
s = subjects.find_one({'zooniverse_id':zid})
survey = s['metadata']['survey']
if survey != 'decals':
zids.remove(zid)
surveys.append(survey)
# Print results to screen
from collections import Counter
print Counter(surveys)
with open("../csv/wrong_size.csv",'w') as f:
for zid in zids:
print >> f,zid