Project

General

Profile

« Previous | Next » 

Revision ff4d15e4

Added by Benoit Parmentier over 8 years ago

global assessment product part1, script function changing zlim and names of outputs

View differences:

climate/research/oregon/interpolation/global_product_assessment_part1_functions.R
145 145
  r_pred <- subset(r_mosaiced_scaled,i)
146 146
  NAvalue(r_pred)<- NA_flag_val 
147 147
 
148
  raster_name <- filename(r_pred)
149
  extension_str <- extension(raster_name)
150
  raster_name_tmp <- gsub(extension_str,"",basename(raster_name))
151
  
148 152
  date_proc <- l_dates[i]
149 153
  date_val <- as.Date(strptime(date_proc,"%Y%m%d"))
150 154
  #month_name <- month.name(date_val)
......
161 165
  
162 166
  if(is.null(zlim_val)){
163 167
    zlim_val_str <- paste(c(minValue(r_pred),maxValue(r_pred)),sep="_",collapse="_")
164
    png_filename <-  file.path(out_dir,paste("Figure4_clim_mosaics_day_","_",date_proc,"_",region_name,"_zlim_",zlim_val_str,"_",out_suffix,".png",sep =""))
168
    #png_filename <-  file.path(out_dir,paste("Figure4_clim_mosaics_day_","_",date_proc,"_",region_name,"_zlim_",zlim_val_str,"_",out_suffix,".png",sep =""))
169
    raster_name_tmp
170
    png_filename <-  file.path(out_dir,paste("Figure_",raster_name_tmp,"_zlim_",zlim_val_str,"_",out_suffix,".png",sep =""))
171
    
165 172
    title_str <-  paste("Predicted ",variable_name, " on ",date_str , " ", sep = "")
166 173
  
167 174
    png(filename=png_filename,width = col_mfrow * res_pix,height = row_mfrow * res_pix)
......
174 181
    dev.off()
175 182
  }else{
176 183
    zlim_val_str <- paste(zlim_val,sep="_",collapse="_")
177
    png_filename <-  file.path(out_dir,paste("Figure4_clim_mosaics_day_","_",date_proc,"_",region_name,"_",zlim_val_str,"_",out_suffix,".png",sep =""))
178
    title_str <-  paste("Predicted ",variable_name, " on ",date_str , " ", sep = "")
184
    #png_filename <-  file.path(out_dir,paste("Figure_mosaics_day_","_",date_proc,"_",region_name,"_",zlim_val_str,"_",out_suffix,".png",sep =""))
185
    png_filename <-  file.path(out_dir,paste("Figure_",raster_name_tmp,"_zlim_",zlim_val_str,"_",out_suffix,".png",sep =""))
179 186

  
187
    title_str <-  paste("Predicted ",variable_name, " on ",date_str , " ", sep = "")
188
    png(filename=png_filename,width = col_mfrow * res_pix,height = row_mfrow * res_pix)
189
    
180 190
    plot(r_pred,main =title_str,cex.main =1.5,col=matlab.like(255),zlim=zlim_val,
181 191
       legend.shrink=0.8,legend.width=0.8)
182 192
       #axis.args = list(cex.axis = 1.6), #control size of legend z

Also available in: Unified diff