Index: branches/eam_branches/relphot.20210521/include/relphot.h
===================================================================
--- branches/eam_branches/relphot.20210521/include/relphot.h	(revision 41611)
+++ branches/eam_branches/relphot.20210521/include/relphot.h	(revision 41615)
@@ -66,4 +66,10 @@
   PS1_w = 6,
 } PS1filters;
+
+typedef enum {
+  GRID_MEAN = 0,
+  GRID_STDEV = 1,
+  GRID_NPTS = 2,
+} GridOutputMode;
 
 typedef struct {
@@ -374,4 +380,5 @@
 int    SKY_DEPTH;  /** XXX EAM : depth of catalog tables, fix usage */
 char  *SYNTH_ZERO_POINTS;
+char  *GRID_MEANFILE;
 
 // globals for parallel region operations
@@ -574,6 +581,9 @@
 void          setMflatFromGrid    PROTO((Catalog *catalog));
 void          initGridBins        PROTO(());
-GridCorrectionType *getGridCorr   PROTO((int *Nlast));
-int           GridCorrectionSave  PROTO((char *filename));
+GridCorrectionType *getGridCorrByCode PROTO((int code));
+GridCorrectionType *getGridCorrNext   PROTO((int *Nlast));
+int           GridCorrectionSave  PROTO((void));
+int           GridCorrectionSaveFile  PROTO((char *filename, GridOutputMode mode));
+void          GridCorrectionLoad  PROTO((char *filename));
 void          initImageBins       PROTO((Catalog *catalog, int Ncatalog, int doImageList));
 void          initImagesSubset    PROTO((ImageSubset *input, off_t *line_number, off_t N));
