ChiantiPy.Gui package

Submodules

ChiantiPy.model.Maker module

classes and methods to analyze observations of astrophysical spectra

ChiantiPy.model.Maker.diffPrintMcF(specData, matchDict, filename='diffPrintMcF.txt', sort=None)

calculates the weighted and straight differences between observed and predicted prints the values saves to a file from a PyMC run

ChiantiPy.model.Maker.doDemGofntQ(inQueue, outQueue)

helper for multiprocessing with maker.mgofnt()

ChiantiPy.model.Maker.emPlot(matchDict, vs='T', loc='upper right', fs=10, adjust=None, position='both', legend=True, verbose=0)

to plot line intensities divided by gofnt adjust is to provide an adjustment to the position of the labels position : one of ‘both’, ‘right’, ‘left’, or ‘none’

ChiantiPy.model.Maker.makeMatchPkl(specData, temp, dens, wghtFactor=0.25, abundanceName=None, minAbund=1e-06, useMgofnt=1, verbose=0)

input a data dictionary and instantiate a maker class, and run mgofnt and then make a pickle file to use multiprocessing, this needs to be run in an ipython console

Parameters

specDatadict

the observed line intensities, wavelegths …

class ChiantiPy.model.Maker.maker(temperature, specData, elementList=[], ionList=[], allLines=False, abundanceName=None, minAbund=10.0, wghtFactor=None, verbose=False)

Bases: ChiantiPy.base._IonTrails.ionTrails, ChiantiPy.base._SpecTrails.specTrails

a class matching observed lines to lines in the CHIANTI database

argCheck(temperature=None, eDensity=None, pDensity='default', verbose=0)

to check the compatibility of the three arguments and put them into numpy arrays of atleast_1d

diffPrintChi(dir='.', filename='diffPrintChi.txt', wghtFactor=0.3)

calculates the weighted and straight differences between observed and predicted prints the values saves the as a dictionary self.Diff to be used together with a prior brute-force chi-squared minimization approach

diffPrintMc(dir='.', filename='diffPrintMc.txt', sort=None)

calculates the weighted and straight differences between observed and predicted prints the values saves to a file from a PyMC3 run also created a attribute self.Dict, a dict with the following keys: ‘wvl’ = observed wavelength (A) ‘relDiff’ = (I_obs - I_pred)/(I_obs) ‘ionS’ the CHIANTI type name for an ion

dumpMatch(filename)

to save the attribute match to a pickle file

dumpSearchData(filename)

to save the attribute match to a pickle file

emFitPlot()

to plot the emission measures derived from search over temperature

emMake(outName, reference)

to make an emission measure file outName does not need the suffix .em reference should be a list of references

emPlot(vs='T', loc='upper right', fs=10, adjust=None, position='both', label=True, legend=True, verbose=1)

to plot line intensities divided by gofnt adjust is to provide an adjustment to the position of the labels position : one of ‘both’, ‘right’, ‘left’, or ‘none’

emSet(value)

sets the EM values for a N temperature EM distribution

emSetIndices(indices, verbose=0)

to set the indices of the N temperature/density EM distribution

findMinMaxIndices(verbose=0)

to find the minimum and maximum indices where all match[‘intensitySum’] are greater than 0

fit1t(initialValue, maxfev=0)

calls leastsq to fit the 1t (single temperature) model

fitFunc1t(em)

the fitting function for the isothermal model to be called by leastsq

Parameters

em (number) – the log10 value of the emission measure

Returns

weighted chisquared

Return type

float

fitFuncNt(value)

the fitting function for the 1 (single temperature) temperature model to be called by leastsq

fitNt(initialValue, maxfev=0)

calls leastsq to fit the 2d model

getChisq()

return chisq

getNormalizedChisq()

return normalized chisq

getWeightedDiff()

to calculated the weighted difference of each of the intensities returns a 1D array

gofnt(temperature, density, verbose=1)

calculate the gofnt function for each of the matched lines do each ion only once

loadMatch(filename)

to open a pickle file, return the match data and make it an attribute

loadSearchData(filename)

to load the pickled search data as an attribute self.SearchData

makeMatch(verbose=False)

to match the CHIANTI lines with the input specdata uses ionTrails.ionGate to sort through ions

mgofnt(temperature, density, proc=6, timeout=0.1, verbose=0)

calculate the gofnt function for each of the matched lines this is the multiprocessing version do each ion only once

predict()

to predict the intensities of the observed lines from an emission measure the emission measure is already specified as self.Em which is an np array

predictPrint(minContribution=0.1, outfile='predictPrint.txt', sort=None, verbose=0)

to predict the intensities of the observed lines from an emission measure the emission measure is already specified as self.Em which is an np array

predictPrint1d(minContribution=0.1, outfile=0, verbose=0)

to predict the intensities of the observed lines from an emission measure the emission measure is already specified as self.Em which is an np array

search1dSpace(initialEm, indxlimits=None, verbose=0, log=0, maxfev=0)

to conduct a brute force search over electron density for an isothermal-space and find the best fit to the em and density indxlimits give the range of indices to fit over can use self.MinIndex and self.MaxIndex+1 initialEm = log value of the emission measure to begin the searching

search1tEmSpace(verbose=0)

to find the value of chisq as a function of Em with T = best-fit

search2tSpace(initial, indxlimits=None, verbose=0, log=0, maxfev=0)

to conduct a brute force search of 2 temperature space and find the best fit indxlimits give the range of indices to fit over

search3tSpace(initial, indxlimits=None, verbose=0, log=0)

to conduct a brute force search of 3 temperature space and find the best fit indxlimits give the range of indices to fit over set log to create a log file of the iterations rather that outputting to the jupyter/ipython session

search4tSpace(initial, indxlimits=None, verbose=0, log=0)

to conduct a brute force search of 4 temperature space and find the best fit indxlimits give the range of indices to fit over set log to create a log file of the iterations rather that outputting to the jupyter/ipython session derived from Aug 2018 3t method

Module contents

classes and methods for modeling observed spectra.