nsf_broad_to_narrow = {
    'life_ag':['Agricultural sciences and natural resources','Biological and biomedical sciences','Health sciences'],\
    'chem_phys':['Chemistry','Geosciences, atmospheric sciences, and ocean sciences','Physics and astronomy'],\
    'math_cs':['Mathematics and statistics', 'Computer and information sciences'],\
    'engineering':['Aerospace, aeronautical, and astronautical engineering','Bioengineering and biomedical engineering',\
                   'Chemical engineering','Civil engineering','Electrical, electronics, and communications engineering', \
                   'Industrial and manufacturing engineering','Materials science engineering','Mechanical engineering',\
                   'Other engineering'],\
    'psych_soc':['Psychology', 'Anthropology', 'Economics', 'Political science and government', 'Sociology',\
                    'Other social sciences'],\
    'education':['Education administration','Education research','Teacher education','Teaching fields','Other education'],\
    'humanities':['Foreign languages and literature','History','Letters','Other humanities and arts'],\
    'business':['Business management and administration','Communication'],\
    'none':['Total','Non-S&E fields not elsewhere classified','Detailed field unavailable','Unknown field']
}

nsf_narrow_to_broad = {}
for k in nsf_broad_to_narrow.keys():
    for v in nsf_broad_to_narrow[k]:
        nsf_narrow_to_broad[v] = k

nsf_broad_to_narrow_pd = {
    'life_ag':['Agricultural sciences', 'Biological sciences', 'Neurobiology and neuroscience'],\
    'chem_phys':['Earth, atmospheric, and ocean sciences', 'Physical sciences'],\
    'math_cs':['Computer sciences', 'Mathematics and statistics'],\
    'engineering':['Engineering'],\
    'psych_soc':['Family and consumer sciences and human sciences', 'Psychology', 'Social sciences'],\
    'none':['Use Broad Fields for 2017 and later', 'Communication',\
            'Multidisciplinary and interdisciplinary studies', 'Clinical medicine', 'Other health'],\
}

nsf_narrow_to_broad_pd = {}
for k in nsf_broad_to_narrow_pd.keys():
    for v in nsf_broad_to_narrow_pd[k]:
        nsf_narrow_to_broad_pd[v] = k
        

broad_to_narrow = {
    'life_ag':['alzh', 'anatomy', 'angiogenesis', 'animalscience', 'astrobiology', 'behavior', 'bone', 'cancer', 'cellbio', \
               'cellgenetherapy', 'chronobiology', 'compbio', 'csd', 'dev', 'ecotox', 'entomology', 'epidemiology', 'evol', \
               'fly', 'genetics', 'idtree', 'imaging', 'immunology', 'insectneuropeptides', 'kinesiology', 'mareco', 'marinemammalscience', \
               'medphysradonc', 'microbiology', 'mycology', 'neuro', 'neurooncology', 'npath', 'ntrauma', \
               'nutrition', 'phtree', 'publichealth', 'phycology','physiology', 'plantbio',  \
               'plantsys', 'pombe', 'primate', 'psyphys', 'silviculture', 'ssib', 'stemcell', 'structuralbiology', \
               'telo', 'tereco', 'thee', 'vision'],\
    'chem_phys':['appliedphys', 'astronomy', 'chemistry', 'crystallography', 'coastalscience', 'geoscience', \
                 'meteorology', 'oceanography', 'physics'],\
    'math_cs':['computerscience', 'math'],\
    'engineering':['biomech', 'bme', 'etree', 'environment', 'fluids', 'materials', 'robotics'],\
    'psych_soc':['anthropology', 'cityplanning', 'division', 'division45', 'econ', 'geography', \
                    'grouprelations', 'hdfs', 'iotree', 'ling', 'polisci', 'psych', 'publicpolicy', 'socialpsych', \
                    'sociology', 'sts'],\
    'education':['educ'],\
    'humanities':['architecture', 'arthistory', 'bioethics', 'hist',  'law', 'literature', 'music', 'orientalstudies', \
                  'phil', 'theology', 'writingstudies'],\
    'business':['advert', 'business', 'mis', 'nonprofit', 'orgcommunication', 'mgt'],\
    'none':[\
            #medicine and/or clinical psychology
            'bronchopulmonology', 'hypnosis', 'kinesiology', 'musictherapy', 'neurosurgery', 'nursing', 'pedsurgeons', 'plasticsurgery', \
            'surgicalcriticalcare', 'womenshealth', \
            #trees based on institution not discipline
            'bcm', 'mich', 'uncw',\
            #no data in tree
            'iotree'],\
}

narrow_to_broad = {}
for k in broad_to_narrow.keys():
    for v in broad_to_narrow[k]:
        narrow_to_broad[v] = k

broad_abbrev = {
    'life_ag':'Li',\
    'chem_phys':'Ph',\
    'math_cs':'Ma',\
    'engineering':'En',\
    'psych_soc':'So',\
    'education':'Ed',\
    'humanities':'Hu',\
    'business':'Bu',\
    'none':'No',\
}

broad_full_name = {
    'life_ag':'Life sciences',\
    'chem_phys':'Physical sciences',\
    'math_cs':'Math & CS',\
    'engineering':'Engineering',\
    'psych_soc':'Social sciences',\
    'education':'Education',\
    'humanities':'Humanities',\
    'business':'Business',\
    'none':'None',\
}

broad_color = {
    #from http://personal.sron.nl/~pault/
    'life_ag': '#77aadd',\
    'chem_phys': '#99ddff',\
    'psych_soc': '#aaaa00',\
    'humanities': '#ee8866',\
    'education': '#dddddd',\
    'engineering': '#ffaabb',\
    'math_cs': '#eedd88',\
    'business': '#000000',\
}

narrow_full_name = {'alzh':'Alzheimer\'s',\
                    'anatomy':'Anatomy',\
                    'angiogenesis':'Angiogenesis',\
                    'animalscience':'Animal Science',\
                    'behavior':'Animal Behavior',\
                    'bioethics': 'Bioethics',\
                    'astrobiology':'Astrobiology',\
                    'cellbio':'Cell Biology',\
                    'cellgenetherapy':'Cell & Gene Therapy',\
                    'chronobiology':'Chronobiology',\
                    'compbio':'Comp. Biology',\
                    'dev':'Dev.Biology',\
                    'entomology':'Entomology',\
                    'environment':'Environmental Engineering',\
                    'epidemiology':'Epidemiology',\
                    'evol':'Evolution',\
                    'fly':'Drosophila Bio.',\
                    'genetics':'Genetics',\
                    'idtree':'Infectious Disease',\
                    'imaging':'Imaging',\
                    'insectneuropeptides': 'Insect Neuropeptides',\
                    'mareco':'Marine Ecology',\
                    'marinemammalscience':'Marine Mammal Science',\
                    'medphysradonc':'Medical Physics',\
                    'microbiology':'Microbiology',\
                    'mycology':'Mycology',\
                    'neuro':'Neuroscience',\
                    'neurooncology':'Neurooncology',\
                    'npath':'Neuropathology',\
                    'ntrauma':'Neurotrauma',\
                    'nursing':'Nursing',\
                    'phtree':'Public Health',\
                    'publichealth':'Public Health',\
                    'phycology':'Phycology',\
                    'physiology':'Physiology',\
                    'plantbio':'Plant Biology',\
                    'plantsys':'Plant Systematics',\
                    'pombe':'Fission Yeast Genetics',\
                    'primate':'Primatology',\
                    'psyphys':'Psychophysiology',\
                    'ssib':'Ingestive Behavior',\
                    'stemcell':'Stem Cell Biology',\
                    'structuralbiology':'Structural Biology',\
                    'telo':'Telomere Biology',\
                    'tereco':'Terrestrial Ecol.',\
                    'thee':'Theoretical Ecol.',\
                    'appliedphys':'Applied Physiology',\
                    'astronomy':'Astronomy',\
                    'chemistry':'Chemistry',\
                    'crystallography':'Crystallography',\
                    'geoscience':'Geoscience',\
                    'meteorology':'Meteorology',\
                    'oceanography':'Oceanography',\
                    'physics':'Physics',\
                    'computerscience':'Computer Science',\
                    'math':'Mathematics',\
                    'biomech':'Biomechanics',\
                    'bme':'Biomedical Eng.',\
                    'etree':'Engineering',\
                    'fluids':'Fluid Dynamics & Combustion',\
                    'robotics':'Robotics',\
                    'anthropology':'Anthropology',\
                    'cityplanning':'City Planning',\
                    'division':'Adult Dev. & Aging',\
                    'division45':'Psych. Culture, Eth., Race',\
                    'econ':'Economics',\
                    'geography':'Geography',\
                    'hdfs':'Human Development & Family',\
                    'hypnosis':'Hypnosis',\
                    'ling':'Linguistics',\
                    'polisci':'Political Science',\
                    'psych':'Psychology',\
                    'publicpolicy':'Public Policy',\
                    'socialpsych':'Social Psychology',\
                    'sociology':'Sociology',\
                    'sts':'Sci. & Tech. Studies',\
                    'csd':'Comm. Sci. & Disorders',\
                    'educ':'Education',\
                    'musictherapy':'Music Therapy',\
                    'architecture':'Architecture',\
                    'arthistory':'Art History',\
                    'hist':'History',\
                    'law':'Law',\
                    'literature':'Literature',\
                    'music':'Music',\
                    'orientalstudies':'Oriental Studies',\
                    'phil':'Philosophy',\
                    'theology':'Theology',\
                    'writingstudies':'Writing Studies',\
                    'advert':'Advertising',\
                    'business':'Business',\
                    'mis':'Management Information Systems',\
                    'nonprofit':'Nonprofit Studies',\
                    'orgcommunication':'Org. Communication',\
                    'bronchopulmonology':'Bronchopulmonology',\
                    'mich':'University of Michigan',\
                    'neurosurgery':'Neurosurgery',\
                    'pedsurgeons':'Pediatric Surgeons',\
                    'plasticsurgery':'Plastic Surgery',\
                    'womenshealth':'Women\'s Health',\
                    'cancer':'Cancer',\
                    'coastalscience':'Coastal Science',
                    'ecotox':'Ecotoxicology',
                    'grouprelations':'Group Relations',
                    'immunology':'Immunology',
                    'iotree':'Industrial and Organizational Psychology',
                    'kinesiology':'Kinesiology',
                    'materials':'Materials Science',
                    'mgt':'Management',
}


narrow_abbrev = {'alzh':'Al',\
                 'anatomy':'An',\
                 'angiogenesis':'Ag',\
                 'animalscience':'AS',\
                 'behavior':'AB',\
                 'astrobiology':'As',\
                 'bioethics':'Be',\
                 'cellbio':'Ce',\
                 'cellgenetherapy':'GT',\
                 'chronobiology':'Ch',\
                 'compbio':'CB',\
                 'dev':'DB',\
                 'entomology':'Et',\
                 'environment':'EE',\
                 'epidemiology':'Ep',\
                 'evol':'Ev',\
                 'fly':'DB',\
                 'genetics':'Ge',\
                 'idtree':'ID',\
                 'imaging':'Im',\
                 'insectneuropeptides':'Ip',\
                 'mareco':'ME',\
                 'marinemammalscience':'MM',\
                 'medphysradonc':'MP',\
                 'microbiology':'Mi',\
                 'mycology':'My',\
                 'neuro':'N',\
                 'neurooncology':'No',\
                 'npath':'Np',\
                 'ntrauma':'Nt',\
                 'nursing':'Nu',\
                 'phtree':'PH',\
                 'publichealth':'PH',\
                 'phycology':'Pg',\
                 'physiology':'Py',\
                 'plantbio':'PB',\
                 'plantsys':'Ps',\
                 'pombe':'FY',\
                 'primate':'Pr',\
                 'psyphys':'Pp',\
                 'ssib':'IB',\
                 'stemcell':'SC',\
                 'structuralbiology':'SB',\
                 'telo':'TB',\
                 'tereco':'TE',\
                 'thee':'Te',\
                 'appliedphys':'AP',\
                 'astronomy':'At',\
                 'chemistry':'C',\
                 'crystallography':'Cy',\
                 'geoscience':'Ge',\
                 'meteorology':'My',\
                 'oceanography':'Oc',\
                 'physics':'P',\
                 'computerscience':'CS',\
                 'math':'M',\
                 'biomech':'Bm',\
                 'bme':'BE',\
                 'etree':'E',\
                 'fluids':'FD',\
                 'robotics':'Ro',\
                 'anthropology':'An',\
                 'cityplanning':'CP',\
                 'division':'AD',\
                 'division45':'ER',\
                 'econ':'E',\
                 'geography':'G',\
                 'hdfs':'DF',\
                 'hypnosis':'Hp',\
                 'ling':'L',\
                 'polisci':'PS',\
                 'psych':'Ps',\
                 'publicpolicy':'Pu',\
                 'socialpsych':'SP',\
                 'sociology':'So',\
                 'sts':'ST',\
                 'csd':'CD',\
                 'educ':'Ed',\
                 'musictherapy':'MT',\
                 'architecture':'Ar',\
                 'arthistory':'AH',\
                 'hist':'H',\
                 'history':'H',\
                 'law':'Lw',\
                 'literature':'Li',\
                 'music':'Mu',\
                 'orientalstudies':'OS',\
                 'phil':'Ph',\
                 'theology':'Th',\
                 'writingstudies':'WS',\
                 'advert':'Ad',\
                 'business':'B',\
                 'mis':'Mg',\
                 'nonprofit':'NS',\
                 'orgcommunication':'OC',\
                 'bronchopulmonology':'Bp',\
                 'mich':'UM',\
                 'neurosurgery':'Ns',\
                 'pedsurgeons':'PS',\
                 'plasticsurgery':'Pl',\
                 'womenshealth':'WH',\
                 'cancer':'Ca',\
                 'coastalscience':'Co',
                 'ecotox':'Ex',
                 'grouprelations':'GR',
                 'immunology':'Im',
                 'iotree':'IO',
                 'kinesiology':'Ky',
                 'materials':'MS',
                 'mgt':'Mg',
}