Exemplo n.º 1
0
def main():
    # If a model file is not specified, a uniformly spaced model should be generated based on the data.the
    # i.e., use sites as bounds, and use smallest period as a starting point for cell sizes.
    files = sys.argv[1:]
    for file in files:
        if not utils.check_file(file):
            print('File {} not found.'.format(file))
            return
    files = utils.sort_files(files=files)
    try:
        data = WSDS.Data(datafile=files['dat'])
    except KeyError:
        print('No data file given. Site locations will not be available.')
        data = None
    try:
        model = WSDS.Model(files['model'])
    except KeyError:
        if data is None:
            print('One or more of <model_file> and <data_file> must be given!')
            return
        else:
            print('Generating initial model...')
            model = WSDS.Model(data=data)
            print([model.vals.shape, model.nx, model.ny, model.nz])

    app = QtWidgets.QApplication(sys.argv)
    viewer = model_viewer_2d(model=model, data=data)
    viewer.show()
    ret = app.exec_()
    sys.exit(ret)
    viewer.disconnect_mpl_events()
Exemplo n.º 2
0
def main():
    files = sys.argv[1:]
    for file in files:
        if not check_file(file):
            print('File {} not found.'.format(file))
            return
    files = sort_files(files=files)
    try:
        data = WSDS.Data(datafile=files['dat'])
    except KeyError:
        print('No data file given. Site locations will not be available.')
        data = None
    try:
        model = WSDS.Model(files['model'])
    except KeyError:
        print('Model must be specified')
        return
    app = Qt.QApplication(sys.argv)
    viewer = ModelWindow(files)
    viewer.show()
    ret = app.exec_()
    sys.exit(ret)
Exemplo n.º 3
0
import pyMT.data_structures as WSDS
import pandas as pd
import numpy as np

# Define your data and list locations
data_file = 'C:/Users/eroots/phd/ownCloud/data/Regions/MetalEarth/swayze/swz_cull1/finish/swz_cull1i_Z.dat'
list_file = 'C:/Users/eroots/phd/ownCloud/data/Regions/MetalEarth/swayze/j2/swz_cull1.lst'
# Read data and list
data = WSDS.Data(data_file)
raw = WSDS.RawData(list_file)
# Define what info you want in the CSV (headers)
columns = ('site', 'X', 'Y', 'period', 'beta', 'alpha', 'det_phi', 'skew_phi',
           'phi_1', 'phi_2', 'phi_3', 'phi_max', 'phi_min', 'Lambda',
           'azimuth', 'delta')

c = 0
site_list = []
# Initialize numpy array with zeros
arr = np.zeros((len(data.site_names) * len(data.periods), len(columns)))
for site in data.site_names:
    for ii, period in enumerate(data.periods):
        phase_tensor = data.sites[site].phase_tensors[ii]
        for jj, column in enumerate(columns):
            # Can't pass string to np array, so ignore for now
            if column == 'site':
                # arr[ii, jj] = site
                pass
            # If looking for lat/longs, grab these from the RawData object
            elif column == 'X':
                arr[c, jj] = raw.sites[site].locations['Long']
            elif column == 'Y':
Exemplo n.º 4
0
from scipy.interpolate import griddata
import naturalneighbor as nn
import matplotlib.pyplot as plt
import numpy as np
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
Exemplo n.º 5
0
import pyMT.data_structures as WSDS
import pyMT.utils as utils
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt

# raw = WSDS.RawData(r'C:\Users\eric\Documents\MATLAB' +
#                    r'\MATLAB\Inversion\Regions\abi-gren\New\j2\allsites.lst')
datafile = r'C:\Users\eric\Documents\MATLAB\MATLAB\Inversion\Test_Models\dimensionality\synthCond.data'
raw = WSDS.Data(datafile)

site_bost = {}
for site in raw.sites.values():
    bostick, depth = utils.compute_bost1D(site)[:2]
    if 'TZXR' in site.components:
        tzxr = site.data['TZXR']
        tzyr = site.data['TZYR']
    else:
        tzxr = site.data['ZXXR'] * 0
        tzyr = site.data['ZXYR'] * 0
    # site_bost.update({site.name: {'bostick': bostick, 'depth': depth,
    #                               'Long': site.locations['Long'],
    #                               'Lat': site.locations['Lat'],
    #                               'TZXR': tzxr, 'TZYR': tzyr}})
    site_bost.update({
        site.name: {
            'bostick': bostick,
            'depth': depth,
            'X': site.locations['Y'],
            'Y': site.locations['X'],
            'TZXR': tzxr,
Exemplo n.º 6
0
                setattr(data.sites[site].phase_tensors[ii], comp + '_error',
                        max_error)
            # data.sites[site].errmap[comp] = error_map
        # data.sites[site].apply_error_floor()
    return data, smoothed


# C:\Users\eric\phd\ownCloud\data\Regions\MetalEarth\swayze\R2south_4\pt
# datafile = 'C:/Users/eric/phd/ownCloud/data/Regions/MetalEarth/swayze/R2south_4/pt/R2south_4d_Z_reset.dat'
# respfile = 'C:/Users/eric/phd/ownCloud/data/Regions/MetalEarth/swayze/R2south_4/pt/R2South_fine_fwd_Z.dat'
# listfile = 'C:/Users/eric/phd/ownCloud/data/Regions/MetalEarth/swayze/j2/R2south_4c.lst'
datafile = 'C:/Users/eric/phd/ownCloud/data/Regions/MetalEarth/swayze/' + \
           'swz_cull1/finish/pt/swz_cull1i_Z_extended_periods.dat'
respfile = 'C:/Users/eric/phd/ownCloud/data/Regions/MetalEarth/swayze/swz_cull1/finish/swz_finish.dat'
listfile = 'C:/Users/eric/phd/ownCloud/data/Regions/MetalEarth/swayze/j2/swz_cull1.lst'
data = WSDS.Data(datafile=datafile, listfile=listfile)
resp = WSDS.Data(datafile=respfile, listfile=listfile)
raw = WSDS.RawData(listfile=listfile)
data.inv_type = 6
error_in_degrees = 3
site = '18-swz080m'
data, smoothed = regulate_errors(data,
                                 raw,
                                 multiplier=1.5,
                                 fwidth=0.75,
                                 sites=None)
components = ('PTXY', 'PTYX', 'PTXX', 'PTYY')
for comp in components[:2]:
    phi_data = np.rad2deg(
        np.arctan(
            np.array([
Exemplo n.º 7
0
########################################
# WESTERN SUPERIOR - DRYDEN
# model_file = r'C:\Users\eric\phd\ownCloud\data\Regions\wst\wsSC1\wsSC_final.model'
# base_data = r'C:\Users\eric\phd\ownCloud\data\Regions\wst\wsSC1\wsSC_final.dat'
# data_file = 'C:/Users/eric/phd/ownCloud/data/Regions/MetalEarth/dryden/dry5/dry53.data'
# list_file = 'C:/Users/eric/phd/ownCloud/data/Regions/MetalEarth/dryden/j2/dry5_3.lst'
# base_list = r'C:\Users\eric\phd\ownCloud\data\Regions\wst\j2\southcentral.lst'
# model_out = r'C:\Users\eric\phd\ownCloud\data\Regions\MetalEarth\dryden\wst2dry\wst2dry.model'
# data_out = r'C:\Users\eric\phd\ownCloud\data\Regions\MetalEarth\dryden\wst2dry.dat'
########################################
plot_it = 0
write_it = 1
azi = -0  # Rotate the non-base data back

mod = WSDS.Model(model_file)
data = WSDS.Data(datafile=data_file, listfile=list_file)
data.locations = data.get_locs(azi=-azi)
data.set_locs()
base_data = WSDS.Data(datafile=base_data, listfile=base_list)
for site in base_data.site_names:
    if site in data.site_names:
        x_diff = data.sites[site].locations['X'] - base_data.sites[
            site].locations['X']
        y_diff = data.sites[site].locations['Y'] - base_data.sites[
            site].locations['Y']
        break
data.locations[:, 0] -= x_diff
data.locations[:, 1] -= y_diff
file_format = 'wsinv3dmt'
depths_per_decade = (8, 10, 12, 14, 10)
x, y, z = (utils.edge2center(arr) for arr in (mod.dx, mod.dy, mod.dz))
Exemplo n.º 8
0
if __name__ == '__main__':
    # filename = 'F:/GJH/TNG&MTR-EDI/all.lst'
    # filename = 'C:/users/eroots/phd/ownCloud/data/ArcMap/LegacyMT/ag_edi/ag/all.lst'
    # filename = 'C:/Users/eric/Documents/MATLAB/MATLAB/Inversion/GJH/ForEric/TNG&MTR-EDI/all.lst'
    # filename = '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'
    # out_path = 'C:/Users/eric/phd/ownCloud/Documents/Seminars/Seminar 3/Figures/PTs/'
    filename = 'C:/Users/eroots/phd/ownCloud/data/Regions/MetalEarth/dryden/dry5/dry5_3.dat'
    listfile = 'C:/Users/eroots/phd/ownCloud/data/Regions/MetalEarth/dryden/j2/dry5_3.lst'
    out_path = 'C:/Users/eroots/phd/ownCloud/Documents/Dryden_paper/RoughFigures/PTs/'
    out_file = 'dryden_PT_'
    ext = '.png'
    dpi = 600
    save_fig = 1
    cutoff_distance = 1000
    data = WSDS.Data(filename, listfile=listfile)
    raw = WSDS.RawData(listfile)
    # data.locations = rawdata.get_locs(mode='latlong')

    all_sites = deepcopy(data.site_names)
    # Remove redunantly close points
    for ii, site1 in enumerate(data.site_names):
        for jj, site2 in enumerate(data.site_names):
            dist = euclidean((data.locations[ii, 1], data.locations[ii, 0]),
                             (data.locations[jj, 1], data.locations[jj, 0]))
            if dist < cutoff_distance and site1 in all_sites and (site1 !=
                                                                  site2):
                if site2 in all_sites:
                    all_sites.remove(site2)
    rm_sites = [site for site in data.site_names if site not in all_sites]
    data.remove_sites(sites=rm_sites)
Exemplo n.º 9
0
import pyMT.data_structures as WSDS
import pyMT.utils as utils
from scipy.interpolate import griddata
import matplotlib.pyplot as plt
import numpy as np
import e_colours.colourmaps as cm

cmap = cm.jet_plus(64)
# listfile = r'C:\Users\eric\phd\Kilauea\ConvertedEDIs\2018-517\allsites.lst'
# listfile = r'C:\Users\eric\phd\Kilauea\ConvertedEDIs\all\515-520.lst')
# listfile = r'C:\Users\eric\phd\Kilauea\ConvertedEDIs\all\allsites.lst'
# datafile = r'C:\Users\eric\Documents\MATLAB\MATLAB\Inversion\Test_Models\dimensionality\synthLayer.data'
# data = WSDS.RawData(listfile=listfile)
data = WSDS.Data(
    datafile='C:/Users/eric/phd/Kilauea/stitched/1_day/Z/Kilauea_may_daily.data'
)
days = (501, 530)
hour_or_day = 1  # sets the interval in labels, so choose appropriately
n_interp = 300
cax_rho = [0, 4]
# data = WSDS.Data(datafile=datafile)
# 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()}
bost = {
    site.name: utils.compute_bost1D(site)[0]
    for site in data.sites.values()
}
depths = {
Exemplo n.º 10
0
import numpy as np
import matplotlib.pyplot as plt
import pyMT.data_structures as WSDS


def gen_tiling(num_plots):
        if num_plots < 3:
            tiling = [num_plots, 1]
        else:
            s1 = np.floor(np.sqrt(num_plots))
            s2 = np.ceil(num_plots / s1)
            tiling = [int(s1), int(s2)]
        return tiling


data = WSDS.Data(datafile='C:/Users/eroots/phd/ownCloud/data/Regions/afton/afton1/afton_cull1.dat',
                 listfile='C:/Users/eroots/phd/ownCloud/data/Regions/afton/j2/afton_cull1.lst')

plots_per_fig = 6
N = 45
bottom = 0
max_height = 4
plot_range = (-np.pi / 2, np.pi / 2)
width = np.pi / N
theta = np.linspace(plot_range[0], plot_range[1], N, endpoint=False)

figures = {}
p_idx = 0
tiling = gen_tiling(plots_per_fig)
for ii in range(int(np.ceil(data.NP / plots_per_fig))):
    figures.update({ii: plt.figure()})
    axes = []
Exemplo n.º 11
0
def do_the_bosticks(listfile=None,
                    datafile=None,
                    comp=None,
                    N_interp=None,
                    z_bounds=None,
                    filter_width=1,
                    sites_slice=None):
    # if listfile is None:
    #     print('Listfile is None')
    #     listfile = r'C:\Users\eric\Documents\MATLAB\MATLAB\Inversion\Regions\abi-gren\New\j2\allsites.lst'
    if datafile is None:
        print('datafile is None')
        datafile = r'C:\Users\eric\Documents\MATLAB\MATLAB\Inversion\Regions\abi-gren\New\j2\allsites_1.data'
    if listfile:
        raw = WSDS.RawData(listfile=listfile)
    else:
        raw = WSDS.Data(datafile=datafile)
    if not sites_slice:
        sites_slice = ('p91011', 'p91009', 'e90005', 'e90001', 'g90003',
                       'p91003', 'p91006', 'p91006', 'p91008', 'p91012',
                       'e89001', 'e90002', 'g90004', 'g90002', 'g90006',
                       'p91013', 'p91014', 'p91015', 'p91016', 'p91017',
                       'p91019')
    data = WSDS.Data(listfile=listfile, datafile=datafile)
    NS = len(raw.site_names)
    if not N_interp:
        NZ_interp = 200
        NXY_interp = 200
    elif len(N_interp) == 1:
        NZ_interp = N_interp
        NXY_interp = N_interp
    else:
        NZ_interp = N_interp[0]
        NXY_interp = N_interp[1]
    locs = np.zeros((NS, 2))
    all_depths = []
    all_bosticks = []
    for ii, site_name in enumerate(raw.site_names):
        site = raw.sites[site_name]
        locs[ii, 1] = data.sites[site.name].locations['X'] / 1000
        locs[ii, 0] = data.sites[site.name].locations['Y'] / 1000
        # locs[ii, 1] = raw.sites[site.name].locations['Long']
        # locs[ii, 0] = raw.sites[site.name].locations['Lat']
        bostick, depth = utils.compute_bost1D(site,
                                              comp=comp,
                                              filter_width=filter_width)[:2]
        if any(np.isnan(depth)):
            print(site_name)
            sys.exit()
        all_depths.append(depth)
        all_bosticks.append(bostick)
    all_depths_flat = np.array(utils.flatten_list(all_bosticks))
    data_points = np.zeros((len(all_depths_flat), 3))
    c = 0
    for ii, ds in enumerate(all_depths):
        for d in ds:
            data_points[c, 0] = locs[ii, 0]
            data_points[c, 1] = locs[ii, 1]
            data_points[c, 2] = d
            c += 1
    try:
        y = [data.sites[site].locations['X'] / 1000
             for site in sites_slice]  # if site in data.site_names]
        x = [data.sites[site].locations['Y'] / 1000
             for site in sites_slice]  # if site in data.site_names]
        # y = [raw.sites[site].locations['Long'] for site in sites_slice]  # if site in data.site_names]
        # x = [raw.sites[site].locations['Lat'] for site in sites_slice]  # if site in data.site_names]
    except KeyError as e:
        if (type(sites_slice[0]) == str):
            print('Site {} not found. Check your site list.'.format(e))
            print(e)
            sys.exit()
        else:
            x = sites_slice[:int(len(sites_slice) / 2)]
            y = sites_slice[int(len(sites_slice) / 2):]
    # This sorting is south-north. Might not make sense for west-east profiles.
    x, y = ([y2 for (x2, y2) in sorted(zip(y, x))],
            [x2 for (x2, y2) in sorted(zip(y, x))])
    print(x, y)
    print(raw.site_names)
    print(data.periods)
    print('Data file is {}'.format(datafile))
    print('List file is {}'.format(listfile))
    V = np.array(utils.flatten_list(all_bosticks))

    if not z_bounds:
        z_bounds = (0.1, 300)
    zi = np.logspace(np.log10(z_bounds[0]), np.log10(z_bounds[1]), NZ_interp)
    yi = np.linspace(min(y), max(y), NXY_interp)
    xi = np.interp(yi, y, x)
    X = np.ndarray.flatten(np.tile(xi, (NZ_interp, 1)), order='F')
    Y = np.ndarray.flatten(np.tile(yi, (NZ_interp, 1)), order='F')
    Z = np.ndarray.flatten(np.tile(zi, (1, NXY_interp)), order='F')
    query_points = np.transpose(np.array((X, Y, Z)))
    return data_points, query_points, V
Exemplo n.º 12
0
import pyMT.data_structures as WSDS
import pyMT.utils as utils
import matplotlib.pyplot as plt
import numpy as np

listfile = r'C:\Users\eric\Documents\MATLAB\MATLAB\Inversion\Regions\aften\j2\deci_4.lst'
raw = WSDS.RawData(listfile)
data = WSDS.Data(
    r'C:\Users\eric\Documents\MATLAB\MATLAB\Inversion\Regions\aften\deci0_4\deci_4_1.data',
    listfile=listfile)
site = 'l6_351'

raw_site = raw.sites[site]
data_site = data.sites[site]

fig = plt.figure()
fig.add_subplot(121)
plt.errorbar(np.log10(data_site.periods),
             np.sqrt(data_site.periods) * data_site.data['ZXYR'],
             xerr=None,
             yerr=np.sqrt(data_site.periods) * data_site.used_error['ZXYR'],
             marker='o',
             mec='k',
             linestyle='')
plt.errorbar(np.log10(raw_site.periods),
             np.sqrt(raw_site.periods) * raw_site.data['ZXYR'],
             xerr=None,
             yerr=None,
             marker='o',
             linestyle='')
error_map = np.zeros(data_site.data['ZXYR'].shape)
Exemplo n.º 13
0
def main(in_file, out_file):
    data = WSDS.Data(in_file)
    # if data.inv_type == 5:
    #     print('Ignoring transfer function data...\n')
    #     data.inv_type = 1
    data.write(outfile=out_file, file_format='modem')
Exemplo n.º 14
0
def main_mesh(args, data=None):
    if data is None:
        datafile = WSIO.verify_input('Data file to use?', expected='read')
        data = WSDS.Data(datafile=datafile)
    avg_rho = np.mean([
        utils.compute_rho(site, calc_comp='det', errtype='none')
        for site in data.sites.values()
    ])
    print('Average determinant apparent resistivity is {}'.format(avg_rho))
    bg_resistivity = WSIO.verify_input('Background resistivity?',
                                       expected=float,
                                       default=avg_rho)
    xmesh = utils.generate_lateral_mesh(site_locs=data.locations[:, 0])
    ymesh = utils.generate_lateral_mesh(site_locs=data.locations[:, 1])
    max_depth = min([500, utils.skin_depth(bg_resistivity, data.periods[-1])])
    min_depth = min([1, utils.skin_depth(bg_resistivity, data.periods[0])])
    print(
        'Note: Default min and max depths are based on skin depth of lowest and highest periods.'
    )
    min_depth = WSIO.verify_input('Depth of first layer?',
                                  expected=float,
                                  default=min_depth)
    max_depth = WSIO.verify_input('Depth of last layer?',
                                  expected=float,
                                  default=max_depth)
    NZ = WSIO.verify_input('Total # of layers or # of layers per decade?',
                           expected='numtuple',
                           default=60)
    zmesh = utils.generate_zmesh(min_depth=min_depth,
                                 max_depth=max_depth,
                                 NZ=NZ)
    model = WSDS.Model()
    model.dx = xmesh
    model.dy = ymesh
    model.dz = zmesh
    model.vals = bg_resistivity * np.ones((model.nx, model.ny, model.nz))
    if '-i' in args:
        viewer = meshview(model, data)
        viewer.show()
    else:
        nxpads = WSIO.verify_input('Number of pads in X direction',
                                   expected=int,
                                   default=5)
        nypads = WSIO.verify_input('Number of pads in y direction',
                                   expected=int,
                                   default=5)
        xpads = [model.xCS[0]]
        ypads = [model.yCS[0]]
        for ii in range(nxpads):
            xpads.append(
                WSIO.verify_input('Pad size',
                                  expected=float,
                                  default=xpads[ii] * 1.2))
            xpads = xpads[1:]
        for ii in range(nypads):
            ypads.append(
                WSIO.verify_input('Pad size',
                                  expected=float,
                                  default=ypads[ii] * 1.2))
            ypads = ypads[:1]
        model.dx = xpads[-1::-1] + model.dx + xpads
        model.dy = ypads[-1::-1] + model.dy + ypads
        modelname = WSIO.verify_input('Model name',
                                      expected='write',
                                      default='mod')
        if '.model' not in modelname:
            modelname = ''.join([modelname, '.model'])
        model.write(modelname)
    return
Exemplo n.º 15
0
def gen_tiling(num_plots):
        if num_plots < 3:
            tiling = [num_plots, 1]
        else:
            s1 = np.floor(np.sqrt(num_plots))
            s2 = np.ceil(num_plots / s1)
            tiling = [int(s1), int(s2)]
        return tiling


# data = WSDS.Data(datafile='C:/Users/eroots/phd/ownCloud/data/Regions/afton/afton1/afton_cull1.dat',
#                  listfile='C:/Users/eroots/phd/ownCloud/data/Regions/afton/j2/afton_cull1.lst')
# data = WSDS.Data(datafile='C:/Users/eroots/phd/ownCloud/data/Regions/MetalEarth/malartic/mal1/moresites/finish/mal5_all.dat',
#                  listfile='C:/Users/eroots/phd/ownCloud/data/Regions/MetalEarth/malartic/j2/mal5.lst')
# data = WSDS.RawData(listfile='C:/Users/eric/phd/ownCloud/data/Regions/MetalEarth/matheson/j2/mat_westLine.lst')
data = WSDS.Data('C:/Users/eroots/phd/ownCloud/data/Regions/afton/sorted_lines.dat')
# NP = len(data.master_period_list().keys())
NP = data.NP
plots_per_fig = 6
N = 45
bottom = 0
max_height = 4
plot_range = (-np.pi / 2, np.pi / 2)
width = np.pi / N
theta = np.linspace(plot_range[0], plot_range[1], N, endpoint=False)

figures = {}
figures_TF = {}
p_idx = 0
tiling = gen_tiling(plots_per_fig)
# for ii in range(int(np.ceil(data.NP / plots_per_fig))):