Esempio n. 1
0
def perform_download_coincidences(filename):
    """Load data from esd/api to h5 (filename)"""

    filters = tables.Filters(complevel=1)
    start = datetime.datetime(2016, 3, 10, 0, 0, 0)
    end = datetime.datetime(2016, 3, 10, 0, 1, 0)

    with tables.open_file(filename, 'w', filters=filters) as datafile:
        esd.download_coincidences(datafile, stations=[501, 510], start=start, end=end, n=2, progress=False)
Esempio n. 2
0
def perform_download_coincidences(filename):
    """Load data from esd/api to h5 (filename)"""

    filters = tables.Filters(complevel=1)
    start = datetime.datetime(2012, 1, 1, 0, 0, 0)
    eind = datetime.datetime(2012, 1, 1, 0, 2, 0)

    with tables.open_file(filename, 'w', filters=filters) as datafile:
        esd.download_coincidences(datafile, cluster='Science Park',
                                  start=start, end=eind, n=2, progress=False)
Esempio n. 3
0
def perform_download_coincidences(filename):
    """Load data from esd/api to h5 (filename)"""

    filters = tables.Filters(complevel=1)
    start = datetime.datetime(2012, 1, 1, 0, 0, 0)
    eind = datetime.datetime(2012, 1, 1, 0, 2, 0)

    with tables.open_file(filename, 'w', filters=filters) as datafile:
        esd.download_coincidences(datafile,
                                  cluster='Science Park',
                                  start=start,
                                  end=eind,
                                  n=2,
                                  progress=False)
import datetime
import tables
from sapphire import esd

DATAFILE = 'data.h5'
STATIONS = [501, 503, 506]
START = datetime.datetime(2016, 1, 1)
END = datetime.datetime(2016, 1, 2)


if __name__ == '__main__':
    if 'data' not in globals():
        data = tables.open_file(DATAFILE, 'a')

    if '/coincidences' not in data:
        esd.download_coincidences(data, stations=STATIONS, start=START, end=END)
Esempio n. 5
0
# In[43]:


# We have to open a datafile(but in our case we have to creat one):

data = tables.open_file('data_coincidences.h5', 'a')


# In[44]:


# Then downloading the coincidences. 
# Here we specify the cluster 'Enschede' to select all stations in that cluster.
# We set n to 3, requiring that a coincidence has at least 3 events.

esd.download_coincidences(data, cluster='Enschede', start=start, end=end, n=3)



# In[45]:


# If you now look in the data file it will contain event tables for all stations with at least one event in a coincidence,and 
# a coincidence table for the coincidence data. 
# Just like when coincidences were searched manually:

print(data)