SPECTRAL SYNTHESIS VIA MULTI-LOOP CONVOLUTION OF RETRACTINNG THIN FLUX TUBES REU SUMMER INTERNSHIP 2017 - CALLUM FAIRBAIRN - IDL PROGRAMMING INFO 07/29/17 ;===============================================================================; This file contains information regarding the main programming procedures used with regards to my summer project. This will detail their filepath within my directory structure, how they interact with other programs and the main tasks performed. I will order this discussion of programs based on the order problems needed to be tackled whilst advancing the project. This should complement my project report and allow for results to be replicated and extended. ;===============================================================================; ********************************************************************************* PREFT/ ********************************************************************************* The first task was to generate TFT data by running the PREFT simulations. The relevant programs are detailed below. flare31_run.pro This is the driver program which sets the thin flux tube parameters and evolves the tube. This top level program calls the many sub routines written by dana in order to advance the tube. flare_cont.pro This program continues the currently loaded PREFT tarr file - thus extending the run and allowing us to examine later dynamics. The number of iterations to perform can be adjusted. preft_cf.pro This is a modification of Dana's PREFT file which incorporates an enhanced tension at the chromospheric footpoints to avoid firehose instabilities. Changes were made in the contained make_tube and calc_dv procedures. flare_cf.pro This is the tension adapted driver program analogue to flare31_run.pro. This only differs by setting the profile for the enhanced tension. infowrite.pro This produces the 'runinfo.dat' output file along side the PREFT savefile. This contains the initialisation parameters chosen for easy access later. ********************************************************************************* analysis_tools/ ********************************************************************************* Having performed the runs we then proceeded to perform various forms of spectral analysis. The programming steps are detailed below. --------------------------------------------------------------------------------- 1) Visualising the PREFT runs --------------------------------------------------------------------------------- widget.pro This program produces a user interactive widget which plots different PREFT properties - loop shape, temperature, denisty and velocity-z. The slider allows us to step through different times. This allows us to quickly examine the physics of retraction which is important in understanding the spectral repsonse. tarrtime.pro This plotting procedure reads in my data runs and outputs a comparison of the temporal evolution of a given loop property. This will require adaptation for files in different locations or different properties. --------------------------------------------------------------------------------- 2) Performing RHESSI spectral synthesis --------------------------------------------------------------------------------- rx_inverted.dat This contains the flux transfer rate obtained by solving the inverse problem of fitting a given spectral band to the RHESSI observed band. This can then be applied to synthesis of all the other bands. tube_brem_band.pro This program performs the brehmstrahhlung analysis of the flux tube. This generates the light curve per unit flux. rh_spec_thist.pro This funstion convolves the flux transfer rate with the light curve per unit flux corresponding to the PREFT run. This outputs a structure containing the synthetic RHESSI spectra. --------------------------------------------------------------------------------- 3) GOES Synthesis and Comparison --------------------------------------------------------------------------------- goes_data.pro This uses the rd_goes.pro procedure to access GOES data within the swwidl distribution corresponding to the flare event of interest. This is then saved for easy access later as goes_data.sav. goes_spec_synth.pro Performs GOES synthesis for the loaded PREFT tarr data. This is then returns a a structure containing the two synthesised channels. goes_compare.pro This procedure loads in a PREFT run and computes the GOES synthesis via goes_spec_synth.pro. The result is then plotted against the observational GOES data. --------------------------------------------------------------------------------- 4) Spectral Comparison --------------------------------------------------------------------------------- rhessi_2004.sav The save file contains the observational RHESSI data for the Feb 26th 2004 flare. specview.pro This program launches a widget which allows the user to synthesise spectra for a chosen PREFT run and examine the light curve and spectral evolution with time. relax_test.pro This program performed a test on the length of PREFT run required to produce spectra which were close to the infinite time limit result of the run. This motivated the criteria adopted in other programs which checks that the integrated light curve between 10-30 keV has dropped to below 0.04 of its peak. If not the PREFT run should be extended. rherror.pro This interpolates the data onto a common x-axis such that Log Root Mean Square Deviations can be calculated between the observational and synthesised data. The error measures are output in an array. These measures give us a quantitative means of comparing the closeness of spectral fitting. rh_compare.pro This procedure was arguably the most important in my project. It reads in a user specified PREFT run and performs the spectral synthesis using rh_spec_thist.pro. It then checks that the PREFT run has a suitable length as investigated via relax_test.pro. The user can then select a flare time to examine in hr,min and secs. The program then extracts the PREFT and observational data correspnding to this time. Error analysis is then performed between the energy range 10-30keV in order to quantify the similarity between the PREFT and synthesised data - this calls the rh_error.pro function. Finally the spectra is plotted with the the Logarithmic Root Mean Square Deviation (LRMSD) included alongside the PREFT parameters chosen. The plot is saved and the error database is updated with the latest results parameter and error results via the procedure errordata.pro. --------------------------------------------------------------------------------- 5) Multi-Convolution Method: Using the methods above we are able to identify parameter choices which provide good spectral fits at different times and hence we can proceed with the multi convolution method. --------------------------------------------------------------------------------- sum_conv_[1-5].pro This file reads in the flux transfer rate and then distributes it amongst the different loop types. It then convolves each loop type with these new flux shares and saves the results in a structure for access by other programs. net_conv_run_[1-5].pro This procedure is the culmination of the study. The RHESSI and GOES observational data is read in. The output from sum_conv_[1-5].pro is restored and used to construct the net multi loop RHESSI and GOES synthesis. It then loops through time and outputs the RHESSI comparison plot, the GOES comaprison plot, the LRMSD error for both the multi and single loop methods and the progress through the light curve for a given energy band. These comparisons allows us to see the success of the multi convolution method. The different times in the loop are saved to a directory for MPEG stitching later. makemp4.pro This file reads in the .png plots output from net_conv_run_[1-5].pro and stitches them together into a movie - conv_movie.mp4. ********************************************************************************* Example Command Log ********************************************************************************* >flare31_run Performs PREFT run. >flare_cont Extends run as deemed necessary. >rh_compare Use to find effective spectral RHESSI fits at different times. >sum_conv_5 Produce separate multi convolution contributions. >net_conv_sum_5 Produce multi convolution analysis plots. >makemp4 Produce movie showing multi loop analysis for all times during the flare. NOTE PROGRAMS MAY NEED EDITING DEPENDING ON THE DIRECTORY STRUCTURE YOU USE. FURTHERORE SOME PROCEDURES RELY ON PROGRAMS WITHIN DANA'S DIRECTORY. ENSURE THIS IS ADDED TO YOUR IDL PATH ENVIRONMENT. ---------------------------------------------------------------------------------