Ne From Power

Ne From Power#

WIP

This page is currently a work in progress, meaning it likely has incomplete explanations and some non-functional code/links/ect. Please be patient!

If you think you can help, please consider contributing.

Plasma density can be found either by integrating the area under the ion line in the ISR spectra or from the power of the returned signal. This second method does not require the full spectra to be resolved, so higher range resolution can be achieved. The other ISR parameters (Te, Ti, and Vlos) cannot be derived from this method. In general, the normal estimation of Ne is suitable for most applications, especially when co-located estimates of temperature and velocity are desired. However, if the application would benefit from high range or altitude resolution and only plasma density is required, this parameter may be suitable.

import numpy as np
import h5py
import os
import urllib.request
import matplotlib.pyplot as plt

Download files that will be used in this tutorial.

# Download the file that we need to run these examples
filename = 'data/20200207.001_lp_5min-fitcal.h5'

if not os.path.exists(filename):
    url='https://data.amisr.com/database/dbase_site_media/PFISR/Experiments/20200207.001/DataFiles/20200207.001_lp_5min-fitcal.h5'

    print('Downloading data file...')
    urllib.request.urlretrieve(url, filename)

    print('...Done!')

Read in the required NeFromPower arrays and create an RTI plot.

with h5py.File(filename, 'r') as h5:
    bidx = 0
    rng0 = h5['NeFromPower/Range'][bidx,:]
    ne0 = h5['NeFromPower/Ne_NoTr'][:,bidx,:]
    utime = h5['Time/UnixTime'][:,0]

time = utime.astype('datetime64[s]')
fig = plt.figure(figsize=(10,4))
ax = fig.add_subplot(111)
c = ax.pcolormesh(time, rng0, ne0.T, vmin=0., vmax=4.e11)
ax.set_xlabel('Universal Time')
ax.set_ylabel('Slant Range (m)')
fig.colorbar(c, label=r'Electron Density (m$^{-3}$)')
<matplotlib.colorbar.Colorbar at 0x7f3df8262710>
_images/8c6c27bacf1c79adf48fc495012d3449ceb1f35ffd864524f6fd7cc80a1de5c1.png

Note the artifacts below 60 km. These should be removed before any analysis.

QUESTION: Are these artifacts always in the same place?

ridx = np.argmin(np.abs(60000.-rng0))
rng = rng0[ridx:]
ne = ne0[:,ridx:]
fig = plt.figure(figsize=(10,4))
ax = fig.add_subplot(111)
c = ax.pcolormesh(time, rng, ne.T, vmin=0., vmax=4.e11)
ax.set_xlabel('Universal Time')
ax.set_ylabel('Slant Range (m)')
fig.colorbar(c, label=r'Electron Density (m$^{-3}$)')
<matplotlib.colorbar.Colorbar at 0x7f3df0c5df00>
_images/432be76fe6f21c94fcde6a3c0fb28c578764d10ca1ed0da472668e8ef46fe3e5.png

For comparison, plot the fitted electron densities from this same experiment.

with h5py.File(filename, 'r') as h5:
    bidx = 0
    rng_fit = h5['FittedParams/Range'][bidx,:]
    ne_fit = h5['FittedParams/Ne'][:,bidx,:]
#     utime = h5['Time/UnixTime'][:,0]

# time = utime.astype('datetime64[s]')

fig = plt.figure(figsize=(10,4))
ax = fig.add_subplot(111)
c = ax.pcolormesh(time, rng_fit[np.isfinite(rng_fit)], ne_fit[:,np.isfinite(rng_fit)].T, vmin=0., vmax=4.e11)
ax.set_xlabel('Universal Time')
ax.set_ylabel('Slant Range (m)')
fig.colorbar(c, label=r'Electron Density (m$^{-3}$)')
<matplotlib.colorbar.Colorbar at 0x7f3df0a2afe0>
_images/ff3a850621f7c44dd45db49ba9bd2cb62852bb685a2bb6315d7f9e48600c3b06.png

Note that the range resolution of the fitted electron density is substantially less than that from NeFromPower.

rng_res_fit = np.nanmean(np.diff(rng_fit))
rng_res = np.nanmean(np.diff(rng))

print(f'Range Resolution of Fitted Ne: {rng_res_fit} m')
print(f'Range Resolution of NeFromPower: {rng_res} m')
Range Resolution of Fitted Ne: 5995.848481514085 m
Range Resolution of NeFromPower: 2997.924560546875 m