KeplerGO / KeplerScienceWebsite

Website for the Kepler/K2 Science Center.
http://keplerscience.arc.nasa.gov
11 stars 19 forks source link

Put the C0-1-2-3 target lists online #52

Closed mrtommyb closed 8 years ago

mrtommyb commented 8 years ago

The C8 target list is now final and therefor we can post it online.

mrtommyb commented 8 years ago

the target list is there but we still need to make the webpage and list abstracts

barentsen commented 8 years ago

I started working on the webpage listing C8 programs.

barentsen commented 8 years ago

I added the C8 approved programs table to the website using the silly script below and pushed to GitHub.

@mrtommyb For abstracts, can I use the text from the "Summary" column in the K2GO3_2 Investigation Report spreadsheet (which could be automated), or do we want to grab the abstracts directly from the proposals?

import pandas as pd

if __name__ == "__main__":
    target_table = pd.read_csv("K2Campaign8targets.csv")
    propdf = pd.read_csv("K2GO3_2 Investigation Report.csv")

    # First we extract the GO proposal IDs from the target list
    investigation_ids = []
    for invid in target_table[" Investigation IDs"]:
        investigation_ids.extend(invid.split("|"))
    # Extract the prefix bit from those IDs starting with "GO"
    go_ids = sorted(set([invid.split("_")[0]
                         for invid in investigation_ids
                         if invid.startswith("GO")]))

    # Extract corresponding PI names and titles
    website_table = []
    for goid in go_ids:
        seqnum = int(goid[3:])
        proposal = propdf.loc[propdf['Response seq number'] == seqnum]

        website_table.append({"id": goid,
                              "pi": proposal['PI Last name'].iloc[0],
                              "title": proposal['Title'].iloc[0]})

    for row in website_table:
        print("""<tr>\n"""
              """  <td>{id}</td>\n"""
              """  <td>{pi}</td>\n"""
              """  <td>{title}</td>\n"""
              """  <td></td>\n"""
              """</tr>\n""".format(**row))
kcolon commented 8 years ago

The summary column is exactly what we want, I believe!

On Dec 18, 2015, at 12:27 AM, Geert Barentsen notifications@github.com wrote:

I added the C8 approved programs table to the website using the silly script below and pushed to GitHub.

@mrtommyb https://github.com/mrtommyb For abstracts, can I use the text from the "Summary" column in the K2GO3_2 Investigation Report spreadsheet (which could be automated), or do we want to grab the abstracts directly from the proposals?

import pandas as pd

if name == "main": target_table = pd.read_csv("K2Campaign8targets.csv") propdf = pd.read_csv("K2GO3_2 Investigation Report.csv")

# First we extract the GO proposal IDs from the target list
investigation_ids = []
for invid in target_table[" Investigation IDs"]:
    investigation_ids.extend(invid.split("|"))
# Extract the prefix bit from those IDs starting with "GO"
go_ids = sorted(set([invid.split("_")[0]
                     for invid in investigation_ids
                     if invid.startswith("GO")]))

# Extract corresponding PI names and titles
website_table = []
for goid in go_ids:
    seqnum = int(goid[3:])
    proposal = propdf.loc[propdf['Response seq number'] == seqnum]

    website_table.append({"id": goid,
                          "pi": proposal['PI Last name'].iloc[0],
                          "title": proposal['Title'].iloc[0]})

for row in website_table:
    print("""<tr>\n"""
          """  <td>{id}</td>\n"""
          """  <td>{pi}</td>\n"""
          """  <td>{title}</td>\n"""
          """  <td></td>\n"""
          """</tr>\n""".format(**row))

— Reply to this email directly or view it on GitHub https://github.com/KeplerGO/KeplerScienceWebsite/issues/52#issuecomment-165713072.

mrtommyb commented 8 years ago

I agree with Knicole

On Dec 18, 2015, at 10:54 AM, Knicole Colon notifications@github.com wrote:

The summary column is exactly what we want, I believe!

On Dec 18, 2015, at 12:27 AM, Geert Barentsen notifications@github.com wrote:

I added the C8 approved programs table to the website using the silly script below and pushed to GitHub.

@mrtommyb https://github.com/mrtommyb For abstracts, can I use the text from the "Summary" column in the K2GO3_2 Investigation Report spreadsheet (which could be automated), or do we want to grab the abstracts directly from the proposals?

import pandas as pd

if name == "main": target_table = pd.read_csv("K2Campaign8targets.csv") propdf = pd.read_csv("K2GO3_2 Investigation Report.csv")

First we extract the GO proposal IDs from the target list

investigation_ids = [] for invid in target_table[" Investigation IDs"]: investigation_ids.extend(invid.split("|"))

Extract the prefix bit from those IDs starting with "GO"

goids = sorted(set([invid.split("")[0] for invid in investigation_ids if invid.startswith("GO")]))

Extract corresponding PI names and titles

website_table = [] for goid in go_ids: seqnum = int(goid[3:]) proposal = propdf.loc[propdf['Response seq number'] == seqnum]

website_table.append({"id": goid, "pi": proposal['PI Last name'].iloc[0], "title": proposal['Title'].iloc[0]})

for row in website_table: print("""\n""" """ {id}\n""" """ {pi}\n""" """ {title}\n""" """ \n""" """\n""".format(**row)) — Reply to this email directly or view it on GitHub https://github.com/KeplerGO/KeplerScienceWebsite/issues/52#issuecomment-165713072.

— Reply to this email directly or view it on GitHub https://github.com/KeplerGO/KeplerScienceWebsite/issues/52#issuecomment-165869365.

barentsen commented 8 years ago

I have pushed the C8 target list, abstracts, and "per-proposal target lists" to the dev server.

Have a look here and see if you like it, before I do this for other campaigns:

http://keplergo.github.io/KeplerScienceWebsite/k2-approved-programs.html

Question: should we add infomation about funding status? Now is the time to do so.

kcolon commented 8 years ago

Wonderful! My only comment is perhaps in the text file we should list the PI with last name first (for consistency with the list of CoIs and because sometimes it’s difficult to determine which of a person’s name is the last name, e.g. http://keplergo.github.io/KeplerScienceWebsite/data/k2-programs/GO8080.txt http://keplergo.github.io/KeplerScienceWebsite/data/k2-programs/GO8080.txt).

On Dec 21, 2015, at 11:05 AM, Geert Barentsen notifications@github.com wrote:

I have pushed the C8 target list, abstracts, and "per-proposal target lists" to the dev server.

Have a look here and see if you like it, before I do this for other campaigns:

http://keplergo.github.io/KeplerScienceWebsite/k2-approved-programs.html http://keplergo.github.io/KeplerScienceWebsite/k2-approved-programs.html Question: should we add infomation about funding status? Now is the time to do so.

— Reply to this email directly or view it on GitHub https://github.com/KeplerGO/KeplerScienceWebsite/issues/52#issuecomment-166391567.

barentsen commented 8 years ago

Fair enough, I've changed the PI "last, first name" order.

kcolon commented 8 years ago

thanks :-) looks great

On Dec 21, 2015, at 11:24 AM, Geert Barentsen notifications@github.com wrote:

Fair enough, I've changed the PI "last, first name" order.

— Reply to this email directly or view it on GitHub https://github.com/KeplerGO/KeplerScienceWebsite/issues/52#issuecomment-166396175.

barentsen commented 8 years ago

C8 target list has been pushed. Will sync with web server at end of day.

Now looking into doing this for other campaigns, so not closing yet.

barentsen commented 8 years ago

Campaigns 4 through 8 have now been reformatted and pushed to github (will sync to live when not in airport):

http://keplergo.github.io/KeplerScienceWebsite/k2-approved-programs.html#campaign-4

@mrtommyb Does a table with e.g. PI names, titles, abstracts exists for C0-1-2-3 programs, or do I need to create one from scratch?

barentsen commented 8 years ago

The C0-1-2-3 program table and target lists have now been re-formatted in the same format as the other campaigns.

For future reference, the script used to format the tables, summaries, and target lists is available at content/pages/k2-observing/approved-programs/create-programs-page.py.

Closing.