GEUS-Glaciology-and-Climate / PROMICE-AWS-data-issues

PROMICE AWS QA/QC
http://promice.org
5 stars 0 forks source link

spurious lufft precipitation rates #26

Open jasonebox opened 1 year ago

jasonebox commented 1 year ago

I've started working with the lufft precipitation rates :-)

two related issues...

1.) instead of posting accumulated precipitation, should instead convert precip_u, precip_u_cor (and in some cases precip_l, precip_l_cor) to the time rate of change using e.g.,

            flag=0
            if sum(df.columns=='t_l')==0:
                varnams=['precip_u','precip_u_cor','t_u']
            else:
                varnams=['precip_l','precip_l_cor','t_l','precip_u','precip_u_cor','t_u']
                flag=1

...

            x=pd.read_csv(tmpfile)
            N=len(x)
            if N>0:
                x['tp_u']=np.nan
                for i in range(1,N):
                    x['tp_u'][i]=x['precip_u_cor'][i]-x['precip_u_cor'][i-1]
                    if x['tp_u'][i]>400 or x['tp_u'][i]<0:
                        issues_site.append(site)
                        issues_date.append(df.time[i])
                        issues_p_rate.append(x['tp_u'][i])
                        issues_level.append('u')
                        # x['tp_u'][i]=np.nan

...By posting the rate of change, we have no issue with defining a) when zero should start and b) in cases of extended gaps, accumulated precipitation becomes ambiguous. Rather, users should just see NaN and thus know no data be available that period. Further, users can produce accumulated precipitation, if they wish.

2.) in some cases, get nice results like: NUK_Uv3_2021

in other cases, the result reflects large offsets in the accumulated precipitation record: NUK_Uv3_2022 or NSE_2022 there are several other cases...

So, I coded this (from which the example code above comes), that outputs the dates of spurious accumulated precipitation change into this folder (all from this repo). My hope is the issues can be resolved and the next release will have a much more user friendly form. :-)

jasonebox commented 1 year ago

when there are short gaps from no transmission, I think spline interpolation is worth a try. See hourly example below.

image