def project_locations(data, zone, letter): data.locations = data.get_locs(mode='latlong') for ii in range(len(data.locations)): easting, northing = utils.project((data.locations[ii, 1], data.locations[ii, 0]), zone=zone, letter=letter)[2:] data.locations[ii, 1], data.locations[ii, 0] = easting, northing return data
def transform_locations(dataset, UTM): dataset.raw_data.locations = dataset.raw_data.get_locs(mode='latlong') UTM_number = int(UTM[:2]) UTM_letter = UTM[-1] for ii in range(len(dataset.raw_data.locations)): easting, northing = project( (dataset.raw_data.locations[ii, 1], dataset.raw_data.locations[ii, 0]), zone=UTM_number, letter=UTM_letter)[2:] dataset.raw_data.locations[ii, 1], dataset.raw_data.locations[ ii, 0] = easting, northing
import e_colours.colourmaps as cm from mpl_toolkits.axes_grid1 import make_axes_locatable cmap = cm.jet_plus(64) # listfile = r'C:\Users\eric\Documents\MATLAB\MATLAB\Inversion\Regions\dbr15\j2\allsites.lst' # listfile = r'C:\Users\eric\Documents\MATLAB\MATLAB\Inversion\Regions\MetalEarth\j2\allbb.lst') # datafile = r'C:\Users\eric\Documents\MATLAB\MATLAB\Inversion\Regions\MetalEarth\j2\allbb.data') # datafile = 'C:/Users/eric/Documents/MATLAB/MATLAB/Inversion/Regions/MetalEarth/swayze/swz_cull1/swz_cull1f_Z.dat' datafile = 'C:/Users/eric/phd/ownCloud/data/Regions/MetalEarth/j2/cull_allSuperior.data' listfile = 'C:/Users/eric/phd/ownCloud/data/Regions/MetalEarth/j2/culled_allSuperior.lst' data = WSDS.Data(datafile=datafile, listfile=listfile) raw = WSDS.RawData(listfile=listfile) raw.locations = raw.get_locs(mode='latlong') for ii in range(len(raw.locations)): lon, lat = utils.project((raw.locations[ii, 1], raw.locations[ii, 0]), zone=16, letter='U')[2:] raw.locations[ii, 1], raw.locations[ii, 0] = lon, lat data.locations = raw.locations save_path = 'C:/Users/eric/phd/ownCloud/Documents/Seminars/Seminar 3/Figures/Pseudosections/culled/' # rmsites = [site for site in data.site_names if site[0] == 'e' or site[0] == 'd'] # data.remove_sites(rmsites) # data.sort_sites(order='west-east') rho = {site.name: utils.compute_rho(site)[0] for site in data.sites.values()} pha = {site.name: utils.compute_phase(site)[0] for site in data.sites.values()} rho_lim = [0, 5] n_interp = 250 period = 14 padding = 50000 # bost = {site.name: utils.compute_bost1D(site)[0] for site in data.sites.values()} # depths = {site.name: utils.compute_bost1D(site)[1] for site in data.sites.values()}
radius = 20 label_offset = -4.5 file_path = local_path + '/phd/ownCloud/Documents/ME_Transects/Dryden_paper/RoughFigures/' file_name = 'pt_pseudosection_phi2' file_types = ['.pdf', '.png'] #, '.ps', '.png') dpi = 600 linear_xaxis = True # cmap = cm.jet_plus_r(64) cmap = cm.jet(64) # cmap = cm.bwr(64) data.locations = data.get_locs(mode='latlong') main_transect.locations = main_transect.get_locs(mode='latlong') for ii, site in enumerate(data.site_names): easting, northing = utils.project( (data.locations[ii, 1], data.locations[ii, 0]), zone=16, letter='U')[2:] data.locations[ii, 1], data.locations[ii, 0] = easting, northing data.sites[site].locations['X'], data.sites[site].locations[ 'Y'] = northing, easting for ii, site in enumerate(main_transect.site_names): easting, northing = utils.project( (main_transect.locations[ii, 1], main_transect.locations[ii, 0]), zone=16, letter='U')[2:] main_transect.locations[ii, 1], main_transect.locations[ii, 0] = easting, northing main_transect.sites[site].locations['X'], main_transect.sites[ site].locations['Y'] = northing, easting main_transect.spatial_units = 'km'
dist = euclidean( (ME_data.locations[ii, 1], ME_data.locations[ii, 0]), (ME_data.locations[jj, 1], ME_data.locations[jj, 0])) if dist < cutoff_distance and site1 in all_sites_ME and (site1 != site2): if site2 in all_sites_ME: all_sites_ME.remove(site2) rm_sites = [ site for site in ME_data.site_names if site not in all_sites_ME ] ME_data.remove_sites(sites=rm_sites) ME_raw.remove_sites(sites=rm_sites) ME_raw.locations = ME_raw.get_locs(mode='latlong') for ii in range(len(ME_raw.locations)): lon, lat = utils.project( (ME_raw.locations[ii, 1], ME_raw.locations[ii, 0]), zone=16, letter='U')[2:] ME_raw.locations[ii, 1], ME_raw.locations[ii, 0] = lon, lat ME_data.locations = ME_raw.locations all_sites = deepcopy(all_data.site_names) # Remove redunantly close points for ii, site1 in enumerate(all_data.site_names): for jj, site2 in enumerate(all_data.site_names): dist = euclidean( (all_data.locations[ii, 1], all_data.locations[ii, 0]), (all_data.locations[jj, 1], all_data.locations[jj, 0])) if dist < cutoff_distance and site1 in all_sites and (site1 != site2): if site2 in all_sites and not (site2 in all_sites_ME): all_sites.remove(site2)
save_path = 'C:/Users/eric/phd/ownCloud/Documents/Seminars/Seminar 3/Figures/Pseudosections/subprovinces/botCBar/' raw = WSDS.RawData(list_file) data = WSDS.Data(datafile=datafile, listfile=list_file) use_periods = data.periods[0:1] raw.locations = raw.get_locs(mode='latlong') # transform = ccrs.PlateCarree() # We want the data plotted in UTM, and we will convert them to UTM before plotting # transform = ccrs.UTM(zone=16) transform = ccrs.TransverseMercator(central_longitude=-85, central_latitude=49, false_northing=5430000, false_easting=645000) for ii in range(len(raw.locations)): easting, northing = utils.project( (raw.locations[ii, 1], raw.locations[ii, 0]), zone=16, letter='U')[2:] raw.locations[ii, 1], raw.locations[ii, 0] = easting, northing shp = shapereader.Reader(shp_file_base) # Note I use ccrs.PlateCarree() here because that is the projection the shapefile is in # I.E., latlong, not UTM. cartopy will take care of converting them as long as these are # all defined properly. # plt.plot(raw.locations[:, 1], raw.locations[:, 0], 'k.', transform=transform) # plt.show() data.locations = raw.locations rho = {site.name: utils.compute_rho(site)[0] for site in data.sites.values()} pha = {site.name: utils.compute_phase(site)[0] for site in data.sites.values()} for idx, period in enumerate(use_periods): loc_x = [] loc_y = []