Пример #1
0
def get_lc(name):
    """ Get light curve of target """
    m = marshal.MarshalAccess()
    m.download_lightcurve(name)
    lcpath = './Data/marshal/lightcurves/' + name + '/marshal_plot_lc_lightcurve_' + name + '.csv'
    lc = pd.read_csv(lcpath)
    return lc
Пример #2
0
def get_pos(name):
    """
    Get position of target, borrow from
    https://github.com/annayqho/FinderChart/blob/master/ztf_finder.py
    """
    m = marshal.MarshalAccess()
    m.load_target_sources()
    coords = m.get_target_coordinates(name)
    ra = coords.ra.values[0]
    dec = coords.dec.values[0]
    return ra, dec
Пример #3
0
def get_pos(name):
    """
    Get position of target, if you need to
    This is very slow, so it's probably better
    to supply an RA and DEC
    """
    m = marshal.MarshalAccess()
    m.load_target_sources()
    coords = m.get_target_coordinates(name)
    ra = coords.ra.values[0]
    dec = coords.dec.values[0]
    return ra, dec
Пример #4
0
def download_spec():
    """ Download the spectra """
    # connect to databases
    m = marshal.MarshalAccess()
    print("Connected")

    # download light curves
    marshal.download_spectra('ZTF18aaqjovh')

    # I moved all the spectra to the directory SPEC_DIR

    # return filenames
    f = glob.glob(SPEC_DIR + "/*.ascii")
    print(f)
    return f
Пример #5
0
 def update_marshal(self, program="Cosmology", store=True):
     """ """
     self._marshal = marshal.MarshalAccess()
     self._marshal.load_target_sources(program)
     if store:
         self._marshal.store()
Пример #6
0
def dump_rcf_table():
    m = marshal.MarshalAccess()
    m.load_target_sources("Redshift Completeness Factor")
    names = np.array(m.target_sources['name'])
    classes = np.array(m.target_sources['classification'])
    redshift = np.array(m.target_sources['redshift'])