/* !C ******************************************************************** !Description: Integer function check_reg_uniformity.c Evaluates surface uniformity. Called from create_cloud_mask.c !Input arguments: none Inputs from mask_processing_constants.h !Output arguments: none int uniform value of 1 if uniform, otherwise 0 (returned through function call) !Revision History: R. Frey 05/2007 !Team-unique Header: !References and Credits: !END ******************************************************************/ /* Includes */ #include #include "mask_processing_constants.h" #include "pixel.h" #include "granule.h" int check_reg_uniformity() { /* Declarations */ int loc_uniform; int nland; int nwater; int ncoast; int ntotal; int nl, ne; int imve, imvl; int pxsnow; long int j, ide; unsigned char nise_val; unsigned char lsf; /* Initializations */ nwater = 0; nland = 0; ncoast = 0; ntotal = nlcntx * necntx; loc_uniform = 1; imve = (necntx-1) / 2; imvl = (nlcntx-1) / 2; // Check for edges of granule. if(pxin.line_edge == 1 || pxin.elem_edge == 1) { loc_uniform = 0; } // Check for snow/ice in current pixel. /* else if(pxin.snow || pxin.ice) { loc_uniform = 0; } */ else { // Check region (3x3 pixel area centered on current pixel) for scene uniformity. for ( nl=0; nl