PSQLQueryTool Glossary
Contents: Description, Procedure, Functions Used, Related Functions
Description In order to make the most of the MSFF PSQL Mars database, you must be familiar with the schema and table layout of the database. There are two sources for this information in the reference schema:
The examples provided below will help you explore the tables and columns available for your use in database queries. This is only intended to get you started; you should refine the constraints-list and the order-by-list according to your needs.
Procedure
1) Write the query; for more information see Writing PSQL-DB Queries dv> query="select schema_name, table_name, field_name, datatype_name, description from\ reference.pubmars_glossary order by 1,2,3" 2) Access the PSQLQueryTool from Davinci; see the themis3db function page for a complete description of all available options dv> url=themis3db(query,psql=1,header=1) Using PSQL password ... Read TEXT file: 1 lines (A very long URL may be repeated to your screen; HINT: copy URL into your browser to preview results -and error messages- like this) 3) Read in the results; the two options shown here are most useful for these Glossary examples:
dv> gloss=read_lines(url) Downloading.done. Read TEXT file: 2665 lines Text Buffer with 2665 lines of text --OR-- dv> copy(url,$TMPDIR) Downloading.done. [path to file repeated to screen; review results outside of Davinci]
dv> query="select distinct table_name from reference.glossary where schema_name='thmpub' order by table_name;" dv> tablst=read_lines(url) Downloading.done. Read TEXT file: 19 lines Text Buffer with 19 lines of text 1: class 2: feature 3: frmgeom 4: geomqlt 5: imgidx 6: imgproc 7: irfrmsci 8: irqubsci 9: pgisgeom 10: projgeom 11: qubgeom 12: stage 13: status 14: themis_details 15: thm3_header 16: thm3_quality 17: thm3_qube 18: tlm 19: vissci
dv> query="select schema_name, table_name, field_name, datatype_name, description from reference.pubmars_glossary where table_name='qubgeom' order by field_name;" dv> url=themis3db(query,psql=1,header=0,xformat=1) dv> qubgeom=read_lines(url) Downloading.done. Read TEXT file: 145 lines Text Buffer with 145 lines of text dv> qubgeom[,55:60] Text Buffer with 6 lines of text 1: *************************** 10. row *************************** 2: schema_name: thmpub 3: table_name: qubgeom 4: field_name: lat 5: datatypename: float8 6: description: Latitude of this point_id on the planet Mars
dv> query="select schema_name, table_name, field_name, description from reference.glossary where field_name like '%temp%';" dv> tempflds=read_lines(url) Downloading.done. Read TEXT file: 253 lines Text Buffer with 253 lines of text 1: *************************** 1. row *************************** 2: table_name: imgidx 3: field_name: focal_plane_temperature 4: description: Temperature in Kelvin of the VIS camera focal plane array at the time of the observation 5: ....
|
DavinciWiki Mini-Nav Bar Contents
Contact Developers
All other topics
Functions Used
Related Procedures |