In [1]:
import numpy as np
from mtpy.contrib.netcdf import nc, winglink_to_netCDF
from pyproj import Proj


No handlers could be found for logger "mtpy.utils.decorator"
ERROR:root:the config yaml file /home/jami/.anaconda3/envs/mtpy_fork/lib/python2.7/site-packages/mtpy-1.0.1-py2.7.egg/mtpy/utils/logging.yml does not exist?
None
WARNING:mtpy.utils.decorator:GDAL_DATA environment variable is not set  Please see https://trac.osgeo.org/gdal/wiki/FAQInstallationAndBuilding#HowtosetGDAL_DATAvariable 
GDAL is not working !!!
WARNING:mtpy.utils.decorator:GDAL_DATA environment variable is not set  Please see https://trac.osgeo.org/gdal/wiki/FAQInstallationAndBuilding#HowtosetGDAL_DATAvariable 
GDAL is not working !!!
GDAL is not working !!!

In [2]:
# the input data "winGlink_3dmod_input.xyzv" had no information about the crs.
# so, we had to hard code it.
# epsg 32753 represents the data area are in WGS84/ UTM 53S

source_proj = Proj(init='epsg:32753')
grid_proj = Proj(init='epsg:4326')

# make a grid that covers the whole area of all the points
# with desired resolution. The grid epsg we want is 4326 which is global and in lat/lon.
grid_spec = nc.grid_from_extent_and_resolution(left=(131.5, -31., -4500.),
                                               right=(132.5, -30., -125.),
                                               resolution=(0.005, 0.005, 100.))

In [3]:
WING_LINK_DATA_FILE = 'E:/Githubz/ummazannat/mtpy/mtpy/contrib/netcdf/winGlink_3dmod_input.xyzv'
# WING_LINK_DATA_FILE = '../../examples/data/winGlink_3dmod_input.xyzv'

# input data hes been fixed for false origin
source_points, source_values = winglink_to_netCDF.read_winglink_xyzv(WING_LINK_DATA_FILE,
                                                                     false_easting=500000.0,
                                                                     false_northing=10000000.0)

In [4]:
output_file = 'winglink.nc'

winglink_to_netCDF.mask_interpolate_and_write(output_file,
                                              source_points, source_values, source_proj,
                                              grid_spec, grid_proj)

In [ ]: