src/main/java/org/opensha/sha/earthquake/rupForecastImpl/WGCEP_UCERF_2_Final/griddedSeis/NSHMP_GridSourceGenerator.java
private void readAllGridFiles() {

		// 
		sumOfAllAvals = new double[numAvals];

		agrd_cstcal_out = readGridFile(PATH+"agrd_cstcal.out.asc",true);
		agrd_brawly_out = readGridFile(PATH+"agrd_brawly.out.asc",true);
		agrd_creeps_out = readGridFile(PATH+"agrd_creeps.out.asc",true);
		agrd_deeps_out = readGridFile(PATH+"agrd_deeps.out.asc",true);
		agrd_mendos_out = readGridFile(PATH+"agrd_mendos.out.asc",true);
		agrd_wuscmp_out = readGridFile(PATH+"agrd_wuscmp.out.asc",true);
		agrd_wusext_out = readGridFile(PATH+"agrd_wusext.out.asc",true);
		agrd_impext_out = readGridFile(PATH+"agrd_impext.out.asc",true);
		area1new_agrid  = readGridFile(PATH+"area1new.agrid.asc",true);
		area2new_agrid = readGridFile(PATH+"area2new.agrid.asc",true);
		area3new_agrid = readGridFile(PATH+"area3new.agrid.asc",true);
		area4new_agrid = readGridFile(PATH+"area4new.agrid.asc",true);
		mojave_agrid = readGridFile(PATH+"mojave.agrid.asc",true);
		sangreg_agrid = readGridFile(PATH+"sangreg.agrid.asc",true);
		fltmmaxAll21ch_out6 = readGridFile(PATH+"fltmmaxALL21ch.out6.asc",false);
		fltmmaxAll21gr_out6 = readGridFile(PATH+"fltmmaxALL21gr.out6.asc",false);
		fltmmaxAll24ch_out6 = readGridFile(PATH+"fltmmaxALL24ch.out6.asc",false);
		fltmmaxAll24gr_out6 = readGridFile(PATH+"fltmmaxALL24gr.out6.asc",false);

		int numMags = fltmmaxAll21ch_out6.length;


		// find maximum magitude from max mag files
		maxFromMaxMagFiles = -1;
		for(int i=0; i<numMags; ++i) {
			if(fltmmaxAll21ch_out6[i] > maxFromMaxMagFiles) 
				maxFromMaxMagFiles = fltmmaxAll21ch_out6[i];
			if(fltmmaxAll21gr_out6[i] > maxFromMaxMagFiles) 
				maxFromMaxMagFiles = fltmmaxAll21gr_out6[i];
			if(fltmmaxAll24ch_out6[i] > maxFromMaxMagFiles) 
				maxFromMaxMagFiles = fltmmaxAll24ch_out6[i];
			if(fltmmaxAll24gr_out6[i] > maxFromMaxMagFiles) 
				maxFromMaxMagFiles = fltmmaxAll24gr_out6[i];
		}

		//System.out.println(maxFromMaxMagFiles);
		/* find indices that are zeros in all files 
		// NO LONGER NEEDED SINCE I TRIM THE RELM REGION
		System.out.println("Looking for zeros ...");
		for(int i=0; i<agrd_brawly_out.length;i++){
			boolean allZero = true;
			if(agrd_brawly_out[i] !=0) allZero = false;
			if(agrd_creeps_out[i] !=0) allZero = false;
			if(agrd_cstcal_out[i] !=0) allZero = false;
			if(agrd_deeps_out[i] !=0) allZero = false;
			if(agrd_mendos_out[i] !=0) allZero = false;
			if(agrd_wuscmp_out[i] !=0) allZero = false;
			if(agrd_wusext_out[i] !=0) allZero = false;
			if(area1new_agrid[i] !=0) allZero = false;
			if(area2new_agrid[i] !=0) allZero = false;
			if(area3new_agrid[i] !=0) allZero = false;
			if(area4new_agrid[i] !=0) allZero = false;
			if(mojave_agrid[i] !=0) allZero = false;
			if(sangreg_agrid[i] !=0) allZero = false;

			if(allZero) {
				Location loc = this.getGridLocation(i);
				System.out.println(i+" is all zero; aValIndexForLocIndex = "+
						aValIndexForLocIndex[i]+" Location: "+
						(float)loc.getLatitude()+"\t"+
	    				(float)loc.getLongitude()+"\t"+
	    				(float)sumOfAllAvals[i]);
			}
		}
		 */

	}
/**
	 * This reads all grid files into arrays
	 *
	 */
This reads all grid files into arrays
This reads all grid files into arrays
private void readAllGridFiles() {
		sumOfAllAvals = new double[numAvals];
		agrd_cstcal_out = readGridFile(PATH+"agrd_cstcal.out.asc",true);
		agrd_brawly_out = readGridFile(PATH+"agrd_brawly.out.asc",true);
		agrd_creeps_out = readGridFile(PATH+"agrd_creeps.out.asc",true);
		agrd_deeps_out = readGridFile(PATH+"agrd_deeps.out.asc",true);
		agrd_mendos_out = readGridFile(PATH+"agrd_mendos.out.asc",true);
		agrd_wuscmp_out = readGridFile(PATH+"agrd_wuscmp.out.asc",true);
		agrd_wusext_out = readGridFile(PATH+"agrd_wusext.out.asc",true);
		agrd_impext_out = readGridFile(PATH+"agrd_impext.out.asc",true);
		area1new_agrid  = readGridFile(PATH+"area1new.agrid.asc",true);
		area2new_agrid = readGridFile(PATH+"area2new.agrid.asc",true);
		area3new_agrid = readGridFile(PATH+"area3new.agrid.asc",true);
		area4new_agrid = readGridFile(PATH+"area4new.agrid.asc",true);
		mojave_agrid = readGridFile(PATH+"mojave.agrid.asc",true);
		sangreg_agrid = readGridFile(PATH+"sangreg.agrid.asc",true);
		fltmmaxAll21ch_out6 = readGridFile(PATH+"fltmmaxALL21ch.out6.asc",false);
		fltmmaxAll21gr_out6 = readGridFile(PATH+"fltmmaxALL21gr.out6.asc",false);
		fltmmaxAll24ch_out6 = readGridFile(PATH+"fltmmaxALL24ch.out6.asc",false);
		fltmmaxAll24gr_out6 = readGridFile(PATH+"fltmmaxALL24gr.out6.asc",false);
		int numMags = fltmmaxAll21ch_out6.length;
		find maximum magitude from max mag files
		maxFromMaxMagFiles = -1;
		for(int i=0; i<numMags; ++i) {
			if(fltmmaxAll21ch_out6[i] > maxFromMaxMagFiles) 
				maxFromMaxMagFiles = fltmmaxAll21ch_out6[i];
			if(fltmmaxAll21gr_out6[i] > maxFromMaxMagFiles) 
				maxFromMaxMagFiles = fltmmaxAll21gr_out6[i];
			if(fltmmaxAll24ch_out6[i] > maxFromMaxMagFiles) 
				maxFromMaxMagFiles = fltmmaxAll24ch_out6[i];
			if(fltmmaxAll24gr_out6[i] > maxFromMaxMagFiles) 
				maxFromMaxMagFiles = fltmmaxAll24gr_out6[i];
		}
		/* find indices that are zeros in all files 
		NO LONGER NEEDED SINCE I TRIM THE RELM REGION
		System.out.println("Looking for zeros ...");
		for(int i=0; i<agrd_brawly_out.length;i++){
			boolean allZero = true;
			if(agrd_brawly_out[i] !=0) allZero = false;
			if(agrd_creeps_out[i] !=0) allZero = false;
			if(agrd_cstcal_out[i] !=0) allZero = false;
			if(agrd_deeps_out[i] !=0) allZero = false;
			if(agrd_mendos_out[i] !=0) allZero = false;
			if(agrd_wuscmp_out[i] !=0) allZero = false;
			if(agrd_wusext_out[i] !=0) allZero = false;
			if(area1new_agrid[i] !=0) allZero = false;
			if(area2new_agrid[i] !=0) allZero = false;
			if(area3new_agrid[i] !=0) allZero = false;
			if(area4new_agrid[i] !=0) allZero = false;
			if(mojave_agrid[i] !=0) allZero = false;
			if(sangreg_agrid[i] !=0) allZero = false;
			if(allZero) {
				Location loc = this.getGridLocation(i);
				System.out.println(i+" is all zero; aValIndexForLocIndex = "+
						aValIndexForLocIndex[i]+" Location: "+
						(float)loc.getLatitude()+"\t"+
	    				(float)loc.getLongitude()+"\t"+
	    				(float)sumOfAllAvals[i]);
			}
		}
		 */
	}
private void readAllGridFiles ( ) { sumOfAllAvals = new double [ numAvals ] ; agrd_cstcal_out = readGridFile ( PATH + "agrd_cstcal.out.asc" , true ) ; agrd_brawly_out = readGridFile ( PATH + "agrd_brawly.out.asc" , true ) ; agrd_creeps_out = readGridFile ( PATH + "agrd_creeps.out.asc" , true ) ; agrd_deeps_out = readGridFile ( PATH + "agrd_deeps.out.asc" , true ) ; agrd_mendos_out = readGridFile ( PATH + "agrd_mendos.out.asc" , true ) ; agrd_wuscmp_out = readGridFile ( PATH + "agrd_wuscmp.out.asc" , true ) ; agrd_wusext_out = readGridFile ( PATH + "agrd_wusext.out.asc" , true ) ; agrd_impext_out = readGridFile ( PATH + "agrd_impext.out.asc" , true ) ; area1new_agrid = readGridFile ( PATH + "area1new.agrid.asc" , true ) ; area2new_agrid = readGridFile ( PATH + "area2new.agrid.asc" , true ) ; area3new_agrid = readGridFile ( PATH + "area3new.agrid.asc" , true ) ; area4new_agrid = readGridFile ( PATH + "area4new.agrid.asc" , true ) ; mojave_agrid = readGridFile ( PATH + "mojave.agrid.asc" , true ) ; sangreg_agrid = readGridFile ( PATH + "sangreg.agrid.asc" , true ) ; fltmmaxAll21ch_out6 = readGridFile ( PATH + "fltmmaxALL21ch.out6.asc" , false ) ; fltmmaxAll21gr_out6 = readGridFile ( PATH + "fltmmaxALL21gr.out6.asc" , false ) ; fltmmaxAll24ch_out6 = readGridFile ( PATH + "fltmmaxALL24ch.out6.asc" , false ) ; fltmmaxAll24gr_out6 = readGridFile ( PATH + "fltmmaxALL24gr.out6.asc" , false ) ; int numMags = fltmmaxAll21ch_out6 . length ; maxFromMaxMagFiles = - 1 ; for ( int i = 0 ; i < numMags ; ++ i ) { if ( fltmmaxAll21ch_out6 [ i ] > maxFromMaxMagFiles ) maxFromMaxMagFiles = fltmmaxAll21ch_out6 [ i ] ; if ( fltmmaxAll21gr_out6 [ i ] > maxFromMaxMagFiles ) maxFromMaxMagFiles = fltmmaxAll21gr_out6 [ i ] ; if ( fltmmaxAll24ch_out6 [ i ] > maxFromMaxMagFiles ) maxFromMaxMagFiles = fltmmaxAll24ch_out6 [ i ] ; if ( fltmmaxAll24gr_out6 [ i ] > maxFromMaxMagFiles ) maxFromMaxMagFiles = fltmmaxAll24gr_out6 [ i ] ; } /* find indices that are zeros in all files 
		// NO LONGER NEEDED SINCE I TRIM THE RELM REGION
		System.out.println("Looking for zeros ...");
		for(int i=0; i<agrd_brawly_out.length;i++){
			boolean allZero = true;
			if(agrd_brawly_out[i] !=0) allZero = false;
			if(agrd_creeps_out[i] !=0) allZero = false;
			if(agrd_cstcal_out[i] !=0) allZero = false;
			if(agrd_deeps_out[i] !=0) allZero = false;
			if(agrd_mendos_out[i] !=0) allZero = false;
			if(agrd_wuscmp_out[i] !=0) allZero = false;
			if(agrd_wusext_out[i] !=0) allZero = false;
			if(area1new_agrid[i] !=0) allZero = false;
			if(area2new_agrid[i] !=0) allZero = false;
			if(area3new_agrid[i] !=0) allZero = false;
			if(area4new_agrid[i] !=0) allZero = false;
			if(mojave_agrid[i] !=0) allZero = false;
			if(sangreg_agrid[i] !=0) allZero = false;

			if(allZero) {
				Location loc = this.getGridLocation(i);
				System.out.println(i+" is all zero; aValIndexForLocIndex = "+
						aValIndexForLocIndex[i]+" Location: "+
						(float)loc.getLatitude()+"\t"+
	    				(float)loc.getLongitude()+"\t"+
	    				(float)sumOfAllAvals[i]);
			}
		}
		 */ }
This reads all grid files into arrays
This reads all grid files into arrays
//  // find maximum magitude from max mag files //System.out.println(maxFromMaxMagFiles);