Commit 971e2e77fd9e5b94e39a5bc9417cc000f5984a98

Authored by Olivier Hagolle
1 parent 2d2f9656
Exists in master

adaptation to run with both Python2 and Python 3

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
smac.py
... ... @@ -29,7 +29,7 @@ def PdeZ(Z) :
29 29  
30 30 class coeff:
31 31 def __init__(self,smac_filename):
32   - with file(smac_filename) as f:
  32 + with open(smac_filename) as f:
33 33 lines=f.readlines()
34 34 #H20
35 35 temp=lines[0].strip().split()
... ... @@ -213,7 +213,7 @@ def smac_inv( r_toa, tetas, phis, tetav, phiv,pressure,taup550, uo3, uh2o, coef)
213 213 #/*------: 7) scattering angle cosine :--------*/
214 214 cksi = - ( (us*uv) + (sqrt(1. - us*us) * sqrt (1. - uv*uv)*cos((phis-phiv) * cdr) ) )
215 215 if (cksi < -1 ) :
216   - cksi=-1.0
  216 + cksi=-1.0
217 217  
218 218 #/*------: 8) scattering angle in degree :--------*/
219 219 ksiD = crd*acos(cksi)
... ... @@ -458,4 +458,4 @@ if __name__==&quot;__main__&quot; :
458 458 r_surf = smac_inv(r_toa , theta_s, phi_s, theta_v, phi_v,1013,0.1,0.3,0.3, coefs)
459 459 r_toa2 = smac_dir(r_surf, theta_s, phi_s, theta_v, phi_v,1013,0.1,0.3,0.3, coefs)
460 460  
461   - print r_toa, r_surf,r_toa2
462 461 \ No newline at end of file
  462 + print(r_toa, r_surf,r_toa2)
... ...