Resources ========= An API resource provides access to information stored on the server. Resources available on this API include the following: 1. schema 2. flatfile 3. response_spectra 4. fourier_spectra Each resource has a default set of information that is returned when no query string parameters are provided. Those defaults are described here. Customization of the returned information can be achieved using query string parameters. schema ------ The schema resource provides access to the organizational structure of the database. The default set of parameters is obtained using the URL below. https://www.uclageo.com/gm_database/api/index.php/schema By default, this query returns a set of HTML tables that includes a list of publicly accessible tables in the database, as well as a list of the fields and the attributes of the fields in those tables. This information can also be returned in JSON or CSV format, as described in the :doc:`query_string` section. flatfile -------- A flatfile is a single table that contains information synthesized from many different tables. You may be familiar with NGA flatfiles. The flatfile resource allows you to customize the information you'd like to put into your flatfile, and return it in HTML, JSON, or CSV format. The flatfile resource provides access to data contained in most of the publicly accessible tables in the database. Fields excluded from the flatfile include acc and fourier_spectra because these tables contain large amounts of data that must be accessed through a separate resource. (NOTE: A resource has not yet been written for acc, but we're working on it). The URL below will return an HTML-formatted flatfile with 50 rows containing data from the following tables: event, event_type, network, station, site, motion, intensity_measure, component, resp_spectra. All fields within these tables are returned, with the exception of foreign keys, which are records in one table used to identify corresponding records in another table. For example, event_id appears in both the event table (as a primary key) and the motion table (as a foreign key) to identify the event that generated the motion. These keys are really important to relate tables to each other within the relational database, but they are redundant in a flatfile where the data are merged into a single table. For example, event_id is repeated for every motion for the event in the flatfile, but is contained only once in the database. https://www.uclageo.com/gm_database/api/index.php/flatfile If you'd like to customize your flatfile, check out our :doc:`query_string` section. response_spectra ---------------- Response spectra data can be accessed through the flatfile resource, but we thought it would be nice to provide a plotting option too. Hence, the response_spectra resource. The response_spectra resource returns a plot of the requested acceleration response spectra, as well as a table of data to accompany those spectra. The default link below will return 50 pseudo-acceleration response spectra (5% damping) sorted in order of event_id. https://www.uclageo.com/gm_database/api/index.php/response_spectra If you'd like to customize your response spectra data, check out our :doc:`query_string` section. Response spectra data are stored in the database as JSON strings, which means that you can't request data based on response spectra values. For example, you can't say "I want all of the response spectra with a spectral acceleration at 2s greater than 0.3g". But you can filter in other ways based on fields stored in the database (e.g., PGA, PGV). fourier_spectra ---------------- The fourier_spectra resource provides access to Fourier amplitude spectra, which are not accessible through the flatfile resource for two reasons. First, the amount of data stored in the fourier_spectra table is large, and putting it together with other data would potentially make a very large table that is infeasible to transfer via web services. Second, the only component available for fourier_spectra is the effective amplitude spectra (EAS), which is smoothed using Konno-Omachi smoothing and decimated to return evenly-spaced frequency components in log-frequency space. Because the EAS is the only available component, PGA, PGV, and other intensity measures cannot be used in the query string to customize output because there is no EAS component for those intensity measures. So, for example, you can't say "I'd like all of the Fourier spectra for motions with PGA = 0-0.1g" because there is no PGA for the EAS component. Rather than getting frustrating writing query strings that don't return desired results, we thought it would be better to create a separate resource. We have elected not to include the Fourier amplitude spectra for the individual components because EAS is the component most commonly utilized in ground motion model development. If you'd like individual component spectra, reach out to us. https://www.uclageo.com/gm_database/api/index.php/fourier_spectra If you'd like to customize your Fourier spectra data, check out our :doc:`query_string` section. Fourier spectra data are stored in the database as JSON strings, which means that you can't request data based on response spectra values.