<jupyter_start><jupyter_text>Detect Counts: Low-frequency Nanoflares<jupyter_code>import os
import glob
import traceback
os.environ['MKL_NUM_THREADS'] = '1'
os.environ['OMP_NUM_THREADS'] = '1'
os.environ['NUMEXPR_NUM_THREADS'] = '1'
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors
import h5py
import astropy.units as u
from astropy.io.fits.hdu.base import DTYPE2BITPIX
import sunpy.map
from astropy.coordinates import SkyCoord
from astropy.visualization import AsinhStretch,ImageNormalize,SqrtStretch
import distributed

import synthesizAR
from synthesizAR.instruments import InstrumentSDOAIA
from synthesizAR.atomic import EmissionModel
from synthesizAR.maps import make_los_velocity_map, make_temperature_map
from synthesizAR.visualize import plot_aia_channels

%matplotlib inline
cluster = distributed.LocalCluster(n_workers=64,threads_per_worker=1)
client = distributed.Client(cluster)
client
field = synthesizAR.Field.restore('/storage-home/w/wtb2/data/timelag_synthesis_v2/low_frequency/field_checkpoint/')
em_model = EmissionModel.restore('/storage-home/w/wtb2/data/timelag_synthesis_v2/low_frequency/nei/emission_model.json')
aia = InstrumentSDOAIA([0, 30000]*u.s,field.magnetogram.observer_coordinate)
observer = synthesizAR.Observer(field, [aia], parallel=True)
observer.build_detector_files('/storage-home/w/wtb2/data/timelag_synthesis_v2/low_frequency/nei/',
                              ds=0.5*u.Mm)
futures = observer.flatten_detector_counts(emission_model=em_model)
bin_futures = observer.bin_detector_counts('/storage-home/w/wtb2/data/timelag_synthesis_v2/low_frequency/nei/')<jupyter_output><empty_output><jupyter_text>Viz Sandbox<jupyter_code>plot_aia_channels(aia,10.0e3*u.s,'/storage-home/w/wtb2/data/timelag_synthesis_v2/low_frequency/nei/',
                  norm=ImageNormalize(stretch=SqrtStretch(),vmin=0,vmax=1e3))<jupyter_output>/storage-home/w/wtb2/anaconda3/envs/synthesized-timelags/lib/python3.6/site-packages/sunpy/map/sources/sdo.py:48: SunpyDeprecationWarning: Use Matplotlib to load the colormaps
  self.plot_settings['cmap'] = cm.get_cmap(self._get_cmap_name())
{'fraction_non_alphanumeric': 0.10536218250235184, 'fraction_numerical': 0.018344308560677328, 'mean_word_length': 6.996240601503759, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '221025', 'license': 'MIT', 'n_tokens_mistral': 818, 'n_tokens_neox': 773, 'n_words': 101, 'path': 'notebooks/low_frequency/detect_nei.ipynb', 'repo_name': 'rice-solar-physics/synthetic-observables-paper-models', 'size': '2126'}