An API for browsing/querying the TLE database collected in Rhode Island
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
htdocs
time_series/1995
utils
LICENSE
README.md

README.md

TLEbrowser

An API for browsing/querying the TLE database collected in Rhode Island

1. Input data sources

There are 2 different data sources. One is an sqlite database which contains a table named 'events' which is an overview of all TLEs in the database. Amongst other it contains for all events the start time of the event, the name of the raw data file which contains the event, the line number where the associated time series starts in the raw data file and the number of lines which needed to be read from the raw data file. The other data source is a folder hierarchy containing the raw data files. All methods are working from these 2 data sources.

1.1 The SQLite database

The database is generated automagically using the R script meta2sdb.R. Well, at the moment it's not quite true because meta2sdb.R cannot walk trough a hierarchy of time_series files yet, it can only process a single file - but the purpose is to develop meta2sdb further in this direction soon. There is currently only one table in the database, defined by the following scheme:

CREATE TABLE events 
( "EventNumber" INTEGER,
  "MaxVoltage" REAL,
  "MinVoltage" REAL,
  "BoardType" TEXT,
  "PerChannelSamplingRate" REAL,
  "BlockStartTime" TEXT,
  "BlockStopTime" TEXT,
  "BlockTimeSource" TEXT,
  "PreTriggerSamples" INTEGER,
  "PostTriggerSamples" INTEGER,
  "Pos" INTEGER,
  "NSamples" INTEGER,
  "BaseName" TEXT
);

It also implements a few views, see the source of meta2sdb for more details.

1.2 The raw time series files

They are plain text files with the extension 'time_series'. See file time_series/1995/1995_11_28__19_52_03.time_series for an idea about the structure.

2. Configuration

Location of the sqlite database and the folder containing the time_series files can be configured in conf_db.php and conf_ts.php, respectively.

2. Data retrieving methods

Currently 2 methods are implemented.

2.1 getEvent.php

This method accepts 2 parameters. The first one is the basename of the time_series file which contains the event and the second one is the id (an integer number) of the event within the time_series file. These 2 informations uniquely specifies an event within the 'event' table in the sqlite database. It then returns the corresponding row of the database table encoded as JSON (later on we might implement other formats too). Here is an example result set

{"EventNumber":1,
 "MaxVoltage":1.25,
 "MinVoltage":-1.25,
 "BoardType":"2801-A ( 27Khz )",
 "PerChannelSamplingRate":2035.6234,
 "BlockStartTime":"1995-11-28 19:52:03.555",
 "BlockStopTime":"1995-11-28 19:52:04.058",
 "BlockTimeSource":"GPS",
 "PreTriggerSamples":203,
 "PostTriggerSamples":814,
 "Pos":27,
 "NSamples":1024,
 "BaseName":"1995_11_28__19_52_03.time_series"}
2.2 getEventTs.php

This method accepts the exact same paramaters as getEvent.php, but it reads the actual time series data from the appropriate time_series file. The time series is encoded into JSON too (later on we might implement other formats too). Here is a truncated version of an example result set:

{"chn_0":{"StartTime":"1995-11-28 19:52:03.555",
                 "ts":[{"x":0,"y":0.00854},
                       {"x":0.491,"y":0}]},
 "chn_1":{"StartTime":"1995-11-28 19:52:03.555",
                 "ts":[{"x":0.164,"y":-0.00488},
                       {"x":0.655,"y":-0.0061}]},
 "chn_2":{"StartTime":"1995-11-28 19:52:03.555",
                 "ts":[{"x":0.327,"y":-0.08118},
                       {"x":0.819,"y":-0.08423}]}}

The time series data associated to an event requires approximately 80KB if it's encoded into json this way.

3. Realization

A realization of this API can be found at http://geodata.ggki.hu/tle/. Some working examples are:

4. Graphical user interface

http://geodata.ggki.hu/tle/ also intends to provide a user friendly (i.e. mouse-click based) graphical interface to the methods above, but it's a work-in progress.