File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,29 @@ def convolve(
152152        ConvolutionResult: convolved image, scaling factor 
153153    """ 
154154
155+     ### These values aren't used in convolution, but are needed for santiy checks 
156+     conbeam , sfactor  =  get_convolving_beam (
157+         old_beam = old_beam ,
158+         new_beam = new_beam ,
159+         dx = dx ,
160+         dy = dy ,
161+         cutoff = cutoff ,
162+     )
163+     if  np .isnan (sfactor ):
164+         logger .warning ("Beam larger than cutoff -- blanking" )
165+         newim  =  np .ones_like (image ) *  np .nan 
166+         return  ConvolutionResult (newim , sfactor )
167+     if  conbeam  is  None :
168+         conbeam  =  new_beam .deconvolve (old_beam )
169+     if  np .isnan (conbeam ):
170+         return  ConvolutionResult (image  *  np .nan , sfactor )
171+     if  np .isnan (image ).all ():
172+         return  ConvolutionResult (image , sfactor )
173+     if  conbeam  ==  Beam (major = 0  *  u .deg , minor = 0  *  u .deg , pa = 0  *  u .deg ) and  sfactor  ==  1 :
174+         return  ConvolutionResult (image , sfactor )
175+     ### 
176+ 
177+     # Now we do the convolution 
155178    nanflag  =  np .isnan (image ).any ()
156179
157180    if  nanflag :
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments