Mercurial > repos > mnhn65mo > netcdf_handler
comparison netcdf_metadata_info.xml @ 0:8da8ec7da45f draft default tip
Uploaded
author | mnhn65mo |
---|---|
date | Thu, 02 Aug 2018 09:24:38 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:8da8ec7da45f |
---|---|
1 <tool id="netcdf-metadata_info" name="Netcdf Metadata Info" version="0.1.0"> | |
2 <description>summarize content of a nc file</description> | |
3 <requirements> | |
4 <requirement type="package" version="1.1.6">netcdf-metadata-info</requirement> | |
5 </requirements> | |
6 <command detect_errors="exit_code"><![CDATA[ | |
7 netcdf-metadata-info '$input' | |
8 && | |
9 while read -r l;do | |
10 a=\$(echo \$l | cut -d' ' -f1);echo \$l>dimensions_\$a | |
11 ;done <variables.tabular | |
12 && | |
13 rm dimensions_VariableName | |
14 && | |
15 for f in dimensions_*; do cat \$f | sed 's/ /\t\n/g' | sed '\$s/$/ /' >\$f.tabular ; done | |
16 && | |
17 for f in dimensions_*.tabular;do | |
18 awk 'NR % 2 != 0' \$f > \$f.2 | |
19 && | |
20 sed 1d \$f.2 > \$f | |
21 && | |
22 rm \$f.2 | |
23 ;done | |
24 && | |
25 ncdump -h '$input' > '$info' | |
26 ]]></command> | |
27 <inputs> | |
28 <param type="data" name="input" label="Netcdf file" format="netcdf,h5" help="Netcdf file you need information about."/> | |
29 </inputs> | |
30 <outputs> | |
31 <!-- | |
32 <data name="var_tabs" format="tabular"> | |
33 <discover_datasets pattern="__designation_and_ext__" visible="true"/> | |
34 <discover_datasets pattern="conda_activate.log" visible="false"/> | |
35 </data> | |
36 --> | |
37 <data name="output" format="tabular" label="Metadata infos from ${input.name}.Variables.tab" from_work_dir="variables.tabular"/> | |
38 <data name="info" label="info file" format="txt"/> | |
39 </outputs> | |
40 | |
41 <help><![CDATA[ | |
42 **What it does** | |
43 | |
44 First the tool will give general information about the input in a 'info file' output. (command $ncdump -h inputfile) | |
45 | |
46 Then, a general tabular 'variables' summarize dimensions details inside each available variable. | |
47 | |
48 | |
49 The summary tabular file has the general structure : | |
50 | |
51 | |
52 Variable1 Var1_Number_of_Dim Dim1 Dim1_size ... DimN DimN_size | |
53 | |
54 VariableX VarX_Number_of_Dim DimX1 DimX1_size ... DimXN DimXN_size | |
55 | |
56 ... | |
57 | |
58 | |
59 **Input** | |
60 | |
61 A netcdf file (xxx.nc). | |
62 | |
63 **Outputs** | |
64 | |
65 An Information file. | |
66 | |
67 A summary tabular file. | |
68 | |
69 | |
70 -------------------------------- | |
71 | |
72 The Netcdf Info tool use the netcdf functions : https://www.unidata.ucar.edu/software/netcdf/docs/index.html | |
73 | |
74 Run this tool before considering using Netcdf Read. | |
75 ]]></help> | |
76 | |
77 </tool> |