SUMup-database / SUMup-data-suggestion

The issue tab of this reppository is used to interact on new and old data that could be added to SUMup.
1 stars 0 forks source link

Issue report: Density data from Clerx et al. (2022) have depth in centimeter and are not sorted #78

Closed BaptisteVandecrux closed 5 months ago

BaptisteVandecrux commented 5 months ago

Data source:

reference = 'Clerx, N., Machguth, H., Tedstone, A., Jullien, N., Wever, N., Weingartner, R., and Roessler, O.: In situ measurements of meltwater flow through snow and firn in the accumulation zone of the SW Greenland Ice Sheet, The Cryosphere, 16, 4379–4401, https://doi.org/10.5194/tc-16-4379-2022, 2022. Data: Clerx, N., Machguth, H., Tedstone, A., Jullien, N., Wever, N., Weingartner, R., and Roessler, O. (2022). DATASET: In situ measurements of meltwater flow through snow and firn in the accumulation zone of the SW Greenland Ice Sheet [Data set]. In The Cryosphere. Zenodo. https://doi.org/10.5281/zenodo.7119818'

reference_short = ''Clerx et al. (2022)''

This issue will be fixed in the 2024 release. In the meantime, a temporary fix can be applied by the users. Unfortunately, this fix is unperfect because some depth values were not extracted properly.


# incomplete fix of Clerx et al. 2022 data:
print('profile_key, profile')
for p in df_sumup.loc[df_sumup.reference_short=='Clerx et al. (2022)','profile_key'].drop_duplicates():
    print(p, ',',df_sumup.loc[df_sumup.profile_key == p,'profile'].values[0])
    # sort the depth
    df_sumup.loc[df_sumup.profile_key == p,:] = \
        df_sumup.loc[df_sumup.profile_key == p,:].sort_values('start_depth').values
    # convert depth to meters instead of cm
    df_sumup.loc[df_sumup.profile_key == p,'start_depth'] = \
        df_sumup.loc[df_sumup.profile_key == p,'start_depth'] /100

    # shift the top part of the profile where the density applies to the preceding 
    # depth interval, while deeper down, density values apply to the following 
    # depth interval
    tmp = df_sumup.loc[df_sumup.profile_key == p,['start_depth','density']].values
    if df_sumup.loc[df_sumup.profile_key == p,'profile'].values[0] in ['FS4_20m', 'FS4_5m']: ind_shift = 13
    if df_sumup.loc[df_sumup.profile_key == p,'profile'].values[0] in ['FS2_12m']: ind_shift = 16
    tmp[:ind_shift,:] = tmp[:ind_shift,:] - 0.1
    df_sumup.loc[df_sumup.profile_key == p,['start_depth','stop_depth']] = tmp

    # calculate stop_depth for each section
    df_sumup.loc[df_sumup.profile_key == p,'stop_depth'] = \
        df_sumup.loc[df_sumup.profile_key == p,'start_depth'] \
            + df_sumup.loc[df_sumup.profile_key == p,'start_depth'].diff().shift(-1).ffill()

    # calculating midpoint
    df_sumup.loc[df_sumup.profile_key == p,'midpoint'] = \
        df_sumup.loc[df_sumup.profile_key == p,'start_depth']  \
            + (df_sumup.loc[df_sumup.profile_key == p,'stop_depth'] \
                - df_sumup.loc[df_sumup.profile_key == p,'start_depth'])/2

    plt.figure()
    df_sumup.loc[df_sumup.profile_key == p,:].plot(x='density', y='midpoint', 
                                                   drawstyle="steps-pre")
    plt.title(str(p)+','+df_sumup.loc[df_sumup.profile_key == p,'profile'].values[0])
    plt.ylim(df_sumup.loc[df_sumup.profile_key == p,'stop_depth'].max(),0)
    plt.ylabel('Depth (m)')
    plt.xlabel('Density (kg m$^{-3}$)')
    plt.gca().get_legend().remove()
profile_key, profile
2603 , FS4_20m
2604 , FS4_5m
2605 , FS5_20m
2606 , FS5_5m
2607 , FS2_12m

billede billede billede billede billede