diff --git a/.buildinfo b/.buildinfo new file mode 100644 index 000000000..58b03ecf9 --- /dev/null +++ b/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 8bf9155c22aee48e8584c5b3e975d46a +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/.doctrees/api.doctree b/.doctrees/api.doctree new file mode 100644 index 000000000..8ad397cbd Binary files /dev/null and b/.doctrees/api.doctree differ diff --git a/.doctrees/api_tutorial.doctree b/.doctrees/api_tutorial.doctree new file mode 100644 index 000000000..a0f1f2fa8 Binary files /dev/null and b/.doctrees/api_tutorial.doctree differ diff --git a/.doctrees/api_views.doctree b/.doctrees/api_views.doctree new file mode 100644 index 000000000..1c5a0796c Binary files /dev/null and b/.doctrees/api_views.doctree differ diff --git a/.doctrees/data_access.doctree b/.doctrees/data_access.doctree new file mode 100644 index 000000000..bdf03a6dc Binary files /dev/null and b/.doctrees/data_access.doctree differ diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle new file mode 100644 index 000000000..7524423d1 Binary files /dev/null and b/.doctrees/environment.pickle differ diff --git a/.doctrees/hisparc_maps.doctree b/.doctrees/hisparc_maps.doctree new file mode 100644 index 000000000..40276d9ab Binary files /dev/null and b/.doctrees/hisparc_maps.doctree differ diff --git a/.doctrees/index.doctree b/.doctrees/index.doctree new file mode 100644 index 000000000..3b6d40b2b Binary files /dev/null and b/.doctrees/index.doctree differ diff --git a/.doctrees/station_layout.doctree b/.doctrees/station_layout.doctree new file mode 100644 index 000000000..7ac2fa23e Binary files /dev/null and b/.doctrees/station_layout.doctree differ diff --git a/.doctrees/status_display.doctree b/.doctrees/status_display.doctree new file mode 100644 index 000000000..0ae464513 Binary files /dev/null and b/.doctrees/status_display.doctree differ diff --git a/.doctrees/status_display_views.doctree b/.doctrees/status_display_views.doctree new file mode 100644 index 000000000..fa4dee29d Binary files /dev/null and b/.doctrees/status_display_views.doctree differ diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/_images/coordinate_system.png b/_images/coordinate_system.png new file mode 100644 index 000000000..0dc052184 Binary files /dev/null and b/_images/coordinate_system.png differ diff --git a/_sources/api.rst.txt b/_sources/api.rst.txt new file mode 100644 index 000000000..5bd0bdfab --- /dev/null +++ b/_sources/api.rst.txt @@ -0,0 +1,13 @@ +API Reference +============= + +.. automodule:: publicdb.api + :members: + :undoc-members: + + +Contents: + +.. toctree:: + + api_views diff --git a/_sources/api_tutorial.rst.txt b/_sources/api_tutorial.rst.txt new file mode 100644 index 000000000..4d77a01e9 --- /dev/null +++ b/_sources/api_tutorial.rst.txt @@ -0,0 +1,179 @@ +.. include:: subst.inc + +API Tutorial +============ + +The |hisparc| |api| (Application Programming Interface) simplifies +metadata access from other applications. In this tutorial, we'll give +some examples of how this data can be accessed and used with Javascript +(`jQuery `_) and `Python +`_. We'll show you how to do some neat things. +How can you get a list of all |hisparc| stations in Denmark? What is the +position of station 201? Which stations had data on 20 October 2010? How +does the number of measured events change during a few weeks? This +tutorial will give you an overview of some of possibilities with the +|hisparc| |api|. For details on all available classes and methods, +please see the :doc:`api`. + +.. note:: + + We'll require you to know some basic programming, i.e. to understand + what an :code:`if` statement is and :code:`for` loop does. If you + are new to coding you can try a tutorial online, for instance + `Codeacademy `_, we recommend learning + Python or jQuery. + + +First look +---------- + +First we will just look at what this |api| is. The |api| can be accessed +via the internet by opening urls. Instead of a website you get data as a +response. This data is formatted as a JSON (JavaScript Object Notation), +this format can be understood by many programming languages. + +To see what options the |api| has we will look at it in a browser. Open +the following link in your browser (this will not work in Internet +Explorer): `https://data.hisparc.nl/api/ `_. + +You should now see some text, like this: + +.. code-block:: javascript + + {"base_url": "https://data.hisparc.nl/api/", + "clusters": "clusters/", + "clusters_in_country": "countries/{country_id}/", + "configuration": "station/{station_id}/config/{year}/{month}/{day}/", + "countries": "countries/", + "has_data": "station/{station_id}/data/{year}/{month}/{day}/", + ... + "subclusters_in_cluster": "clusters/{cluster_id}/"} + +This is the JSON, it is a dictionary (indicated by the :code:`{` and +:code:`}` enclosing brackets): an object which has keys and values. Each +key (:code:`"clusters"`, :code:`"has_data"`) refers to a value +(:code:`"clusters/"`, +:code:`"station/{station_id}/data/{year}/{month}/{day}/"`). + + +Cluster list +^^^^^^^^^^^^ + +This tells us that if we want a list of all clusters we need to use the +clusters option by appending :code:`"clusters/"` to the base url, +resulting in the following: +`https://data.hisparc.nl/api/clusters/ `_. + +With this result: + +.. code-block:: javascript + + [{"name": "Amsterdam", + "number": 0}, + {"name": "Utrecht", + "number": 1000}, + ... + {"name": "Karlsruhe", + "number": 70000}] + +This JSON is a list (indicated by the :code:`[` and :code:`]` enclosing +brackets) of dictionaries, one for each cluster. Each dictionary +contains the name and number of a cluster. This way information about +the network of stations can be retrieved. + + +Javascript example +------------------ + +The following code example will generate a webpage which will use the +|api| to get an up-to-date list of stations. It will then show a +drop-down menu from which a station can be selected, once you have +chosen a station you can click the :code:`Get info` button to make +Javascript get the station information. To try this you can either use +this example page: `jsFiddle `_ or create +your own HTML file with this code: + +.. code-block:: html + + + + + + + +

Station info

+

Choose a station:

+ +

+    
+    
+
+
+Python example
+--------------
+
+In this example we will use several standard Python libraries and the
+popular plotting library `matplotlib `_ (pylab).
+We start by importing the required libraries, one to get data from the
+urls, one to make working with dates easy and the plotting library. Then
+define the start values and perpare two empty lists in which the data
+can be placed. Then a while loop is used to loop over all days between
+datum and end_datum, reading each corresponding url. Finally a plot is
+made, setting the dates against their values.
+
+Start Python and type (or copy/paste without the :code:`>>>`) the
+following lines of code:
+
+.. code-block:: python
+
+    >>> from urllib.request import urlopen
+    >>> from datetime import date, timedelta
+    >>> from pylab import plot, show
+    >>> id = 501
+    >>> datum = date(2010, 10, 1)
+    >>> end_datum = date(2011, 2, 1)
+    >>> base = 'https://data.hisparc.nl/api/station/%d/num_events/%d/%d/%d'
+    >>> events = []
+    >>> dates = []
+    >>> while datum < end_datum:
+    ...     url = urlopen(base % (id, datum.year, datum.month, datum.day))
+    ...     events.append(url.read())
+    ...     dates.append(datum)
+    ...     datum += timedelta(days=1)
+    ...
+    >>> step(dates, events)
+    >>> show()
+
+
+SAPPHiRE
+^^^^^^^^
+
+The HiSPARC Python framework SAPPHiRE includes an API module. This module
+simplifies access to the API. See the SAPPHiRE documentation for more
+information:
+`https://docs.hisparc.nl/sapphire/ `_.
diff --git a/_sources/api_views.rst.txt b/_sources/api_views.rst.txt
new file mode 100644
index 000000000..6d9c8cdde
--- /dev/null
+++ b/_sources/api_views.rst.txt
@@ -0,0 +1,11 @@
+API Views Reference
+===================
+
+.. automodule:: publicdb.api.views
+   :members:
+   :undoc-members:
+
+
+Contents:
+
+.. toctree::
diff --git a/_sources/data_access.rst.txt b/_sources/data_access.rst.txt
new file mode 100644
index 000000000..83cccaeb4
--- /dev/null
+++ b/_sources/data_access.rst.txt
@@ -0,0 +1,105 @@
+.. include:: subst.inc
+
+Data access
+===========
+
+There are several ways in which the |hisparc| data can be accessed:
+
+- Via the Public database `download forms
+  `_.
+- Via Python using the |sapphire| framework (see `SAPPHiRE Tutorial
+  `_).
+- Via the `jSparc `_ web applications.
+
+To access metadata, like a list of all stations or information about a
+specific station see the :doc:`api_tutorial`.
+
+
+Download form
+-------------
+
+When looking at the data page for a station (i.e. `Kaj Munk College
+`_), you will see a 'Download
+event summary data' link on the right. When this link is clicked you
+will be taken to the `Data download form
+`_. On this page you can select
+the station, the start and end date for which you want to download the
+data. There is also an option to download weather data instead of events,
+however, not all stations gather weather data.
+
+When you click the Submit button without checking the checkbox to
+Download, the data should (Firefox always downloads the data) show up in
+your browser window. If you check the Download box the data will be
+downloaded to your PC as a csv file.
+
+This csv file can be read by many programs, including Excel. Use the
+Import option in Excel to make it recognize tabs as delimiter between
+columns.
+
+
+Downloading via Python
+----------------------
+
+.. note::
+
+    An easy to use module has been added to |sapphire| to download
+    data from the ESD. The following is an old (but working) example.
+
+This is an example of how to download the data from the Public database
+in Python. In this example we will download 1 hour of data for station
+202 on July 2, 2013.
+
+First load the required libraries (requires the numpy package).
+
+.. code-block:: python
+
+    >>> from datetime import datetime
+    >>> from urllib import urlencode
+    >>> from urllib.request import urlopen
+    >>> from StringIO import StringIO
+    >>> from numpy import genfromtxt
+
+Then define the url and place the start and end datetime in the query.
+To download weather data instead, replace 'events' by 'weather' in
+the url (and choose a station that has weather data, e.g. 3 or 501).
+
+.. note::
+
+    Do not pass the query to the urlopen 'data' argument because that
+    changes the request into a *POST* request, but you need a *GET*
+    request.
+
+.. code-block:: python
+
+    >>> url = 'https://data.hisparc.nl/data/202/events'
+    >>> start = str(datetime(2013, 7, 2, 11, 0))
+    >>> end = str(datetime(2013, 7, 2, 12, 0))
+    >>> query = urlencode({'download': False, 'start': start,'end': end})
+    >>> full_url = url + '?' + query
+
+Download the data and store it in a variable
+
+.. code-block:: python
+
+    >>> data = urlopen(full_url).read()
+
+Now use numpy to convert the data from csv to a numpy array.
+
+.. code-block:: python
+
+    >>> format = [('date', 'datetime64[D]'), ('time', '|S8'),
+                  ('timestamp', 'uint32'), ('nanoseconds', 'uint32'),
+                  ('pulseheights', '4int16'), ('integrals', '4int32'),
+                  ('n1', 'float32'), ('n2', 'float32'),
+                  ('n3', 'float32'), ('n4', 'float32'),
+                  ('t1', 'float32'), ('t2', 'float32'),
+                  ('t3', 'float32'), ('t4', 'float32'),
+                  ('t_trigger', 'float32'),
+                  ('zenith', 'int16'), ('azimuth', 'int16')]
+    >>> a = genfromtxt(StringIO(data), delimiter="\t", dtype=format)
+    >>> print(a[0])
+    (datetime.date(2013, 7, 2), '11:00:02', 1372762802L, 466307811L,
+     [78, 798, -1, -1], [535, 10882, -1, -1],
+     0.14720000326633453, 3.854599952697754, -1.0, -1.0,
+     345.0, 12.5, -1.0, -1.0, 345.0, -999, -999)
diff --git a/_sources/hisparc_maps.rst.txt b/_sources/hisparc_maps.rst.txt
new file mode 100644
index 000000000..8c7d5b44c
--- /dev/null
+++ b/_sources/hisparc_maps.rst.txt
@@ -0,0 +1,110 @@
+.. include:: subst.inc
+
+HiSPARC maps
+============
+
+Each |hisparc| station is equipped with a GPS antenne. This GPS is used
+to for time synchronization between stations and to determine the exact
+location of each station. All these locations are stored in our
+database. The GPS positions can be found on the data pages of stations,
+via the API (:doc:`api`) and in the raw data.
+
+
+Map
+---
+
+Using the `Leafet `_ library with `CARTO
+`_ maps tiles (based on `OpenStreetMap
+`_ data) we are able to visualize the
+detector network by showing the locations of the stations on a map.
+
+Here is an overview of the network: `Stations on map
+`_
+
+
+Station info
+^^^^^^^^^^^^
+
+When you click on a station marker a popup will show information about
+that station, its name and cluster. If the station has data the name of
+the station will be a link to its data page.
+
+
+Status
+^^^^^^
+
+The stations on the map can have one of 4 colors to indicate the current
+status of that station.
+
+- Green: when a station is operating properly
+- Yellow: it is responding to the server but has a problem
+- Red: it is completely unresponsive (offline)
+- Gray: it is is no longer active or the status can't be determined.
+
+
+Embedding
+---------
+
+On several public database pages a map is embedded to show the station
+location or provide an overview of multiple stations. Moreover, maps are
+also used on our main website to give an overview of the station
+organization and clustering (e.g. `Bristol
+`_, `Science
+Park
+`_
+). This is accomplished by placing an iframe on those pages that
+shows another page which only has the map as its content. Example code:
+
+.. code-block:: html
+
+    
+
+Result:
+
+.. raw:: html
+
+    
+ +
+ + +Syntax +^^^^^^ + +To show a map of a specific region or location, use the syntax explained +here. First start with the base url:: + + https://data.hisparc.nl/maps/ + +When no extra options are given the page zooms and positions the map +such that all stations fit in the window. But you can also focus on a +specific region or station. Several levels of regions are possible:: + + https://data.hisparc.nl/maps/[Country]/[Cluster]/[Subcluster]/ + https://data.hisparc.nl/maps/[Station number]/ + +An overview of countries, clusters and subclusters can be found on +https://data.hisparc.nl/ . First you can choose to focus on a Country: + +- https://data.hisparc.nl/maps/Netherlands/ +- https://data.hisparc.nl/maps/Denmark/ + +Then focus more closely on a cluster, note that you also need to give +the country: + +- https://data.hisparc.nl/maps/Netherlands/Enschede/ +- https://data.hisparc.nl/maps/Netherlands/Utrecht/ +- https://data.hisparc.nl/maps/United%20Kingdom/Bristol/ + +And to focus on a subcluster, also specifying the country and cluster: + +- https://data.hisparc.nl/maps/Netherlands/Amsterdam/Zaanstad/ +- https://data.hisparc.nl/maps/Netherlands/Enschede/Enschede/ + +Finally you can also focus on one specific station by simply giving its +station number: + +- https://data.hisparc.nl/maps/8005/ +- https://data.hisparc.nl/maps/8103/ diff --git a/_sources/index.rst.txt b/_sources/index.rst.txt new file mode 100644 index 000000000..7cd87648d --- /dev/null +++ b/_sources/index.rst.txt @@ -0,0 +1,26 @@ +Public Database documentation! +============================== + +The HiSPARC Public Database is the interface through which everyone can access +the data and our station administration is done. + +Contents: + +.. toctree:: + :maxdepth: 2 + + data_access + api_tutorial + hisparc_maps + station_layout + api + status_display + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/_sources/station_layout.rst.txt b/_sources/station_layout.rst.txt new file mode 100644 index 000000000..441bb23d6 --- /dev/null +++ b/_sources/station_layout.rst.txt @@ -0,0 +1,63 @@ +.. include:: subst.inc + +HiSPARC station layout +====================== + +Each |hisparc| station has a GPS antenne and either 2 or 4 scintillator +detectors. This GPS is used to determine the exact location of the +station. However, the GPS is often not at the center of the station, +moreover, not all stations are oriented the same way, and the distances +between detector may differ. For reconstruction of the measured data it +is important to know the location of each detector, this section +explains how the location of the detectors can be measured and +communicated to us. + + +Compass coordinates +------------------- + +The coordinate system we have chosen for describing the position of +detectors is illustrated in the following figure. + +.. image:: images/coordinate_system.png + :width: 313px + +For each detector 3 (or 4) coordinates need to be determined: + +- First the distance (:code:`r`) from the GPS to the center of the + scintillator (in meters). +- Next the alpha angle (:code:`α`) which is the clock-wise turning angle + between North and the detector as seen from the GPS (in degrees). +- A height (:code:`z`) coordinate can be measured if there is a + significant altitude difference between the GPS antenna and the + detectors, or if the detectors are not at the same height. Up is + positive (in meters). +- The rotation of the detector is described by the beta angle + (:code:`β`), which is the clock-wise turning rotation of the long side + of the detector relative to North (in degrees). + +For more information about the coordinate systems used in HiSPARC see: +`Coordinate systems and units in HiSPARC +`_. + +For Dutch schools we have an assignment sheet in the infopakket which +walks students through the process of measuring the station layout: +`De stationsplattegrond +`_. + + +Submitting the measurements +--------------------------- + +New layouts can be submitted via the `layout submit form +`_. A verification e-mail will be sent +to the submitter. The submitted measurements will be reviewed before they are +made available on the website and via the API. + + +Accessing the data +------------------ + +The detector coordinates can be accessed via the :doc:`API `. +These can, for example, be used when analysing data or when making a schematic +drawing of the station layout. diff --git a/_sources/status_display.rst.txt b/_sources/status_display.rst.txt new file mode 100644 index 000000000..36a72f40d --- /dev/null +++ b/_sources/status_display.rst.txt @@ -0,0 +1,13 @@ +Status Display Reference +======================== + +.. automodule:: publicdb.status_display + :members: + :undoc-members: + + +Contents: + +.. toctree:: + + status_display_views diff --git a/_sources/status_display_views.rst.txt b/_sources/status_display_views.rst.txt new file mode 100644 index 000000000..aac40fa8b --- /dev/null +++ b/_sources/status_display_views.rst.txt @@ -0,0 +1,11 @@ +Status Display Views Reference +============================== + +.. automodule:: publicdb.status_display.views + :members: + :undoc-members: + + +Contents: + +.. toctree:: diff --git a/_static/basic.css b/_static/basic.css new file mode 100644 index 000000000..f316efcb4 --- /dev/null +++ b/_static/basic.css @@ -0,0 +1,925 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 360px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +a:visited { + color: #551A8B; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +nav.contents, +aside.topic, +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +.sig dd { + margin-top: 0px; + margin-bottom: 0px; +} + +.sig dl { + margin-top: 0px; + margin-bottom: 0px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +.translated { + background-color: rgba(207, 255, 207, 0.2) +} + +.untranslated { + background-color: rgba(255, 207, 207, 0.2) +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/_static/doctools.js b/_static/doctools.js new file mode 100644 index 000000000..4d67807d1 --- /dev/null +++ b/_static/doctools.js @@ -0,0 +1,156 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Base JavaScript utilities for all Sphinx HTML documentation. + * + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); + } +}; + +/** + * Small JavaScript module for the documentation. + */ +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } + }, + + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; + }, + + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})` + ); + Documentation.LOCALE = catalog.locale; + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); + }, + + /** + * Initialise the domain index toggle buttons + */ + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)) + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); + }, + + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } + }); + }, +}; + +// quick alias for translations +const _ = Documentation.gettext; + +_ready(Documentation.init); diff --git a/_static/documentation_options.js b/_static/documentation_options.js new file mode 100644 index 000000000..867e7247d --- /dev/null +++ b/_static/documentation_options.js @@ -0,0 +1,13 @@ +const DOCUMENTATION_OPTIONS = { + VERSION: '0.4', + LANGUAGE: 'en', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/_static/favicon.ico b/_static/favicon.ico new file mode 100644 index 000000000..2632b900a Binary files /dev/null and b/_static/favicon.ico differ diff --git a/_static/file.png b/_static/file.png new file mode 100644 index 000000000..a858a410e Binary files /dev/null and b/_static/file.png differ diff --git a/_static/header.png b/_static/header.png new file mode 100644 index 000000000..383625f38 Binary files /dev/null and b/_static/header.png differ diff --git a/_static/hisparc_style.css b/_static/hisparc_style.css new file mode 100644 index 000000000..21b105f9e --- /dev/null +++ b/_static/hisparc_style.css @@ -0,0 +1,70 @@ +body { + background: #fff; + max-width: 900px; + margin: 0 auto;} + +div.document { + background-color: #fafafa;} + +div.sphinxsidebar ul { + margin: 10px 10px;} + +div.sphinxsidebarwrapper { + padding: 0px 0px 10px 0px;} + +div.sphinxsidebar h3, +div.sphinxsidebar h4 { + color: #111; + background: none; + padding: 8px 10px 5px 10px; + border-bottom: 1px solid #ddd;} + +div.sphinxsidebar h3 a { + color: #111;} + +div.sphinxsidebar a { + color: #333;} + +div.sphinxsidebarwrapper ul { + margin-right: 5px;} + +p.searchtip { + display: none;} + +div.body { + padding: 0 25px 25px 30px; + color: #333;} + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + background: none; + padding-top: 0; + padding-left: 0;} + +div.body h1 { + border-top: none; + padding-top: 20px; + font-size: 260%;} + +div.body h2 { + font-size: 210%; + padding-top: 15px;} + +div.body h3 { + font-size: 170%; + border-bottom: 1px solid #BBB;} + +div.body h4 { + font-size: 130%; + margin-top: 20px; + padding-left: 3px;} + +div.related { + background-color: #0071E2;} + +div.related a { + color: #fff;} diff --git a/_static/language_data.js b/_static/language_data.js new file mode 100644 index 000000000..367b8ed81 --- /dev/null +++ b/_static/language_data.js @@ -0,0 +1,199 @@ +/* + * language_data.js + * ~~~~~~~~~~~~~~~~ + * + * This script contains the language-specific data used by searchtools.js, + * namely the list of stopwords, stemmer, scorer and splitter. + * + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; + + +/* Non-minified version is copied as a separate JS file, if available */ + +/** + * Porter Stemmer + */ +var Stemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + diff --git a/_static/minus.png b/_static/minus.png new file mode 100644 index 000000000..d96755fda Binary files /dev/null and b/_static/minus.png differ diff --git a/_static/nature.css b/_static/nature.css new file mode 100644 index 000000000..ba033b0db --- /dev/null +++ b/_static/nature.css @@ -0,0 +1,252 @@ +/* + * nature.css_t + * ~~~~~~~~~~~~ + * + * Sphinx stylesheet -- nature theme. + * + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: Arial, sans-serif; + font-size: 100%; + background-color: #fff; + color: #555; + margin: 0; + padding: 0; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 230px; +} + +hr { + border: 1px solid #B1B4B6; +} + +div.document { + background-color: #eee; +} + +div.body { + background-color: #ffffff; + color: #3E4349; + padding: 0 30px 30px 30px; + font-size: 0.9em; +} + +div.footer { + color: #555; + width: 100%; + padding: 13px 0; + text-align: center; + font-size: 75%; +} + +div.footer a { + color: #444; + text-decoration: underline; +} + +div.related { + background-color: #6BA81E; + line-height: 32px; + color: #fff; + text-shadow: 0px 1px 0 #444; + font-size: 0.9em; +} + +div.related a { + color: #E2F3CC; +} + +div.sphinxsidebar { + font-size: 0.75em; + line-height: 1.5em; +} + +div.sphinxsidebarwrapper{ + padding: 20px 0; +} + +div.sphinxsidebar h3, +div.sphinxsidebar h4 { + font-family: Arial, sans-serif; + color: #222; + font-size: 1.2em; + font-weight: normal; + margin: 0; + padding: 5px 10px; + background-color: #ddd; + text-shadow: 1px 1px 0 white +} + +div.sphinxsidebar h4{ + font-size: 1.1em; +} + +div.sphinxsidebar h3 a { + color: #444; +} + + +div.sphinxsidebar p { + color: #888; + padding: 5px 20px; +} + +div.sphinxsidebar p.topless { +} + +div.sphinxsidebar ul { + margin: 10px 20px; + padding: 0; + color: #000; +} + +div.sphinxsidebar a { + color: #444; +} + +div.sphinxsidebar input { + border: 1px solid #ccc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar .searchformwrapper { + margin-left: 20px; + margin-right: 20px; +} + +/* -- body styles ----------------------------------------------------------- */ + +a { + color: #005B81; + text-decoration: none; +} + +a:hover { + color: #E32E00; + text-decoration: underline; +} + +a:visited { + color: #551A8B; +} + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: Arial, sans-serif; + background-color: #BED4EB; + font-weight: normal; + color: #212224; + margin: 30px 0px 10px 0px; + padding: 5px 0 5px 10px; + text-shadow: 0px 1px 0 white +} + +div.body h1 { border-top: 20px solid white; margin-top: 0; font-size: 200%; } +div.body h2 { font-size: 150%; background-color: #C8D5E3; } +div.body h3 { font-size: 120%; background-color: #D8DEE3; } +div.body h4 { font-size: 110%; background-color: #D8DEE3; } +div.body h5 { font-size: 100%; background-color: #D8DEE3; } +div.body h6 { font-size: 100%; background-color: #D8DEE3; } + +a.headerlink { + color: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + background-color: #c60f0f; + color: white; +} + +div.body p, div.body dd, div.body li { + line-height: 1.5em; +} + +div.admonition p.admonition-title + p { + display: inline; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +nav.contents, +aside.topic, +div.topic { + background-color: #eee; +} + +div.warning { + background-color: #ffe4e4; + border: 1px solid #f66; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre { + padding: 10px; + line-height: 1.2em; + border: 1px solid #C6C9CB; + font-size: 1.1em; + margin: 1.5em 0 1.5em 0; + -webkit-box-shadow: 1px 1px 1px #d8d8d8; + -moz-box-shadow: 1px 1px 1px #d8d8d8; +} + +code { + background-color: #ecf0f3; + color: #222; + /* padding: 1px 2px; */ + font-size: 1.1em; + font-family: monospace; +} + +.viewcode-back { + font-family: Arial, sans-serif; +} + +div.viewcode-block:target { + background-color: #f4debf; + border-top: 1px solid #ac9; + border-bottom: 1px solid #ac9; +} + +div.code-block-caption { + background-color: #ddd; + color: #222; + border: 1px solid #C6C9CB; +} \ No newline at end of file diff --git a/_static/plus.png b/_static/plus.png new file mode 100644 index 000000000..7107cec93 Binary files /dev/null and b/_static/plus.png differ diff --git a/_static/pygments.css b/_static/pygments.css new file mode 100644 index 000000000..0d49244ed --- /dev/null +++ b/_static/pygments.css @@ -0,0 +1,75 @@ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.highlight .hll { background-color: #ffffcc } +.highlight { background: #eeffcc; } +.highlight .c { color: #408090; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #007020; font-weight: bold } /* Keyword */ +.highlight .o { color: #666666 } /* Operator */ +.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #007020 } /* Comment.Preproc */ +.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ +.highlight .gr { color: #FF0000 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #333333 } /* Generic.Output */ +.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #0044DD } /* Generic.Traceback */ +.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #007020 } /* Keyword.Pseudo */ +.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #902000 } /* Keyword.Type */ +.highlight .m { color: #208050 } /* Literal.Number */ +.highlight .s { color: #4070a0 } /* Literal.String */ +.highlight .na { color: #4070a0 } /* Name.Attribute */ +.highlight .nb { color: #007020 } /* Name.Builtin */ +.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.highlight .no { color: #60add5 } /* Name.Constant */ +.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #007020 } /* Name.Exception */ +.highlight .nf { color: #06287e } /* Name.Function */ +.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ +.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #bb60d5 } /* Name.Variable */ +.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mb { color: #208050 } /* Literal.Number.Bin */ +.highlight .mf { color: #208050 } /* Literal.Number.Float */ +.highlight .mh { color: #208050 } /* Literal.Number.Hex */ +.highlight .mi { color: #208050 } /* Literal.Number.Integer */ +.highlight .mo { color: #208050 } /* Literal.Number.Oct */ +.highlight .sa { color: #4070a0 } /* Literal.String.Affix */ +.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ +.highlight .sc { color: #4070a0 } /* Literal.String.Char */ +.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ +.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ +.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ +.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.highlight .sx { color: #c65d09 } /* Literal.String.Other */ +.highlight .sr { color: #235388 } /* Literal.String.Regex */ +.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ +.highlight .ss { color: #517918 } /* Literal.String.Symbol */ +.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #06287e } /* Name.Function.Magic */ +.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ +.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ +.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ +.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ +.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/_static/searchtools.js b/_static/searchtools.js new file mode 100644 index 000000000..92da3f8b2 --- /dev/null +++ b/_static/searchtools.js @@ -0,0 +1,619 @@ +/* + * searchtools.js + * ~~~~~~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for the full-text search. + * + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +/** + * Simple result scoring code. + */ +if (typeof Scorer === "undefined") { + var Scorer = { + // Implement the following function to further tweak the score for each result + // The function takes a result array [docname, title, anchor, descr, score, filename] + // and returns the new score. + /* + score: result => { + const [docname, title, anchor, descr, score, filename] = result + return score + }, + */ + + // query matches the full name of an object + objNameMatch: 11, + // or matches in the last dotted part of the object name + objPartialMatch: 6, + // Additive scores depending on the priority of the object + objPrio: { + 0: 15, // used to be importantResults + 1: 5, // used to be objectResults + 2: -5, // used to be unimportantResults + }, + // Used when the priority is not in the mapping. + objPrioDefault: 0, + + // query found in title + title: 15, + partialTitle: 7, + // query found in terms + term: 5, + partialTerm: 2, + }; +} + +const _removeChildren = (element) => { + while (element && element.lastChild) element.removeChild(element.lastChild); +}; + +/** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping + */ +const _escapeRegExp = (string) => + string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string + +const _displayItem = (item, searchTerms, highlightTerms) => { + const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; + const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; + const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; + const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; + const contentRoot = document.documentElement.dataset.content_root; + + const [docName, title, anchor, descr, score, _filename] = item; + + let listItem = document.createElement("li"); + let requestUrl; + let linkUrl; + if (docBuilder === "dirhtml") { + // dirhtml builder + let dirname = docName + "/"; + if (dirname.match(/\/index\/$/)) + dirname = dirname.substring(0, dirname.length - 6); + else if (dirname === "index/") dirname = ""; + requestUrl = contentRoot + dirname; + linkUrl = requestUrl; + } else { + // normal html builders + requestUrl = contentRoot + docName + docFileSuffix; + linkUrl = docName + docLinkSuffix; + } + let linkEl = listItem.appendChild(document.createElement("a")); + linkEl.href = linkUrl + anchor; + linkEl.dataset.score = score; + linkEl.innerHTML = title; + if (descr) { + listItem.appendChild(document.createElement("span")).innerHTML = + " (" + descr + ")"; + // highlight search terms in the description + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + } + else if (showSearchSummary) + fetch(requestUrl) + .then((responseData) => responseData.text()) + .then((data) => { + if (data) + listItem.appendChild( + Search.makeSearchSummary(data, searchTerms, anchor) + ); + // highlight search terms in the summary + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + }); + Search.output.appendChild(listItem); +}; +const _finishSearch = (resultCount) => { + Search.stopPulse(); + Search.title.innerText = _("Search Results"); + if (!resultCount) + Search.status.innerText = Documentation.gettext( + "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories." + ); + else + Search.status.innerText = _( + "Search finished, found ${resultCount} page(s) matching the search query." + ).replace('${resultCount}', resultCount); +}; +const _displayNextItem = ( + results, + resultCount, + searchTerms, + highlightTerms, +) => { + // results left, load the summary and display it + // this is intended to be dynamic (don't sub resultsCount) + if (results.length) { + _displayItem(results.pop(), searchTerms, highlightTerms); + setTimeout( + () => _displayNextItem(results, resultCount, searchTerms, highlightTerms), + 5 + ); + } + // search finished, update title and status message + else _finishSearch(resultCount); +}; +// Helper function used by query() to order search results. +// Each input is an array of [docname, title, anchor, descr, score, filename]. +// Order the results by score (in opposite order of appearance, since the +// `_displayNextItem` function uses pop() to retrieve items) and then alphabetically. +const _orderResultsByScoreThenName = (a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; +}; + +/** + * Default splitQuery function. Can be overridden in ``sphinx.search`` with a + * custom function per language. + * + * The regular expression works by splitting the string on consecutive characters + * that are not Unicode letters, numbers, underscores, or emoji characters. + * This is the same as ``\W+`` in Python, preserving the surrogate pair area. + */ +if (typeof splitQuery === "undefined") { + var splitQuery = (query) => query + .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu) + .filter(term => term) // remove remaining empty strings +} + +/** + * Search Module + */ +const Search = { + _index: null, + _queued_query: null, + _pulse_status: -1, + + htmlToText: (htmlString, anchor) => { + const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); + for (const removalQuery of [".headerlinks", "script", "style"]) { + htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() }); + } + if (anchor) { + const anchorContent = htmlElement.querySelector(`[role="main"] ${anchor}`); + if (anchorContent) return anchorContent.textContent; + + console.warn( + `Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.` + ); + } + + // if anchor not specified or not found, fall back to main content + const docContent = htmlElement.querySelector('[role="main"]'); + if (docContent) return docContent.textContent; + + console.warn( + "Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template." + ); + return ""; + }, + + init: () => { + const query = new URLSearchParams(window.location.search).get("q"); + document + .querySelectorAll('input[name="q"]') + .forEach((el) => (el.value = query)); + if (query) Search.performSearch(query); + }, + + loadIndex: (url) => + (document.body.appendChild(document.createElement("script")).src = url), + + setIndex: (index) => { + Search._index = index; + if (Search._queued_query !== null) { + const query = Search._queued_query; + Search._queued_query = null; + Search.query(query); + } + }, + + hasIndex: () => Search._index !== null, + + deferQuery: (query) => (Search._queued_query = query), + + stopPulse: () => (Search._pulse_status = -1), + + startPulse: () => { + if (Search._pulse_status >= 0) return; + + const pulse = () => { + Search._pulse_status = (Search._pulse_status + 1) % 4; + Search.dots.innerText = ".".repeat(Search._pulse_status); + if (Search._pulse_status >= 0) window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something (or wait until index is loaded) + */ + performSearch: (query) => { + // create the required interface elements + const searchText = document.createElement("h2"); + searchText.textContent = _("Searching"); + const searchSummary = document.createElement("p"); + searchSummary.classList.add("search-summary"); + searchSummary.innerText = ""; + const searchList = document.createElement("ul"); + searchList.classList.add("search"); + + const out = document.getElementById("search-results"); + Search.title = out.appendChild(searchText); + Search.dots = Search.title.appendChild(document.createElement("span")); + Search.status = out.appendChild(searchSummary); + Search.output = out.appendChild(searchList); + + const searchProgress = document.getElementById("search-progress"); + // Some themes don't use the search progress node + if (searchProgress) { + searchProgress.innerText = _("Preparing search..."); + } + Search.startPulse(); + + // index already loaded, the browser was quick! + if (Search.hasIndex()) Search.query(query); + else Search.deferQuery(query); + }, + + _parseQuery: (query) => { + // stem the search terms and add them to the correct list + const stemmer = new Stemmer(); + const searchTerms = new Set(); + const excludedTerms = new Set(); + const highlightTerms = new Set(); + const objectTerms = new Set(splitQuery(query.toLowerCase().trim())); + splitQuery(query.trim()).forEach((queryTerm) => { + const queryTermLower = queryTerm.toLowerCase(); + + // maybe skip this "word" + // stopwords array is from language_data.js + if ( + stopwords.indexOf(queryTermLower) !== -1 || + queryTerm.match(/^\d+$/) + ) + return; + + // stem the word + let word = stemmer.stemWord(queryTermLower); + // select the correct list + if (word[0] === "-") excludedTerms.add(word.substr(1)); + else { + searchTerms.add(word); + highlightTerms.add(queryTermLower); + } + }); + + if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js + localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" ")) + } + + // console.debug("SEARCH: searching for:"); + // console.info("required: ", [...searchTerms]); + // console.info("excluded: ", [...excludedTerms]); + + return [query, searchTerms, excludedTerms, highlightTerms, objectTerms]; + }, + + /** + * execute search (requires search index to be loaded) + */ + _performSearch: (query, searchTerms, excludedTerms, highlightTerms, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + + // Collect multiple result groups to be sorted separately and then ordered. + // Each is an array of [docname, title, anchor, descr, score, filename]. + const normalResults = []; + const nonMainIndexResults = []; + + _removeChildren(document.getElementById("search-progress")); + + const queryLower = query.toLowerCase().trim(); + for (const [title, foundTitles] of Object.entries(allTitles)) { + if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) { + for (const [file, id] of foundTitles) { + let score = Math.round(100 * queryLower.length / title.length) + normalResults.push([ + docNames[file], + titles[file] !== title ? `${titles[file]} > ${title}` : title, + id !== null ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + + // search for explicit entries in index directives + for (const [entry, foundEntries] of Object.entries(indexEntries)) { + if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { + for (const [file, id, isMain] of foundEntries) { + const score = Math.round(100 * queryLower.length / entry.length); + const result = [ + docNames[file], + titles[file], + id ? "#" + id : "", + null, + score, + filenames[file], + ]; + if (isMain) { + normalResults.push(result); + } else { + nonMainIndexResults.push(result); + } + } + } + } + + // lookup as object + objectTerms.forEach((term) => + normalResults.push(...Search.performObjectSearch(term, objectTerms)) + ); + + // lookup as search terms in fulltext + normalResults.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + + // let the scorer override scores with a custom scoring function + if (Scorer.score) { + normalResults.forEach((item) => (item[4] = Scorer.score(item))); + nonMainIndexResults.forEach((item) => (item[4] = Scorer.score(item))); + } + + // Sort each group of results by score and then alphabetically by name. + normalResults.sort(_orderResultsByScoreThenName); + nonMainIndexResults.sort(_orderResultsByScoreThenName); + + // Combine the result groups in (reverse) order. + // Non-main index entries are typically arbitrary cross-references, + // so display them after other results. + let results = [...nonMainIndexResults, ...normalResults]; + + // remove duplicate search results + // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept + let seen = new Set(); + results = results.reverse().reduce((acc, result) => { + let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(','); + if (!seen.has(resultStr)) { + acc.push(result); + seen.add(resultStr); + } + return acc; + }, []); + + return results.reverse(); + }, + + query: (query) => { + const [searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms] = Search._parseQuery(query); + const results = Search._performSearch(searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms); + + // for debugging + //Search.lastresults = results.slice(); // a copy + // console.info("search results:", Search.lastresults); + + // print the results + _displayNextItem(results, results.length, searchTerms, highlightTerms); + }, + + /** + * search for object names + */ + performObjectSearch: (object, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const objects = Search._index.objects; + const objNames = Search._index.objnames; + const titles = Search._index.titles; + + const results = []; + + const objectSearchCallback = (prefix, match) => { + const name = match[4] + const fullname = (prefix ? prefix + "." : "") + name; + const fullnameLower = fullname.toLowerCase(); + if (fullnameLower.indexOf(object) < 0) return; + + let score = 0; + const parts = fullnameLower.split("."); + + // check for different match types: exact matches of full name or + // "last name" (i.e. last dotted part) + if (fullnameLower === object || parts.slice(-1)[0] === object) + score += Scorer.objNameMatch; + else if (parts.slice(-1)[0].indexOf(object) > -1) + score += Scorer.objPartialMatch; // matches in last name + + const objName = objNames[match[1]][2]; + const title = titles[match[0]]; + + // If more than one term searched for, we require other words to be + // found in the name/title/description + const otherTerms = new Set(objectTerms); + otherTerms.delete(object); + if (otherTerms.size > 0) { + const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase(); + if ( + [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0) + ) + return; + } + + let anchor = match[3]; + if (anchor === "") anchor = fullname; + else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname; + + const descr = objName + _(", in ") + title; + + // add custom score for some objects according to scorer + if (Scorer.objPrio.hasOwnProperty(match[2])) + score += Scorer.objPrio[match[2]]; + else score += Scorer.objPrioDefault; + + results.push([ + docNames[match[0]], + fullname, + "#" + anchor, + descr, + score, + filenames[match[0]], + ]); + }; + Object.keys(objects).forEach((prefix) => + objects[prefix].forEach((array) => + objectSearchCallback(prefix, array) + ) + ); + return results; + }, + + /** + * search for full-text terms in the index + */ + performTermsSearch: (searchTerms, excludedTerms) => { + // prepare search + const terms = Search._index.terms; + const titleTerms = Search._index.titleterms; + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + + const scoreMap = new Map(); + const fileMap = new Map(); + + // perform the search on the required terms + searchTerms.forEach((word) => { + const files = []; + const arr = [ + { files: terms[word], score: Scorer.term }, + { files: titleTerms[word], score: Scorer.title }, + ]; + // add support for partial matches + if (word.length > 2) { + const escapedWord = _escapeRegExp(word); + if (!terms.hasOwnProperty(word)) { + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + } + if (!titleTerms.hasOwnProperty(word)) { + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: titleTerms[term], score: Scorer.partialTitle }); + }); + } + } + + // no match but word was a required one + if (arr.every((record) => record.files === undefined)) return; + + // found search word in contents + arr.forEach((record) => { + if (record.files === undefined) return; + + let recordFiles = record.files; + if (recordFiles.length === undefined) recordFiles = [recordFiles]; + files.push(...recordFiles); + + // set score for the word in each file + recordFiles.forEach((file) => { + if (!scoreMap.has(file)) scoreMap.set(file, {}); + scoreMap.get(file)[word] = record.score; + }); + }); + + // create the mapping + files.forEach((file) => { + if (!fileMap.has(file)) fileMap.set(file, [word]); + else if (fileMap.get(file).indexOf(word) === -1) fileMap.get(file).push(word); + }); + }); + + // now check if the files don't contain excluded terms + const results = []; + for (const [file, wordList] of fileMap) { + // check if all requirements are matched + + // as search terms with length < 3 are discarded + const filteredTermCount = [...searchTerms].filter( + (term) => term.length > 2 + ).length; + if ( + wordList.length !== searchTerms.size && + wordList.length !== filteredTermCount + ) + continue; + + // ensure that none of the excluded terms is in the search result + if ( + [...excludedTerms].some( + (term) => + terms[term] === file || + titleTerms[term] === file || + (terms[term] || []).includes(file) || + (titleTerms[term] || []).includes(file) + ) + ) + break; + + // select one (max) score for the file. + const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w])); + // add result to the result list + results.push([ + docNames[file], + titles[file], + "", + null, + score, + filenames[file], + ]); + } + return results; + }, + + /** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words. + */ + makeSearchSummary: (htmlText, keywords, anchor) => { + const text = Search.htmlToText(htmlText, anchor); + if (text === "") return null; + + const textLower = text.toLowerCase(); + const actualStartPosition = [...keywords] + .map((k) => textLower.indexOf(k.toLowerCase())) + .filter((i) => i > -1) + .slice(-1)[0]; + const startWithContext = Math.max(actualStartPosition - 120, 0); + + const top = startWithContext === 0 ? "" : "..."; + const tail = startWithContext + 240 < text.length ? "..." : ""; + + let summary = document.createElement("p"); + summary.classList.add("context"); + summary.textContent = top + text.substr(startWithContext, 240).trim() + tail; + + return summary; + }, +}; + +_ready(Search.init); diff --git a/_static/sphinx_highlight.js b/_static/sphinx_highlight.js new file mode 100644 index 000000000..8a96c69a1 --- /dev/null +++ b/_static/sphinx_highlight.js @@ -0,0 +1,154 @@ +/* Highlighting utilities for Sphinx HTML documentation. */ +"use strict"; + +const SPHINX_HIGHLIGHT_ENABLED = true + +/** + * highlight a given string on a node by wrapping it in + * span elements with the given class name. + */ +const _highlight = (node, addItems, text, className) => { + if (node.nodeType === Node.TEXT_NODE) { + const val = node.nodeValue; + const parent = node.parentNode; + const pos = val.toLowerCase().indexOf(text); + if ( + pos >= 0 && + !parent.classList.contains(className) && + !parent.classList.contains("nohighlight") + ) { + let span; + + const closestNode = parent.closest("body, svg, foreignObject"); + const isInSVG = closestNode && closestNode.matches("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.classList.add(className); + } + + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + const rest = document.createTextNode(val.substr(pos + text.length)); + parent.insertBefore( + span, + parent.insertBefore( + rest, + node.nextSibling + ) + ); + node.nodeValue = val.substr(0, pos); + /* There may be more occurrences of search term in this node. So call this + * function recursively on the remaining fragment. + */ + _highlight(rest, addItems, text, className); + + if (isInSVG) { + const rect = document.createElementNS( + "http://www.w3.org/2000/svg", + "rect" + ); + const bbox = parent.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute("class", className); + addItems.push({ parent: parent, target: rect }); + } + } + } else if (node.matches && !node.matches("button, select, textarea")) { + node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); + } +}; +const _highlightText = (thisNode, text, className) => { + let addItems = []; + _highlight(thisNode, addItems, text, className); + addItems.forEach((obj) => + obj.parent.insertAdjacentElement("beforebegin", obj.target) + ); +}; + +/** + * Small JavaScript module for the documentation. + */ +const SphinxHighlight = { + + /** + * highlight the search words provided in localstorage in the text + */ + highlightSearchWords: () => { + if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight + + // get and clear terms from localstorage + const url = new URL(window.location); + const highlight = + localStorage.getItem("sphinx_highlight_terms") + || url.searchParams.get("highlight") + || ""; + localStorage.removeItem("sphinx_highlight_terms") + url.searchParams.delete("highlight"); + window.history.replaceState({}, "", url); + + // get individual terms from highlight string + const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); + if (terms.length === 0) return; // nothing to do + + // There should never be more than one element matching "div.body" + const divBody = document.querySelectorAll("div.body"); + const body = divBody.length ? divBody[0] : document.querySelector("body"); + window.setTimeout(() => { + terms.forEach((term) => _highlightText(body, term, "highlighted")); + }, 10); + + const searchBox = document.getElementById("searchbox"); + if (searchBox === null) return; + searchBox.appendChild( + document + .createRange() + .createContextualFragment( + '" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(() => { + /* Do not call highlightSearchWords() when we are on the search page. + * It will highlight words from the *previous* search query. + */ + if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); + SphinxHighlight.initEscapeListener(); +}); diff --git a/api.html b/api.html new file mode 100644 index 000000000..2c9a1d125 --- /dev/null +++ b/api.html @@ -0,0 +1,145 @@ + + + + + + + + API Reference — Public Database 0.4 documentation + + + + + + + + + + + + + + +
+
+
+
+ +
+

API Reference

+

Application Programming Interface for HiSPARC Public Database

+

The API simplifies data access for data contained in the +HiSPARC Public Database. It was born out of the +need for easy access to up-to-date information about stations.

+

Contents:

+ +
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/api_tutorial.html b/api_tutorial.html new file mode 100644 index 000000000..ba16d8b8f --- /dev/null +++ b/api_tutorial.html @@ -0,0 +1,286 @@ + + + + + + + + API Tutorial — Public Database 0.4 documentation + + + + + + + + + + + + + + +
+
+
+
+ +
+

API Tutorial

+

The HiSPARC API (Application Programming Interface) simplifies +metadata access from other applications. In this tutorial, we’ll give +some examples of how this data can be accessed and used with Javascript +(jQuery) and Python. We’ll show you how to do some neat things. +How can you get a list of all HiSPARC stations in Denmark? What is the +position of station 201? Which stations had data on 20 October 2010? How +does the number of measured events change during a few weeks? This +tutorial will give you an overview of some of possibilities with the +HiSPARC API. For details on all available classes and methods, +please see the API Reference.

+
+

Note

+

We’ll require you to know some basic programming, i.e. to understand +what an if statement is and for loop does. If you +are new to coding you can try a tutorial online, for instance +Codeacademy, we recommend learning +Python or jQuery.

+
+
+

First look

+

First we will just look at what this API is. The API can be accessed +via the internet by opening urls. Instead of a website you get data as a +response. This data is formatted as a JSON (JavaScript Object Notation), +this format can be understood by many programming languages.

+

To see what options the API has we will look at it in a browser. Open +the following link in your browser (this will not work in Internet +Explorer): https://data.hisparc.nl/api/.

+

You should now see some text, like this:

+
{"base_url": "https://data.hisparc.nl/api/",
+ "clusters": "clusters/",
+ "clusters_in_country": "countries/{country_id}/",
+ "configuration": "station/{station_id}/config/{year}/{month}/{day}/",
+ "countries": "countries/",
+ "has_data": "station/{station_id}/data/{year}/{month}/{day}/",
+ ...
+ "subclusters_in_cluster": "clusters/{cluster_id}/"}
+
+
+

This is the JSON, it is a dictionary (indicated by the { and +} enclosing brackets): an object which has keys and values. Each +key ("clusters", "has_data") refers to a value +("clusters/", +"station/{station_id}/data/{year}/{month}/{day}/").

+
+

Cluster list

+

This tells us that if we want a list of all clusters we need to use the +clusters option by appending "clusters/" to the base url, +resulting in the following: +https://data.hisparc.nl/api/clusters/.

+

With this result:

+
[{"name": "Amsterdam",
+  "number": 0},
+ {"name": "Utrecht",
+  "number": 1000},
+ ...
+ {"name": "Karlsruhe",
+  "number": 70000}]
+
+
+

This JSON is a list (indicated by the [ and ] enclosing +brackets) of dictionaries, one for each cluster. Each dictionary +contains the name and number of a cluster. This way information about +the network of stations can be retrieved.

+
+
+
+

Javascript example

+

The following code example will generate a webpage which will use the +API to get an up-to-date list of stations. It will then show a +drop-down menu from which a station can be selected, once you have +chosen a station you can click the Get info button to make +Javascript get the station information. To try this you can either use +this example page: jsFiddle or create +your own HTML file with this code:

+
<html>
+<head>
+<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
+<script>
+    $(function() {
+        // Get an up-to-date list of HiSPARC stations
+        $.getJSON(
+            'https://data.hisparc.nl/api/stations/',
+            function(data) {
+                // Create the drop-down menu
+                var select = $('<select>');
+                var id, name;
+                for (var i in data) {
+                    id = data[i].number;
+                    name = data[i].name;
+                    select.append($('<option>').attr('value', id).text(id + ' - ' + name));}
+                $('#station_list').append(select);});
+
+        // Attach a function to the Get info button
+        $('#get_station').on('click', function() {
+            var id = $('#station_list').find('select').val();
+            // Get info for selected station and display it in a nice way
+            $.getJSON('https://data.hisparc.nl/api/station/' + id + '/',
+                      function(data) {
+                          $('#station_info').text(JSON.stringify(data, undefined, 4));
+                      });
+            });
+        });
+</script>
+</head>
+<body style="font-family: sans-serif;">
+    <h2>Station info</h2>
+    <p id="station_list">Choose a station: </p>
+    <input type="submit" id="get_station" value="Get info">
+    <pre id="station_info"></pre>
+</body>
+</html>
+
+
+
+
+

Python example

+

In this example we will use several standard Python libraries and the +popular plotting library matplotlib (pylab). +We start by importing the required libraries, one to get data from the +urls, one to make working with dates easy and the plotting library. Then +define the start values and perpare two empty lists in which the data +can be placed. Then a while loop is used to loop over all days between +datum and end_datum, reading each corresponding url. Finally a plot is +made, setting the dates against their values.

+

Start Python and type (or copy/paste without the >>>) the +following lines of code:

+
>>> from urllib.request import urlopen
+>>> from datetime import date, timedelta
+>>> from pylab import plot, show
+>>> id = 501
+>>> datum = date(2010, 10, 1)
+>>> end_datum = date(2011, 2, 1)
+>>> base = 'https://data.hisparc.nl/api/station/%d/num_events/%d/%d/%d'
+>>> events = []
+>>> dates = []
+>>> while datum < end_datum:
+...     url = urlopen(base % (id, datum.year, datum.month, datum.day))
+...     events.append(url.read())
+...     dates.append(datum)
+...     datum += timedelta(days=1)
+...
+>>> step(dates, events)
+>>> show()
+
+
+
+

SAPPHiRE

+

The HiSPARC Python framework SAPPHiRE includes an API module. This module +simplifies access to the API. See the SAPPHiRE documentation for more +information: +https://docs.hisparc.nl/sapphire/.

+
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/api_views.html b/api_views.html new file mode 100644 index 000000000..a73e55ba4 --- /dev/null +++ b/api_views.html @@ -0,0 +1,397 @@ + + + + + + + + API Views Reference — Public Database 0.4 documentation + + + + + + + + + + + + + + +
+
+
+
+ +
+

API Views Reference

+
+
+clusters(request, country_number=None)
+

Get cluster list

+

Retrieve a list of all clusters or only the clusters in a specific country. +By cluster we here mean the main clusters, which contain subclusters.

+
+
Parameters:
+

country_number – a country number identifier, give this to only get +clusters from a specific country.

+
+
Returns:
+

list of dictionaries containing the name and number of all +clusters that matched the given parameters.

+
+
+
+ +
+
+config(request, station_number, date=None)
+

Get station config settings

+

Retrieve the entire configuration of a station. If no date if given the +latest config will be sent, otherwise the latest on or before the given +date.

+
+
Parameters:
+
    +
  • station_number – a station number identifier.

  • +
  • date – the date for which to get a configuration.

  • +
+
+
Returns:
+

dictionary containing the entire configuration from +the HiSPARC DAQ.

+
+
+
+ +
+
+countries(request)
+

Get country list

+

Retrieve a list of all countries.

+
+
Returns:
+

list of dictionaries containing the name and number of +all countries.

+
+
+
+ +
+
+get_cluster_dict(country=None)
+
+ +
+
+get_country_dict()
+
+ +
+
+get_event_traces(request, station_number, ext_timestamp)
+

Get the traces for an event

+
+
Parameters:
+
    +
  • station_number – a station number identifier.

  • +
  • ext_timestamp – extended timestamp (nanoseconds since UNIX epoch).

  • +
  • raw – (optional, GET) if present get the raw trace, i.e. without +subtracted baseline.

  • +
+
+
Returns:
+

two or four traces.

+
+
+
+ +
+
+get_station_dict(subcluster=None)
+

Return list of station numbers and names

+

For all non-test stations in the given subcluster

+
+ +
+
+get_subcluster_dict(cluster=None)
+
+ +
+
+has_data(request, station_number, type=None, year=None, month=None, date=None)
+

Check for presence of cosmic ray data

+

Find out if the given station has measured shower data, either on a +specific date, or at all.

+
+
Parameters:
+
    +
  • station_number – a stationn number identifier.

  • +
  • type – the data type: events, singles or weather.

  • +
  • year,month,date – the date, this has to be within the time +HiSPARC has been operational and can be as specific as +you desire.

  • +
+
+
Returns:
+

boolean, True if the given station has data, False otherwise.

+
+
+
+ +
+
+json_dict(result)
+

Create a json HTTPResponse

+
+ +
+
+man(request)
+

Give overview of the possible urls

+
+ +
+
+network_status(request)
+

Get status of the network

+
+
Returns:
+

dictionary containing status info for each station.

+
+
+
+ +
+
+num_events(request, station_number, year=None, month=None, date=None, hour=None)
+

Get number of events for a station

+

Retrieve the number of events that a station has measured during its +entire operation or during a specific period, which can be a year, +month, day or an hour.

+
+
Parameters:
+
    +
  • station_number – a stationn number identifier.

  • +
  • year,month,date,hour – the date, this has to be within the time +HiSPARC has been operational and can be as specific as you desire.

  • +
+
+
Returns:
+

integer containing the total number of events ever recorded by +the given station.

+
+
+
+ +
+
+station(request, station_number, year=None, month=None, date=None)
+

Get station info

+

Retrieve general information about a station. If no date if given +the latest valid info will be sent, otherwise the latest on or +before the given date.

+
+
Parameters:
+
    +
  • station_number – a station number identifier.

  • +
  • date – the date for which to get station info.

  • +
+
+
Returns:
+

dictionary containing info about the station. Most importantly, +this contains information about the location of the station GPS +and the relative locations of the individual scintillators.

+
+
+
+ +
+
+stations(request, subcluster_number=None)
+

Get station list

+

Retrieve a list of all stations or all stations in a subcluster.

+
+
Parameters:
+

subcluster_number – a subcluster number identifier. If given, only +stations belonging to that subcluster will be included in the list.

+
+
Returns:
+

list containing dictionaries which consist of the name and number +of each station (matching the subcluster).

+
+
+
+ +
+
+stations_with_data(request, type=None, year=None, month=None, date=None)
+

Get stations with event or weather data

+

Retrieve a list of all stations which have recorded events, singles or +weather data in the given year, month, day or at all.

+
+
Parameters:
+
    +
  • type – data type to check for: events, singles or weather.

  • +
  • year,month,date – the date, this has to be within the time +HiSPARC has been operational and can be as specific as you desire.

  • +
+
+
Returns:
+

list of dictionaries containing the name and number of each +station that has measured weather data in the given year.

+
+
+
+ +
+
+subclusters(request, cluster_number=None)
+

Get subcluster list

+

Retrieve a list of all subclusters or all subclusters in a specific +cluster.

+
+
Parameters:
+

cluster_number – a cluster number identifier, give this to only get +subclusters from this cluster.

+
+
Returns:
+

list of dictionaries containing the name and number of all +subclusters that matched the given parameters.

+
+
+
+ +
+
+validate_date(date)
+

Check if date is outside HiSPARC project range

+

If not valid, a 404 (Not Found) should be returned to the user.

+
+
Returns:
+

boolean, True if the date is in the range, False otherwise.

+
+
+
+ +

Contents:

+
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/data_access.html b/data_access.html new file mode 100644 index 000000000..4aa97cd88 --- /dev/null +++ b/data_access.html @@ -0,0 +1,207 @@ + + + + + + + + Data access — Public Database 0.4 documentation + + + + + + + + + + + + + + +
+
+
+
+ +
+

Data access

+

There are several ways in which the HiSPARC data can be accessed:

+ +

To access metadata, like a list of all stations or information about a +specific station see the API Tutorial.

+
+

Download form

+

When looking at the data page for a station (i.e. Kaj Munk College), you will see a ‘Download +event summary data’ link on the right. When this link is clicked you +will be taken to the Data download form. On this page you can select +the station, the start and end date for which you want to download the +data. There is also an option to download weather data instead of events, +however, not all stations gather weather data.

+

When you click the Submit button without checking the checkbox to +Download, the data should (Firefox always downloads the data) show up in +your browser window. If you check the Download box the data will be +downloaded to your PC as a csv file.

+

This csv file can be read by many programs, including Excel. Use the +Import option in Excel to make it recognize tabs as delimiter between +columns.

+
+
+

Downloading via Python

+
+

Note

+

An easy to use module has been added to SAPPHiRE to download +data from the ESD. The following is an old (but working) example.

+
+

This is an example of how to download the data from the Public database +in Python. In this example we will download 1 hour of data for station +202 on July 2, 2013.

+

First load the required libraries (requires the numpy package).

+
>>> from datetime import datetime
+>>> from urllib import urlencode
+>>> from urllib.request import urlopen
+>>> from StringIO import StringIO
+>>> from numpy import genfromtxt
+
+
+

Then define the url and place the start and end datetime in the query. +To download weather data instead, replace ‘events’ by ‘weather’ in +the url (and choose a station that has weather data, e.g. 3 or 501).

+
+

Note

+

Do not pass the query to the urlopen ‘data’ argument because that +changes the request into a POST request, but you need a GET +request.

+
+
>>> url = 'https://data.hisparc.nl/data/202/events'
+>>> start = str(datetime(2013, 7, 2, 11, 0))
+>>> end = str(datetime(2013, 7, 2, 12, 0))
+>>> query = urlencode({'download': False, 'start': start,'end': end})
+>>> full_url = url + '?' + query
+
+
+

Download the data and store it in a variable

+
>>> data = urlopen(full_url).read()
+
+
+

Now use numpy to convert the data from csv to a numpy array.

+
>>> format = [('date', 'datetime64[D]'), ('time', '|S8'),
+              ('timestamp', 'uint32'), ('nanoseconds', 'uint32'),
+              ('pulseheights', '4int16'), ('integrals', '4int32'),
+              ('n1', 'float32'), ('n2', 'float32'),
+              ('n3', 'float32'), ('n4', 'float32'),
+              ('t1', 'float32'), ('t2', 'float32'),
+              ('t3', 'float32'), ('t4', 'float32'),
+              ('t_trigger', 'float32'),
+              ('zenith', 'int16'), ('azimuth', 'int16')]
+>>> a = genfromtxt(StringIO(data), delimiter="\t", dtype=format)
+>>> print(a[0])
+(datetime.date(2013, 7, 2), '11:00:02', 1372762802L, 466307811L,
+ [78, 798, -1, -1], [535, 10882, -1, -1],
+ 0.14720000326633453, 3.854599952697754, -1.0, -1.0,
+ 345.0, 12.5, -1.0, -1.0, 345.0, -999, -999)
+
+
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/genindex.html b/genindex.html new file mode 100644 index 000000000..e96bdeea6 --- /dev/null +++ b/genindex.html @@ -0,0 +1,390 @@ + + + + + + + Index — Public Database 0.4 documentation + + + + + + + + + + + + +
+
+
+
+ + +

Index

+ +
+ C + | G + | H + | J + | L + | M + | N + | P + | S + | T + | V + +
+

C

+ + + +
+ +

G

+ + + +
+ +

H

+ + + +
+ +

J

+ + +
+ +

L

+ + + +
+ +

M

+ + +
+ +

N

+ + + +
+ +

P

+ + + +
    +
  • + publicdb.api.views + +
  • +
  • + publicdb.status_display + +
  • +
  • + publicdb.status_display.views + +
  • +
+ +

S

+ + + +
+ +

T

+ + +
+ +

V

+ + +
+ + + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/hisparc_maps.html b/hisparc_maps.html new file mode 100644 index 000000000..34829a678 --- /dev/null +++ b/hisparc_maps.html @@ -0,0 +1,218 @@ + + + + + + + + HiSPARC maps — Public Database 0.4 documentation + + + + + + + + + + + + + + +
+
+
+
+ +
+

HiSPARC maps

+

Each HiSPARC station is equipped with a GPS antenne. This GPS is used +to for time synchronization between stations and to determine the exact +location of each station. All these locations are stored in our +database. The GPS positions can be found on the data pages of stations, +via the API (API Reference) and in the raw data.

+
+

Map

+

Using the Leafet library with CARTO maps tiles (based on OpenStreetMap data) we are able to visualize the +detector network by showing the locations of the stations on a map.

+

Here is an overview of the network: Stations on map

+
+

Station info

+

When you click on a station marker a popup will show information about +that station, its name and cluster. If the station has data the name of +the station will be a link to its data page.

+
+
+

Status

+

The stations on the map can have one of 4 colors to indicate the current +status of that station.

+
    +
  • Green: when a station is operating properly

  • +
  • Yellow: it is responding to the server but has a problem

  • +
  • Red: it is completely unresponsive (offline)

  • +
  • Gray: it is is no longer active or the status can’t be determined.

  • +
+
+
+
+

Embedding

+

On several public database pages a map is embedded to show the station +location or provide an overview of multiple stations. Moreover, maps are +also used on our main website to give an overview of the station +organization and clustering (e.g. Bristol, Science +Park +). This is accomplished by placing an iframe on those pages that +shows another page which only has the map as its content. Example code:

+
<iframe src="https://data.hisparc.nl/maps/Netherlands/Amsterdam/Science%20Park/"
+        scrolling="no" frameborder="0" width="600" height="300"></iframe>
+
+
+

Result:

+
+ +
+

Syntax

+

To show a map of a specific region or location, use the syntax explained +here. First start with the base url:

+
https://data.hisparc.nl/maps/
+
+
+

When no extra options are given the page zooms and positions the map +such that all stations fit in the window. But you can also focus on a +specific region or station. Several levels of regions are possible:

+
https://data.hisparc.nl/maps/[Country]/[Cluster]/[Subcluster]/
+https://data.hisparc.nl/maps/[Station number]/
+
+
+

An overview of countries, clusters and subclusters can be found on +https://data.hisparc.nl/ . First you can choose to focus on a Country:

+ +

Then focus more closely on a cluster, note that you also need to give +the country:

+ +

And to focus on a subcluster, also specifying the country and cluster:

+ +

Finally you can also focus on one specific station by simply giving its +station number:

+ +
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 000000000..e98240c65 --- /dev/null +++ b/index.html @@ -0,0 +1,156 @@ + + + + + + + + Public Database documentation! — Public Database 0.4 documentation + + + + + + + + + + + + + +
+
+
+
+ +
+

Public Database documentation!

+

The HiSPARC Public Database is the interface through which everyone can access +the data and our station administration is done.

+

Contents:

+ +
+
+

Indices and tables

+ +
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/objects.inv b/objects.inv new file mode 100644 index 000000000..188acff84 Binary files /dev/null and b/objects.inv differ diff --git a/py-modindex.html b/py-modindex.html new file mode 100644 index 000000000..e829c9d8b --- /dev/null +++ b/py-modindex.html @@ -0,0 +1,121 @@ + + + + + + + Python Module Index — Public Database 0.4 documentation + + + + + + + + + + + + + + + +
+
+
+
+ + +

Python Module Index

+ +
+ p +
+ + + + + + + + + + + + + + + + + + + +
 
+ p
+ publicdb +
    + publicdb.api +
    + publicdb.api.views +
    + publicdb.status_display +
    + publicdb.status_display.views +
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/search.html b/search.html new file mode 100644 index 000000000..34e26561b --- /dev/null +++ b/search.html @@ -0,0 +1,103 @@ + + + + + + + Search — Public Database 0.4 documentation + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Search

+ + + + +

+ Searching for multiple words only shows matches that contain + all words. +

+ + +
+ + + +
+ + +
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/searchindex.js b/searchindex.js new file mode 100644 index 000000000..6efe55110 --- /dev/null +++ b/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({"alltitles": {"API Reference": [[0, "module-publicdb.api"]], "API Tutorial": [[1, "api-tutorial"]], "API Views Reference": [[2, "module-publicdb.api.views"]], "Accessing the data": [[6, "accessing-the-data"]], "Cluster list": [[1, "cluster-list"]], "Compass coordinates": [[6, "compass-coordinates"]], "Data access": [[3, "data-access"]], "Download form": [[3, "download-form"]], "Downloading via Python": [[3, "downloading-via-python"]], "Embedding": [[4, "embedding"]], "First look": [[1, "first-look"]], "HiSPARC maps": [[4, "hisparc-maps"]], "HiSPARC station layout": [[6, "hisparc-station-layout"]], "Indices and tables": [[5, "indices-and-tables"]], "Javascript example": [[1, "javascript-example"]], "Map": [[4, "map"]], "Public Database documentation!": [[5, "public-database-documentation"]], "Python example": [[1, "python-example"]], "SAPPHiRE": [[1, "sapphire"]], "Station info": [[4, "station-info"]], "Status": [[4, "status"]], "Status Display Reference": [[7, "module-publicdb.status_display"]], "Status Display Views Reference": [[8, "module-publicdb.status_display.views"]], "Submitting the measurements": [[6, "submitting-the-measurements"]], "Syntax": [[4, "syntax"]]}, "docnames": ["api", "api_tutorial", "api_views", "data_access", "hisparc_maps", "index", "station_layout", "status_display", "status_display_views"], "envversion": {"sphinx": 61, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2}, "filenames": ["api.rst", "api_tutorial.rst", "api_views.rst", "data_access.rst", "hisparc_maps.rst", "index.rst", "station_layout.rst", "status_display.rst", "status_display_views.rst"], "indexentries": {"clusters() (in module publicdb.api.views)": [[2, "publicdb.api.views.clusters", false]], "config() (in module publicdb.api.views)": [[2, "publicdb.api.views.config", false]], "countries() (in module publicdb.api.views)": [[2, "publicdb.api.views.countries", false]], "create_plot_object() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.create_plot_object", false]], "get_cluster_dict() (in module publicdb.api.views)": [[2, "publicdb.api.views.get_cluster_dict", false]], "get_config_source() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_config_source", false]], "get_context_data() (networksummarydetailview method)": [[8, "publicdb.status_display.views.NetworkSummaryDetailView.get_context_data", false]], "get_context_data() (summarydetailview method)": [[8, "publicdb.status_display.views.SummaryDetailView.get_context_data", false]], "get_country_dict() (in module publicdb.api.views)": [[2, "publicdb.api.views.get_country_dict", false]], "get_dataset_source() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_dataset_source", false]], "get_detector_timing_offsets() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_detector_timing_offsets", false]], "get_detector_timing_offsets_source() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_detector_timing_offsets_source", false]], "get_event_traces() (in module publicdb.api.views)": [[2, "publicdb.api.views.get_event_traces", false]], "get_eventtime_histogram_sources() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_eventtime_histogram_sources", false]], "get_eventtime_source() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_eventtime_source", false]], "get_focus() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_focus", false]], "get_gpslocations() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_gpslocations", false]], "get_histogram_source() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_histogram_source", false]], "get_object() (networksummarydetailview method)": [[8, "publicdb.status_display.views.NetworkSummaryDetailView.get_object", false]], "get_object() (summarydetailview method)": [[8, "publicdb.status_display.views.SummaryDetailView.get_object", false]], "get_queryset() (networksummarydetailview method)": [[8, "publicdb.status_display.views.NetworkSummaryDetailView.get_queryset", false]], "get_queryset() (summarydetailview method)": [[8, "publicdb.status_display.views.SummaryDetailView.get_queryset", false]], "get_redirect_url() (latestnetworksummaryredirectview method)": [[8, "publicdb.status_display.views.LatestNetworkSummaryRedirectView.get_redirect_url", false]], "get_redirect_url() (latestsummaryredirectview method)": [[8, "publicdb.status_display.views.LatestSummaryRedirectView.get_redirect_url", false]], "get_specific_config_source() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_specific_config_source", false]], "get_specific_dataset_source() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_specific_dataset_source", false]], "get_specific_histogram_source() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_specific_histogram_source", false]], "get_specific_network_histogram_source() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_specific_network_histogram_source", false]], "get_station_dict() (in module publicdb.api.views)": [[2, "publicdb.api.views.get_station_dict", false]], "get_station_layout_source() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_station_layout_source", false]], "get_station_timing_offsets() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_station_timing_offsets", false]], "get_station_timing_offsets_source() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.get_station_timing_offsets_source", false]], "get_subcluster_dict() (in module publicdb.api.views)": [[2, "publicdb.api.views.get_subcluster_dict", false]], "has_data() (in module publicdb.api.views)": [[2, "publicdb.api.views.has_data", false]], "help() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.help", false]], "http_method_names (networksummarydetailview attribute)": [[8, "publicdb.status_display.views.NetworkSummaryDetailView.http_method_names", false]], "http_method_names (summarydetailview attribute)": [[8, "publicdb.status_display.views.SummaryDetailView.http_method_names", false]], "json_dict() (in module publicdb.api.views)": [[2, "publicdb.api.views.json_dict", false]], "latestnetworksummaryredirectview (class in publicdb.status_display.views)": [[8, "publicdb.status_display.views.LatestNetworkSummaryRedirectView", false]], "latestsummaryredirectview (class in publicdb.status_display.views)": [[8, "publicdb.status_display.views.LatestSummaryRedirectView", false]], "man() (in module publicdb.api.views)": [[2, "publicdb.api.views.man", false]], "module": [[0, "module-publicdb.api", false], [2, "module-publicdb.api.views", false], [7, "module-publicdb.status_display", false], [8, "module-publicdb.status_display.views", false]], "nav_calendar() (networksummarydetailview method)": [[8, "publicdb.status_display.views.NetworkSummaryDetailView.nav_calendar", false]], "nav_calendar() (summarydetailview method)": [[8, "publicdb.status_display.views.SummaryDetailView.nav_calendar", false]], "nav_months() (networksummarydetailview method)": [[8, "publicdb.status_display.views.NetworkSummaryDetailView.nav_months", false]], "nav_months() (summarydetailview method)": [[8, "publicdb.status_display.views.SummaryDetailView.nav_months", false]], "nav_years() (networksummarydetailview method)": [[8, "publicdb.status_display.views.NetworkSummaryDetailView.nav_years", false]], "nav_years() (summarydetailview method)": [[8, "publicdb.status_display.views.SummaryDetailView.nav_years", false]], "network_status() (in module publicdb.api.views)": [[2, "publicdb.api.views.network_status", false]], "networksummarydetailview (class in publicdb.status_display.views)": [[8, "publicdb.status_display.views.NetworkSummaryDetailView", false]], "none_to_nan() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.none_to_nan", false]], "num_events() (in module publicdb.api.views)": [[2, "publicdb.api.views.num_events", false]], "plot_config() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.plot_config", false]], "plot_dataset() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.plot_dataset", false]], "plot_histogram() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.plot_histogram", false]], "plot_timing_offsets() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.plot_timing_offsets", false]], "publicdb.api": [[0, "module-publicdb.api", false]], "publicdb.api.views": [[2, "module-publicdb.api.views", false]], "publicdb.status_display": [[7, "module-publicdb.status_display", false]], "publicdb.status_display.views": [[8, "module-publicdb.status_display.views", false]], "station() (in module publicdb.api.views)": [[2, "publicdb.api.views.station", false]], "station_config() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.station_config", false]], "station_has_config() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.station_has_config", false]], "station_has_data() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.station_has_data", false]], "station_latest() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.station_latest", false]], "station_status() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.station_status", false]], "stations() (in module publicdb.api.views)": [[2, "publicdb.api.views.stations", false]], "stations() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.stations", false]], "stations_by_country() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.stations_by_country", false]], "stations_by_name() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.stations_by_name", false]], "stations_by_number() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.stations_by_number", false]], "stations_by_status() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.stations_by_status", false]], "stations_on_map() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.stations_on_map", false]], "stations_with_data() (in module publicdb.api.views)": [[2, "publicdb.api.views.stations_with_data", false]], "stations_with_data() (in module publicdb.status_display.views)": [[8, "publicdb.status_display.views.stations_with_data", false]], "subclusters() (in module publicdb.api.views)": [[2, "publicdb.api.views.subclusters", false]], "summarydetailview (class in publicdb.status_display.views)": [[8, "publicdb.status_display.views.SummaryDetailView", false]], "template_name (networksummarydetailview attribute)": [[8, "publicdb.status_display.views.NetworkSummaryDetailView.template_name", false]], "template_name (summarydetailview attribute)": [[8, "publicdb.status_display.views.SummaryDetailView.template_name", false]], "validate_date() (in module publicdb.api.views)": [[2, "publicdb.api.views.validate_date", false]]}, "objects": {"publicdb": [[0, 0, 0, "-", "api"], [7, 0, 0, "-", "status_display"]], "publicdb.api": [[2, 0, 0, "-", "views"]], "publicdb.api.views": [[2, 1, 1, "", "clusters"], [2, 1, 1, "", "config"], [2, 1, 1, "", "countries"], [2, 1, 1, "", "get_cluster_dict"], [2, 1, 1, "", "get_country_dict"], [2, 1, 1, "", "get_event_traces"], [2, 1, 1, "", "get_station_dict"], [2, 1, 1, "", "get_subcluster_dict"], [2, 1, 1, "", "has_data"], [2, 1, 1, "", "json_dict"], [2, 1, 1, "", "man"], [2, 1, 1, "", "network_status"], [2, 1, 1, "", "num_events"], [2, 1, 1, "", "station"], [2, 1, 1, "", "stations"], [2, 1, 1, "", "stations_with_data"], [2, 1, 1, "", "subclusters"], [2, 1, 1, "", "validate_date"]], "publicdb.status_display": [[8, 0, 0, "-", "views"]], "publicdb.status_display.views": [[8, 2, 1, "", "LatestNetworkSummaryRedirectView"], [8, 2, 1, "", "LatestSummaryRedirectView"], [8, 2, 1, "", "NetworkSummaryDetailView"], [8, 2, 1, "", "SummaryDetailView"], [8, 1, 1, "", "create_plot_object"], [8, 1, 1, "", "get_config_source"], [8, 1, 1, "", "get_dataset_source"], [8, 1, 1, "", "get_detector_timing_offsets"], [8, 1, 1, "", "get_detector_timing_offsets_source"], [8, 1, 1, "", "get_eventtime_histogram_sources"], [8, 1, 1, "", "get_eventtime_source"], [8, 1, 1, "", "get_focus"], [8, 1, 1, "", "get_gpslocations"], [8, 1, 1, "", "get_histogram_source"], [8, 1, 1, "", "get_specific_config_source"], [8, 1, 1, "", "get_specific_dataset_source"], [8, 1, 1, "", "get_specific_histogram_source"], [8, 1, 1, "", "get_specific_network_histogram_source"], [8, 1, 1, "", "get_station_layout_source"], [8, 1, 1, "", "get_station_timing_offsets"], [8, 1, 1, "", "get_station_timing_offsets_source"], [8, 1, 1, "", "help"], [8, 1, 1, "", "none_to_nan"], [8, 1, 1, "", "plot_config"], [8, 1, 1, "", "plot_dataset"], [8, 1, 1, "", "plot_histogram"], [8, 1, 1, "", "plot_timing_offsets"], [8, 1, 1, "", "station_config"], [8, 1, 1, "", "station_has_config"], [8, 1, 1, "", "station_has_data"], [8, 1, 1, "", "station_latest"], [8, 1, 1, "", "station_status"], [8, 1, 1, "", "stations"], [8, 1, 1, "", "stations_by_country"], [8, 1, 1, "", "stations_by_name"], [8, 1, 1, "", "stations_by_number"], [8, 1, 1, "", "stations_by_status"], [8, 1, 1, "", "stations_on_map"], [8, 1, 1, "", "stations_with_data"]], "publicdb.status_display.views.LatestNetworkSummaryRedirectView": [[8, 3, 1, "", "get_redirect_url"]], "publicdb.status_display.views.LatestSummaryRedirectView": [[8, 3, 1, "", "get_redirect_url"]], "publicdb.status_display.views.NetworkSummaryDetailView": [[8, 3, 1, "", "get_context_data"], [8, 3, 1, "", "get_object"], [8, 3, 1, "", "get_queryset"], [8, 4, 1, "", "http_method_names"], [8, 3, 1, "", "nav_calendar"], [8, 3, 1, "", "nav_months"], [8, 3, 1, "", "nav_years"], [8, 4, 1, "", "template_name"]], "publicdb.status_display.views.SummaryDetailView": [[8, 3, 1, "", "get_context_data"], [8, 3, 1, "", "get_object"], [8, 3, 1, "", "get_queryset"], [8, 4, 1, "", "http_method_names"], [8, 3, 1, "", "nav_calendar"], [8, 3, 1, "", "nav_months"], [8, 3, 1, "", "nav_years"], [8, 4, 1, "", "template_name"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"], "2": ["py", "class", "Python class"], "3": ["py", "method", "Python method"], "4": ["py", "attribute", "Python attribute"]}, "objtypes": {"0": "py:module", "1": "py:function", "2": "py:class", "3": "py:method", "4": "py:attribute"}, "terms": {"0": [1, 3, 4], "00": 3, "02": 3, "1": [1, 3], "10": 1, "1000": 1, "10882": 3, "11": [1, 3], "12": 3, "1372762802l": 3, "14720000326633453": 3, "2": [1, 3, 6], "20": 1, "2002": 8, "2004": 8, "201": 1, "2010": 1, "2011": 1, "2013": 3, "202": 3, "20kingdom": 4, "20park": 4, "3": [3, 6], "300": 4, "345": 3, "4": [1, 4, 6], "404": 2, "466307811l": 3, "4int16": 3, "4int32": 3, "5": 3, "501": [1, 3], "535": 3, "600": 4, "7": 3, "70000": 1, "78": 3, "798": 3, "8005": 4, "8103": 4, "854599952697754": 3, "999": 3, "A": 6, "And": 4, "But": 4, "By": 2, "For": [1, 2, 6], "If": [1, 2, 3, 4], "In": [1, 3], "It": [0, 1], "Not": 2, "On": [3, 4], "The": [0, 1, 3, 4, 5, 6, 7, 8], "Then": [1, 3, 4], "There": 3, "These": 6, "To": [1, 3, 4], "With": 1, "abl": 4, "about": [0, 1, 2, 3, 4, 6], "access": [0, 1, 5], "accomplish": 4, "activ": 4, "ad": 3, "administr": 5, "against": 1, "all": [1, 2, 3, 4, 6, 8], "alpha": 6, "also": [3, 4], "altitud": 6, "alwai": 3, "amsterdam": [1, 4], "an": [1, 2, 3, 4, 6], "analys": 6, "angl": 6, "anoth": 4, "antenn": [4, 6], "antenna": 6, "api": [3, 4, 5, 6], "append": 1, "applic": [0, 1, 3], "ar": [1, 3, 4, 6, 8], "arg": 8, "argument": [3, 8], "arrai": 3, "assign": 6, "attach": 1, "attr": 1, "avail": [1, 6, 8], "azimuth": 3, "base": [1, 4], "base_url": 1, "baselin": 2, "basic": 1, "becaus": 3, "been": [2, 3], "befor": [2, 6], "belong": [2, 8], "beta": 6, "between": [1, 3, 4, 6, 8], "bin": 8, "bodi": 1, "boolean": [2, 8], "born": 0, "box": 3, "bracket": 1, "bristol": 4, "browser": [1, 3], "button": [1, 3], "calendar": 8, "call": 8, "can": [1, 2, 3, 4, 5, 6, 8], "carto": 4, "center": 6, "chang": [1, 3], "check": [2, 3, 8], "checkbox": 3, "choos": [1, 3, 4], "chosen": [1, 6], "class": [1, 8], "click": [1, 3, 4], "clock": 6, "close": 4, "cluster": [0, 2, 4, 8], "cluster_id": 1, "cluster_numb": 2, "clusters_in_countri": 1, "code": [1, 4], "codeacademi": 1, "coincid": 8, "colleg": 3, "color": 4, "column": 3, "com": 1, "commun": 6, "compass": 5, "complet": 4, "config": [0, 1, 2, 8], "configur": [1, 2, 8], "consist": 2, "constructor": 8, "contain": [0, 1, 2, 8], "content": [0, 2, 4, 5, 7, 8], "context": 8, "convert": 3, "coordin": 5, "copi": 1, "correspond": 1, "cosmic": 2, "countri": [0, 1, 2, 4, 8], "country_id": 1, "country_numb": 2, "creat": [1, 2, 8], "create_plot_object": [7, 8], "csv": 3, "current": [4, 8], "d": [1, 3], "dai": [1, 2], "daili": 8, "dailyhistogram": 8, "daq": 2, "data": [0, 1, 2, 4, 5, 7, 8], "databas": [0, 3, 4], "dataset": 8, "date": [0, 1, 2, 3, 8], "datetim": [1, 3], "datetime64": 3, "datum": 1, "de": 6, "default": 8, "defin": [1, 3], "degre": 6, "delimit": 3, "denmark": [1, 4], "describ": 6, "desir": 2, "detail": 1, "detector": [4, 6], "determin": [4, 6], "dict": 8, "dictionari": [1, 2], "differ": 6, "displai": [1, 5], "distanc": 6, "do": [1, 3], "doc": 1, "document": 1, "doe": 1, "done": 5, "down": 1, "download": 5, "draw": 6, "drop": 1, "dtype": 3, "dure": [1, 2], "dutch": 6, "e": [1, 2, 3, 4, 6], "each": [1, 2, 4, 6], "easi": [0, 1, 3], "either": [1, 2, 6, 8], "embed": 5, "empti": 1, "enclos": 1, "end": [3, 8], "end_datum": 1, "ensched": 4, "entir": 2, "epoch": 2, "equip": 4, "error": 8, "esd": 3, "event": [1, 2, 3, 8], "eventtim": 8, "ever": 2, "everyon": 5, "exact": [4, 6], "exampl": [3, 4, 5, 6], "excel": 3, "explain": [4, 6], "explor": 1, "ext_timestamp": 2, "extend": 2, "extra": [4, 8], "fals": [2, 3], "famili": 1, "few": 1, "figur": 6, "file": [1, 3], "final": [1, 4], "find": [1, 2], "firefox": 3, "first": [3, 4, 5, 6], "fit": 4, "float32": 3, "focu": 4, "follow": [1, 3, 6, 8], "font": 1, "form": [5, 6], "format": [1, 3], "found": [2, 4], "four": 2, "framebord": 4, "framework": [1, 3], "from": [1, 2, 3, 6, 8], "full_url": 3, "function": 1, "g": [3, 4], "gather": 3, "gener": [1, 2, 8], "genfromtxt": 3, "get": [1, 2, 3, 8], "get_cluster_dict": [0, 2], "get_config_sourc": [7, 8], "get_context_data": [7, 8], "get_country_dict": [0, 2], "get_dataset_sourc": [7, 8], "get_detector_timing_offset": [7, 8], "get_detector_timing_offsets_sourc": [7, 8], "get_event_trac": [0, 2], "get_eventtime_histogram_sourc": [7, 8], "get_eventtime_sourc": [7, 8], "get_focu": [7, 8], "get_gpsloc": [7, 8], "get_histogram_sourc": [7, 8], "get_object": [7, 8], "get_queryset": [7, 8], "get_redirect_url": [7, 8], "get_specific_config_sourc": [7, 8], "get_specific_dataset_sourc": [7, 8], "get_specific_histogram_sourc": [7, 8], "get_specific_network_histogram_sourc": [7, 8], "get_stat": 1, "get_station_dict": [0, 2], "get_station_layout_sourc": [7, 8], "get_station_timing_offset": [7, 8], "get_station_timing_offsets_sourc": [7, 8], "get_subcluster_dict": [0, 2], "getjson": 1, "give": [1, 2, 4], "given": [2, 4, 8], "gp": [2, 4, 6, 8], "grai": 4, "green": 4, "h2": 1, "ha": [1, 2, 3, 4, 6, 8], "had": 1, "has_data": [0, 1, 2], "have": [1, 2, 4, 6], "head": 1, "height": [4, 6], "help": [7, 8], "here": [2, 4], "hisparc": [0, 1, 2, 3, 5], "histogram": 8, "histori": 8, "hour": [2, 3], "how": [1, 3, 6], "howev": [3, 6], "html": [1, 8], "http": [1, 3, 4], "http_method_nam": [7, 8], "httprespons": 2, "i": [1, 2, 3, 4, 5, 6, 8], "id": 1, "identifi": 2, "ifram": 4, "illustr": 6, "implement": 8, "import": [1, 3, 6], "importantli": 2, "includ": [1, 2, 3], "index": 5, "indic": [1, 4, 8], "individu": 2, "info": [1, 2], "infopakket": 6, "inform": [0, 1, 2, 3, 4, 6], "input": 1, "insert": 8, "instanc": 1, "instead": [1, 3], "int16": 3, "integ": 2, "integr": 3, "interfac": [0, 1, 5], "internet": 1, "its": [2, 4], "j": 1, "javascript": 5, "jqueri": 1, "jsfiddl": 1, "json": [1, 2], "json_dict": [0, 2], "jsparc": 3, "juli": 3, "just": 1, "kaj": 3, "karlsruh": 1, "kei": 1, "keyword": 8, "know": [1, 6], "kwarg": 8, "languag": 1, "latest": 2, "latestnetworksummaryredirectview": [7, 8], "latestsummaryredirectview": [7, 8], "layout": 5, "leafet": 4, "learn": 1, "level": 4, "librari": [1, 3, 4], "like": [1, 3], "line": 1, "link": [1, 3, 4, 8], "list": [2, 3, 8], "ll": 1, "load": 3, "locat": [2, 4, 6, 8], "long": 6, "longer": 4, "look": [3, 5, 8], "loop": 1, "made": [1, 6], "mai": [6, 8], "mail": 6, "main": [2, 4], "make": [1, 3, 6], "man": [0, 2], "mani": [1, 3], "map": [5, 8], "marker": 4, "match": [2, 8], "matplotlib": 1, "mean": 2, "measur": [1, 2, 5, 7], "menu": 1, "metadata": [1, 3], "meter": 6, "method": [1, 8], "min": 1, "modul": [1, 3, 5], "month": [1, 2, 8], "more": [1, 4, 6], "moreov": [4, 6], "most": [2, 8], "multipl": 4, "munk": 3, "n1": 3, "n2": 3, "n3": 3, "n4": 3, "name": [1, 2, 4, 8], "nanosecond": [2, 3], "nav_calendar": [7, 8], "nav_month": [7, 8], "nav_year": [7, 8], "neat": 1, "need": [0, 1, 3, 4, 6], "netherland": 4, "network": [1, 2, 4], "network_coincid": 8, "network_statu": [0, 2], "networkhistogram": 8, "networksummarydetailview": [7, 8], "new": [1, 6], "next": 6, "nice": 1, "nl": [1, 3, 4], "non": 2, "none": [2, 8], "none_to_nan": [7, 8], "north": 6, "notat": 1, "note": 4, "now": [1, 3, 8], "num_ev": [0, 1, 2], "number": [1, 2, 4, 8], "numpi": 3, "object": [1, 8], "octob": 1, "offlin": 4, "offset": 8, "often": 6, "old": 3, "onc": 1, "one": [1, 4], "onli": [2, 4], "onlin": 1, "open": 1, "openstreetmap": 4, "oper": [2, 4], "option": [1, 2, 3, 4], "order": 8, "organ": 4, "orient": 6, "other": [1, 8], "otherwis": [2, 8], "our": [4, 5], "out": [0, 2], "outsid": 2, "over": 1, "overridden": 8, "overview": [1, 2, 4], "own": 1, "p": 1, "packag": 3, "page": [1, 3, 4, 5, 8], "pair": 8, "paramet": [2, 8], "park": 4, "particular": 8, "pass": 3, "past": 1, "pattern": 8, "pc": 3, "period": 2, "perpar": 1, "place": [1, 3, 4], "pleas": 1, "plot": [1, 8], "plot_config": [7, 8], "plot_dataset": [7, 8], "plot_histogram": [7, 8], "plot_timing_offset": [7, 8], "popular": 1, "popup": 4, "posit": [1, 4, 6], "possibl": [1, 2, 4], "post": 3, "pre": 1, "presenc": 2, "present": 2, "previou": 8, "print": 3, "problem": 4, "process": 6, "program": [0, 1, 3], "project": 2, "properli": 4, "provid": [4, 7, 8], "public": [0, 3, 4], "pulseheight": 3, "pylab": 1, "python": 5, "queri": 3, "queryset": 8, "r": 6, "rai": 2, "rang": 2, "raw": [2, 4], "read": [1, 3], "recent": 8, "recogn": 3, "recommend": 1, "reconstruct": 6, "record": [2, 8], "red": 4, "redirect": 8, "ref_station_numb": 8, "refer": [1, 4, 5], "region": 4, "rel": [2, 6], "replac": 3, "request": [1, 2, 3, 8], "requir": [1, 3], "respond": 4, "respons": 1, "result": [1, 2, 4], "retriev": [1, 2, 8], "return": [2, 8], "review": 6, "right": 3, "rotat": 6, "s8": 3, "same": 6, "san": 1, "sapphir": [3, 4, 6], "schemat": 6, "school": 6, "scienc": 4, "scintil": [2, 6], "script": 1, "scroll": 4, "search": 5, "section": 6, "see": [1, 3, 6], "seen": 6, "select": [1, 3], "sent": [2, 6], "serif": 1, "server": 4, "set": [1, 2], "sever": [1, 3, 4], "sheet": 6, "should": [1, 2, 3], "show": [1, 3, 4, 8], "shower": [2, 8], "side": 6, "signific": 6, "simpli": 4, "simplifi": [0, 1], "sinc": 2, "singl": [2, 8], "some": 1, "specif": [2, 3, 4, 8], "specifi": 4, "src": [1, 4], "standard": 1, "start": [1, 3, 4, 8], "statement": 1, "static": 8, "station": [0, 1, 2, 3, 5, 7, 8], "station_config": [7, 8], "station_data": 8, "station_has_config": [7, 8], "station_has_data": [7, 8], "station_id": 1, "station_info": 1, "station_latest": [7, 8], "station_list": 1, "station_numb": [2, 8], "station_statu": [7, 8], "stationn": 2, "stations_by_countri": [7, 8], "stations_by_nam": [7, 8], "stations_by_numb": [7, 8], "stations_by_statu": [7, 8], "stations_on_map": [7, 8], "stations_with_data": [0, 2, 7, 8], "stationsplattegrond": 6, "statu": [2, 5], "status_displai": 8, "step": 1, "store": [3, 4], "str": 3, "stringifi": 1, "stringio": 3, "student": 6, "style": 1, "subclust": [0, 2, 4, 8], "subcluster_numb": 2, "subclusters_in_clust": 1, "submit": [1, 3, 5], "submitt": 6, "subtract": 2, "summari": [3, 7], "summarydetailview": [7, 8], "support": 8, "synchron": 4, "system": 6, "t": [3, 4], "t1": 3, "t2": 3, "t3": 3, "t4": 3, "t_trigger": 3, "tab": 3, "taken": 3, "tell": 1, "template_nam": [7, 8], "test": 2, "text": 1, "thei": 6, "thi": [1, 2, 3, 4, 6, 8], "thing": [1, 8], "those": 4, "through": [5, 6], "tile": 4, "time": [2, 3, 4, 8], "timedelta": 1, "timestamp": [2, 3], "total": 2, "trace": 2, "trigger": 8, "true": 2, "try": 1, "tupl": 8, "turn": 6, "tutori": [3, 5], "two": [1, 2], "type": [1, 2, 8], "u": [1, 6], "uint32": 3, "undefin": 1, "understand": 1, "understood": 1, "unit": [4, 6], "unix": 2, "unrespons": 4, "up": [0, 1, 3, 6, 8], "url": [1, 2, 3, 4, 8], "urlconf": 8, "urlencod": 3, "urllib": [1, 3], "urlopen": [1, 3], "us": [1, 3, 4, 6, 8], "user": 2, "utrecht": [1, 4], "val": 1, "valid": [2, 8], "validate_d": [0, 2], "valu": [1, 8], "var": 1, "variabl": 3, "verif": 6, "via": [1, 4, 5, 6], "view": [0, 5, 7], "visual": 4, "voltag": 8, "wa": 0, "wai": [1, 3, 6], "walk": 6, "want": [1, 3], "we": [1, 2, 3, 4, 6], "weather": [2, 3, 8], "web": 3, "webpag": [1, 7], "websit": [1, 4, 6], "week": 1, "what": 1, "when": [3, 4, 6], "which": [1, 2, 3, 4, 5, 6, 8], "while": 1, "width": 4, "window": [3, 4], "wise": 6, "within": 2, "without": [1, 2, 3], "work": [1, 3], "x": 8, "x_label": 8, "x_valu": 8, "y": 8, "y_label": 8, "y_seri": 8, "year": [1, 2, 8], "yellow": 4, "you": [1, 2, 3, 4], "your": [1, 3], "z": 6, "zaanstad": 4, "zenith": 3, "zoom": 4, "\u03b1": 6, "\u03b2": 6}, "titles": ["API Reference", "API Tutorial", "API Views Reference", "Data access", "HiSPARC maps", "Public Database documentation!", "HiSPARC station layout", "Status Display Reference", "Status Display Views Reference"], "titleterms": {"access": [3, 6], "api": [0, 1, 2], "cluster": 1, "compass": 6, "coordin": 6, "data": [3, 6], "databas": 5, "displai": [7, 8], "document": 5, "download": 3, "embed": 4, "exampl": 1, "first": 1, "form": 3, "hisparc": [4, 6], "indic": 5, "info": 4, "javascript": 1, "layout": 6, "list": 1, "look": 1, "map": 4, "measur": 6, "public": 5, "python": [1, 3], "refer": [0, 2, 7, 8], "sapphir": 1, "station": [4, 6], "statu": [4, 7, 8], "submit": 6, "syntax": 4, "tabl": 5, "tutori": 1, "via": 3, "view": [2, 8]}}) \ No newline at end of file diff --git a/station_layout.html b/station_layout.html new file mode 100644 index 000000000..3a1e20f2d --- /dev/null +++ b/station_layout.html @@ -0,0 +1,173 @@ + + + + + + + + HiSPARC station layout — Public Database 0.4 documentation + + + + + + + + + + + + + + +
+
+
+
+ +
+

HiSPARC station layout

+

Each HiSPARC station has a GPS antenne and either 2 or 4 scintillator +detectors. This GPS is used to determine the exact location of the +station. However, the GPS is often not at the center of the station, +moreover, not all stations are oriented the same way, and the distances +between detector may differ. For reconstruction of the measured data it +is important to know the location of each detector, this section +explains how the location of the detectors can be measured and +communicated to us.

+
+

Compass coordinates

+

The coordinate system we have chosen for describing the position of +detectors is illustrated in the following figure.

+_images/coordinate_system.png + +

For each detector 3 (or 4) coordinates need to be determined:

+
    +
  • First the distance (r) from the GPS to the center of the +scintillator (in meters).

  • +
  • Next the alpha angle (α) which is the clock-wise turning angle +between North and the detector as seen from the GPS (in degrees).

  • +
  • A height (z) coordinate can be measured if there is a +significant altitude difference between the GPS antenna and the +detectors, or if the detectors are not at the same height. Up is +positive (in meters).

  • +
  • The rotation of the detector is described by the beta angle +(β), which is the clock-wise turning rotation of the long side +of the detector relative to North (in degrees).

  • +
+

For more information about the coordinate systems used in HiSPARC see: +Coordinate systems and units in HiSPARC.

+

For Dutch schools we have an assignment sheet in the infopakket which +walks students through the process of measuring the station layout: +De stationsplattegrond.

+
+
+

Submitting the measurements

+

New layouts can be submitted via the layout submit form. A verification e-mail will be sent +to the submitter. The submitted measurements will be reviewed before they are +made available on the website and via the API.

+
+
+

Accessing the data

+

The detector coordinates can be accessed via the API. +These can, for example, be used when analysing data or when making a schematic +drawing of the station layout.

+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/status_display.html b/status_display.html new file mode 100644 index 000000000..7ab75d09f --- /dev/null +++ b/status_display.html @@ -0,0 +1,191 @@ + + + + + + + + Status Display Reference — Public Database 0.4 documentation + + + + + + + + + + + + + + +
+
+
+
+ +
+

Status Display Reference

+

Station Status Display

+

The Status Display provides webpages that display summaries of data measured +by stations.

+

Contents:

+
+ +
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/status_display_views.html b/status_display_views.html new file mode 100644 index 000000000..c8eca11a6 --- /dev/null +++ b/status_display_views.html @@ -0,0 +1,591 @@ + + + + + + + + Status Display Views Reference — Public Database 0.4 documentation + + + + + + + + + + + + + +
+
+
+
+ +
+

Status Display Views Reference

+
+
+class LatestNetworkSummaryRedirectView(**kwargs)
+

Show most recent coincidence data page

+

Constructor. Called in the URLconf; can contain helpful extra +keyword arguments, and other things.

+
+
+get_redirect_url(*args, **kwargs)
+

Return the URL redirect to. Keyword arguments from the URL pattern +match generating the redirect request are provided as kwargs to this +method.

+
+ +
+ +
+
+class LatestSummaryRedirectView(**kwargs)
+

Show most recent data for a particular station

+

Constructor. Called in the URLconf; can contain helpful extra +keyword arguments, and other things.

+
+
+get_redirect_url(*args, **kwargs)
+

Return the URL redirect to. Keyword arguments from the URL pattern +match generating the redirect request are provided as kwargs to this +method.

+
+ +
+ +
+
+class NetworkSummaryDetailView(**kwargs)
+

Constructor. Called in the URLconf; can contain helpful extra +keyword arguments, and other things.

+
+
+get_context_data(**kwargs)
+

Insert the single object into the context dict.

+
+ +
+
+get_object(queryset=None)
+

Get the object this request displays.

+
+ +
+
+get_queryset()
+

Return the QuerySet that will be used to look up the object.

+

This method is called by the default implementation of get_object() and +may not be called if get_object() is overridden.

+
+ +
+
+http_method_names = ['get']
+
+ +
+
+nav_calendar()
+

Create a month calendar with links

+
+ +
+
+nav_months()
+

Create list of months with links

+
+ +
+
+nav_years()
+

Create list of previous years

+
+ +
+
+template_name = 'status_display/network_coincidences.html'
+
+ +
+ +
+
+class SummaryDetailView(**kwargs)
+

Constructor. Called in the URLconf; can contain helpful extra +keyword arguments, and other things.

+
+
+get_context_data(**kwargs)
+

Insert the single object into the context dict.

+
+ +
+
+get_object(queryset=None)
+

Get the object this request displays.

+
+ +
+
+get_queryset()
+

Return the QuerySet that will be used to look up the object.

+

This method is called by the default implementation of get_object() and +may not be called if get_object() is overridden.

+
+ +
+
+http_method_names = ['get']
+
+ +
+
+nav_calendar()
+

Create a month calendar with links

+
+ +
+
+nav_months()
+

Create list of months with links

+
+ +
+
+nav_years()
+

Create list of previous years

+
+ +
+
+template_name = 'status_display/station_data.html'
+
+ +
+ +
+
+create_plot_object(x_values, y_series, x_label, y_label)
+
+ +
+
+get_config_source(station_number, type)
+

Get configuration data for a specific station

+
+
Parameters:
+
    +
  • station_number – station for which to get the configuration data.

  • +
  • type – the type of configuration data to get. The following +are supported: voltage, current, gps, trigger.

  • +
+
+
Returns:
+

list of lists containing the configuration history.

+
+
+
+ +
+
+get_dataset_source(date, type, station_number)
+

Get a dataset for a specific date and station

+
+
Parameters:
+
    +
  • date – the date for which to get the dataset.

  • +
  • type – the type of dataset to retrieve.

  • +
  • station_number – the station to which the data belongs.

  • +
+
+
Returns:
+

list of tuples containing (x, y) pairs.

+
+
+
+ +
+
+get_detector_timing_offsets(station_number)
+
+ +
+
+get_detector_timing_offsets_source(request, station_number)
+
+ +
+
+get_eventtime_histogram_sources(station_number, start, end)
+
+ +
+
+get_eventtime_source(request, station_number, start=None, end=None)
+

Get all eventtime data from start to end

+
+ +
+
+get_focus(country=None, cluster=None, subcluster=None)
+
+ +
+
+get_gpslocations(configs)
+

Get all valid GPS locations from the configs

+
+ +
+
+get_histogram_source(date, type, station_number=None)
+

Get histogram data for a specific date

+
+
Parameters:
+
    +
  • date – the date for which to get the histogram data.

  • +
  • type – the type of histogram to retrieve.

  • +
  • station_number – if None a NetworkHistogram is looked for, otherwise +a DailyHistogram for a specific station is looked for.

  • +
+
+
Returns:
+

list of tuples containing (bin, value) pairs.

+
+
+
+ +
+
+get_specific_config_source(request, station_number, type)
+
+ +
+
+get_specific_dataset_source(request, station_number, date, type)
+
+ +
+
+get_specific_histogram_source(request, station_number, date, type)
+

Get a station histogram for a specific date

+
+ +
+
+get_specific_network_histogram_source(request, date, type)
+
+ +
+
+get_station_layout_source(request, station_number)
+
+ +
+
+get_station_timing_offsets(ref_station_number, station_number)
+

Get all station timing offsets for a station pair

+
+
Parameters:
+

ref_station_number,station_number – station numbers.

+
+
Returns:
+

list of tuples with date, offset, and error.

+
+
+
+ +
+
+get_station_timing_offsets_source(request, ref_station_number, station_number)
+
+ +
+
+help(request)
+

Show the static help page

+
+ +
+
+none_to_nan(x)
+
+ +
+
+plot_config(type, configs)
+

Create a plot object from station configs

+
+ +
+
+plot_dataset(dataset)
+

Create a dataset plot object

+
+ +
+
+plot_histogram(histogram)
+

Create a histogram object

+
+ +
+
+plot_timing_offsets(station_number)
+

Create a plot object from station configs

+
+ +
+
+station_config(request, station_number)
+

Show configuration history for a particular station

+
+ +
+
+station_has_config(station)
+

Check if there is a valid configuration for the given station

+
+
Parameters:
+

station – Station object for which to check.

+
+
Returns:
+

boolean indicating if the station has a configuration available.

+
+
+
+ +
+
+station_has_data(station)
+

Check if there is valid event or weather data for the given station

+
+
Parameters:
+

station – Station object for which to check.

+
+
Returns:
+

boolean indicating if the station has recorded data, either +weather or shower, between 2002 and now.

+
+
+
+ +
+
+station_latest(request, station_number)
+

Show daily histograms for a particular station

+
+ +
+
+station_status(request, station_number)
+

Show data status for a particular station

+
+ +
+
+stations(request)
+

Show the default station list

+
+ +
+
+stations_by_country(request)
+

Show a list of stations, ordered by country, cluster and subcluster

+
+ +
+
+stations_by_name(request)
+

Show a list of stations, ordered by station name

+
+ +
+
+stations_by_number(request)
+

Show a list of stations, ordered by number

+
+ +
+
+stations_by_status(request)
+

Show a list of stations, ordered by status

+
+ +
+
+stations_on_map(request, country=None, cluster=None, subcluster=None)
+

Show all stations from a subcluster on a map

+
+ +
+
+stations_with_data()
+

Get list of station numbers with valid event or weather data

+
+
Returns:
+

list with station numbers for stations that recorded data, either +weather or shower, between 2004 and now.

+
+
+
+ +

Contents:

+
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file