def plot_obs_domain(ax=None, cmap=None):

    if cmap is None:
        warm = make_cmap(colors='warm_humid')

    linesec = {'origin': (38.29, -123.59),
               'az': 50, 'dist': 110, 'ndiv': 0}

    if ax is None:
        fig, ax = plt.subplots()

    elev = elevation(linesec=linesec,
                     domain=[-124.0, -122.0, 37.8, 39.38],
                     source='BNCaliforniaDEM.mat')

    m = elev.plot_elevation_map(ax=ax, cmap=cmap, shaded=False,
                                add_loc=['FRS','BBY','CZD','Petaluma'],
                                colorbar=True,
                                add_geoline=linesec,
                                grid=False,
                                altitude_range=[-5, 800],
                                contour_lines=[800],
                                latdelta=0.2, londelta=0.2,
                                addrivers=False,
                                homed='/home/raul/Dropbox/NOCAL_DEM')

    add_rings(ax, space_km=10, color='k', mapping=[m, 38.51, -123.25])
Example #2
0
def plot_obs_domain(ax=None, cmap=None):

    if cmap is None:
        warm = make_cmap(colors='warm_humid')

    linesec = {'origin': (38.29, -123.59), 'az': 50, 'dist': 110, 'ndiv': 0}

    if ax is None:
        fig, ax = plt.subplots()

    elev = elevation(linesec=linesec,
                     domain=[-124.0, -122.0, 37.8, 39.38],
                     source='BNCaliforniaDEM.mat')

    m = elev.plot_elevation_map(ax=ax,
                                cmap=cmap,
                                shaded=False,
                                add_loc=['FRS', 'BBY', 'CZD', 'Petaluma'],
                                colorbar=True,
                                add_geoline=linesec,
                                grid=False,
                                altitude_range=[-5, 800],
                                contour_lines=[800],
                                latdelta=0.2,
                                londelta=0.2,
                                addrivers=False,
                                homed='/home/raul/Dropbox/NOCAL_DEM')

    add_rings(ax, space_km=10, color='k', mapping=[m, 38.51, -123.25])
Example #3
0
def plot_terrain_profile():

    from matplotlib import gridspec
    warm = make_cmap(colors='warm_humid')

    linesec = {'origin': (38.29, -123.59), 'az': 50, 'dist': 110, 'ndiv': 0}

    elev = elevation(domain_num=4)

    plt.figure(figsize=(8.5, 11))
    gs = gridspec.GridSpec(2, 1, height_ratios=[3, 1])
    ax0 = plt.subplot(gs[0])
    ax1 = plt.subplot(gs[1])
    elev.plot_elevation_map(
        ax=ax0,
        cmap=warm,
        shaded=False,
        add_loc=['BBY', 'FRS', 'CZD'],
        colorbar=True,
        grid=False,
        altitude_range=[0, 800],
        contour_lines=[800, 1000],
        latdelta=0.1,
        londelta=0.2,
        add_geoline=linesec,
    )
    elev.plot_elevation_profile(ax=ax1)
def plot_petaluma_gap(ax=None,cmap=None):

    if cmap is None:
        warm = make_cmap(colors='warm_humid')

    if ax is None:
        fig, ax = plt.subplots()

    elev = elevation(domain=[-123.5, -121, 37.7, 38.7],
                     source='NCalDEMforGapFlow.mat')
    elev.plot_elevation_map(ax=ax, cmap=cmap, shaded=False,
                            locations=locs, colorbar=False, grid=False,
                            altitude_range=[-9, 800],
                            contour_lines=[800],
                            latdelta=0.2, londelta=0.2,
                            addrivers=False,
                            homed='/home/raul/Dropbox/NOCAL_DEM')
Example #5
0
def plot_petaluma_gap(ax=None, cmap=None):

    if cmap is None:
        warm = make_cmap(colors='warm_humid')

    if ax is None:
        fig, ax = plt.subplots()

    elev = elevation(domain=[-123.5, -121, 37.7, 38.7],
                     source='NCalDEMforGapFlow.mat')
    elev.plot_elevation_map(ax=ax,
                            cmap=cmap,
                            shaded=False,
                            locations=locs,
                            colorbar=False,
                            grid=False,
                            altitude_range=[-9, 800],
                            contour_lines=[800],
                            latdelta=0.2,
                            londelta=0.2,
                            addrivers=False,
                            homed='/home/raul/Dropbox/NOCAL_DEM')
def plot_terrain_profile():

    from matplotlib import gridspec
    warm = make_cmap(colors='warm_humid')

    linesec = {'origin': (38.29, -123.59),
               'az': 50, 'dist': 110, 'ndiv': 0}
               
    elev = elevation(domain_num=4)

    plt.figure(figsize=(8.5, 11))
    gs = gridspec.GridSpec(2, 1, height_ratios=[3, 1])
    ax0 = plt.subplot(gs[0])
    ax1 = plt.subplot(gs[1])
    elev.plot_elevation_map(ax=ax0, cmap=warm, shaded=False,
                            add_loc=['BBY','FRS','CZD'],
                            colorbar=True, grid=False,
                            altitude_range=[0, 800],
                            contour_lines=[800, 1000],
                            latdelta=0.1, londelta=0.2,
                            add_geoline=linesec,
                            )
    elev.plot_elevation_profile(ax=ax1)
Example #7
0
    print('Coordinate transformation performed on entire observation')
    print('')

# ## Making Polar Plots of X-ray emission from North and South Pole <br>
#
# Polar plots are created for either the full observation or feach defined time interval. The user is prompted to set the max limit for the color bar used in the plots. The pltos are saved to the same folder as the corrected event file.

# In[29]:

# Creating the custom color map for polar plots
c = colors.ColorConverter().to_rgb
custom_map = make_me_colors.make_cmap([
    c('white'),
    c('cyan'), 0.10,
    c('cyan'),
    c('blue'), 0.50,
    c('blue'),
    c('lime'), 0.90,
    c('lime')
])
# The color strings can be changed to what the user desires! Default: color map used in the Weigt et al. 2020

# convert to X-ray brightness in Rayleighs - assuimg Aef = 40cm^2 (appropriate for 300eV X-rays)
conf = 4.0 * np.pi * 206264.806**2 / 1E6 / 1000  # convert flux -> Rayleighs (brightness)

ratio = rad_pole_0 / rad_eq_0  # ratio of polar radius to equatorial radius

# Defining azimuth angle and distance in polar plot
azimuth = np.deg2rad(np.arange(0,
                               361))  # azimuth = S3 longitude in this system
# R deifned for both North and South poles using latitude. North: (0,90), South: (0, -90)
    15.,  # it is not necessary to perform unterpolation on a high radius since we have a high number of values
    Sharpness=20.,
    kernel='Gaussian',
    scaleInterp=1.)
VT_mean = opyf.npInterpolateVTK2D(
    Xdata, Vdata, XT,
    ParametreInterpolatorVTK=interp_params)  # may take a while if X large
gridVx_mean = opyf.Interpolate.npTargetPoints2Grid2D(VT_mean[:, 0], resX, resY)
gridVy_mean = opyf.Interpolate.npTargetPoints2Grid2D(VT_mean[:, 1], resX, resY)

colors = [(11. / 255, 22. / 255, 33. / 255, 1.),
          (33. / 255, 66. / 255, 99. / 255, 1.),
          (33. / 255, 66. / 255, 99. / 255, 0.),
          (204. / 255., 204. / 255, 0, 1), (0.6, 0, 0, 1)]
position = [0., 0.15 / (0.8), 0.2 / 0.8, 0.3 / 0.8, 1.]
cmap = make_cmap(colors, position=position)
setPlot = {
    'DisplayVis': True,
    'DisplayField': True,
    'QuiverOnFieldColored': False,
    'QuiverOnField': False,
    'DisplayPointsColored': False,
    'DisplayPoints': False,
    'QuiverOnPointsColored': False,
    'QuiverOnPoints': False,
    'DisplayContour': False,
    'ScaleVectors': None,
    # Warning : in Image convention the y0 is on the up left corner
    'extentFrame': [0, Lvis, Hvis, 0],
    'unit': 'px'
}