This guide (https://newcastlerse.github.io/5gir-docs) is in our GitHub repository (https://github.com/NewcastleRSE/5gir-docs).
To install:
To run the python package Data Wherehouse Client, you need to create a conda environment. To create it, follow the instructions in here.
You can get and export the data from the data warehouse via PostgreSQL queries or python code.
You can get and export the data from the data warehouse via PostgreSQL queries from the command line.
To PostgreSQL queries, you need to log in to the 5GIR database with either the bash or CMD code below
Open the bash terminal on Linux and MACs, or Git bash on Windows, and run the following bash code.
psql.exe
to the environment variable PATH
, then you can skip this step and move to step 3. Otherwise,
you need to locate the directory and add it to PATH
every time you open a new Git bash window before running the
command psql
. An example of a Postgres directory is “C:\Program Files\PostgreSQL\14\bin” which must contain the
file “psql.exe”. If this is the case for you, you can add it to PATH
with:
PATH="$PATH":/c/Program\ Files/PostgreSQL/14/bin
Note that you need to replace “C:” with “/c”, replace all “" with “/”, and add a “" before each space character if the directory full path has any spaces, like in the example above. If the directory is different in your case, adjust the directory accordingly.
dbname=database_name
host=host_domain
port=host_port
username=user_name
psql --dbname="$dbname" --host="$host" --port="$port" --username="$username" --password
Open the Command Prompt on Windows, and run the following CMD code.
psql.exe
to the Path
environment variable, then you can skip this step and move to step 3. Otherwise, you need to locate the directory and
add it to PATH
every time you open a new Git bash window before running the command psql
. An example of a
Postgres directory is C:\Program Files\PostgreSQL\14\bin
which must contain the file “psql.exe”. If this is the
case for you, you can add it to PATH
with:
set "PATH=%PATH%;C:\Program Files\PostgreSQL\14\bin;"
If the directory is different in your case, adjust the directory accordingly.
Define the database name, host name, server port and username with the code below by replacing database_name, host_domain, host_port and user_name with the database name, host name, server port and username, respectively.
set "dbname=database_name"
set "host=host_domain"
set "port=host_port"
set "username=user_name"
psql --dbname=%dbname% --host=%host% --port=%port% --username=%username% --password
Once you logged in to the data warehouse database, you run the same SQL queries, regardless of your terminal (Bash or CMD) and Operating System (OS; Linux, Mac or Windows).
\dt
select * from study;
select * from measurementtype;
select * from measurement;
select * from measurement where study = 0 and measurementgroup = 0
select * from measurement where study = 0 and measurementgroup = 0 and time >= '2025-09-08 00:00:00.000' and time < '2025-09-15 00:00:00.000' order by time;
\COPY study TO 'study.csv' DELIMITER ',' CSV HEADER
\COPY (select * from measurement where study = 0 and measurementgroup = 0) TO 'wet150.csv' DELIMITER ',' CSV HEADER
\COPY (select * from measurement where study = 0 and measurementgroup = 1) TO 'apogee.csv' DELIMITER ',' CSV HEADER
TODO
TODO