get_flag_data: Get flag data

View source: R/satfile_funcs.R

get_flag_dataR Documentation

Get flag data

Description

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.

Usage

get_flag_data(num, flag_df)

Arguments

num

Number in the flag matrix

flag_df

Dataframe containing bits and their corresponding info, in order

Value

Subsetted flag_df containing only the info of the flags contained within the "num" value

Examples

# 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)


BIO-RSG/oceancolouR documentation built on April 20, 2024, 6:40 a.m.