View source: R/satfile_funcs.R
get_flag_data | R Documentation |
Given a number from a matrix of quality flags in a satellite file that uses the bit string system for flags, and the dataframe of all flag bits/names/descriptions, get the descriptions of the flags used by that specific number.
get_flag_data(num, flag_df)
num |
Number in the flag matrix |
flag_df |
Dataframe containing bits and their corresponding info, in order |
Subsetted flag_df containing only the info of the flags contained within the "num" value
# load example SGLI dataset containing real data, their quality flags, and flag descriptions
data("example02_GC1SG1_202109031518L33309_L2SG_IWPRK_2000")
data("sgli_flag_df")
# look at the descriptions of the flags
sgli_flag_df
# get the flag value of the first pixel
pixel1_flag <- example02_GC1SG1_202109031518L33309_L2SG_IWPRK_2000$flags[1]
pixel1_flag
# now plug it into the function to see which flags are used in this value
get_flag_data(num=pixel1_flag,flag_df=sgli_flag_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.