Usage
Getting help
If you need some information about a command you can always pass the --help
flag to get some information
Generate a config file
First you can generate a template config file:
Note
you can also pass a path to the command to choose where the config file should be generated and what the name of the file should be:
this generates a fileconfig.yml
under your given path
this gernerates the config file with the name config_test.yaml
.
Make your changes
In the config.yml
file you now can change the variables needed.
Fill in the database credentials:
and add some paths for your fits filesfits_files:
paths:
- path/to_your_file/2021-07-07_L1a.fits
- path_to_your_folder
tables:
- name: HOUSEKEEPING
target_table: RAW_HOUSEKEEPING # This will be the table_name in the db
- name: JTSIM_BROADCAST # If no table name given it will use the orignal name
Note
if a folder is given all fits files under this folder will be taken for upload.
Check if the right files are taken
You can check if you get the right fits files with
this command shows all files it will consider uploading in your terminal and at the end shows the number of files.Note
If you don't add an path the cli looks for the config file in the same folder as you are currently in.
Inspect available Tables
If you want to see what tables are available in your fits files you can run
this will get you a summary of all tablesTip
If you want to see if the tables are available in all files just run the sam command with the matrix flag
this will show the reult in the terminal. If you want to have and excel or csv useBuild db
Now upload the data into our data base we use the build command
this will upload all the fits tables into your data base and create the meta tables to keep track on changes of the filesWarning
If you rerun the build command it acts as an reset. it will drop the tables and reupload all data to have a fresh start. This is only recommend to use when you lost track of some changes in the data you have done manually and you are not sure you corrupted the data.
Update db
Once builded and you get new files or changes you can update the database. This command will check if there a new files in your defnied folders and upload them to the db. If the timestamp of your file changed to a newer date. Like when you changed a file it will also update this file to the newer version. This way the fits files and the db stay in sync. To update just run
Note
If you add a new table in your config file the update command will check trough the older files too if this table is in this file and upload accordingly.