Exemple #1
0
def vso_session():
    client = vso.VSOClient()
    qr = client.query(vso.attrs.Time((2011, 9, 20, 1), (2011, 9, 20, 2)), vso.attrs.Instrument("RHESSI"))
    entries = tables.entries_from_query_result(qr)
    database = Database("sqlite:///:memory:")
    for entry in entries:
        database.add(entry)
    database.commit()
    return database.session
Exemple #2
0
def vso_session():
    client = vso.VSOClient()
    qr = client.query(
        vso.attrs.Time('20110608T235955', '2011-06-09'),
        vso.attrs.Instrument('aia'))
    entries = tables.entries_from_query_result(qr)
    database = Database('sqlite:///:memory:')
    for entry in entries:
        database.add(entry)
    database.commit()
    return database.session
Exemple #3
0
def vso_session():
    client = vso.VSOClient()
    qr = client.search(vso.attrs.Time((2011, 9, 20, 1), (2011, 9, 20, 2)),
                       vso.attrs.Instrument('RHESSI'))
    entries = tables.entries_from_query_result(qr)
    database = Database('sqlite:///:memory:')
    for entry in entries:
        database.add(entry)
    database.commit()
    return database.session
Exemple #4
0
def vso_session():
    client = vso.VSOClient()
    qr = client.search(a.Time((2011, 9, 20, 1), (2011, 9, 20, 2)),
                       a.Instrument.rhessi,
                       response_format="legacy")
    entries = tables.entries_from_query_result(qr)
    database = Database('sqlite:///:memory:')
    for entry in entries:
        database.add(entry)
    database.commit()
    return database.session
Exemple #5
0
def session():
    database = Database('sqlite:///:memory:')
    for i in range(1, 11):
        entry = tables.DatabaseEntry()
        database.add(entry)
        # every entry has a fake download time of 2005-06-15 i:00:00
        database.edit(entry, download_time=datetime(2005, 6, 15, i))
        # every second entry gets starred
        if i % 2 == 0:
            database.star(entry)
        # every third entry is stored in the path /tmp
        if i % 3 == 0:
            database.edit(entry, path='/tmp')
        # every fifth entry gets the tag 'foo'
        if i % 5 == 0:
            database.tag(entry, 'foo')
    # the last entry gets the FITS header entry INSTRUME=EIT
    entry.fits_header_entries.append(tables.FitsHeaderEntry('INSTRUME', 'EIT'))
    database.commit()
    return database.session
def session():
    database = Database('sqlite:///:memory:')
    for i in range(1, 11):
        entry = tables.DatabaseEntry()
        database.add(entry)
        # every entry has a fake download time of 2005-06-15 i:00:00
        database.edit(entry, download_time=datetime(2005, 6, 15, i))
        # every second entry gets starred
        if i % 2 == 0:
            database.star(entry)
        # every third entry is stored in the path /tmp
        if i % 3 == 0:
            database.edit(entry, path='/tmp')
        # every fifth entry gets the tag 'foo'
        if i % 5 == 0:
            database.tag(entry, 'foo')
    # the last entry gets the FITS header entry INSTRUME=EIT
    entry.fits_header_entries.append(tables.FitsHeaderEntry('INSTRUME', 'EIT'))
    database.commit()
    return database.session