<jupyter_start><jupyter_text>Raw and Calibrated Observational Data Load and Downbin the Raw Observation DataThe time-integreated GBT data are provided at full-frequency resolution as nupmy dictionaries for each observation target and each subband. The data without time-series filtering is found in `../data/GBT_DATA/Unfiltered_Data/`. The data with time-series filtering is found in `../data/GBT_DATA/Filtered_Data/`A utility module for loading and joining the GBT data `load` is provided in `'../python/'`. To load the data, provide the data directory and observation identification as arguments in `load.load`. The data may be downbinned using the `downsample` optional argument and shifted half the downbinned frequency channel width with the `do_shift` optional argument. Our analysis is performed at a downsampling factor of `10`.<jupyter_code>M31_Data = load.load('../data/GBT_Data/Filtered_Data/', 'M31', downsample = 1, do_shift = False)

M31_Freqs = M31_Data[0]  # The central frequency for each frequency channel, GHz
M31_AntennaTemp = M31_Data[1] # The antenna temperature at each frequency channel, K
M31_Sig = M31_Data[2] # The ON Position measurement for each frequency channel, Raw Antenna Counts
M31_Ref = M31_Data[3] # The OFF Position measurement for each frequency channel, Raw Antenna Counts
M31_SigAccept = M31_Data[4] # The fraction of ON Position measurements accepted at each frequency channnel
M31_RefAccept = M31_Data[5] # The fraction of OFF Position measurements accepted at each frequency channnel<jupyter_output>M31_A.npz<jupyter_text>Infer a Calibration FunctionIdentically formatted GBT with observations of calibration sources used to infer a flux density spectrum from the antenna temperature are provided in the GBT data directory. Each target observation has a matching calibration observation from the same observing session in the same mode. The table below provides the appropriate calibration observation for each target observation.| Observation Target | Calibration Observation || ------------- | ------------- || RX$-$J0720 | 3C48_mode9 || RX$-$J0806 | 3C48_mode9|| M31 | 3C48_mode2 || Galactic Center | 3C286_mode2 || Galactic Center Offset | 3C286_mode2|| M54 | 3C286_mode4 |The calibration observations corresponds to sources with well-characterized flux density spectra so that the antenna temperature may be calibrated against the expected flux density measurement.  The calibration antenna temperature is first smoothed with a median filter in order to improve the signal-to-noise, resulting in a better behaved calibration function.<jupyter_code>Cal_Data = load.load('../data/GBT_Data/Filtered_Data/', '3C48_mode2', downsample = 1, do_shift = False)

Cal_Freqs = Cal_Data[0]  # The central frequency for each frequency channel, GHz
Cal_AntennaTemp = Cal_Data[1] # The antenna temperature at each frequency channel, K

Cal_Func = load.get_expected(Cal_Freqs, '3C48') / ndimage.median_filter(Cal_AntennaTemp, size = 31)<jupyter_output>3C48_mode2_A.npz<jupyter_text>Reduce the DataThe raw data is provided at frequencies outside the data-taking range for each observation. Following GBT documentation, the LBand should be reduced to the frequency range `1.15 - 1.73 GHz`. We also mask out data at the location of the notch filter in the frequency range `1.2  - 1.35 GHz`.<jupyter_code>locs = np.where(np.logical_and(M31_Freqs >= 1.15, M31_Freqs <= 1.73))

for item in [M31_Freqs, M31_AntennaTemp, M31_Sig, M31_Ref, M31_SigAccept, M31_RefAccept, Cal_Func]:
    item = item[locs]

mask_locs = np.where(np.logical_and(M31_Freqs >= 1.2, M31_Freqs <= 1.34))
mask = np.ones_like(M31_Freqs)
mask[mask_locs] = np.nan<jupyter_output><empty_output><jupyter_text>Plot the Calibrated Flux Density Spectra<jupyter_code>mpl.rcParams['figure.figsize'] = 10, 6 # default figure size


plt.plot(M31_Freqs, mask*(Cal_Func * M31_AntennaTemp), label = 'M31')

plt.xlabel('Frequency [GHz]')
plt.ylabel('Flux Density [Jy]')

plt.legend(fontsize = 20)
plt.tight_layout()
plt.show()<jupyter_output>/sw/lsa/centos7/python-anaconda2/2019.03/lib/python2.7/site-packages/matplotlib/font_manager.py:1331: UserWarning: findfont: Font family [u'serif'] not found. Falling back to DejaVu Sans
  (prop.get_family(), self.defaultFamily[fontext]))
{'fraction_non_alphanumeric': 0.08732394366197183, 'fraction_numerical': 0.038262910798122066, 'mean_word_length': 5.456060606060606, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '376764', 'license': 'MIT', 'n_tokens_mistral': 1419, 'n_tokens_neox': 1279, 'n_words': 457, 'path': 'examples/Load_GBT_Example.ipynb', 'repo_name': 'joshwfoster/RadioAxionSearch', 'size': '4260'}