""" simple Python script to create ADS tophits links TODO: could loop through a few journals maybe exclude books History: 20130915: Original by rgm """ from __future__ import print_function import numpy as np #
  • 2013: # [ Any Journal ] #http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&qform=AST&arxiv_sel=astro-ph&sim_query=YES&ned_query=YES&adsobj_query=YES&aut_logic=OR&obj_logic=OR&author=&object=&start_mon=&start_year=2013&end_mon=&end_year=2013&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=200&start_nr=1&jou_pick=NO&ref_stems=&data_and=ALL&group_and=ALL&start_entry_day=&start_entry_mon=&start_entry_year=&end_entry_day=&end_entry_mon=&end_entry_year=&min_score=&sort=SCORE&data_type=SHORT&aut_syn=YES&ttl_syn=YES&txt_syn=YES&aut_wt=1.0&obj_wt=1.0&ttl_wt=0.3&txt_wt=3.0&aut_wgt=YES&obj_wgt=YES&ttl_wgt=YES&txt_wgt=YES&ttl_sco=YES&txt_sco=YES&version=1 # # [ Nature or Science ] years = range(1950, 2014) years = range(1950, 2020) print(years[0], ' to ', years[-1], len(years)) #years.reverse() print(years[0], ' to ', years[-1], len(years)) print(years) title= 'Top Hits by year' fh=open('tophits_new.html', 'w') fh.write(' ') fh.write('\n') fh.write(' ' + title + ' ') fh.write('\n') fh.write('') fh.write('\n') fh.write('\n') fh.write('\n') fh.write('\n\n') fh.write('\n created with mk_tophits.py\n') fh.write('\n\n') fh.write('\n

    Citations analysis for all authors

    \n') fh.write('\n\n') fh.write('\n

    Top 20 papers sorted by citation count per year

    \n') fh.write('\n') fh.write('\n\n') for year in reversed(years): year=str(year) url_any="http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&qform=AST&arxiv_sel=astro-ph&sim_query=YES&ned_query=YES&adsobj_query=YES&aut_logic=OR&obj_logic=OR&author=&object=&start_mon=&start_year=" + year + "&end_mon=&end_year=" + year + "&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=20&start_nr=1&jou_pick=ALL&ref_stems=&data_and=ALL&group_and=ALL&start_entry_day=&start_entry_mon=&start_entry_year=&end_entry_day=&end_entry_mon=&end_entry_year=&min_score=&sort=CITATIONS&data_type=SHORT&aut_syn=YES&ttl_syn=YES&txt_syn=YES&aut_wt=1.0&obj_wt=1.0&ttl_wt=0.3&txt_wt=3.0&aut_wgt=YES&obj_wgt=YES&ttl_wgt=YES&txt_wgt=YES&ttl_sco=YES&txt_sco=YES&version=1" html_any= '[' + ' Any Publication ]' url_refereed="http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&qform=AST&arxiv_sel=astro-ph&sim_query=YES&ned_query=YES&adsobj_query=YES&aut_logic=OR&obj_logic=OR&author=&object=&start_mon=&start_year=" + year + "&end_mon=&end_year=" + year + "&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=20&start_nr=1&jou_pick=NO&ref_stems=&data_and=ALL&group_and=ALL&start_entry_day=&start_entry_mon=&start_entry_year=&end_entry_day=&end_entry_mon=&end_entry_year=&min_score=&sort=CITATIONS&data_type=SHORT&aut_syn=YES&ttl_syn=YES&txt_syn=YES&aut_wt=1.0&obj_wt=1.0&ttl_wt=0.3&txt_wt=3.0&aut_wgt=YES&obj_wgt=YES&ttl_wgt=YES&txt_wgt=YES&ttl_sco=YES&txt_sco=YES&version=1" html_refereed= '[' + ' Refereed Journal ]' url_ScienceNature= "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&qform=AST&arxiv_sel=astro-ph&sim_query=YES&ned_query=YES&adsobj_query=YES&aut_logic=OR&obj_logic=OR&author=&object=&start_mon=&start_year=" + year + "&end_mon=&end_year=" + year + "&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=20&start_nr=1&jou_pick=NO&ref_stems=Sci%2C+Natur&data_and=ALL&group_and=ALL&start_entry_day=&start_entry_mon=&start_entry_year=&end_entry_day=&end_entry_mon=&end_entry_year=&min_score=&sort=CITATIONS&data_type=SHORT&aut_syn=YES&ttl_syn=YES&txt_syn=YES&aut_wt=1.0&obj_wt=1.0&ttl_wt=0.3&txt_wt=3.0&aut_wgt=YES&obj_wgt=YES&ttl_wgt=YES&txt_wgt=YES&ttl_sco=YES&txt_sco=YES&version=1" html_ScienceNature= '[ Science or Nature ]' url_Nature= "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&qform=AST&arxiv_sel=astro-ph&sim_query=YES&ned_query=YES&adsobj_query=YES&aut_logic=OR&obj_logic=OR&author=&object=&start_mon=&start_year=" + year + "&end_mon=&end_year=" + year + "&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=20&start_nr=1&jou_pick=NO&ref_stems=Natur&data_and=ALL&group_and=ALL&start_entry_day=&start_entry_mon=&start_entry_year=&end_entry_day=&end_entry_mon=&end_entry_year=&min_score=&sort=CITATIONS&data_type=SHORT&aut_syn=YES&ttl_syn=YES&txt_syn=YES&aut_wt=1.0&obj_wt=1.0&ttl_wt=0.3&txt_wt=3.0&aut_wgt=YES&obj_wgt=YES&ttl_wgt=YES&txt_wgt=YES&ttl_sco=YES&txt_sco=YES&version=1" html_Nature= '[ Nature ]' url_Science= "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&qform=AST&arxiv_sel=astro-ph&sim_query=YES&ned_query=YES&adsobj_query=YES&aut_logic=OR&obj_logic=OR&author=&object=&start_mon=&start_year=" + year + "&end_mon=&end_year=" + year + "&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=20&start_nr=1&jou_pick=NO&ref_stems=Sci&data_and=ALL&group_and=ALL&start_entry_day=&start_entry_mon=&start_entry_year=&end_entry_day=&end_entry_mon=&end_entry_year=&min_score=&sort=CITATIONS&data_type=SHORT&aut_syn=YES&ttl_syn=YES&txt_syn=YES&aut_wt=1.0&obj_wt=1.0&ttl_wt=0.3&txt_wt=3.0&aut_wgt=YES&obj_wgt=YES&ttl_wgt=YES&txt_wgt=YES&ttl_sco=YES&txt_sco=YES&version=1" html_Science= '[ Science ]' print() print('
  • ' + year +': ') print() print(html_any) print() print(html_refereed) print() print(html_ScienceNature) print() fh.write('\n') fh.write('
  • ' + year +': ') fh.write('\n') fh.write(html_any) fh.write('\n\n') fh.write(html_refereed) fh.write('\n\n') fh.write(html_ScienceNature) fh.write('\n\n') fh.write(html_Nature) fh.write('\n\n') fh.write(html_Science) fh.write('\n\n') print(years[0], ' to ', years[-1], len(years)) #years.reverse() print(years[0], ' to ', years[-1], len(years)) print(years) decades=range(1990, 2010, 10) print(decades) decades = np.linspace(1900, 2010, 12) print(decades) fh.write('\n\n') fh.write('\n

    Top 20 papers sorted by citation count per decade

    \n') fh.write('\n') fh.write('\n\n') for decade in reversed(decades): print(str(decade), str(decade+9)) print(str(int(decade)), str(int(decade+9))) start_year=str(int(decade)) end_year=str(int(decade+9)) url_any="http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&qform=AST&arxiv_sel=astro-ph&sim_query=YES&ned_query=YES&adsobj_query=YES&aut_logic=OR&obj_logic=OR&author=&object=&start_mon=&start_year=" + start_year + "&end_mon=&end_year=" + end_year + "&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=20&start_nr=1&jou_pick=ALL&ref_stems=&data_and=ALL&group_and=ALL&start_entry_day=&start_entry_mon=&start_entry_year=&end_entry_day=&end_entry_mon=&end_entry_year=&min_score=&sort=CITATIONS&data_type=SHORT&aut_syn=YES&ttl_syn=YES&txt_syn=YES&aut_wt=1.0&obj_wt=1.0&ttl_wt=0.3&txt_wt=3.0&aut_wgt=YES&obj_wgt=YES&ttl_wgt=YES&txt_wgt=YES&ttl_sco=YES&txt_sco=YES&version=1" html_any= '[' + ' Any Publication ]' url_refereed="http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&qform=AST&arxiv_sel=astro-ph&sim_query=YES&ned_query=YES&adsobj_query=YES&aut_logic=OR&obj_logic=OR&author=&object=&start_mon=&start_year=" + start_year + "&end_mon=&end_year=" + end_year + "&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=20&start_nr=1&jou_pick=NO&ref_stems=&data_and=ALL&group_and=ALL&start_entry_day=&start_entry_mon=&start_entry_year=&end_entry_day=&end_entry_mon=&end_entry_year=&min_score=&sort=CITATIONS&data_type=SHORT&aut_syn=YES&ttl_syn=YES&txt_syn=YES&aut_wt=1.0&obj_wt=1.0&ttl_wt=0.3&txt_wt=3.0&aut_wgt=YES&obj_wgt=YES&ttl_wgt=YES&txt_wgt=YES&ttl_sco=YES&txt_sco=YES&version=1" html_refereed= '[' + ' Refereed Journal ]' url_Nature= "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&qform=AST&arxiv_sel=astro-ph&sim_query=YES&ned_query=YES&adsobj_query=YES&aut_logic=OR&obj_logic=OR&author=&object=&start_mon=&start_year=" + start_year + "&end_mon=&end_year=" + end_year + "&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=20&start_nr=1&jou_pick=NO&ref_stems=Natur&data_and=ALL&group_and=ALL&start_entry_day=&start_entry_mon=&start_entry_year=&end_entry_day=&end_entry_mon=&end_entry_year=&min_score=&sort=CITATIONS&data_type=SHORT&aut_syn=YES&ttl_syn=YES&txt_syn=YES&aut_wt=1.0&obj_wt=1.0&ttl_wt=0.3&txt_wt=3.0&aut_wgt=YES&obj_wgt=YES&ttl_wgt=YES&txt_wgt=YES&ttl_sco=YES&txt_sco=YES&version=1" html_Nature= '[ Nature ]' url_Science= "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&qform=AST&arxiv_sel=astro-ph&sim_query=YES&ned_query=YES&adsobj_query=YES&aut_logic=OR&obj_logic=OR&author=&object=&start_mon=&start_year=" + start_year + "&end_mon=&end_year=" + end_year + "&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=20&start_nr=1&jou_pick=NO&ref_stems=Sci&data_and=ALL&group_and=ALL&start_entry_day=&start_entry_mon=&start_entry_year=&end_entry_day=&end_entry_mon=&end_entry_year=&min_score=&sort=CITATIONS&data_type=SHORT&aut_syn=YES&ttl_syn=YES&txt_syn=YES&aut_wt=1.0&obj_wt=1.0&ttl_wt=0.3&txt_wt=3.0&aut_wgt=YES&obj_wgt=YES&ttl_wgt=YES&txt_wgt=YES&ttl_sco=YES&txt_sco=YES&version=1" html_Science= '[ Science ]' fh.write('\n') fh.write('
  • ' + start_year +': ') fh.write('\n') fh.write(html_any) fh.write('\n\n') fh.write(html_refereed) fh.write('\n\n') fh.write(html_Nature) fh.write('\n\n') fh.write(html_Science) fh.write('\n\n') fh.write('\n') fh.write('\n') fh.write('') fh.write('\n') fh.flush() fh.close()