from astropy import units as un
from astropy.coordinates import SkyCoord as coord
from astroquery.simbad import Simbad
from tqdm import tqdm

from astrocats.supernovae.scripts.repos import repo_file_list

from ...catalog.utils import get_entry_filename

events = OrderedDict()

warnings.filterwarnings('ignore')

outdir = "astrocats/cataclysmic/output/"

files = repo_file_list(bones=False)

newcatalog = []

# Simbad.list_votable_fields()
# sys.exit()
for fcnt, eventfile in enumerate(tqdm(sorted(files, key=lambda s: s.lower()))):
    if fcnt > 2000:
        break
    fileeventname = os.path.splitext(os.path.basename(eventfile))[0].replace(
        '.json', '')

    if eventfile.split('.')[-1] == 'gz':
        with gzip.open(eventfile, 'rt') as f:
            filetext = f.read()
    else:
示例#2
0
from bokeh.resources import CDN

from astrocats.catalog.utils import bandaliasf, bandcolorf, tprint, tq
from astrocats.supernovae.scripts.events import get_event_text
from astrocats.supernovae.scripts.repos import repo_file_list

tools = "pan,wheel_zoom,box_zoom,save,crosshair,reset,resize"

outdir = "astrocats/supernovae/output/html"

averagetypes = ['Ia', 'I P', 'Ia P', 'Ib P', 'Ic P', 'Ia/c', 'Ib/c', 'Ib/c P',
                'II P', 'II L', 'IIn', 'IIn P',
                'IIb P', 'Ia CSM', 'SLSN-Ic', 'SLSN-I', 'SLSN-II', 'Ia-91bg',
                'Ia-91T', 'Ia-02cx', 'Ib-Ca', 'II P-97D', 'Ic BL']

files = repo_file_list(bones=False)


def photo_cut(x):
    return ('magnitude' in x and 'time' in x and 'includeshost' not in x)

with open('astrocats/supernovae/output/catalog.min.json', 'r') as f:
    filetext = f.read()
    meta = json.loads(filetext, object_pairs_hook=OrderedDict)

metanames = [x['name'] for x in meta]

for averagetype in averagetypes:
    phototime = []
    phototimelowererrs = []
    phototimeuppererrs = []