In [1]:
import numpy as np
from mtpy.contrib.netcdf import nc, winglink_to_netCDF
from pyproj import Proj
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 [ ]: