Query Argo database

Introduction

The easiest way to query the database is to make a SQL script. For example, if you wanted to find all the profiles in 2009 when the temperature QC for the delayed mode was defined and the temperature QC for BOM was 7 you might create a script, say temp.sql, like:

SELECT argoid,juld,d_mode_tmp_qc,bom_tmp_qc FROM profile 
  WHERE juld > 21184 AND juld < 21915 AND dataMode = 'D'
    AND d_mode_tmp_qc != -999 and bom_tmp_qc = 5;
where
  • `profile' is the table with profiles (the other tables are `yearStats' and `levels'
  • the columns that will be displayed will be display in the results follow the SELECT command. In this case this is `argoid,juld,d_mode_tmp_qc,bom_tmp_qc'. Use `*' to display all the columns.
  • the juld since 1950 for 2009 are 21,184 to 21,915
  • dataMode equal 'D' for delayed mode (can also be 'R' for realtime or 'A' for adjusted.
  • -999 is the fill value, so `d_mode_tmp_qc != -999' ensures that only rows with defined d_mode_tmp_qc are searched
  • `bom_tmp_qc = 5' indicates that only data when bom_tmp_qc is 5 is wanted.
The query can then be made with the command:
psql -f temp.sql -d insert_argo

Things to do now

Contact

Page navigation