ViewFinder | Data Concierge

Odessa

Team Updates

we are excited

satanfreemanMax Shevchenko

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

satanfreemanMax Shevchenko

Hello!

We've added the video) Check it out)

satanfreemanMax Shevchenko

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)

Б
Бочарников Сергей
Not in vain​, I was programming for, about, 2 days. Now there are so much things to add and correct in existing architecture.
Not in vain​, I was programming for, about, 2 days. Now there are so much things to add and correct in existing architecture.
L
Lysenko Tymur
using System;
namespace APIforEOSDIS
{
/*
Структура, котрая будет хранить координаты
левой нижней (left lower - ll) и правой верхней (right upper - ru) точек прямоугольника,
который используется в WorldviewLNK.DataforQuery для построения запроса.
*/
public struct RectArea
{
private double x_ll, y_ll, x_ru, y_ru;
private bool x_ll_sig, y_ll_sig, x_ru_sig, y_ru_sig;
static private bool IsInRange(double val)
{
if (Math.Abs(val) >= 0 && Math.Abs(val) <= 790)
return true;
return false;
}
static private void SetVal(double val, out double num, out bool sig)
{
if (!IsInRange(val))
{
sig = false;
num = 0;
return;
}
sig = (val >= 0) ? false : true;
num = Math.Abs(val);
}
static private bool IsValid(string val)
{
if (val == "")
return false;
bool WasPoint = false;
for (int i = 0; i < val.Length - 1; i++)
{
if ((val[i] == '.') && (i != 0) && !WasPoint)
WasPoint = true;
else if (val[i] < '0' || val[i] > '9')
return false;
}
byte last_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'))
return false;
return true;
}
static private void SetVal(string val, out double num, out bool sig)
{
if (IsValid(val))
{
byte last_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;
}
public double X_ll
{
get { return (x_ll_sig) ? -this.x_ll : this.x_ll; }
set { SetVal(value, out x_ll, out x_ll_sig); }
}
public double Y_ll
{
get { return (y_ll_sig) ? -this.y_ll : this.y_ll; }
set { SetVal(value, out y_ll, out y_ll_sig); }
}
public double X_ru
{
get { return (x_ru_sig) ? -this.x_ru : this.x_ru; }
set { SetVal(value, out x_ru, out x_ru_sig); }
}
public double Y_ru
{
get { return (y_ru_sig) ? -this.y_ru : this.y_ru; }
set { SetVal(value, out y_ru, out y_ru_sig); }
}
public RectArea(double x_ll_val, double y_ll_val, double x_ru_val, double y_ru_val)
{
SetVal(x_ll_val, out x_ll, out x_ll_sig);
SetVal(y_ll_val, out y_ll, out y_ll_sig);
SetVal(x_ru_val, out x_ru, out x_ru_sig);
SetVal(y_ru_val, out y_ru, out y_ru_sig);
}
public RectArea(string x_ll_val, string y_ll_val, string x_ru_val, string y_ru_val)
{
SetVal(x_ll_val, out x_ll, out x_ll_sig);
SetVal(y_ll_val, out y_ll, out y_ll_sig);
SetVal(x_ru_val, out x_ru, out x_ru_sig);
SetVal(y_ru_val, out y_ru, out y_ru_sig);
}
public void InitializeCoord(double x_ll_val, double y_ll_val, double x_ru_val, double y_ru_val)
{
this = new RectArea(x_ll_val, y_ll_val, x_ru_val, y_ru_val);
}
public void InitializeCoord(string x_ll_val, string y_ll_val, string x_ru_val, string y_ru_val)
{
this = new RectArea(x_ll_val, y_ll_val, x_ru_val, y_ru_val);
}
public override string ToString()
{
return X_ll.ToString() + "," + Y_ll + "," + Y_ru + "," + X_ru;
}
}
}
view raw RectArea.cs hosted with ❤ by GitHub
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.Bot.Builder.FormFlow;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Connector;
using APIforEOSDIS;
#pragma warning disable 649
namespace ViewFinderChatBot.Logic
{
public class SimpleViewFinderBot
{
//public
//public WorldviewQueryMaker querymaker { get; set; }
public enum CountriesOptions { Ukraine, USA, Germany};
//public enum CitiesOptions { Odessa, Washington, Berlin };
public enum CategoriesOptions { 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}\".")]
public class ViewFinderOrder
{
public CountriesOptions? Country;
//[Optional]
//public CitiesOptions? City;
public CategoriesOptions Category;
public static IForm<ViewFinderOrder> BuildForm()
{
OnCompletionAsyncDelegate<ViewFinderOrder> processOrder = async (context, state) =>
{
RectArea rect=new RectArea();
string[] layers= { };
IMessageActivity reply = context.MakeMessage();
//should be taken out from the dataBase (consider MSSQL server)
switch (state.Country)
{
case CountriesOptions.Ukraine: rect = new RectArea(18.549583190694918, 42.05502663141595, 53.26987038141595, 42.56130194069492); break;
case CountriesOptions.USA: rect = new RectArea(-146.612249529861, 9.360138033414074, 50.765206221414076, -57.961272813861015); break;
case CountriesOptions.Germany: rect = new RectArea(-1.0942022813609764, 44.940590437914, 55.291857484914004, 21.068541897639022); break;
}
//should be taken out from the dataBase (consider MSSQL server)
switch (state.Category)
{
case CategoriesOptions.Atmosphere : layers = new string[] { "AMSR2_Wind_Speed_Day" }; break;
case CategoriesOptions.Cryosphere : layers = new string[] { "MODIS_Terra_Sea_Ice", "MODIS_Aqua_Sea_Ice", "MODIS_Terra_Snow_Cover", "MODIS_Aqua_Snow_Cover" };break;
case CategoriesOptions.Ocean : layers = new string[] { "MODIS_Terra_Chlorophyll_A", "MODIS_Aqua_Chlorophyll_A" }; break;
}
WorldviewQueryMaker querymaker = new WorldviewQueryMaker(layers, new DateTime(2017, 04, 29), rect, projection_type.geographic);
reply.Text = string.Format(querymaker.Gen_Query_Link());
await context.PostAsync(reply);
};
return new FormBuilder<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();
}
};
}
}
using System;
namespace APIforEOSDIS
{
public enum projection_type { geographic, arctic, antarctic };
public class WorldviewQueryMaker
{
private string[] layers_list;
private projection_type projection;
private DateTime time;
private RectArea coordinates;
private const string default_layers = "VIIRS_SNPP_CorrectedReflectance_TrueColor,Reference_Labels,Reference_Features";
public string[] Layers_list
{
get { return layers_list; }
set { layers_list = value; }
}
public DateTime Time
{
get { return time; }
set { time = value; }
}
public RectArea Coordinates
{
get { return coordinates; }
set { coordinates = value; }
}
private projection_type Projections
{
get { return projection; }
set { projection = value; }
}
public WorldviewQueryMaker(string[] Lyr_list, DateTime Tm, RectArea Coord, projection_type Prj_tp)
{
layers_list = Lyr_list; time = Tm; coordinates = Coord; projection = Prj_tp;
}
public string Gen_Query_Link()
{
string layers_str = "";
if (layers_list != null)
for (int i = 0; i < layers_list.Length; i++)
if (layers_list[i] != "")
layers_str += "," + layers_list[i];
string projctn_name = "";
switch (projection)
{
case projection_type.geographic:
projctn_name = "geographic";
break;
case projection_type.arctic:
projctn_name = "arctic";
break;
case projection_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();
}
}
}
satanfreemanMax Shevchenko

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 discover, we clarify
satanfreemanMax Shevchenko
Created a gif for the presentation showing the capabilities of our bot. We are preparing for the submission of the project.

.

Б
Бочарников Сергей
Team Stream Item
egoКулачинская Татьяна Андреевна
Team Stream Item
egoКулачинская Татьяна Андреевна
Created a library for creating links for the map.
Created a library for creating links for the map.
Б
Бочарников Сергей
Part of the presentation is ready. It will be completed, when we finish the code
Part of the presentation is ready. It will be completed, when we finish the code
Б
Бочарников Сергей

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...

egoКулачинская Татьяна Андреевна

We changed the method of implementation from web-service to a conversation with bot.

egoКулачинская Татьяна Андреевна

Hello World!

satanfreemanMax Shevchenko
NASA Logo

SpaceApps is a NASA incubator innovation program.