<s> """<STR_LIT>""" <EOL> import datetime <EOL> import numpy as np <EOL> import netCDF4 <EOL> from . . config import FileMetadata <EOL> from . . io . common import make_time_unit_str , _test_arguments <EOL> from . . core . radar import Radar <EOL> def read_pattern ( filename , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> _test_arguments ( kwargs ) <EOL> filemetadata = FileMetadata ( '<STR_LIT>' ) <EOL> ncobj = netCDF4 . Dataset ( filename ) <EOL> ncvars = ncobj . variables <EOL> nrays = ncvars [ '<STR_LIT>' ] . shape [ <NUM_LIT:0> ] <EOL> scan_type = '<STR_LIT>' <EOL> time = filemetadata ( '<STR_LIT:time>' ) <EOL> nctime = ncvars [ '<STR_LIT>' ] <EOL> time [ '<STR_LIT>' ] = make_time_unit_str ( <EOL> datetime . datetime . utcfromtimestamp ( nctime [ <NUM_LIT:0> ] ) ) <EOL> time [ '<STR_LIT:data>' ] = np . linspace ( <NUM_LIT:0> , nctime [ - <NUM_LIT:1> ] - nctime [ <NUM_LIT:0> ] , nrays ) <EOL> _range = filemetadata ( '<STR_LIT>' ) <EOL> _range [ '<STR_LIT:data>' ] = ncvars [ '<STR_LIT>' ] [ : ] <EOL> _range [ '<STR_LIT>' ] = _range [ '<STR_LIT:data>' ] [ <NUM_LIT:0> ] <EOL> _range [ '<STR_LIT>' ] = ( _range [ '<STR_LIT:data>' ] [ <NUM_LIT:1> ] - _range [ '<STR_LIT:data>' ] [ <NUM_LIT:0> ] ) <EOL> fields = { } <EOL> field_name = filemetadata . get_field_name ( '<STR_LIT>' ) <EOL> field_dic = filemetadata ( field_name ) <EOL> field_dic [ '<STR_LIT>' ] = ncvars [ '<STR_LIT>' ] . _FillValue <EOL> field_dic [ '<STR_LIT:data>' ] = ncvars [ '<STR_LIT>' ] [ : ] <EOL> fields [ field_name ] = field_dic <EOL> metadata = filemetadata ( '<STR_LIT>' ) <EOL> for k in [ '<STR_LIT>' , '<STR_LIT:title>' , '<STR_LIT>' ] : <EOL> if k in ncobj . ncattrs ( ) : <EOL> metadata [ k ] = ncobj . getncattr ( k ) <EOL> latitude = filemetadata ( '<STR_LIT>' ) <EOL> longitude = filemetadata ( '<STR_LIT>' ) <EOL> altitude = filemetadata ( '<STR_LIT>' ) <EOL> latitude [ '<STR_LIT:data>' ] = np . array ( [ ncobj . latitude [ : - <NUM_LIT:1> ] ] , dtype = '<STR_LIT>' ) <EOL> longitude [ '<STR_LIT:data>' ] = np . array ( [ ncobj . longitude [ : - <NUM_LIT:1> ] ] , dtype = '<STR_LIT>' ) <EOL> altitude [ '<STR_LIT:data>' ] = np . array ( [ ncobj . elevation ] , dtype = '<STR_LIT>' ) <EOL> sweep_number = filemetadata ( '<STR_LIT>' ) <EOL> sweep_mode = filemetadata ( '<STR_LIT>' ) <EOL> fixed_angle = filemetadata ( '<STR_LIT>' ) <EOL> sweep_start_ray_index = filemetadata ( '<STR_LIT>' ) <EOL> sweep_end_ray_index = filemetadata ( '<STR_LIT>' ) <EOL> sweep_number [ '<STR_LIT:data>' ] = np . arange ( <NUM_LIT:1> , dtype = '<STR_LIT>' ) <EOL> sweep_mode [ '<STR_LIT:data>' ] = np . array ( <NUM_LIT:1> * [ '<STR_LIT>' ] ) <EOL> fixed_angle [ '<STR_LIT:data>' ] = np . array ( [ <NUM_LIT:0> ] , dtype = '<STR_LIT>' ) <EOL> sweep_start_ray_index [ '<STR_LIT:data>' ] = np . array ( [ <NUM_LIT:0> ] , dtype = '<STR_LIT>' ) <EOL> sweep_end_ray_index [ '<STR_LIT:data>' ] = np . array ( [ nrays - <NUM_LIT:1> ] , dtype = '<STR_LIT>' ) <EOL> azimuth = filemetadata ( '<STR_LIT>' ) <EOL> elevation = filemetadata ( '<STR_LIT>' ) <EOL> azimuth [ '<STR_LIT:data>' ] = ncvars [ '<STR_LIT>' ] [ : ] <EOL> elevation [ '<STR_LIT:data>' ] = np . array ( [ <NUM_LIT:0.> ] , dtype = '<STR_LIT>' ) <EOL> instrument_parameters = None <EOL> return Radar ( <EOL> time , _range , fields , metadata , scan_type , <EOL> latitude , longitude , altitude , <EOL> sweep_number , sweep_mode , fixed_angle , sweep_start_ray_index , <EOL> sweep_end_ray_index , <EOL> azimuth , elevation , <EOL> instrument_parameters = instrument_parameters ) </s>
