Closed JessyBarrette closed 2 years ago
I assumed the qc tool would run on a cron job, similar to the post processing script. it would look for any cast with 8_* processing level and do qc on it. Were you thinking something different?
Right ok sounds good to me!
The new script present here can potentially be use to trigger on a cronJob to qc any profiles not qced yet on the server.
The script apply the following steps:
ctd.ctd_file_cast
view for any casts in the processing_stages 8_rbr_processed
or 8_binAvg
. (A limit of 1000 was added for now since it seems like the database would fail to return limit=-1
ctd.ctd_file_cast_data
and run the different tests to apply.ctd.ctd_file_cast_data
back to the database through the api and update the processing_stage of the correspond hakai_id.If more than a 1000 profiles needs to be qced those will be run the next cronJob.
The auto qc method was successfully integrated on the hakaidev database and applied resulting flags to the right data.
Some work needs to get done to change the data type of the qartod flag columns *_f;ag_level_1 which are strings right now to integers https://github.com/HakaiInstitute/hakai-database/pull/327
Once that is completed, the portal should be able to make available any profiles associated with the processing_stages: '8_binAvg', '8_rbr_processed', '9_qc_auto', '10_qc_pi'
This is all working with the latest development branch commit 55a5022725f3e84b3081f1e081b0247912f7b233
Issue
The Hakai Profile QAQC tool needs to be integrated within the Hakai CTD profile workflow. This tool needs to be triggered when:
How to use the package
Once installed on a server, the tool could be triggered by sending a command line like:
Method
Once triggered, the tool would retrieve the data through the hakai-api from the view
ctd.ctd_file_cast_data
. It would then run a series of tests.The main question is how to return those resulting flags back to the database. One potential way is to send back through the hakai-api a json string of the resulting data delimited per ctd_data_pk with each individual flag (level1 and level2). See the following jupyter notebook for an example: https://github.com/HakaiInstitute/hakai-profile-qaqc/blob/main/notebook/update-hakai-db-flags.ipynb
How to trigger
The tool can be triggered by the server by using the
processing_stage
column withinctd_cast
table. Any cast available at the8_*
stage (8_rbr_processed or 8_binAvg) is ready to be qced. Once QCed and corresponding casts processing_stage can be move to the9_qc_auto
stage.