Index: branches/eam_branches/relphot.20210521/src/GridOps.c
===================================================================
--- branches/eam_branches/relphot.20210521/src/GridOps.c	(revision 41637)
+++ branches/eam_branches/relphot.20210521/src/GridOps.c	(revision 41646)
@@ -19,5 +19,5 @@
 static int                 NGridCorr = 0;
 
-# if (1)
+# if (0)
 /* PS1 / PS2 values */
 # define NX_CHIP 4900
@@ -25,11 +25,11 @@
 # define NX_BIN 16
 # define NY_BIN 16
-# else
+# endif
+
 /* test values */
-# define NX_CHIP 1000
-# define NY_CHIP 1000
-# define NX_BIN 2
-# define NY_BIN 2
-# endif
+# define NX_CHIP_DEFAULT 1000
+# define NY_CHIP_DEFAULT 1000
+# define NX_BIN_DEFAULT 2
+# define NY_BIN_DEFAULT 2
 
 void initGridBins (void) {
@@ -141,4 +141,13 @@
     if (!code) continue;
 
+    int NX_CHIP = NX_CHIP_DEFAULT;
+    int NY_CHIP = NY_CHIP_DEFAULT;
+    int NX_BIN  = NX_BIN_DEFAULT;
+    int NY_BIN  = NY_BIN_DEFAULT;
+    if (isGPC1chip(code)) { NX_CHIP = 4900; NY_CHIP = 4900; NX_BIN = NY_BIN = GRID_BIN_GPC1; }
+    if (isGPC2chip(code)) { NX_CHIP = 4900; NY_CHIP = 4900; NX_BIN = NY_BIN = GRID_BIN_GPC2; }
+    if (isHSCchip(code))  { NX_CHIP = 2100; NY_CHIP = 4200; NX_BIN = NY_BIN = GRID_BIN_HSC;  }
+    if (isCFHchip(code))  { NX_CHIP = 2100; NY_CHIP = 4200; NX_BIN = NY_BIN = GRID_BIN_CFH;  }
+
     if (GridCorr[code]) continue; // already created this one
 
@@ -150,5 +159,5 @@
     GridCorr[code]->Ny = NY_BIN;
     GridCorr[code]->dX = NX_BIN / (float) NX_CHIP;
-    GridCorr[code]->dY = NY_BIN / (float) NX_CHIP;
+    GridCorr[code]->dY = NY_BIN / (float) NY_CHIP;
 
     // we are normally accessing this array randomly, so there is no advantage to
