Commit e7cdc0afdf5ccee526f080e157f77e380892e7cf

Authored by Benjamin Renard
2 parents 13a84f26 c88da604

Merge branch 'master' into new-save-plot-request

generic_data/Functions/functions.xml
... ... @@ -132,9 +132,9 @@
132 132 <info_brief>Arc-tangent</info_brief>
133 133 <new_kernel>atan</new_kernel>
134 134 </function>
135   - <function name="atan2(,)" kind="math">
  135 + <function name="atan2(,)" params="2" kind="math">
136 136 <info_brief>Arc-tangent</info_brief>
137   - <new_kernel>atan_2f</new_kernel>
  137 + <new_kernel>atan2</new_kernel>
138 138 </function>
139 139 <function name="ceil()" kind="math">
140 140 <info_brief>Closest integer greater than or equal to its argument</info_brief>
... ...
js/app/models/PlotObjects/PlotObjectConfig.js
... ... @@ -333,7 +333,8 @@ Ext.define(&#39;amdaPlotObj.PlotObjectConfig&#39;, {
333 333 {'key' : '0', 'value' : 'Default'},
334 334 {'key' : '1', 'value' : 'Blue Red'},
335 335 {'key' : '2', 'value' : 'Blue Yellow'},
336   - {'key' : '3', 'value' : 'Grayscale'}
  336 + {'key' : '3', 'value' : 'Grayscale'},
  337 + {'key' : '4', 'value' : 'AMDA Default'},
337 338 ],
338 339  
339 340 availableColors : [
... ...
php/classes/CatalogCacheIntervalObject.php
... ... @@ -68,7 +68,7 @@ class CatalogCacheIntervalObject extends TimeTableCacheIntervalObject
68 68 }
69 69 break;
70 70 case 3: //int
71   - fwrite($handle,pack('L', intval($value)));
  71 + fwrite($handle,pack('l', intval($value)));
72 72 break;
73 73 default: // not defined => string
74 74 fwrite($handle,pack('L', strlen($value)));
... ... @@ -121,7 +121,7 @@ class CatalogCacheIntervalObject extends TimeTableCacheIntervalObject
121 121  
122 122 break;
123 123 case 3: //int
124   - if (!$res = unpack('Lval',fread($handle,4))) {
  124 + if (!$res = unpack('lval',fread($handle,4))) {
125 125 break;
126 126 }
127 127 $val = $res['val'];
... ...
update_amda/correctNan.php 0 → 100644
... ... @@ -0,0 +1,38 @@
  1 +<?php
  2 +
  3 + define("AMDA_INTERNAL_METADATA",getenv("AMDAINTERNALDIR"));
  4 +
  5 + $info = new DomDocument("1.0");
  6 + // $infoName = $argv[1];
  7 + $pattern = "info_psp_loic_*.xml";
  8 + foreach (glob(AMDA_INTERNAL_METADATA."/PARAM_INFO_PREDEFINED/".$pattern) as $infoName) {
  9 + $info->load($infoName);
  10 +
  11 + $dimensions = $info->getElementsByTagName("dimensions")->item(0);
  12 +
  13 + $dim_1 = $dimensions->getAttribute("dim_1");
  14 + $dim_2 = null;
  15 + if ($dimensions->hasAttribute("dim_2"))
  16 + $dim_2 = $dimensions->getAttribute("dim_2");
  17 +
  18 +
  19 + $tables = $info->getElementsByTagName("table");
  20 +
  21 + foreach ($tables as $table) {
  22 + $channels = $table->getElementsByTagName("channel");
  23 + $dim = $table->getAttribute("relatedDim");
  24 + if ( $dim == "dim_1" ) $dim_ = $dim_1;
  25 + if ( $dim == "dim_2" ) $dim_ = $dim_2;
  26 + if ($dim_ != $channels->length) {
  27 + $dimensions->setAttribute($dim, $channels->length);
  28 + echo $infoName.PHP_EOL;
  29 + echo $dim_." ".$channels->length.PHP_EOL;
  30 + }
  31 + }
  32 + $info->save($infoName);
  33 + }
  34 +
  35 +?>
  36 +
  37 +
  38 +
... ...
update_amda/remakeInfo.php 0 → 100644
... ... @@ -0,0 +1,59 @@
  1 +<?php
  2 +
  3 + function remove_children(&$node) {
  4 + while ($node->firstChild) {
  5 + while ($node->firstChild->firstChild) {
  6 + remove_children($node->firstChild);
  7 + }
  8 + $node->removeChild($node->firstChild);
  9 + }
  10 + }
  11 +
  12 + define("NEWMETA",getenv("NEWMETA"));
  13 + define("AMDA_INTERNAL_METADATA",getenv("AMDAINTERNALDIR"));
  14 +
  15 + $pattern = "info_psp_om*.xml";
  16 + $info = new DomDocument("1.0");
  17 +
  18 + // $infoName = $argv[1];
  19 + foreach (glob(NEWMETA."/ParamInfo/".$pattern) as $infoName) {
  20 +
  21 + $info->load($infoName);
  22 + $dimensions = $info->getElementsByTagName("dimensions")->item(0);
  23 +
  24 + if ($dimensions->hasAttribute("dim_2") && $dimensions->getAttribute("dim_2") == "1")
  25 + $dimensions->removeAttribute("dim_2");
  26 +
  27 + $components = $info->getElementsByTagName("components");
  28 + if ($components->length == 0) continue;
  29 + if ( !$components->item(0)->hasChildNodes() ) continue; // has been already processed
  30 + $a=$components->item(0);
  31 + remove_children($a);
  32 +
  33 + $channels = $info->getElementsByTagName("channel");
  34 + foreach ($channels as $channel) {
  35 + $min = $channel->getAttribute("min");
  36 + $max = $channel->getAttribute("max");
  37 +
  38 + if ( $min == "nan" ) {
  39 + $channel->setAttribute("min", "-");
  40 + }
  41 + if ( $max== "nan" ) {
  42 + $channel->setAttribute("max", "-");
  43 + }
  44 + if (is_numeric($min))
  45 + $channel->setAttribute("min",number_format($min,1,".",""));
  46 + if (is_numeric($max))
  47 + $channel->setAttribute("max",number_format($max,1,".",""));
  48 +
  49 + }
  50 + echo basename($infoName).PHP_EOL;
  51 + $info->save(AMDA_INTERNAL_METADATA."/PARAM_INFO_PREDEFINED/".basename($infoName));
  52 + }
  53 +
  54 +?>
  55 +
  56 +
  57 +
  58 +
  59 +
... ...