Cloud types and heights of automated reports are not being parsed
leodevida opened this issue · 2 comments
According to Annex 3 (20th Edition), the Cloud height or type can appear as "///". This is only valid for automated reports.
So, for example, FEW005/// is a valid cloud element, and so are BKN020/// , ///123CB and even /////////.
This is an example:
EGKK 070250Z AUTO 32017G28KT 1900 -SN FEW005/// SCT009/// BKN020/// //////TCU M01/M03 Q1018 BECMG 9999=
One way to implement this would be to change the regular expression in CloudCommand.java, so it takes into consideration the cloud amount and cloud type can be "///" if generated by automated reports.
This would involve changing the current
Pattern CLOUD_REGEX = Pattern.compile("^([A-Z]{3})(\d{3})?([A-Z]{2,3})?$");
To this one
Pattern CLOUD_REGEX = Pattern.compile("^([A-Z/]{2,3})(\d{3}|///)?([A-Z]{2,3}|///)?$");
Note that "///" is an option both both the Cloud amount and the Cloud type at the end. This change also reflects the "VV" option, which has 2 letters and not 3, so the regex changes from {3} to {2,3}.
That change would at least make the clouds being recognized as such, but on itself would not be enough.
In the Cloud section, the type of cloud "///" should be someone added to the CloudType class. The problem is that "///" is not a valid enum constant. Maybe add it as "UNKNOWN" and then process it differently, I don't know.
Hello @leodevida
Sorry for the late answer.
I know about the "///" being available in the cloud layer description and in the vertical visibility.
The problem is more about how do I represent this information in the current model of the project.
The vertical visibility is an Integer field of AbstractWeatherContainer, in the Cloud object, the height is also an Integer. I did not find any acceptable solution to represent this information thus I simply ignored it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.