File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -323,14 +323,15 @@ def reproject_and_coadd(
323323        output_array [...] =  - np .inf 
324324
325325    if  combine_function  in  ("mean" , "sum" ):
326-         for  array  in  arrays :
327-             # By default, values outside of the footprint are set to NaN 
328-             # but we set these to 0 here to avoid getting NaNs in the 
329-             # means/sums. 
330-             array .array [array .footprint  ==  0 ] =  0 
326+         if  match_background :
327+             for  array  in  arrays :
328+                 # By default, values outside of the footprint are set to NaN 
329+                 # but we set these to 0 here to avoid getting NaNs in the 
330+                 # means/sums. 
331+                 array .array [array .footprint  ==  0 ] =  0 
331332
332-             output_array [array .view_in_original_array ] +=  array .array  *  array .footprint 
333-             output_footprint [array .view_in_original_array ] +=  array .footprint 
333+                  output_array [array .view_in_original_array ] +=  array .array  *  array .footprint 
334+                  output_footprint [array .view_in_original_array ] +=  array .footprint 
334335
335336        if  combine_function  ==  "mean" :
336337            with  np .errstate (invalid = "ignore" ):
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments