Commit 55e11e130b822a4cf5f4b3cd3816aafbeffc9d75
1 parent
d4a25a81
Exists in
master
and in
112 other branches
new global AMDAUPDATE
Showing
9 changed files
with
274 additions
and
101 deletions
Show diff stats
install_notes/AMDA_PLUS deleted
... | ... | @@ -1,12 +0,0 @@ |
1 | -These idl codes should be added to old AMDA installation in order AMDA-NG to work. | |
2 | - | |
3 | -Copy | |
4 | - | |
5 | - amdalib/* to /AMDALIB/lib | |
6 | - ddlib/* to /DDLIB/lib | |
7 | - predefined/* - pro specific for amda-ng don't copy; keep as it is | |
8 | - pro/* - pro specific for amda-ng don't copy; keep as it is | |
9 | - templates/* - pro specific for amda-ng don't copy; keep as it is | |
10 | - | |
11 | -Normally there should be no interference between old AMDA and AMDA-NG (TO CHECK) | |
12 | -So AMDA installation could be used with old AMDA as well as with AMDA-NG | |
13 | 0 | \ No newline at end of file |
install_notes/EPN_RESOURCES deleted
... | ... | @@ -1,80 +0,0 @@ |
1 | - | |
2 | -Petit récapitulatif des étapes qui ont été appliquées : | |
3 | - | |
4 | - 1 ère étape: Elle consistait à extraire les informations déjà présentes dans les descripteurs AMDA pour pre-remplir des EPN Resources. | |
5 | - | |
6 | - 2 ème étape: En utilisant l'interface de Natacha, les scientifiques ont remplis manuellement les descripteurs EPN Resources manquants (principalement les ressources planétaires). | |
7 | - | |
8 | - 3 ème étape: Un script a permis de reinjecter les informations ajoutées lors de la 2 ème étape dans les descripteurs AMDA. Le script en question a été ajouté au repository svn 'depotINFO_params', dans 'TOOLS/epnres2amda.php'.Théoriquement, il n'est plus nécessaire de l'utiliser. | |
9 | - | |
10 | - 4 ème étape: Le script AmdaUpdate.php, qui permet de faire une mise à jour des datasets dans AMDA, execute maintenant la création des EPN Resources via l'utilisation de la classe AMDA 'php/classe/EPNResourcesManager.php'. Il créait aussi le fichier 'instruments.xml' qui contient la liste des instruments. Ces fichiers sont créés dans le répertoire 'generic_data/EPNResources/' d'AMDA-NG. | |
11 | - | |
12 | - | |
13 | -Quelques remarques: | |
14 | - | |
15 | - Les étapes 1, 2 et 3 ont été introduites uniquement pour amorcer le process | |
16 | - | |
17 | - Dorénavant, seule l'étape 4 sera systématiquement appliquée pour générer les EPN Resources via les descripteurs AMDA lors d'une mise à jour AMDA. | |
18 | - | |
19 | - Il faut maintenant s'assurer de bien remplir tous les descripteurs dans AMDA, lorsque l'on ajoute une mission, un instrument, un dataset ou un paramètre. | |
20 | - | |
21 | - Les ressources qui n'ont pas été complétées lors de l'étape 2 devront être maintenant complétées depuis les descripteurs AMDA. Si cela se fait via l'interface de Natacha, il faudra envoyer une notification à l'équipe technique pour qu'ils impactent la modification manuellement dans les descripteurs d'AMDA. On ne re-appliquera plus l'étape 3, car le merge des infos est dangereux! | |
22 | - | |
23 | - Les descripteurs manquants (ie. non remplis lors de l'étape 2) sont repérés dans les descripteurs AMDA par 'ToDo'. Par exemple pour la mission MAVEN: | |
24 | - | |
25 | -<?xml version="1.0"?> | |
26 | -<dataRoot> | |
27 | - <dataCenter name="AMDA" desc="AMDA_Internal_Data_Base"> | |
28 | - <mission name="MAVEN" desc="Mars Atmosphere and Volatile Evolution Mission" class="ToDo"> | |
29 | - <instrument name="orbit" desc="MAVEN position" xml:id="ToDo" refURL="ToDo"> | |
30 | - <dataset name="orbit_maven" xml:id="mav:orb:mso"> | |
31 | - <info> | |
32 | - <title>ToDo</title> | |
33 | - <description>ToDo</description> | |
34 | - <creator>ToDo</creator> | |
35 | - <calibration>ToDo</calibration> | |
36 | - </info> | |
37 | - <sampling>300s</sampling> | |
38 | - <dataStart>2014/10/29</dataStart> | |
39 | - <dataStop>2015/10/26</dataStop> | |
40 | - <dataSource>NAIF/SPICE</dataSource> | |
41 | - <parameter name="xyz_mso" units="Rm" size="3" xml:id="mav_xyz_mso"> | |
42 | - <info> | |
43 | - <description>ToDo</description> | |
44 | - <ucd>ToDo</ucd> | |
45 | - <type>ToDo</type> | |
46 | - </info> | |
47 | - <component name="x" xml:id="mav_xyz_mso(0)"/> | |
48 | - <component name="y" xml:id="mav_xyz_mso(1)"/> | |
49 | - <component name="z" xml:id="mav_xyz_mso(2)"/> | |
50 | - </parameter> | |
51 | - <parameter name="r" units="Rm" xml:id="mav_orb_r"> | |
52 | - <info> | |
53 | - <description>ToDo</description> | |
54 | - <ucd>ToDo</ucd> | |
55 | - <type>ToDo</type> | |
56 | - </info> | |
57 | - </parameter> | |
58 | - </dataset> | |
59 | - </instrument> | |
60 | - </mission> | |
61 | - </dataCenter> | |
62 | -</dataRoot> | |
63 | - | |
64 | - L'ajout d'un nouveau target se fera dans le fichier 'targets.xml' contenu dans le repository svn 'depotINFO_params'. Ce fichier est exporté dans AMDA lors d'un AmdaUpdate. | |
65 | - | |
66 | - Il faudra penser à ajouter le mot 'spase' correspondant pour chaque target (car AMDA utilise ce data model, notamment pour les filtres), dans un tag 'attributeName'. Par exemple: | |
67 | - | |
68 | - <TargetType id="titan"> | |
69 | - <targetName>Titan</targetName> | |
70 | - <alternateName>naif:606</alternateName> | |
71 | - <alternateName>iau:SVI</alternateName> | |
72 | - <alternateName>spase:Titan</alternateName> | |
73 | - <description>Satellite of Saturn</description> | |
74 | - <targetClass id="sat">satellite</targetClass> | |
75 | - </TargetType> | |
76 | - | |
77 | - Les fichiers EPN Resources générés (ainsi que les fichiers 'instruments.xml' et 'targets.xml') peuvent très bien être ajoutés dans la base eXist utilisée par l'interface de Natacha pour pouvoir les visualiser plus facilement. | |
78 | - | |
79 | - EPNresource_cass_mag_krtp1s.xml est un exemple d'un EPN resource entièrement rempli via les descripteurs AMDA (contenus dans le fichier DD_Cassini.xml). Ne pas hésiter à le prendre en exemple pour bien comprendre les choses. | |
80 | - |
... | ... | @@ -0,0 +1,89 @@ |
1 | +<?php | |
2 | +/* | |
3 | +* | |
4 | +*/ | |
5 | + function days2MonthDay($date) | |
6 | + { | |
7 | + list($year, $day, $hour, $min, $sec) = sscanf($date, "%04d%03d%02d%02d%02d"); | |
8 | + | |
9 | + $newDate = date("Y-m-d\TH:i:s\Z",strtotime("+$day days",strtotime("$year-01-01 $hour:$min:$sec"))); | |
10 | + | |
11 | + return $newDate; | |
12 | + } | |
13 | + | |
14 | + $AMDA_IHM = getenv('AMDA_IHM'); | |
15 | + //TBD should be one dir with AmdaUpdate [install] and config | |
16 | + define('WSDL','http://amda-dev.irap.omp.eu/BASE/DDService/dd.wsdl'); | |
17 | + | |
18 | + require_once $AMDA_IHM."/php/config.php"; | |
19 | + | |
20 | + if (!file_exists(SimuTargetsXml)) | |
21 | + exit("ERROR : NO TargetsSimu FILE !!! Run makeProxy.php".PHP_EOL); | |
22 | + | |
23 | + $tr = array('_' => ':'); | |
24 | + | |
25 | + try { | |
26 | + $client = new SoapClient(WSDL); | |
27 | + } | |
28 | + catch (SoapFault $exception) { | |
29 | + $msg = $exception->faultstring.PHP_EOL; | |
30 | + exit($msg); | |
31 | + } | |
32 | + // Transform to HTML | |
33 | + $xsl = new DomDocument("1.0"); | |
34 | + $xsl->load(XMLPATH.'orbitsInfo.xsl'); | |
35 | + | |
36 | + $xslt = new XSLTProcessor(); | |
37 | + $xslt->importStylesheet($xsl); | |
38 | + | |
39 | + $targetXml = simplexml_load_file(SimuTargetsXml); | |
40 | + | |
41 | + $targets = $targetXml->Target; | |
42 | + | |
43 | + foreach ($targets as $target) | |
44 | + { | |
45 | + if (!file_exists(RemoteData."$target.json")) | |
46 | + exit("ERROR : NO $target.json FILE !!! Run makeOrbitsArgs.php".PHP_EOL); | |
47 | + | |
48 | + $infoFileName = "simu$target"; | |
49 | + $infoDom = new DomDocument("1.0"); | |
50 | + | |
51 | + $root = $infoDom->createElement('target'); | |
52 | + $root->setAttribute('name', $target); | |
53 | + $infoDom->appendChild($root); | |
54 | + | |
55 | + $orbits = json_decode(file_get_contents(RemoteData.$target.'.json'), true); | |
56 | + | |
57 | + foreach ($orbits as $missionGroup => $missions) | |
58 | + { | |
59 | + $missionGrpNode = $infoDom->createElement('missionGroup'); | |
60 | + $missionGrpNode->setAttribute('name', $missionGroup); | |
61 | + $root->appendChild($missionGrpNode); | |
62 | + | |
63 | + foreach ($missions as $missionName => $mission) | |
64 | + { | |
65 | + $missionNode = $infoDom->createElement('mission'); | |
66 | + $missionNode->setAttribute('name', $missionName); | |
67 | + $missionGrpNode->appendChild($missionNode); | |
68 | + | |
69 | + foreach ($mission as $ds => $param) | |
70 | + { | |
71 | + try { | |
72 | + $res = $client->getStartStop(strtr($ds,$tr)); | |
73 | + $Time = explode("-",$res); | |
74 | + $StartTime = days2MonthDay($Time[0]); | |
75 | + $StopTime = days2MonthDay($Time[1]); | |
76 | + $missionNode->appendChild($infoDom->createElement('start',$StartTime)); | |
77 | + $missionNode->appendChild($infoDom->createElement('stop',$StopTime)); | |
78 | + } | |
79 | + catch (SoapFault $exception) { | |
80 | + $msg = $exception->faultstring.PHP_EOL; | |
81 | + exit($msg); | |
82 | + } | |
83 | + } | |
84 | + } | |
85 | + } | |
86 | + // $infoDom->save($infoFileName.".xml"); | |
87 | + $xslt->transformToURI($infoDom, 'file://'.HELPPATH.'simu/'.$infoFileName); | |
88 | + } | |
89 | +?> | |
0 | 90 | \ No newline at end of file |
... | ... |
... | ... | @@ -0,0 +1,28 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<xsl:stylesheet xmlns:default="http://www.spase-group.org/data/schema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1"> | |
3 | +<xsl:template match="/target"> | |
4 | +<html> | |
5 | + <body> | |
6 | + <h2> | |
7 | + <xsl:value-of select="@name"/> | |
8 | + </h2> | |
9 | + <p>The following missions are available : | |
10 | + <ul> | |
11 | + <!--<xsl:for-each select="missionGroup"> | |
12 | + <xsl:if test="not(@name = 'None')"> | |
13 | + <b><i><xsl:value-of select="@name"/></i></b> | |
14 | + </xsl:if>--> | |
15 | + <xsl:for-each select="missionGroup/mission"> | |
16 | + <li> | |
17 | + <b><xsl:value-of select="@name"/></b><br/> | |
18 | + <xsl:value-of select="start"/> - | |
19 | + <xsl:value-of select="stop"/> | |
20 | + </li> | |
21 | + </xsl:for-each> | |
22 | + <!--</xsl:for-each>--> | |
23 | + </ul> | |
24 | + </p> | |
25 | +</body> | |
26 | +</html> | |
27 | +</xsl:template> | |
28 | +</xsl:stylesheet> | |
... | ... |
php/classes/UserMgr.php
... | ... | @@ -546,11 +546,13 @@ class UserMgr |
546 | 546 | touch($this->userdir.'newLogin'); |
547 | 547 | |
548 | 548 | $this->setPath(); |
549 | - $this->userMissions = $this->getAvailableMissionsByUser(); | |
550 | - | |
551 | - if (!file_exists(USERWSDIR.'LocalParams.xml')) | |
552 | - symlink(DATAPATH.'/LocalParams.xml', USERWSDIR.'LocalParams.xml'); | |
553 | - | |
549 | + $this->userMissions = $this->getAvailableMissionsByUser(); | |
550 | + | |
551 | + if (file_exists(USERWSDIR.'LocalParams.xml')) | |
552 | + unlink(USERWSDIR.'LocalParams.xml'); | |
553 | + // if (!file_exists(USERWSDIR.'LocalParams.xml')) | |
554 | + symlink(DATAPATH.'/LocalData/LocalParams.xml', USERWSDIR.'LocalParams.xml'); | |
555 | + | |
554 | 556 | $ok = $this->makeRemoteTree(); |
555 | 557 | |
556 | 558 | if (!file_exists(USERWSDIR.'Request.xml')) $reqMgr = new RequestMgr(); |
... | ... | @@ -561,7 +563,7 @@ class UserMgr |
561 | 563 | $sessionID = $this->user; |
562 | 564 | |
563 | 565 | /* |
564 | - * Special groups are defined in the generoc_data/SpecialSettings/Groups.xml | |
566 | + * Special groups are defined in the generic_data/SpecialSettings/Groups.xml | |
565 | 567 | */ |
566 | 568 | $specialGroup = $this->isSpecialGroup(); |
567 | 569 | |
... | ... |
php/makeOrbits
php/makeRemote
... | ... | @@ -0,0 +1,124 @@ |
1 | +#!/bin/bash | |
2 | + | |
3 | +# --install | -i ; --with-remote | -r ; --generate-param-args | -a ; | |
4 | +# --spase-synchro | -s ; --clean-new-meta | -c ; --help | -h; | |
5 | + | |
6 | +. updateEnv.sh | |
7 | + | |
8 | + for option in $@ | |
9 | + do | |
10 | + case $option in | |
11 | + --install | -i) INSTALL=1 | |
12 | + ;; | |
13 | + --with-remote | -r) REMOTE=1 | |
14 | + ;; | |
15 | + --generate-param-args | -a) PARAM_INFO=1 | |
16 | + ;; | |
17 | + --spase-synchro | -s) SYNCHRO=1 | |
18 | + ;; | |
19 | + --clean-new-meta | -c) CLEAN_NEWMETA=1 | |
20 | + ;; | |
21 | + --help | -h) echo "updateAmda --install | -i ; --with-remote | -r ; --generate-param-args | -a ; --spase-synchro | -s ; --clean-new-meta | -c ; --help | -h;" | |
22 | + echo "updateAmda without args : update only" | |
23 | + exit | |
24 | + ;; | |
25 | + *) echo "Invalid option" $option | |
26 | + exit | |
27 | + ;; | |
28 | + esac | |
29 | + done | |
30 | + | |
31 | + #Please export DDUSER and DDPASS in the shell !!!! | |
32 | + if [ $PARAM_INFO ] && [[ -z ${DDUSER+x} || -z ${DDPASS+x} ]] | |
33 | + then | |
34 | + echo "Warning : DDUSER and DDPASS should be defined to generate params info" | |
35 | + echo "No params info generation will be done!!!" | |
36 | + unset PARAM_INFO | |
37 | + #export DDUSER=XXXX | |
38 | + #export DDPASS=XXXX | |
39 | + fi | |
40 | + | |
41 | + # In the case of SPASE synchro export SPASEUSER | |
42 | + if [ -z ${SPASEUSER+x} ] && [ $SYNCHRO ] | |
43 | + then | |
44 | + echo "SPASEUSER should be defined to SYNCHRO SPASE Registry" | |
45 | + echo "No SYNHRO wil be done!!!" | |
46 | + #export SPASEUSER=XXXX | |
47 | + unset SYNCHRO | |
48 | + fi | |
49 | + | |
50 | + if [ $INSTALL ] | |
51 | + then | |
52 | + echo "Installing...." | |
53 | + | |
54 | + echo "cleaning in NEWMETA.." | |
55 | + cleanNewMetaLight | |
56 | + echo "clean in NEWMETA : done" | |
57 | + | |
58 | + echo "cleaning in AMDA_IHM/generic_data AMDA_Kernel/config..." | |
59 | + cleanExistingInstallation | |
60 | + echo "clean in AMDA_IHM/generic_data AMDA_Kernel/config : done" | |
61 | + | |
62 | + echo "making Amda From Spase..." | |
63 | + if [ $SYNCHRO ] | |
64 | + then | |
65 | + php $AMDA_SPASE_INTERFACE/makeAmdaFromSpase.php "synchro" | |
66 | + else | |
67 | + php $AMDA_SPASE_INTERFACE/makeAmdaFromSpase.php | |
68 | + fi | |
69 | + echo "make Amda From Spase : done" | |
70 | + | |
71 | + echo "making Tree..." | |
72 | + php $AMDA_SPASE_INTERFACE/makeTree.php | |
73 | + echo "make Tree : done" | |
74 | + | |
75 | + echo "copying 2 amda..." | |
76 | + cp2amda | |
77 | + echo "copy 2 amda : done" | |
78 | + | |
79 | + echo "making Orbits..." | |
80 | + makeOrbits | |
81 | + echo "make Orbits : done" | |
82 | + # Update StartStop only | |
83 | + else | |
84 | + echo "Updating...." | |
85 | + | |
86 | + if [ $SYNCHRO ] | |
87 | + then | |
88 | + php $AMDA_SPASE_INTERFACE/updateStartStop.php 'synchro' | |
89 | + else | |
90 | + php $AMDA_SPASE_INTERFACE/updateStartStop.php 'synchro' | |
91 | + | |
92 | + fi | |
93 | + echo 'update in NEWMETA/dd_missions: done' | |
94 | + | |
95 | + echo "making Tree..." | |
96 | + php $AMDA_SPASE_INTERFACE/makeTree.php | |
97 | + echo "make Tree : done" | |
98 | + | |
99 | + if [ -d $AMDAINSTALLATION/AMDA_IHM/generic_data/LocalData ] && [ -e $AMDA_SPASE_INTERFACE/LocalParams.xml ] | |
100 | + then | |
101 | + cp $AMDA_SPASE_INTERFACE/LocalParams.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/LocalData | |
102 | + fi | |
103 | + echo 'copy 2 amda : done' | |
104 | + fi | |
105 | + | |
106 | + if [ $PARAM_INFO ] | |
107 | + then | |
108 | + echo "Generating param info...." | |
109 | + | |
110 | + cleanNewMetaAll | |
111 | + generate_param_info | |
112 | + | |
113 | + echo "generate info for arguments : done" | |
114 | + fi | |
115 | + | |
116 | + if [ $CLEAN_NEW_META ]; then cleanNewMetaLight; fi | |
117 | + | |
118 | + if [ $REMOTE ] | |
119 | + then | |
120 | + echo "making Remote" | |
121 | + makeRemote | |
122 | + echo "make Remote : done" | |
123 | + fi | |
124 | + | |
0 | 125 | \ No newline at end of file |
... | ... |
... | ... | @@ -0,0 +1,22 @@ |
1 | +#!/bin/bash | |
2 | + | |
3 | + export AMDA_SPASE_INTERFACE=~/AMDA_SPASE_INTERFACE/ | |
4 | + # info dirs will be written here | |
5 | + export NEWMETA=~/NEWMETA/ | |
6 | + # AMDA internal parameter XMLs | |
7 | + export AMDAINTERNALDIR=~/AMDA_INTERNAL_METADATA/ | |
8 | + # AMDA Installation | |
9 | + export AMDAINSTALLATION=~/AMDA | |
10 | + # DD Installation | |
11 | + export DDROOT=/opt/local | |
12 | + # GCC Installation | |
13 | + export GCCROOT=/opt/tools/gcc/4.7.2/rtf | |
14 | + #AMDA_Kernel build type to use for paraminfo generation | |
15 | + export BUILD_TYPE=Release | |
16 | + | |
17 | + export AMDA_IHM=$AMDAINSTALLATION/AMDA_IHM | |
18 | + export LD_LIBRARY_PATH=$GCCROOT/lib64:$GCCROOT/lib:$DDROOT/lib | |
19 | + export PATH=./:$GCCROOT/bin:$DDROOT/bin:$AMDA_SPASE_INTERFACE:$AMDA_IHM/php:$PATH | |
20 | + | |
21 | + | |
22 | + | |
... | ... |