Repository revision
0:d5355f6fa02b

Repository 'cdo_operations'
hg clone https://toolshed.g2.bx.psu.edu/repos/climate/cdo_operations

CDO Operations tool metadata
Miscellaneous
Climate Data Manipulation Operators operations for standard processing of climate and NWP model output.
cdo_operations
toolshed.g2.bx.psu.edu/repos/climate/cdo_operations/cdo_operations/2.0.0+galaxy0
2.0.0+galaxy0
None
True
Version lineage of this tool (guids ordered most recent to oldest)
toolshed.g2.bx.psu.edu/repos/climate/cdo_operations/cdo_operations/2.0.0+galaxy0 (this tool)
cdo_operations
Requirements (dependencies defined in the <requirements> tag set)
name version type
cdo 2.0.0 package
Additional information about this tool
mkdir output_dir &&
        cdo 
        #for $i, $cdo_option in enumerate( $section_option )
            #if $cdo_option.option_type.add_opt == '-f'
                $cdo_option.option_type.add_opt $cdo_option.option_type.output_format
            #elif $cdo_option.option_type.add_opt == '-g'
                $cdo_option.option_type.add_opt $cdo_option.option_type.grid
            #elif $cdo_option.option_type.add_opt == '-gf'
                $cdo_option.option_type.add_opt $cdo_option.option_type.gridfile
            #elif $cdo_option.option_type.add_opt == '-m'
                $cdo_option.option_type.add_opt $cdo_option.option_type.missval
            #elif $cdo_option.option_type.add_opt == '--percentile'
                $cdo_option.option_type.add_opt $cdo_option.option_type.percentile
            #elif $cdo_option.option_type.add_opt == '--seed'
                $cdo_option.option_type.add_opt $cdo_option.option_type.seed
            #else
                $cdo_option.option_type.add_opt
            #end if
        #end for
        #for $i, $cdo_oper in enumerate( $section_operators )
            #if $cdo_oper.operator.opt == 'duplicate'
                -'$cdo_oper.operator.opt',$cdo_oper.operator.ndup
            #elif $cdo_oper.operator.opt == 'addc' or $cdo_oper.operator.opt == 'subc' or $cdo_oper.operator.opt == 'mulc' or $cdo_oper.operator.opt == 'divc'
                -'$cdo_oper.operator.opt',$cdo_oper.operator.const_value
	    #elif $cdo_oper.operator.opt == 'ens' or $cdo_oper.operator.opt == 'zon' or  $cdo_oper.operator.opt == 'tim' or  $cdo_oper.operator.opt == 'vert' or  $cdo_oper.operator.opt == 'day' or  $cdo_oper.operator.opt == 'year' or  $cdo_oper.operator.opt == 'mon' or  $cdo_oper.operator.opt == 'seas' or $cdo_oper.operator.opt == 'fld'
                -'${cdo_oper.operator.opt}${cdo_oper.operator.stat}'
	    #elif $cdo_oper.operator.opt == 'sp2gp' or $cdo_oper.operator.opt == 'gp2sp'
                #if $cdo_oper.operator.trunc > 0
                    -'$cdo_oper.operator.opt',$cdo_oper.operator.trunc
                #else
                    -'$cdo_oper.operator.opt'
                #end if
            #elif $cdo_oper.operator.opt == 'collgrid'
                #if str($cdo_oper.operator.nx)
                    #if str($cdo_oper.operator.names)
                        -'$cdo_oper.operator.opt',$cdo_oper.operator.nx,'$cdo_oper.operator.names'
                    #else
                        -'$cdo_oper.operator.opt',$cdo_oper.operator.nx
                    #end if
                #else
                    -'$cdo_oper.operator.opt'
                #end if
            #elif $cdo_oper.operator.opt == 'distgrid'
                -'$cdo_oper.operator.opt',$cdo_oper.operator.nx,$cdo_oper.operator.ny
            #elif $cdo_oper.operator.opt == 'splitsel'
                    #if str($cdo_oper.operator.noffset)
                        #if str($cdo_oper.operator.nskip)
                            -'$cdo_oper.operator.opt',$cdo_oper.operator.nsets,$cdo_oper.operator.noffset,$cdo_oper.operator.nskip
                        #else
                            -'$cdo_oper.operator.opt',$cdo_oper.operator.nsets,$cdo_oper.operator.noffset
                        #end if
                    #else
                        -'$cdo_oper.operator.opt',$cdo_oper.operator.nsets
                    #end if
            #elif $cdo_oper.operator.opt == 'select' or $cdo_oper.operator.opt == 'delete' or $cdo_oper.operator.opt == 'selname' or $cdo_oper.operator.opt == 'delname' or  $cdo_oper.operator.opt == 'seltimestep' or $cdo_oper.operator.opt == 'sellonlatbox' or $cdo_oper.operator.opt == 'expr' or $cdo_oper.operator.opt == 'ml2pl' or $cdo_oper.operator.opt == 'ml2hl' or $cdo_oper.operator.opt == 'intlevel'
                -'$cdo_oper.operator.opt','$cdo_oper.operator.params'
            #elif $cdo_oper.operator.opt == 'setattribute'
                -'$cdo_oper.operator.opt',FILE='$cdo_oper.operator.attr_file'
            #else
                -'$cdo_oper.operator.opt'
            #end if
            #if $cdo_oper.operator.opt == 'copy' or $cdo_oper.operator.opt == 'cat' or $cdo_oper.operator.opt == 'merge' or $cdo_oper.operator.opt == 'mergetime' or $cdo_oper.operator.opt == 'collgrid' or $cdo_oper.operator.opt == 'select' or $cdo_oper.operator.opt == 'delete' or $cdo_oper.operator.opt == 'replace'
                #for $ifile in $cdo_oper.operator.add_file
                    '${ifile}'
                #end for
            #elif $cdo_oper.operator.add_file and '$cdo_oper.operator.add_file' != '' and '$cdo_oper.operator.add_file' != 'None' and $cdo_oper.operator.add_file is not None
                '$cdo_oper.operator.add_file'
            #end if
            #if $i == 0
                #if $cdo_oper.operator.opt == 'splitcode' or $cdo_oper.operator.opt == 'splitparam' or $cdo_oper.operator.opt == 'splitname' or $cdo_oper.operator.opt == 'splitlevel' or $cdo_oper.operator.opt == 'splitgrid' or  $cdo_oper.operator.opt == 'splitzaxis' or $cdo_oper.operator.opt == 'splittabnum' or $cdo_oper.operator.opt == 'splithour' or $cdo_oper.operator.opt == 'splitday' or $cdo_oper.operator.opt == 'splitseas' or $cdo_oper.operator.opt == 'splityear' or $cdo_oper.operator.opt == 'splityearmon' or $cdo_oper.operator.opt == 'splitmon' 
                    #set output = 'output_dir/outfile_'
                #else
                    #set output = 'output_dir/outfile.netcdf'
                #end if
            #end if
        #end for
        '${output}'
        
None
False
Functional tests
name inputs outputs required files
Test-1 section_operators_0|operator|params: name=Drops
section_operators_0|operator|add_file: WMI_Lear.nc
section_operators_0|operator|opt: select
WMI_Lear.nc
Test-2 section_operators_0|operator|add_file: WMI_Lear.nc
section_operators_0|operator|opt: copy
WMI_Lear.nc
Test-3 section_operators_0|operator|add_file: ['drops1.nc', 'drops2.nc']
section_operators_0|operator|opt: cat
drops1.nc
drops2.nc
Test-4 section_operators_0|operator|add_file: lat_long.nc
section_operators_0|operator|opt: splitname
lat_long.nc
Test-5 section_operators_0|operator|add_file: ['lat_long.nc', 'latitude_modified.nc']
section_operators_0|operator|opt: replace
lat_long.nc
latitude_modified.nc
Test-6 section_operators_0|operator|ndup: 3
section_operators_0|operator|add_file: latitude.nc
section_operators_0|operator|opt: duplicate
latitude.nc
Test-7 section_operators_0|operator|params: Drops
section_operators_0|operator|add_file: WMI_Lear.nc
section_operators_0|operator|opt: selname
WMI_Lear.nc
Test-8 section_operators_0|operator|params: 1,13,25
section_operators_0|operator|add_file: WMI_Lear.nc
section_operators_0|operator|opt: seltimestep
WMI_Lear.nc
Test-9 section_operators_0|operator|params: -10,10,60,70
section_operators_0|operator|add_file: WMI_Lear.nc
section_operators_0|operator|opt: sellonlatbox
WMI_Lear.nc
Test-10 section_operators_0|operator|add_file: WMI_Lear.nc
section_operators_0|operator|opt: invertlat
WMI_Lear.nc
Test-11 section_operators_0|operator|params: Drops
section_operators_0|operator|opt: selname
section_operators_1|operator|const_value: 10.5
section_operators_1|operator|add_file: WMI_Lear.nc
section_operators_1|operator|opt: addc
WMI_Lear.nc
Test-12 section_operators_0|operator|params: Drops2=1000*exp(1+Drops)
section_operators_0|operator|add_file: WMI_Lear.nc
section_operators_0|operator|opt: expr
WMI_Lear.nc
Test-13 section_operators_0|operator|params: CLEAR_SKY_BHI
section_operators_0|operator|opt: selname
section_operators_1|operator|stat: avg
section_operators_1|operator|add_file: timeseries.nc
section_operators_1|operator|opt: tim
timeseries.nc
Test-14 section_operators_0|operator|add_file: timeseries.nc
section_operators_0|operator|opt: sub
section_operators_1|operator|const_value: 10.5
section_operators_1|operator|add_file: timeseries.nc
section_operators_1|operator|opt: addc
timeseries.nc
Test-15 section_operators_0|operator|params: -10,10,60,70
section_operators_0|operator|opt: sellonlatbox
section_operators_1|operator|attr_file: attributes.txt
section_operators_1|operator|add_file: WMI_Lear.nc
section_operators_1|operator|opt: setattribute
attributes.txt
WMI_Lear.nc