Deltares / hatyan

Harmonic tidal analysis and prediction
https://deltares.github.io/hatyan/
GNU General Public License v3.0
13 stars 2 forks source link

Align qc and status columns of timeseries dataframes #308

Closed veenstrajelmer closed 3 days ago

veenstrajelmer commented 3 months ago

There are several hatyan dataframes in rotation:

Status column was removed from dia-df in https://github.com/Deltares/hatyan/pull/300/files. Adding status to dia-df again is possible by adding:

            # add status column
            block_status_list = diablocks_pd.loc[block_id,'STA'].split('!')
            for block_status_one in block_status_list:
                status_tstart = pd.to_datetime(block_status_one[4:17],format='%Y%m%d;%H%M').tz_localize("UTC+01:00")
                status_tstop = pd.to_datetime(block_status_one[18:31],format='%Y%m%d;%H%M').tz_localize("UTC+01:00")
                status_val = block_status_one[-1]
                data_pd_oneblock.loc[status_tstart:status_tstop,'status'] = status_val

to hatyan.read_dia(): https://github.com/Deltares/hatyan/blob/8ebaa8e792d8aacd2397ef843bbc2ac3c145f790/hatyan/timeseries.py#L1571-L1575

Todo: