we are excited
Our Presentation
https://docs.google.com/presentation/d/1aVLeLIdKpZ...
Making the video was an exhausting process cause none of us is professional in all that movie-cutting stuff, but i think, the result is not that bad as it could be
Hello!
We've added the video) Check it out)
Then the feeling, when for the first day the Hakaton mastered more than half a year of self-study!
Keep calm and participate on the hakaton)
thanks to all)
usingSystem; | |
namespaceAPIforEOSDIS | |
{ | |
/* | |
Структура, котрая будет хранить координаты | |
левой нижней (left lower - ll) и правой верхней (right upper - ru) точек прямоугольника, | |
который используется в WorldviewLNK.DataforQuery для построения запроса. | |
*/ | |
publicstructRectArea | |
{ | |
privatedoublex_ll, y_ll, x_ru, y_ru; | |
privateboolx_ll_sig, y_ll_sig, x_ru_sig, y_ru_sig; | |
staticprivateboolIsInRange(doubleval) | |
{ | |
if (Math.Abs(val) >=0&&Math.Abs(val) <=790) | |
returntrue; | |
returnfalse; | |
} | |
staticprivatevoidSetVal(doubleval, outdoublenum, outboolsig) | |
{ | |
if (!IsInRange(val)) | |
{ | |
sig=false; | |
num=0; | |
return; | |
} | |
sig= (val>=0) ?false:true; | |
num=Math.Abs(val); | |
} | |
staticprivateboolIsValid(stringval) | |
{ | |
if (val=="") | |
returnfalse; | |
boolWasPoint=false; | |
for (inti=0; i<val.Length-1; i++) | |
{ | |
if ((val[i] =='.') && (i!=0) &&!WasPoint) | |
WasPoint=true; | |
elseif (val[i] <'0'||val[i] >'9') | |
returnfalse; | |
} | |
bytelast_val_ind= (byte)(val.Length-1); | |
if (!((val[last_val_ind] =='n'||val[last_val_ind] =='s'||val[last_val_ind] =='w'||val[last_val_ind] =='e') | |
|| (val[last_val_ind] =='N'||val[last_val_ind] =='S'||val[last_val_ind] =='W'||val[last_val_ind] =='E')) | |
|| (val[last_val_ind-1] <'0'||val[last_val_ind-1] >'9')) | |
returnfalse; | |
returntrue; | |
} | |
staticprivatevoidSetVal(stringval, outdoublenum, outboolsig) | |
{ | |
if (IsValid(val)) | |
{ | |
bytelast_val_ind= (byte)(val.Length-1); | |
sig= (val[last_val_ind] =='w'||val[last_val_ind] =='W' | |
||val[last_val_ind] =='s'||val[last_val_ind] =='S') ? | |
true:false; | |
val=val.Remove(last_val_ind); | |
num=Math.Abs(Convert.ToDouble(val)); | |
return; | |
} | |
sig=false; | |
num=0; | |
} | |
publicdoubleX_ll | |
{ | |
get { return (x_ll_sig) ?-this.x_ll:this.x_ll; } | |
set { SetVal(value, outx_ll, outx_ll_sig); } | |
} | |
publicdoubleY_ll | |
{ | |
get { return (y_ll_sig) ?-this.y_ll:this.y_ll; } | |
set { SetVal(value, outy_ll, outy_ll_sig); } | |
} | |
publicdoubleX_ru | |
{ | |
get { return (x_ru_sig) ?-this.x_ru:this.x_ru; } | |
set { SetVal(value, outx_ru, outx_ru_sig); } | |
} | |
publicdoubleY_ru | |
{ | |
get { return (y_ru_sig) ?-this.y_ru:this.y_ru; } | |
set { SetVal(value, outy_ru, outy_ru_sig); } | |
} | |
publicRectArea(doublex_ll_val, doubley_ll_val, doublex_ru_val, doubley_ru_val) | |
{ | |
SetVal(x_ll_val, outx_ll, outx_ll_sig); | |
SetVal(y_ll_val, outy_ll, outy_ll_sig); | |
SetVal(x_ru_val, outx_ru, outx_ru_sig); | |
SetVal(y_ru_val, outy_ru, outy_ru_sig); | |
} | |
publicRectArea(stringx_ll_val, stringy_ll_val, stringx_ru_val, stringy_ru_val) | |
{ | |
SetVal(x_ll_val, outx_ll, outx_ll_sig); | |
SetVal(y_ll_val, outy_ll, outy_ll_sig); | |
SetVal(x_ru_val, outx_ru, outx_ru_sig); | |
SetVal(y_ru_val, outy_ru, outy_ru_sig); | |
} | |
publicvoidInitializeCoord(doublex_ll_val, doubley_ll_val, doublex_ru_val, doubley_ru_val) | |
{ | |
this=newRectArea(x_ll_val, y_ll_val, x_ru_val, y_ru_val); | |
} | |
publicvoidInitializeCoord(stringx_ll_val, stringy_ll_val, stringx_ru_val, stringy_ru_val) | |
{ | |
this=newRectArea(x_ll_val, y_ll_val, x_ru_val, y_ru_val); | |
} | |
publicoverridestringToString() | |
{ | |
returnX_ll.ToString() +","+Y_ll+","+Y_ru+","+X_ru; | |
} | |
} | |
} |
usingSystem; | |
usingSystem.Collections.Generic; | |
usingSystem.Linq; | |
usingSystem.Web; | |
usingMicrosoft.Bot.Builder.FormFlow; | |
usingMicrosoft.Bot.Builder.Dialogs; | |
usingMicrosoft.Bot.Connector; | |
usingAPIforEOSDIS; | |
#pragmawarningdisable649 | |
namespaceViewFinderChatBot.Logic | |
{ | |
publicclassSimpleViewFinderBot | |
{ | |
//public | |
//public WorldviewQueryMaker querymaker { get; set; } | |
publicenumCountriesOptions { Ukraine, USA, Germany}; | |
//public enum CitiesOptions { Odessa, Washington, Berlin }; | |
publicenumCategoriesOptions { Atmosphere, Cryosphere, Ocean}; | |
[Serializable] | |
[Template(TemplateUsage.EnumSelectOne, "What kind of {&} would you like to see on the image? {||}", ChoiceStyle=ChoiceStyleOptions.PerLine)] | |
[Template(TemplateUsage.NotUnderstood, "I do not understand \"{0}\".", "Try again with differen word, please, I don't get \"{0}\".")] | |
publicclassViewFinderOrder | |
{ | |
publicCountriesOptions? Country; | |
//[Optional] | |
//public CitiesOptions? City; | |
publicCategoriesOptionsCategory; | |
publicstaticIForm<ViewFinderOrder> BuildForm() | |
{ | |
OnCompletionAsyncDelegate<ViewFinderOrder> processOrder=async (context, state) => | |
{ | |
RectArearect=newRectArea(); | |
string[] layers= { }; | |
IMessageActivityreply=context.MakeMessage(); | |
//should be taken out from the dataBase (consider MSSQL server) | |
switch (state.Country) | |
{ | |
caseCountriesOptions.Ukraine: rect=newRectArea(18.549583190694918, 42.05502663141595, 53.26987038141595, 42.56130194069492); break; | |
caseCountriesOptions.USA: rect=newRectArea(-146.612249529861, 9.360138033414074, 50.765206221414076, -57.961272813861015); break; | |
caseCountriesOptions.Germany: rect=newRectArea(-1.0942022813609764, 44.940590437914, 55.291857484914004, 21.068541897639022); break; | |
} | |
//should be taken out from the dataBase (consider MSSQL server) | |
switch (state.Category) | |
{ | |
caseCategoriesOptions.Atmosphere : layers=newstring[] { "AMSR2_Wind_Speed_Day" }; break; | |
caseCategoriesOptions.Cryosphere : layers=newstring[] { "MODIS_Terra_Sea_Ice", "MODIS_Aqua_Sea_Ice", "MODIS_Terra_Snow_Cover", "MODIS_Aqua_Snow_Cover" };break; | |
caseCategoriesOptions.Ocean : layers=newstring[] { "MODIS_Terra_Chlorophyll_A", "MODIS_Aqua_Chlorophyll_A" }; break; | |
} | |
WorldviewQueryMakerquerymaker=newWorldviewQueryMaker(layers, newDateTime(2017, 04, 29), rect, projection_type.geographic); | |
reply.Text=string.Format(querymaker.Gen_Query_Link()); | |
awaitcontext.PostAsync(reply); | |
}; | |
returnnewFormBuilder<ViewFinderOrder>() | |
.Message("Hello! I am ViewFinder, the WorldView Searching help bot!") | |
.AddRemainingFields() | |
.Confirm("Your choice: {Country}; {Category}?") | |
.Message("Thanks you for using ViewFinder") | |
.OnCompletion(processOrder) | |
.Build(); | |
} | |
}; | |
} | |
} |
usingSystem; | |
namespaceAPIforEOSDIS | |
{ | |
publicenumprojection_type { geographic, arctic, antarctic }; | |
publicclassWorldviewQueryMaker | |
{ | |
privatestring[] layers_list; | |
privateprojection_typeprojection; | |
privateDateTimetime; | |
privateRectAreacoordinates; | |
privateconststringdefault_layers="VIIRS_SNPP_CorrectedReflectance_TrueColor,Reference_Labels,Reference_Features"; | |
publicstring[] Layers_list | |
{ | |
get { returnlayers_list; } | |
set { layers_list=value; } | |
} | |
publicDateTimeTime | |
{ | |
get { returntime; } | |
set { time=value; } | |
} | |
publicRectAreaCoordinates | |
{ | |
get { returncoordinates; } | |
set { coordinates=value; } | |
} | |
privateprojection_typeProjections | |
{ | |
get { returnprojection; } | |
set { projection=value; } | |
} | |
publicWorldviewQueryMaker(string[] Lyr_list, DateTimeTm, RectAreaCoord, projection_typePrj_tp) | |
{ | |
layers_list=Lyr_list; time=Tm; coordinates=Coord; projection=Prj_tp; | |
} | |
publicstringGen_Query_Link() | |
{ | |
stringlayers_str=""; | |
if (layers_list!=null) | |
for (inti=0; i<layers_list.Length; i++) | |
if (layers_list[i] !="") | |
layers_str+=","+layers_list[i]; | |
stringprojctn_name=""; | |
switch (projection) | |
{ | |
caseprojection_type.geographic: | |
projctn_name="geographic"; | |
break; | |
caseprojection_type.arctic: | |
projctn_name="arctic"; | |
break; | |
caseprojection_type.antarctic: | |
projctn_name="antarctic"; | |
break; | |
} | |
return"https://worldview.earthdata.nasa.gov/?p="+projctn_name+ | |
"&l="+default_layers+layers_str+"&t="+time.ToString("yyyy-MM-dd") + | |
"&z=3&v="+coordinates.ToString(); | |
} | |
} | |
} |
Today has given us a lot, but most importantly: self-reliance and motivation to continue.
Our prototype was a bot, but this is only the beginning. In the next several weeks we will finish the test version it and then try to take up a more complex and large step of our project - creating API and clients based architecture . And of course we will train our little chat-bot to become smarter and smarter as far as our project will be developing
We want to say thanks to the organizers - enthusiastic people who actually gave us and other people an ability to participate and gain such a unique experience. Many thanks to Co-working area "terminal 42" for being very welcoming host And finally, NASA and all the mentors for helping us to develop idea of our project and gave an advice and feedback for our prototype.
Sincerely,
ViewFinder team
.
We end our presentation and logic of the bot. Our teamlead gave us a lot of useful information about bots. I read it all the night.
https://docs.botframework.com/en-us/csharp/builder...
https://docs.botframework.com/en-us/azure-bot-serv...
We changed the method of implementation from web-service to a conversation with bot.
Hello World!
SpaceApps is a NASA incubator innovation program.