Skip to content

Commit

Permalink
LB
Browse files Browse the repository at this point in the history
  • Loading branch information
brodeau committed Apr 27, 2024
1 parent a2b1597 commit 61fc53c
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions mojito/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,14 @@ def updateConfig4Scale( res_km, mode='model', ltalk=True ):
print('ERROR [updateConfig4Scale]: "mode=rgps_map" is only meant to be used at 10km !!!')
exit(0)


rc_Qarea_min, rc_Qarea_max = (res_km*(1.-0.125))**2, (res_km*(1.+0.125))**2

from math import log2
zdA_exp = 2.2
zxp = int(log2(res_km/10.))
zdA_tol = round( zdA_exp**zxp, 1 )
# +- tolerance in [km] on the MEAN scale of quadrangles in a batch:
ztpc = 0.125 ; # +- 12.5%

zdA_tol = res_km*ztpc
rc_maxDevMeanAreaQuads = zdA_tol
print(' *** [updateConfig4Scale](): `rc_maxDevMeanAreaQuads` =', rc_maxDevMeanAreaQuads, 'km^2')

rc_Qarea_min , rc_Qarea_max = (res_km - zdA_tol)**2 , (res_km + zdA_tol)**2

# 10 km:
if irk==10:
Expand Down Expand Up @@ -212,12 +210,12 @@ def updateConfig4Scale( res_km, mode='model', ltalk=True ):
#
else:
print('ERROR [updateConfig4Scale()]: scale "'+str(irk)+' km" is unknown!'); sys.exit(0)


if ltalk: print(' *** [updateConfig4Scale](): upper and lower bound for scale "'+str(res_km)+' km":', np.sqrt([rc_Qarea_min, rc_Qarea_max]))

if ltalk:
print(' *** [updateConfig4Scale](): `rc_maxDevMeanAreaQuads` =', rc_maxDevMeanAreaQuads, 'km')
print(' *** [updateConfig4Scale](): upper and lower bound for scale "'+str(res_km)+' km":', np.sqrt([rc_Qarea_min, rc_Qarea_max]))
print(' => rc_Qarea_min, Qarea_Nom, rc_Qarea_max =',rc_Qarea_min, res_km*res_km, rc_Qarea_max,'km^2')
if mode in ['rgps','rgps_track']: print(' (+-',zdA_tol,'km)')

#############################

Expand Down

0 comments on commit 61fc53c

Please sign in to comment.