Skip to content

Commit

Permalink
various updates for sync
Browse files Browse the repository at this point in the history
  • Loading branch information
augustfly committed May 18, 2022
1 parent 77e9162 commit f3c7b7c
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 1 deletion.
2 changes: 1 addition & 1 deletion figureset/figureset.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# import yaml config
with open(sys.argv[1], "r") as stream:
y = yaml.load(stream)
y = yaml.load(stream, Loader=yaml.FullLoader)

# open translation table
t = []
Expand Down
Binary file added figureset/figureset.zip
Binary file not shown.
3 changes: 3 additions & 0 deletions mrt/aasmrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def main():
elif p == 'csv':
sur, ext = os.path.splitext(v)
data.write(sur+".csv", format="ascii.csv", overwrite=False)
elif p == 'tex':
sur, ext = os.path.splitext(v)
data.write(sur+".tex", format="ascii.aastex", overwrite=False)
elif p == 'info':
print(data.info)
else:
Expand Down
105 changes: 105 additions & 0 deletions names/aas-names.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#! /usr/bin/env python

import os, sys

from astroquery.ned import Ned
from astroquery.simbad import Simbad

def main():
"""
Main script for validating names with astroquery.
aas-names.py objectname <options>
Parameters
----------
objectname : str
options:
ned : only print NED object information to terminal
simbad : only print Simbad object information to terminal
show : dump data to terminal
quiet : print tersely to the terminal
csv : dump data to csv version [not implemented]
<none> : if no option given then summarize object found info to terminal
"""
if len(sys.argv) < 2:
print("")
print("-------------------------------------------------------------------------------")
print(" This toolkit is for . ")
print("")
print(" > aas-names.py objectname <options: ned|simbad|show|quiet|csv|<none>>")
print("")
print(" options ")
print(" ned : print summary NED object information to the terminal")
print(" simbad : print summary Simbad object information to the terminal")
print(" show : dump data to terminal.")
print(" sameAs : dump what the repository thinks the object is called.")
print(" verbose : print verbosely to the terminal.")
print(" csv : dump data to csv version [not implemented]")
print("-------------------------------------------------------------------------------")
print("")
return

v = sys.argv[1]
p = len(sys.argv) > 2 and sys.argv[2:] or ""

if 'verbose' in p:
print("")
print("-------------------------------------------------------------------------------")
print("aas-name.py checking...")
print("")
print("Object: ",v)
print("Type: ",p)
print("")

if 'ned' in p:
try:
neddata = Ned.query_object(v)
except:
# this is slightly wrong. The NED query can return an empty
# result or an error from the server. I'm not clear on why there
# is a difference.
neddata = []
if len(neddata) > 0:
if 'sameAs' in p:
print(v," sameAs ", neddata[0]['Object Name'], " in NED.")
elif 'verbose' in p:
print("NED Objects: ",len(neddata))
else: print(len(neddata))
if 'show' in p: print(neddata)
else:
if 'verbose':
print(v," is not in NED.")
else:
print(0)
elif 'simbad' in p:
try:
simdata = Simbad.query_object(v)
except:
simdata = []
if simdata is not None:
if 'sameAs' in p:
print(v, " sameAs ", simdata[0]['MAIN_ID'].decode(), "in Simbad.")
elif 'verbose' in p:
print("Simbad Objects: ",len(simdata))
else: print(len(simdata))
if 'show' in p: print(simdata)
else:
if 'verbose':
print(v," is not in Simbad.")
else:
print(0)
elif 'csv' in p:
print("not implemented")
# sur, ext = os.path.splitext(v)
# data.write(sur+".csv", format="ascii.csv", overwrite=False)
else:
print("")

if __name__ == '__main__':
main()



0 comments on commit f3c7b7c

Please sign in to comment.