#!/usr/bin/env python
#
# grib_checker.py checks Checks whatever you want to check in your life
#
# AUTHOR: BSC-CNS I. CERNICHARO
#

import sys

import msg_content

def check_data_values(msg):
    v_b = msg_content.return_values_bounds(msg)
    # max_,min_,mean_,v_max,v_min,v_mean = v_b
    
    if v_b[0] == v_b[3] and v_b[1] == v_b[4] and v_b[2] == v_b[5]:
        return "OK"

    else:
        return "ERROR"

def check_coords(msg):
    c_b = msg_content.return_coords_bounds(msg)
    # max_lat,min_lat,max_lat1,min_lat1,max_lon,min_lon,max_lon1,min_lon1 = c_b
    
    if c_b == None or c_b == "Error":
        return "ERROR"

    if c_b[4] == c_b[6] and c_b[5] == c_b[7]:
        long_cck = "OK"
    else:
        long_cck = "ERROR"

    if c_b[0] == c_b[2] and c_b[1] == c_b[3]:
        lat_cck = "OK"
    else:
        lat_cck = "ERROR"

    if lat_cck == "OK" and long_cck == "OK": 
        return "OK"
    else: 
        return "ERROR"

if __name__ == "__main__":
    sys.exit()