[GRASS-SVN] r30841 - in grass-addons/gipe: . r.out.vic_met r.out.vic_veg

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 2 04:20:42 EDT 2008


Author: ychemin
Date: 2008-04-02 04:20:41 -0400 (Wed, 02 Apr 2008)
New Revision: 30841

Modified:
   grass-addons/gipe/imagery_Makefile
   grass-addons/gipe/r.out.vic_met/main.c
   grass-addons/gipe/r.out.vic_veg/veg_lib.c
Log:
Updated r.out.vic_met with null cell skip

Modified: grass-addons/gipe/imagery_Makefile
===================================================================
--- grass-addons/gipe/imagery_Makefile	2008-04-02 03:59:42 UTC (rev 30840)
+++ grass-addons/gipe/imagery_Makefile	2008-04-02 08:20:41 UTC (rev 30841)
@@ -47,18 +47,6 @@
 	i.maxlik \
 	i.ortho.photo \
 	i.points \
-	i.pr_blob \
-	i.pr_classify \
-	i.pr_features \
-	i.pr_features_additional \
-	i.pr_features_extract \
-	i.pr_features_selection \
-	i.pr_model \
-	i.pr_sites_aggregate \
-	i.pr_statistics \
-	i.pr_subsets \
-	i.pr_training \
-	i.pr_uxb \
 	i.rectify \
 	i.rgb.his \
 	i.sattime \

Modified: grass-addons/gipe/r.out.vic_met/main.c
===================================================================
--- grass-addons/gipe/r.out.vic_met/main.c	2008-04-02 03:59:42 UTC (rev 30840)
+++ grass-addons/gipe/r.out.vic_met/main.c	2008-04-02 08:20:41 UTC (rev 30841)
@@ -285,6 +285,7 @@
 						break;
 				}
 			}
+			
 			/*Extract lat/long data*/
 			latitude = ymax - ( row * stepy );
 			longitude = xmin + ( col * stepx );
@@ -293,22 +294,28 @@
 				    G_fatal_error(_("Error in pj_do_proj"));
 				}
 			}
-			/* Make the output .dat file name */
-			sprintf(result_lat_long,"%s%.4f%s%.4f%s",result1,latitude,"_",longitude,".dat");	
-			/*Open new ascii file*/
-			if (flag1->answer){
-				/*Initialize grid cell in append mode*/
-				f=fopen(result_lat_long,"a");
+			if(G_is_null_value(&prcp[0])||
+			G_is_d_null_value(&d_tmax[0])||
+			G_is_d_null_value(&d_tmin[0])){
+				/* Do nothing */
 			} else {
-				/*Initialize grid cell in new file mode*/
-				f=fopen(result_lat_long,"w");
+				/* Make the output .dat file name */
+				sprintf(result_lat_long,"%s%.4f%s%.4f%s",result1,latitude,"_",longitude,".dat");	
+				/*Open new ascii file*/
+				if (flag1->answer){
+					/*Initialize grid cell in append mode*/
+					f=fopen(result_lat_long,"a");
+				} else {
+					/*Initialize grid cell in new file mode*/
+					f=fopen(result_lat_long,"w");
+				}
+				/*Print data into the file maps data if available*/
+				for(i=0;i<nfiles_shortest;i++){
+					fprintf(f,"%.2f  %.2f  %.2f\n", d_prcp[i], d_tmax[i], d_tmin[i]);
+				}
+				fclose(f);
+				grid_count=grid_count+1;
 			}
-			/*Print data into the file maps data if available*/
-			for(i=0;i<nfiles_shortest;i++){
-				fprintf(f,"%.2f  %.2f  %.2f\n", d_prcp[i], d_tmax[i], d_tmin[i]);
-			}
-			fclose(f);
-			grid_count=grid_count+1;
 		}
 	}
 	G_message(_("Created %d VIC meteorological files"),grid_count);

Modified: grass-addons/gipe/r.out.vic_veg/veg_lib.c
===================================================================
--- grass-addons/gipe/r.out.vic_veg/veg_lib.c	2008-04-02 03:59:42 UTC (rev 30840)
+++ grass-addons/gipe/r.out.vic_veg/veg_lib.c	2008-04-02 08:20:41 UTC (rev 30841)
@@ -6,17 +6,17 @@
 	FILE *f;
 	f=fopen(filename,"w");
 
-	fprintf(f,"#Class	OvrStry	Rarc	Rmin	JAN-LAI	FEB-LAI	MAR-LAI	APR-LAI	MAY-LAI	JUN-LAI	JUL-LAI	AUG-LAI	SEP-LAI	OCT-LAI	NOV-LAI	DEC-LAI	JAN-ALB	FEB_ALB	MAR-ALB	APR-ALB	MAY-ALB	JUN-ALB	JUL-ALB	AUG-ALB	SEP-ALB	OCT-ALB	NOV-ALB	DEC-ALB	JAN-ROU	FEB-ROU	MAR-ROU	APR-ROU	MAY-ROU	JUN-ROU	JUL-ROU	AUG-ROU	SEP-ROU	OCT-ROU	NOV-ROU	DEC-ROU	JAN-DIS	FEB-DIS	MAR-DIS	APR-DIS	MAY-DIS	JUN-DIS	JUL-DIS	AUG-DIS	SEP-DIS	OCT-DIS	NOV-DIS	DEC-DIS	WIND_H	RGL	SolAtn	WndAtn	Trunk	COMMENT\n \
-1	1	60.0	250.	3.400	3.400	3.500	3.700	4.000	4.400	4.400	4.300	4.200	3.700	3.500	3.400	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	50.0	30	0.5	0.5	0.2	Evergreen Needleleaf\n \
-2	1	60.0	250.	3.400	3.400	3.500	3.700	4.000	4.400	4.400	4.300	4.200	3.700	3.500	3.400	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	50.0	30	0.5	0.5	0.2	Evergreen Broadleaf\n \
-3	1	60.0	125.	1.680	1.520	1.680	2.900	4.900	5.000	5.000	4.600	3.440	3.040	2.160	2.000	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	50.0	30	0.5	0.5	0.2	Deciduous Needleleaf\n \
-4	1	60.0	125.	1.680	1.520	1.680	2.900	4.900	5.000	5.000	4.600	3.440	3.040	2.160	2.000	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	50.0	30	0.5	0.5	0.2	Deciduous Broadleaf\n \
-5	1	60.0	125.	1.680	1.520	1.680	2.900	4.900	5.000	5.000	4.600	3.440	3.040	2.160	2.000	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	50.0	50	0.5	0.5	0.2	Mixed Cover\n \
-6	1	60.0	125.	1.680	1.520	1.680	2.900	4.900	5.000	5.000	4.600	3.440	3.040	2.160	2.000	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	50.0	50	0.5	0.5	0.2	Woodland\n \
-7	0	40.0	125.	2.000	2.250	2.950	3.850	3.750	3.500	3.550	3.200	3.300	2.850	2.600	2.200	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	10	75.	0.5	0.5	0.2	Wooded Grasslands\n \
-8	0	50.0	135.	2.000	2.250	2.950	3.850	3.750	3.500	3.550	3.200	3.300	2.850	2.600	2.200	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	10	75.	0.5	0.5	0.2	Closed Shrublands\n \
-9	0	50.0	135.	2.000	2.250	2.950	3.850	3.750	3.500	3.550	3.200	3.300	2.850	2.600	2.200	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	10	75.	0.5	0.5	0.2	Open Shrublands\n \
-10	0	25.0	120.	2.000	2.250	2.950	3.850	3.750	3.500	3.550	3.200	3.300	2.850	2.600	2.200	0.20	0.20	0.20	0.20	0.20	0.20	0.20	0.20	0.20	0.20	0.20	0.20	0.0738	0.0738	0.0738	0.0738	0.0738	0.0738	0.0738	0.0738	0.0738	0.0738	0.0738	0.0738	0.402	0.402	0.402	0.402	0.402	0.402	0.402	0.402	0.402	0.402	0.402	0.402	10	100	0.5	0.5	0.2	Grasslands\n \
+	fprintf(f,"#Class	OvrStry	Rarc	Rmin	JAN-LAI	FEB-LAI	MAR-LAI	APR-LAI	MAY-LAI	JUN-LAI	JUL-LAI	AUG-LAI	SEP-LAI	OCT-LAI	NOV-LAI	DEC-LAI	JAN-ALB	FEB_ALB	MAR-ALB	APR-ALB	MAY-ALB	JUN-ALB	JUL-ALB	AUG-ALB	SEP-ALB	OCT-ALB	NOV-ALB	DEC-ALB	JAN-ROU	FEB-ROU	MAR-ROU	APR-ROU	MAY-ROU	JUN-ROU	JUL-ROU	AUG-ROU	SEP-ROU	OCT-ROU	NOV-ROU	DEC-ROU	JAN-DIS	FEB-DIS	MAR-DIS	APR-DIS	MAY-DIS	JUN-DIS	JUL-DIS	AUG-DIS	SEP-DIS	OCT-DIS	NOV-DIS	DEC-DIS	WIND_H	RGL	SolAtn	WndAtn	Trunk	COMMENT\n\
+1	1	60.0	250.	3.400	3.400	3.500	3.700	4.000	4.400	4.400	4.300	4.200	3.700	3.500	3.400	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	50.0	30	0.5	0.5	0.2	Evergreen Needleleaf\n\
+2	1	60.0	250.	3.400	3.400	3.500	3.700	4.000	4.400	4.400	4.300	4.200	3.700	3.500	3.400	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	0.12	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	1.476	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	8.04	50.0	30	0.5	0.5	0.2	Evergreen Broadleaf\n\
+3	1	60.0	125.	1.680	1.520	1.680	2.900	4.900	5.000	5.000	4.600	3.440	3.040	2.160	2.000	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	50.0	30	0.5	0.5	0.2	Deciduous Needleleaf\n\
+4	1	60.0	125.	1.680	1.520	1.680	2.900	4.900	5.000	5.000	4.600	3.440	3.040	2.160	2.000	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	50.0	30	0.5	0.5	0.2	Deciduous Broadleaf\n\
+5	1	60.0	125.	1.680	1.520	1.680	2.900	4.900	5.000	5.000	4.600	3.440	3.040	2.160	2.000	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	50.0	50	0.5	0.5	0.2	Mixed Cover\n\
+6	1	60.0	125.	1.680	1.520	1.680	2.900	4.900	5.000	5.000	4.600	3.440	3.040	2.160	2.000	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	0.18	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	1.230	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	6.70	50.0	50	0.5	0.5	0.2	Woodland\n\
+7	0	40.0	125.	2.000	2.250	2.950	3.850	3.750	3.500	3.550	3.200	3.300	2.850	2.600	2.200	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	10	75.	0.5	0.5	0.2	Wooded Grasslands\n\
+8	0	50.0	135.	2.000	2.250	2.950	3.850	3.750	3.500	3.550	3.200	3.300	2.850	2.600	2.200	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	10	75.	0.5	0.5	0.2	Closed Shrublands\n\
+9	0	50.0	135.	2.000	2.250	2.950	3.850	3.750	3.500	3.550	3.200	3.300	2.850	2.600	2.200	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.19	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	0.495	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	1.00	10	75.	0.5	0.5	0.2	Open Shrublands\n\
+10	0	25.0	120.	2.000	2.250	2.950	3.850	3.750	3.500	3.550	3.200	3.300	2.850	2.600	2.200	0.20	0.20	0.20	0.20	0.20	0.20	0.20	0.20	0.20	0.20	0.20	0.20	0.0738	0.0738	0.0738	0.0738	0.0738	0.0738	0.0738	0.0738	0.0738	0.0738	0.0738	0.0738	0.402	0.402	0.402	0.402	0.402	0.402	0.402	0.402	0.402	0.402	0.402	0.402	10	100	0.5	0.5	0.2	Grasslands\n\
 11	0	25.0	120.	0.050	0.020	0.050	0.250	1.500	3.0000	4.500	5.0000	2.5000	0.500	0.050	0.020	0.10	0.10	0.10	0.10	0.20	0.20	0.20	0.20	0.20	0.10	0.10	0.10	0.006	0.006	0.006	0.006	0.012	0.062	0.123	0.185	0.215	0.215	0.006	0.006	0.034	0.034	0.034	0.034	0.067	0.335	0.670	1.005	1.173	1.173	0.034	0.034	10	100	0.5	0.5	0.2	Crop land (corn)\n");
 
 	fclose(f);



More information about the grass-commit mailing list