license export function getVecChannels ( name , rank ) { return [ 'x' , 'y' , 'z' , 'w' , 'u' , 'v' ] . slice ( 0 , rank ) . map ( d => `${ name }.${ d }` ) ; } export function getChannels ( name , rank ) { if ( rank === 1 ) { return [ name ] ; } return getVecChannels ( name , rank ) ; } export function getSourceCoords ( rank , dims ) { if ( rank === 1 ) { return 'rc' ; } let coords = '' ; for ( let i = 0 ; i < rank ; i ++ ) { coords += dims [ i ] ; if ( i < rank - 1 ) { coords += ',' ; } } return coords ; }