Commit 80b3946d714623618c94fd3da7f28e44cee959ea
1 parent
17e47c9e
Exists in
master
and in
92 other branches
Fix NaN for HAPI (#6318)
Showing
2 changed files
with
6 additions
and
2 deletions
Show diff stats
php/hapi/getData.php
... | ... | @@ -109,7 +109,11 @@ while(1) |
109 | 109 | foreach ($columns as $col_key => $col_name) { |
110 | 110 | if ($col_key != 0) |
111 | 111 | echo ","; |
112 | - echo trim($data[$col_key]); | |
112 | + $val = trim($data[$col_key]); | |
113 | + if ($val == "NaN") { | |
114 | + $val = "-1e31"; | |
115 | + } | |
116 | + echo $val; | |
113 | 117 | if ($col_key == 0) |
114 | 118 | echo "Z"; |
115 | 119 | } |
... | ... |
update_amda/makeHAPIMetadata.php
... | ... | @@ -199,7 +199,7 @@ foreach ($dataset_nodes as $dataset_node) { |
199 | 199 | $parameter->{"units"} = $units; |
200 | 200 | |
201 | 201 | //fill |
202 | - $parameter->{"fill"} = "NaN"; | |
202 | + $parameter->{"fill"} = "-1e31"; | |
203 | 203 | |
204 | 204 | //description |
205 | 205 | $description = $parameter_node->getAttribute("description"); |
... | ... |