grblc.search.ads package
Submodules
grblc.search.ads.ECHO module
grblc.search.ads.cli module
Console script for adsgrb.
grblc.search.ads.config module
- grblc.search.ads.config.read_apikey()[source]
Reads in the required API key for APS queries by setting the ads package’s config.token to the string found in {HOME}/.ads/dev_key.
- Returns
No return.
grblc.search.ads.output module
grblc.search.ads.search module
- grblc.search.ads.search.additionalKeywords(keywords)[source]
Convert keyword(s) to a string to use in an ADS query.
- Parameters
keywords (
list,`tuple`,`str`) – Keywords to specifically search for in addition to the GRB.- Returns
String of keyword(s) separated by an “AND” for use in an ADS query.
- grblc.search.ads.search.gcnSearch(GRB, keywords=None, printlength=True, debug=False)[source]
User function to find GCNs containing the inputted GRB and optional keywords
- Parameters
GRB (
str) – GRB name; e.g., ‘010222’ or ‘200205A’keywords (
list,`tuple`,`str`) – Keywords to specifically search for in addition to the GRB.printlength (
bool) – Determines whether the user would like the number of articles found to be printed.
- Returns
A list of ads.search.Article’s containing GCNs pertaining to GRB and optional keywords.
- grblc.search.ads.search.getArticle(articlelist, article, GRB, firsttry=True, debug=False)[source]
Download an article from arXiv or other sources. :param articlelist:
The string list to append article texts to.
- Parameters
article (
ads.search.Article) – The ADS article to retrieve.- Returns
Nothing. Side effect of appending text of article body to articlelist.
Modified from https://github.com/andycasey/ads/blob/master/examples/monthly-institute-publications/stromlo.py#22
- grblc.search.ads.search.getArticles(finds, threading=True, debug=False)[source]
User function to create a single string containing seperated text bodies from a list of ads.search.Article’s.
- Parameters
papers (
listof ads.search.Article) – A list of ADS articles to download.threading (
bool) – Boolean to specify the use of concurrency.
- Returns
String containing each GCN separated by a line.
- grblc.search.ads.search.getGRBComboQuery(GRB)[source]
Get the several versions of a GRB name that could come up in ADS searches. E.g., 010222A, 10222A, GRB010222A, GRB1022A
- Parameters
GRB (
str) – The GRB to get name combinations of.- Returns
String of GRB name combinations separated by “OR” for search in ADS.
- grblc.search.ads.search.litSearch(GRB, keywords=None, printlength=True, debug=False)[source]
User function to find literature containing the inputted GRB and optional keywords
- Parameters
GRB (
str) – GRB name; e.g., ‘010222’ or ‘200205A’keywords (
list,`tuple`,`str`) – Keywords to specifically search for in addition to the GRB.printlength (
bool) – Determines whether the user would like the number of articles found to be printed.
- Returns
A list of ads.search.Article’s containing GCNs pertaining to GRB and optional keywords.