<s> '''<STR_LIT>''' <EOL> import sys <EOL> import os <EOL> import logging <EOL> import glob <EOL> import re <EOL> from osgeo import gdal <EOL> from os . path import basename <EOL> from EOtools . execute import execute <EOL> class VRTCreater : <EOL> def get_NetCDF_list ( self , directory ) : <EOL> result = [ ] <EOL> for path , subdirs , files in os . walk ( directory ) : <EOL> for name in files : <EOL> fileName , fileExtension = os . path . splitext ( name ) <EOL> if fileExtension == '<STR_LIT>' : <EOL> result . append ( os . path . join ( path , name ) ) <EOL> return result <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> vrt_creater = VRTCreater ( ) <EOL> dataset_dir = "<STR_LIT>" <EOL> file_list = vrt_creater . get_NetCDF_list ( dataset_dir ) <EOL> for file in file_list : <EOL> if not file . endswith ( "<STR_LIT>" ) : continue <EOL> print file <EOL> fname = os . path . splitext ( basename ( file ) ) [ <NUM_LIT:0> ] <EOL> dataset = gdal . Open ( file , gdal . GA_ReadOnly ) <EOL> subDataSets = dataset . GetSubDatasets ( ) <EOL> command_string = '<STR_LIT>' <EOL> command_string += dataset_dir + fname <EOL> command_string += '<STR_LIT>' <EOL> command_string += '<STR_LIT:U+0020>' + subDataSets [ <NUM_LIT> ] [ <NUM_LIT:0> ] <EOL> print command_string <EOL> result = execute ( command_string = command_string ) </s>
