Closed alastairUK closed 5 years ago
The ITU-R P.836 Recommendation does not define values for the water_vapour_density and the total_water_content below 0.1% and above 99%, so that's why it returns NaN.
In any case, for clarity purposes I will add a warning to let the users know it when they introduce values of 'p' smaller/larger than these quantities
From a practical standpoint, I wouldn't mind using the value for p=99% for values larger than 99% (by clipping it from above), since the difference will be really small, but using the value of p=0.1% for values below 0.1% might lead to significant errors, as the differences can be very big as these quantities have an exponential behavior when one gets to very small values of p.
In any case, most of the ITU-Recommendations do not need to compute values for the surface vapour density and total water content below these numbers, even when one wants to compute values for the total atmospheric attenuation for p<0.1. For example, Section 2.5 of ITU-R P.618 says that for p < 1%
a large part of the cloud attenuation and gaseous attenuation is already included in the rain attenuation prediction for time percentages below 1%.
This means that if you were to compute the total atmospheric attenuation for p=0.1 %, you would need the values of A_rain(p=0.1%), A_cloud(p=1%), A_gas(p=1%), and A_scintillation(p=0.1%).
Adding a warning is likely the best option. As you say the Rec. doesn't define values for < 0.1, > 99 so can't really do anything standard. It was just I was getting a divide by 0 error I believe when I passed in 99.9 so thought I would stop that happening with the above code change.
I have some other comments on P676. Should I raise another issue?
Hi @alastairUK, yes, please raise a new issue. Thank you so much for the feedback.
The handling of values < 0.1% and > 99% needs to be revised as I believe you get a nan returned at present.
This is what I did locally. But note: I am not a Python programmer so apologies in advance!