#ifndef MODEL_UTILS_H
#define MODEL_UTILS_H

#include "grid_points.h"

#define MAX_NUM_ELEVATIONS 11

typedef struct
{
    double elevation;
    double elevation_directory;
    double transmission;
    double upwelled_radiance;
    double downwelled_radiance;
} MODEL_ELEVATION;


typedef struct
{
    int count;
    int ran_model;                 /* Was the RTM run for the point? */
    uint8_t row;
    uint8_t col;
    uint16_t reanalysis_row;
    uint16_t reanalysis_col; 
    double lon;                    /* longitude (degrees) */
    double lat;                    /* latitude (degrees) */
    double map_x;
    double map_y;
    MODEL_ELEVATION *elevations;
} MODEL_POINT;


typedef struct
{
    int count;
    MODEL_POINT *points;
} MODEL_POINTS;


int initialize_model_points
(
    GRID_POINTS *grid_points,      /* I: The coordinate points */
    MODEL_POINTS *model_points,    /* O: Memory Allocated */
    bool modtran_flag              /* I: 0=RTTOV, 1=MODTRAN */
);

void free_model_points
(
    MODEL_POINTS *model_points
);

#endif
