-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the CzechFOI-DA wiki!
By following these steps, you'll prepare the data, import it into a database, run SQL queries to create necessary views, export those views to CSV files, and finally run the Python script to perform data analysis. You can customize the script for your own analysis needs as well!
Follow the steps below to prepare the data and run the analysis using Python:
-
Download the following files:
- CzechFOI-DA (project folder)
- DB Browser for SQLite (from the official website)
- Vesely_106_202403141131.tar.xz (CSV data)
-
Install DB Browser for SQLite:
- Extract the contents of
DB Browser for SQLitetoC:\github\CzechFOI-DA\DB.Browser.for.SQLite. - Run
DB Browser for SQLite.exefrom this folder.
- Extract the contents of
-
Extract Vesely Data:
- Extract
Vesely_106_202403141131.tar.xzto a CSV file:Vesely_106_202403141131.csv.
- Extract
-
Create New Database:
- Open DB Browser for SQLite.
- In the menu, go to File > New Database and name it
czechFO. - Save the database file to:
C:\github\CzechFOI-DA\DB\czechFOI.db.
-
Open (Connect to) the New Database:
- Go to File > Open Database and select the newly created database:
C:\github\CzechFOI-DA\DB\czechFOI.db.
- Go to File > Open Database and select the newly created database:
-
Import CSV into Table:
- In DB Browser for SQLite, go to File > Import > Table from CSV File.
- Select the CSV file:
Vesely_106_202403141131.csv. - Name the imported table
czech.
-
Check Imported Table:
- In the Database Structure tab, right-click on the table
czechand select Browse Table. - Verify that the table has 11028372 rows.
- In the Database Structure tab, right-click on the table
-
Save the Database:
- Go to File > Write Changes and ignore any errors.
- Close DB Browser for SQLite
- If prompted to save changes to the database file, click Save.
-
Open the SQL File:
- Open DB Browser for SQLite.
- Go to File > Open Database and select the database:
C:\github\CzechFOI-DA\DB\czechFOI.db. - In the menu, go to Execute SQL.
- Click the yellow Open SQL Query Symbol and open the file:
C:\github\CzechFOI-DA\SQLQueries\All SQL Time.sql.
-
Execute SQL Queries:
- In the menu, click the Execute all/selected SQL button.
- This will run the SQL queries (this may take about 30 minutes) to create all necessary tables and views for data analysis.
-
Check the Views:
- Go to the Database Structure tab.
- Expand the Views entry. You should see 22 views.
-
Export Views as CSV Files:
- Right-click on each view and select Export as CSV file.
- Use the standard export settings:
- Column names in the first row
- Field separator:
, - Quote character:
", New line character: WindowsCR+LF
- Export all 22 views at once by selecting all in the Export UI.
- Choose the TERRA folder as the location to save the CSV files.
- Verify that you have 22 CSV files in the TERRA folder.
-
Close DB Browser for SQLite:
- If prompted, save the changes to the database file by clicking Save.
-
Install Python and Visual Studio Code:
- Download and install Python and Visual Studio Code.
- Open Visual Studio Code after installation.
-
Open the Python Script:
- Go to File > Open and select the Python script:
C:\github\CzechFOI-DA\Py Scripts\AH) 2D 6-Axis age-compare rolling-mean significance-1D-2D same-scale.py.
- Go to File > Open and select the Python script:
To run the script successfully, you must install external Python packages (dependencies).
-
Open the terminal or command prompt in Visual Studio Code.
-
Run the following
pipcommands one by one to install the necessary libraries:pip install pandas pip install plotly pip install numpy pip install xarray pip install scipy pip install matplotlib