<jupyter_start><jupyter_text>NOTE!!!! The code below is an *example* only for how to generate a shell script to run nuproducts. IT WILL NOT WORK WITH THE EXAMPLE DATA IN THIS REPOSITORY Please use it as a template only for your own analysis.These scripts do not actually run nuproducts (since that can take a long time), so they instead genreated executable scripts that can be run on the command line withe fields correctly populated (i.e. for barycenter corrected lightcurves).Note that right now this does *not* provide a barycenter-corrected *eventfile*. Do do this, add "cleanup=no" to the nuproducts command. A future version of nuproducts will provide a direct parameter to save the barycenter corrected events.  How to make lightcurves<jupyter_code># top == some path to your top level data directory.

seqid='30001039002'
obs = info.Observation(path=f'{top}/data/', seqid=seqid)
evfile = obs.science_files[mod][0]
regfile = obs._evdir+f'src{mod}01.reg'
bgdreg = obs._evdir+f'bgd{mod}01.reg'

obs.set_outpath = f'{top}/products/{obs.seqid}/lightcurves'


pairs = [[3, 20], [20, 30], [30, 40], [40, 50], [50, 80]]
for [elow, ehigh] in pairs:
    shfile = wrappers.make_lightcurve(evfile, mod, regfile,
                             elow=elow, ehigh=ehigh, bgd_reg=bgdreg,
                             outpath=obs.out_path, barycorr=True)
    print(shfile)
print()<jupyter_output><empty_output><jupyter_text>How to make spectra<jupyter_code># top == some path to your top level data directory.
seqid='30001039002'
obs = info.Observation(path=f'{top}/data/', seqid=seqid)
evfile = obs.science_files[mod][0]
regfile = obs._evdir+f'src{mod}01.reg'
bgdreg = obs._evdir+f'bgd{mod}01.reg'

obs.set_outpath = f'{top}/products/{obs.seqid}/spectra'


shfile = wrappers.make_spectra(evfile, mod, regfile, outpath=obs.out_path)
print(shfile)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11367292225201073, 'fraction_numerical': 0.027345844504021447, 'mean_word_length': 4.777089783281734, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '661735', 'license': 'MIT', 'n_tokens_mistral': 687, 'n_tokens_neox': 636, 'n_words': 193, 'path': 'notebooks/WrapperExample.ipynb', 'repo_name': 'bwgref/nustar-gen-utils', 'size': '1865'}