From 3c6cda68d21179b7b278533b93fc20878288b939 Mon Sep 17 00:00:00 2001 From: Michel Gangloff <Michel.Gangloff@irap.omp.eu> Date: Wed, 22 Nov 2017 15:13:00 +0100 Subject: [PATCH] Mise à jour avec nettoyage du code de app/main.py et suppression de fichiers obsolètes --- comet_server/Dockerfile | 2 +- comet_server/main.py | 8 ++++---- flask_app/app/forms.py | 2 ++ flask_app/app/main.py | 174 +++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------------------------- flask_app/app/new_voevent.xml | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ flask_app/app/templates/index-lunar.html | 3 +++ flask_app/app/templates/index.html | 3 +++ flask_app/app/templates/voevent-psws.html | 20 -------------------- flask_app/app/templates/voevent.xml | 74 -------------------------------------------------------------------------- flask_app/app/voevent.xml | 74 -------------------------------------------------------------------------- flask_app/voevent-fireball.xml | 6 ++++-- flask_app/voevent-lunar.xml | 6 ++++-- flask_app/voevent.xml | 74 -------------------------------------------------------------------------- 13 files changed, 116 insertions(+), 398 deletions(-) create mode 100644 flask_app/app/new_voevent.xml delete mode 100644 flask_app/app/templates/voevent-psws.html delete mode 100644 flask_app/app/templates/voevent.xml delete mode 100644 flask_app/app/voevent.xml delete mode 100644 flask_app/voevent.xml diff --git a/comet_server/Dockerfile b/comet_server/Dockerfile index 490e6bf..19f36f0 100755 --- a/comet_server/Dockerfile +++ b/comet_server/Dockerfile @@ -11,4 +11,4 @@ RUN apt-get update && apt-get -y install \ python-jinja2 COPY main.py /tmp/ RUN pip install comet -CMD twistd -n comet --local-ivo=ivo://hotwired.org/test & python /tmp/main.py +CMD twistd -n comet -r --local-ivo=ivo://hotwired.org/test & python /tmp/main.py diff --git a/comet_server/main.py b/comet_server/main.py index d7d1682..a7f0557 100644 --- a/comet_server/main.py +++ b/comet_server/main.py @@ -6,12 +6,12 @@ from os import stat if __name__ == '__main__': print ("Si tout va bien, on a rien vu !") - voeventfile = '/var/tmp/new_voevent_example.xml' - infos = stat('/var/tmp/new_voevent_example.xml') + voeventfile = '/var/tmp/new_voevent.xml' + infos = stat('/var/tmp/new_voevent.xml') time = asctime(localtime(infos[8])) while True: - infos = stat('/var/tmp/new_voevent_example.xml') + infos = stat('/var/tmp/new_voevent.xml') newtime = asctime(localtime(infos[8])) if newtime>time: - os.system('</var/tmp/new_voevent_example.xml comet-sendvo --host=localhost') + os.system('</var/tmp/new_voevent.xml comet-sendvo --host=localhost') time = newtime diff --git a/flask_app/app/forms.py b/flask_app/app/forms.py index 97e1040..78d14a7 100644 --- a/flask_app/app/forms.py +++ b/flask_app/app/forms.py @@ -16,6 +16,7 @@ class ContactForm(FlaskForm): Olongitude = IntegerField("Observer Longitude") Olatitude = IntegerField("Observer Latitude") comet = TextField("Flash Source") + instrument = TextField("Instrument Description") submit = SubmitField("Send") @@ -33,6 +34,7 @@ class ContactFormLunar(FlaskForm): Olongitude = IntegerField("Observer Longitude") Olatitude = IntegerField("Observer Latitude") comet = TextField("Flash Source") + instrument = TextField("Instrument Description") submit = SubmitField("Send") class ContactFormComet(FlaskForm): diff --git a/flask_app/app/main.py b/flask_app/app/main.py index d8888cc..028013c 100644 --- a/flask_app/app/main.py +++ b/flask_app/app/main.py @@ -14,6 +14,7 @@ from forms import ContactForm , ContactFormLunar, ContactFormComet app =Flask(__name__) app.secret_key = 'development key' + @app.route('/') def home(): return render_template('home.html') @@ -29,12 +30,7 @@ def index(): voevent_id = uuid.uuid4() # Get the date date=str(datetime.datetime.strptime(request.form['DateTime'],"%Y-%m-%d %H:%M:%S")) - year = int(date[0:4]) - month = int(date[5:7]) - day = int(date[8:10]) - hour = int(date[11:13]) - mn = int(date[14:16]) - seconds = int(date[17:19]) + my_datetime=date[0:10]+"T"+date[11:19] # Set the basic packet ID and Author details @@ -43,14 +39,6 @@ def index(): TEMPLATE_FILE = "/tmp/voevent-fireball.xml" template = templateEnv.get_template( TEMPLATE_FILE ) - my_datetime=date - my_datetime=date[0:10]+"T"+date[11:19] - my_shortname=request.form['shortname'] - my_contactname=request.form['observer'] - my_contactphone=request.form['phone'] - my_contactemail=request.form['mail'] - my_city=request.form['city'] - my_country=request.form['country'] # using dictionary to fill information # case of what list [value, datatype, ucd] @@ -71,59 +59,25 @@ def index(): my_list_wherewhen_time={"time_obs":"2017-02-24T11:07:28.1Z", "time_scale":"UTC", "target_origin":"Earth"} - my_list_how={"data_source_type":"observation"} - my_list_how_instrument={"instrument_host_name":"My Home", - "instrument_name":"Celestron 8", - "observer_name":"Pierre Le Sidaner", - "observer_country":"France"} - my_list_how_obs_location={"obs_longitude":"45.147", - "obs_latitude":"85.78", - "obs_altitude":"4000.4"} - my_list_whenwhere_observatory_location={"longitude":"45.147", - "latitude":"85.78", - "altitude":"4000.4"} + my_list_how_instrument={"instrument_description":request.form['instrument']} # one dictionary for all field description my_list_description = {"what":request.form['description']} - # cas d'une liste - # peu utile ici on a tj besoin de key value - print (my_list_how["data_source_type"]) - print (template.render(voevent_id=voevent_id, - my_shortname=my_shortname, - my_contactname=my_contactname, - my_contactphone=my_contactphone, - my_contactemail=my_contactemail, - my_datetime=my_datetime, - my_city=my_city, - my_country=my_country, - my_list_what=my_list_what, - my_list_wherewhen_target=my_list_wherewhen_target, - my_list_wherewhen_time=my_list_wherewhen_time, - my_list_how=my_list_how, - my_list_how_instrument=my_list_how_instrument, - my_list_how_obs_location=my_list_how_obs_location, - my_list_description=my_list_description, - my_groupname_source=my_groupname_source, - my_list_groupname_source=my_list_groupname_source, - my_groupname=my_groupname, - my_list_groupname=my_list_groupname)) - output_filename = '/var/tmp/new_voevent_example.xml' + output_filename = '/var/tmp/new_voevent.xml' new_voevent = open(output_filename,'w') new_voevent.write(template.render(voevent_id=voevent_id, - my_shortname=my_shortname, - my_contactname=my_contactname, - my_contactphone=my_contactphone, - my_contactemail=my_contactemail, + my_shortname=request.form['shortname'], + my_contactname=request.form['observer'], + my_contactphone=request.form['phone'], + my_contactemail=request.form['mail'], my_datetime=my_datetime, - my_city=my_city, - my_country=my_country, + my_city=request.form['city'], + my_country=request.form['country'], my_list_what=my_list_what, my_list_wherewhen_target=my_list_wherewhen_target, my_list_wherewhen_time=my_list_wherewhen_time, - my_list_how=my_list_how, my_list_how_instrument=my_list_how_instrument, - my_list_how_obs_location=my_list_how_obs_location, my_list_description=my_list_description, my_groupname_source=my_groupname_source, my_list_groupname_source=my_list_groupname_source, @@ -145,12 +99,7 @@ def indexlunar(): voevent_id = uuid.uuid4() # Get the date date=str(datetime.datetime.strptime(request.form['DateTime'],"%Y-%m-%d %H:%M:%S")) - year = int(date[0:4]) - month = int(date[5:7]) - day = int(date[8:10]) - hour = int(date[11:13]) - mn = int(date[14:16]) - seconds = int(date[17:19]) + my_datetime=date[0:10]+"T"+date[11:19] # Set the basic packet ID and Author details @@ -159,14 +108,6 @@ def indexlunar(): TEMPLATE_FILE = "/tmp/voevent-lunar.xml" template = templateEnv.get_template( TEMPLATE_FILE ) - my_datetime=date - my_datetime=date[0:10]+"T"+date[11:19] - my_shortname=request.form['shortname'] - my_contactname=request.form['observer'] - my_contactphone=request.form['phone'] - my_contactemail=request.form['mail'] - my_city=request.form['city'] - my_country=request.form['country'] # using dictionary to fill information # case of what list [value, datatype, ucd] @@ -187,60 +128,25 @@ def indexlunar(): my_list_wherewhen_time={"time_obs":"2017-02-24T11:07:28.1Z", "time_scale":"UTC", "target_origin":"Earth"} - my_list_how={"data_source_type":"observation"} - my_list_how_instrument={"instrument_host_name":"My Home", - "instrument_name":"Celestron 8", - "observer_name":"Pierre Le Sidaner", - "observer_country":"France"} - my_list_how_obs_location={"obs_longitude":"45.147", - "obs_latitude":"85.78", - "obs_altitude":"4000.4"} - my_list_whenwhere_observatory_location={"longitude":"45.147", - "latitude":"85.78", - "altitude":"4000.4"} + my_list_how_instrument={"instrument_description":request.form['instrument']} # one dictionary for all field description my_list_description = {"what":request.form['description']} - - # cas d'une liste - # peu utile ici on a tj besoin de key value - print (my_list_how["data_source_type"]) - print (template.render(voevent_id=voevent_id, - my_shortname=my_shortname, - my_contactname=my_contactname, - my_contactphone=my_contactphone, - my_contactemail=my_contactemail, - my_datetime=my_datetime, - my_city=my_city, - my_country=my_country, - my_list_what=my_list_what, - my_list_wherewhen_target=my_list_wherewhen_target, - my_list_wherewhen_time=my_list_wherewhen_time, - my_list_how=my_list_how, - my_list_how_instrument=my_list_how_instrument, - my_list_how_obs_location=my_list_how_obs_location, - my_list_description=my_list_description, - my_groupname_source=my_groupname_source, - my_list_groupname_source=my_list_groupname_source, - my_groupname=my_groupname, - my_list_groupname=my_list_groupname)) - output_filename = '/var/tmp/new_voevent_example.xml' + output_filename = '/var/tmp/new_voevent.xml' new_voevent = open(output_filename,'w') new_voevent.write(template.render(voevent_id=voevent_id, - my_shortname=my_shortname, - my_contactname=my_contactname, - my_contactphone=my_contactphone, - my_contactemail=my_contactemail, + my_shortname=request.form['shortname'], + my_contactname=request.form['observer'], + my_contactphone=request.form['phone'], + my_contactemail=request.form['mail'], my_datetime=my_datetime, - my_city=my_city, - my_country=my_country, + my_city=request.form['city'], + my_country=request.form['country'], my_list_what=my_list_what, my_list_wherewhen_target=my_list_wherewhen_target, my_list_wherewhen_time=my_list_wherewhen_time, - my_list_how=my_list_how, my_list_how_instrument=my_list_how_instrument, - my_list_how_obs_location=my_list_how_obs_location, my_list_description=my_list_description, my_groupname_source=my_groupname_source, my_list_groupname_source=my_list_groupname_source, @@ -263,12 +169,7 @@ def indexcomet(): voevent_id = uuid.uuid4() # Get the date date=str(datetime.datetime.strptime(request.form['DateTime'],"%Y-%m-%d %H:%M:%S")) - year = int(date[0:4]) - month = int(date[5:7]) - day = int(date[8:10]) - hour = int(date[11:13]) - mn = int(date[14:16]) - seconds = int(date[17:19]) + my_datetime=date[0:10]+"T"+date[11:19] # Set the basic packet ID and Author details @@ -277,14 +178,6 @@ def indexcomet(): TEMPLATE_FILE = "/tmp/voevent-comet.xml" template = templateEnv.get_template( TEMPLATE_FILE ) - my_datetime=date - my_datetime=date[0:10]+"T"+date[11:19] - my_shortname=request.form['shortname'] - my_contactname=request.form['observer'] - my_contactphone=request.form['phone'] - my_contactemail=request.form['mail'] - my_city=request.form['city'] - my_country=request.form['country'] # using dictionary to fill information # case of what list [value, datatype, ucd] @@ -304,29 +197,16 @@ def indexcomet(): # one dictionary for all field description my_list_description = {"what":"Tail disconnection of comet 67P"} - print (template.render(voevent_id=voevent_id, - my_shortname=my_shortname, - my_contactname=my_contactname, - my_contactphone=my_contactphone, - my_contactemail=my_contactemail, - my_datetime=my_datetime, - my_city=my_city, - my_country=my_country, - my_list_what=my_list_what, - my_list_wherewhen_target=my_list_wherewhen_target, - my_list_description=my_list_description, - my_groupname=my_groupname, - my_list_groupname=my_list_groupname)) - output_filename = '/var/tmp/new_voevent_example.xml' + output_filename = '/var/tmp/new_voevent.xml' new_voevent = open(output_filename,'w') new_voevent.write(template.render(voevent_id=voevent_id, - my_shortname=my_shortname, - my_contactname=my_contactname, - my_contactphone=my_contactphone, - my_contactemail=my_contactemail, + my_shortname=request.form['shortname'], + my_contactname=request.form['observer'], + my_contactphone=request.form['phone'], + my_contactemail=request.form['mail'], my_datetime=my_datetime, - my_city=my_city, - my_country=my_country, + my_city=request.form['city'], + my_country=request.form['country'], my_list_what=my_list_what, my_list_wherewhen_target=my_list_wherewhen_target, my_list_description=my_list_description, diff --git a/flask_app/app/new_voevent.xml b/flask_app/app/new_voevent.xml new file mode 100644 index 0000000..c2f2b47 --- /dev/null +++ b/flask_app/app/new_voevent.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<voe:VOEvent ivorn="ivo://vopdc.obspm/VOEvent/#01604fa2-6b43-467b-aa51-861c54eff5c7" + role="test" version="2.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:voe="http://www.ivoa.net/xml/VOEvent/v2.0" + xsi:schemaLocation="http://www.ivoa.net/xml/VOEvent/v2.0 http://www.ivoa.net/xml/VOEvent/VOEvent-v2.0.xsd"> + <Who> + <AuthorIVORN>ivo://psws/not_registered_yet</AuthorIVORN> + <Author> + <shortName>MG</shortName> + <contactName>Michel GANGLOFF</contactName> + <contactPhone>604086971</contactPhone> + <contactEmail>Michel.Gangloff@yahoo.fr</contactEmail> + </Author> + <Date>2017-09-27T10:47:00</Date> + </Who> + <What> + <Description> + Location of observation : Toulouse,France + M + </Description> + <Param name="event_status" value="finished" dataType="string" ucd="meta.flag" /> + <Param name="event_type" value="giant planet fireball" dataType="string" ucd="meta.flag" /> + <Group name="target"> + <Param name="target_name" value="Jupiter" dataType="string" ucd="meta.id" /> + <Param name="target_class" value="planet" dataType="string" ucd="meta.id" /> + <Param name="target_region" value="atmosphere" dataType="string" ucd="meta.id" /> + <Param name="latitude" value="0" dataType="float" ucd="pos.bodyrc.lat" unit="deg" /> + <Param name="longitude" value="0" dataType="float" ucd="pos.bodyrc.lon" unit="deg" /> + </Group> + <Group name="source"> + <Param name="target_name" value="0" dataType="string" ucd="meta.id" /> + <Param name="target_class" value="comet" dataType="string" ucd="meta.id" /> + <Param name="target_region" value="trail" dataType="string" ucd="meta.id" /> + </Group> + </What> + <WhereWhen> + <ObsDataLocation> + <ObservatoryLocation> + <AstroCoordSystem/> + <AstroCoords/> + </ObservatoryLocation> + <ObservationLocation> + <AstroCoordSystem/> + <AstroCoords> + <Time unit="s"> + <TimeInstant> + <ISOTime>2017-09-27T10:47:00</ISOTime> + </TimeInstant> + </Time> + </AstroCoords> + </ObservationLocation> + </ObsDataLocation> + </WhereWhen> + <How> + <Description> + 0 + </Description> + <Reference uri="https://TBD.html" type="url" /> + </How> + <Why> + <Concept>http://TBD</Concept> + <Description>Comet observation</Description> + <Name>67P</Name> + </Why> + <Description> + </Description> +</voe:VOEvent> \ No newline at end of file diff --git a/flask_app/app/templates/index-lunar.html b/flask_app/app/templates/index-lunar.html index ca6f746..29df358 100644 --- a/flask_app/app/templates/index-lunar.html +++ b/flask_app/app/templates/index-lunar.html @@ -64,6 +64,9 @@ {{ form.comet.label }}<br> {{ form.comet }} <br> +{{ form.instrument.label }}<br> + {{ form.instrument }} +<br> {{ form.submit }} </div> </fieldset> diff --git a/flask_app/app/templates/index.html b/flask_app/app/templates/index.html index e76de3d..74487a5 100644 --- a/flask_app/app/templates/index.html +++ b/flask_app/app/templates/index.html @@ -65,6 +65,9 @@ {{ form.comet.label }}<br> {{ form.comet }} <br> +{{ form.instrument.label }}<br> + {{ form.instrument }} +<br> {{ form.submit }} </div> </fieldset> diff --git a/flask_app/app/templates/voevent-psws.html b/flask_app/app/templates/voevent-psws.html deleted file mode 100644 index b724a61..0000000 --- a/flask_app/app/templates/voevent-psws.html +++ /dev/null @@ -1,20 +0,0 @@ -<html> - <body> - - <form action = "./result" method = "POST"> - <p>ObservatoryLocation <input type = "text" name = "observatorylocation" /></p> - <p>CoordinateSystem <input type = "text" name = "Coordsys" /></p> - <p>Date <input type = "text" name = "date" /></p> - <p>RA <input type ="text" name = "ra" /></p> - <p>DEC <input type ="text" name = "dec" /></p> - <p>Error2Radius <input type ="text" name = "errortoradius" /></p> - <p>Instrument Description <input type ="text" name = "instrumentdescription" /></p> - <p>Instrument Reference <input type ="text" name = "instrumentreference" /></p> - <p>Inference Name <input type ="text" name = "inferencename" /></p> - <p>Inference Concept <input type ="text" name = "inferenceconcept" /></p> - <p>Citations <input type ="text" name = "citations" /></p> - <p><input type = "submit" value = "submit" /></p> - </form> - - </body> -</html> diff --git a/flask_app/app/templates/voevent.xml b/flask_app/app/templates/voevent.xml deleted file mode 100644 index 8a89bd4..0000000 --- a/flask_app/app/templates/voevent.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<voe:VOEvent ivorn="ivo://vopdc.obspm/VOEvent/#{{voevent_id}}" - role="observation" version="2.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:voe="http://www.ivoa.net/xml/VOEvent/v2.0" - xsi:schemaLocation="http://www.ivoa.net/xml/VOEvent/v2.0 http://www.ivoa.net/xml/VOEvent/VOEvent-v2.0.xsd"> - - <Who> - <AuthorIVORN>ivo://psws/not_registered_yet</AuthorIVORN> - <Author> - <shortName>amateur</shortName> - <contactName>Pierre Le Sidaner</contactName> - <contactPhone>+33-1 40 51 20 82</contactPhone> - <contactEmail>pierre.lesidaner@obspm.fr</contactEmail> - </Author> - <Date>{{my_datetime}}</Date> - </Who> - <What> - <Description>{{my_list_description["what"]}}</Description> - {%- for key, value in my_list_what.items() %} - <Param name="{{key}}" value="{{value[0]}}" dataType="{{value[1]}}" ucd="{{value[2]}}" /> - {%- endfor %} - {%- for group_param in my_list_groupname %} - <Group name={{my_groupname}}> - {%- for key, value in group_param.items() %} - <Param name="{{key}}" value="{{value[0]}}" dataType="{{value[1]}}" ucd="{{value[2]}}" /> - {%- endfor %} - </Group> - {%- endfor %} - </What> - <WhereWhen> - <ObsDataLocation > - <ObservatoryLocation id="GEOSURFACE" > - <AstroCoordSystem id="UTC-GEOD-TOPO"/> - <AstroCoords coord_system_id="UTC-GEOD-TOPO"> - <Position3D> - - - <ObservationLocation> - <AstroCoordSystem id="UTC-ICRS-TOPO" /> - <AstroCoords coord_system_id="UTC-ICRS-TOPO"> - <Time unit="s"> - <TimeInstant> - <ISOTime>{{my_list_wherewhen_time["time_obs"]}}</ISOTime> - </TimeInstant> - </Time> - <Position2D unit="deg"> - <Value2> - <C1>277.5794</C1> - <!-- RA --> - <C2>-62.3326</C2> - <!-- Dec --> - </Value2> - <Error2Radius>0.0500</Error2Radius> - </Position2D> - </AstroCoords> - </ObservationLocation> - </ObsDataLocation> - </WhereWhen> - <How> - <Description>{{my_list_how_instrument["instrument_name"]}}</Description> - <Reference uri="https://TBD.html" type="url" /> - </How> - <Why> - <Concept>http://TBD</Concept> - <Description>Comet observation</Description> - <Name>{{my_list_wherewhen_target["target_name"]}}</Name> - - - </Why> - <Description> - </Description> -</voe:VOEvent> diff --git a/flask_app/app/voevent.xml b/flask_app/app/voevent.xml deleted file mode 100644 index 8a89bd4..0000000 --- a/flask_app/app/voevent.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<voe:VOEvent ivorn="ivo://vopdc.obspm/VOEvent/#{{voevent_id}}" - role="observation" version="2.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:voe="http://www.ivoa.net/xml/VOEvent/v2.0" - xsi:schemaLocation="http://www.ivoa.net/xml/VOEvent/v2.0 http://www.ivoa.net/xml/VOEvent/VOEvent-v2.0.xsd"> - - <Who> - <AuthorIVORN>ivo://psws/not_registered_yet</AuthorIVORN> - <Author> - <shortName>amateur</shortName> - <contactName>Pierre Le Sidaner</contactName> - <contactPhone>+33-1 40 51 20 82</contactPhone> - <contactEmail>pierre.lesidaner@obspm.fr</contactEmail> - </Author> - <Date>{{my_datetime}}</Date> - </Who> - <What> - <Description>{{my_list_description["what"]}}</Description> - {%- for key, value in my_list_what.items() %} - <Param name="{{key}}" value="{{value[0]}}" dataType="{{value[1]}}" ucd="{{value[2]}}" /> - {%- endfor %} - {%- for group_param in my_list_groupname %} - <Group name={{my_groupname}}> - {%- for key, value in group_param.items() %} - <Param name="{{key}}" value="{{value[0]}}" dataType="{{value[1]}}" ucd="{{value[2]}}" /> - {%- endfor %} - </Group> - {%- endfor %} - </What> - <WhereWhen> - <ObsDataLocation > - <ObservatoryLocation id="GEOSURFACE" > - <AstroCoordSystem id="UTC-GEOD-TOPO"/> - <AstroCoords coord_system_id="UTC-GEOD-TOPO"> - <Position3D> - - - <ObservationLocation> - <AstroCoordSystem id="UTC-ICRS-TOPO" /> - <AstroCoords coord_system_id="UTC-ICRS-TOPO"> - <Time unit="s"> - <TimeInstant> - <ISOTime>{{my_list_wherewhen_time["time_obs"]}}</ISOTime> - </TimeInstant> - </Time> - <Position2D unit="deg"> - <Value2> - <C1>277.5794</C1> - <!-- RA --> - <C2>-62.3326</C2> - <!-- Dec --> - </Value2> - <Error2Radius>0.0500</Error2Radius> - </Position2D> - </AstroCoords> - </ObservationLocation> - </ObsDataLocation> - </WhereWhen> - <How> - <Description>{{my_list_how_instrument["instrument_name"]}}</Description> - <Reference uri="https://TBD.html" type="url" /> - </How> - <Why> - <Concept>http://TBD</Concept> - <Description>Comet observation</Description> - <Name>{{my_list_wherewhen_target["target_name"]}}</Name> - - - </Why> - <Description> - </Description> -</voe:VOEvent> diff --git a/flask_app/voevent-fireball.xml b/flask_app/voevent-fireball.xml index 601caf1..b37a0e6 100644 --- a/flask_app/voevent-fireball.xml +++ b/flask_app/voevent-fireball.xml @@ -51,7 +51,7 @@ <AstroCoords> <Time unit="s"> <TimeInstant> - <ISOTime>2017-10-12T12:00:05</ISOTime> + <ISOTime>{{my_datetime}}</ISOTime> </TimeInstant> </Time> </AstroCoords> @@ -59,7 +59,9 @@ </ObsDataLocation> </WhereWhen> <How> - <Description>{{my_list_how_instrument["instrument_name"]}}</Description> + <Description> + {{my_list_how_instrument["instrument_description"]}} + </Description> <Reference uri="https://TBD.html" type="url" /> </How> <Why> diff --git a/flask_app/voevent-lunar.xml b/flask_app/voevent-lunar.xml index 15ac6e7..2652c68 100644 --- a/flask_app/voevent-lunar.xml +++ b/flask_app/voevent-lunar.xml @@ -51,7 +51,7 @@ <AstroCoords> <Time unit="s"> <TimeInstant> - <ISOTime>2017-10-12T12:00:05</ISOTime> + <ISOTime>{{my_datetime}}</ISOTime> </TimeInstant> </Time> </AstroCoords> @@ -59,7 +59,9 @@ </ObsDataLocation> </WhereWhen> <How> - <Description>{{my_list_how_instrument["instrument_name"]}}</Description> + <Description> + {{my_list_how_instrument["instrument_description"]}} + </Description> <Reference uri="https://TBD.html" type="url" /> </How> <Why> diff --git a/flask_app/voevent.xml b/flask_app/voevent.xml deleted file mode 100644 index 8a89bd4..0000000 --- a/flask_app/voevent.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<voe:VOEvent ivorn="ivo://vopdc.obspm/VOEvent/#{{voevent_id}}" - role="observation" version="2.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:voe="http://www.ivoa.net/xml/VOEvent/v2.0" - xsi:schemaLocation="http://www.ivoa.net/xml/VOEvent/v2.0 http://www.ivoa.net/xml/VOEvent/VOEvent-v2.0.xsd"> - - <Who> - <AuthorIVORN>ivo://psws/not_registered_yet</AuthorIVORN> - <Author> - <shortName>amateur</shortName> - <contactName>Pierre Le Sidaner</contactName> - <contactPhone>+33-1 40 51 20 82</contactPhone> - <contactEmail>pierre.lesidaner@obspm.fr</contactEmail> - </Author> - <Date>{{my_datetime}}</Date> - </Who> - <What> - <Description>{{my_list_description["what"]}}</Description> - {%- for key, value in my_list_what.items() %} - <Param name="{{key}}" value="{{value[0]}}" dataType="{{value[1]}}" ucd="{{value[2]}}" /> - {%- endfor %} - {%- for group_param in my_list_groupname %} - <Group name={{my_groupname}}> - {%- for key, value in group_param.items() %} - <Param name="{{key}}" value="{{value[0]}}" dataType="{{value[1]}}" ucd="{{value[2]}}" /> - {%- endfor %} - </Group> - {%- endfor %} - </What> - <WhereWhen> - <ObsDataLocation > - <ObservatoryLocation id="GEOSURFACE" > - <AstroCoordSystem id="UTC-GEOD-TOPO"/> - <AstroCoords coord_system_id="UTC-GEOD-TOPO"> - <Position3D> - - - <ObservationLocation> - <AstroCoordSystem id="UTC-ICRS-TOPO" /> - <AstroCoords coord_system_id="UTC-ICRS-TOPO"> - <Time unit="s"> - <TimeInstant> - <ISOTime>{{my_list_wherewhen_time["time_obs"]}}</ISOTime> - </TimeInstant> - </Time> - <Position2D unit="deg"> - <Value2> - <C1>277.5794</C1> - <!-- RA --> - <C2>-62.3326</C2> - <!-- Dec --> - </Value2> - <Error2Radius>0.0500</Error2Radius> - </Position2D> - </AstroCoords> - </ObservationLocation> - </ObsDataLocation> - </WhereWhen> - <How> - <Description>{{my_list_how_instrument["instrument_name"]}}</Description> - <Reference uri="https://TBD.html" type="url" /> - </How> - <Why> - <Concept>http://TBD</Concept> - <Description>Comet observation</Description> - <Name>{{my_list_wherewhen_target["target_name"]}}</Name> - - - </Why> - <Description> - </Description> -</voe:VOEvent> -- libgit2 0.21.2