I try to deploy some extreme value analysis in windspeed to the cloud for computing. In notebook works fine but after deployment the server answer is an error.
This is the code in notebook which works fine:
In[10]:= myMaxWindSpeed[lat_, lon_] :=
UnitConvert[
Quantity[Part[
maxwind /.
NSolve[Probability[x >= maxwind,
x \[Distributed]
EstimatedDistribution[
WeatherData[{lat, lon},
"MaxWindSpeed", {{1990}, {2015}, "Year"}],
GumbelDistribution[\[Alpha], \[Beta]]]] == 0.02, maxwind,
Reals]][[1]], "Kilometers"/"Hours"]*1.66, "Meters"/"Seconds"]
In[19]:= myMaxWindSpeed[-20, 30]
Out[19]= Quantity[43.3222, ("Meters")/("Seconds")]
So, I can call the function passing two arguments. But when trying to deploy to the Wolfram Cloud the code and answer are the below:
In[20]:= CloudDeploy[
FormFunction[{"lat" -> Restricted["Number", {-180, 180}],
"lon" -> Restricted["Number", {-180, 180}]},
myMaxWindSpeed[#lat, #lon] &]]
Out[20]= CloudObject["https://www.wolframcloud.com/objects/182e0f97-\
b6ff-49bd-8e64-627a27540513"]
The answer is this:
If[Floor[0.461111 maxwind] == 0.461111 maxwind, Floor[0.461111 maxwind], N[0.461111 maxwind]] "Meters"/"Seconds"
Testing cloud deployment with similar functions I have the below one, which works fine. So, what can be the problem here? Why the similar function doesn't work?
In[21]:= testfunction[lati_, longi_] :=
WeatherData[{lati, longi}, "WindSpeed"]
In[22]:= CloudDeploy[
FormFunction[{"lati" -> Restricted["Number", {-180, 180}],
"longi" -> Restricted["Number", {-180, 180}]},
testfunction[#lati, #longi] &]]
Out[22]= CloudObject["https://www.wolframcloud.com/objects/1ba5d447-\
ed36-42db-8d89-0300f10c452a"]
Server answer after fill out the form with some coordinates: 9.7 "Kilometers"/"Hours"