zeeman

Return to directory of Todd's tools

Fits a single pixel of Stokes I and Stokes V cubes for the B field and draws a summary plot.

Usage:

tt.zeeman(filename, Icube, Vcube, Vrms=None, trials=1000, Z=None, 
          restfreq=None, xrange='', xplotrange=[0, 0], plotfile='', 
          showStokesV=False, debug=False, blc=None, trc=None, 
          overwrite=False, stokes='V')
Inputs:
  • filename: the ASCII file containing the I and V spectra. If it does not exist, and the cubes exist, then it will run ispecs to generate it.
  • Icube: the name of the Stokes I cube used to extract the spectrum (You don't need the cube to be on disk, only need to give the name.)
  • Vcube: the name of the Stokes V cube used to extract the spectrum (You don't need the cube to be on disk, only need to give the name.)
  • Vrms: the rms intensity to use for the Stokes V spectrum
  • trials: if greater than 1, then compute uncertainties in the fit parameters with a Monte Carlo method
  • Z: if specified along w/restfreq, then compute B_los (from 2b*d_nu/Z)
  • restfreq: if specified, then convert d_nu from units in the file to Hz; if Z is not specified, print Z*B_los (it can be string with units, or floating point value in Hz or GHz)
  • xrange: e.g. '17~23' (in the current units)
  • blc, trc: only used if filename does not exist (i.e. to generate it with tt.ispec)
  • overwrite: if True, generate new ASCII file (only used if cubes exist)
  • stokes: only used to label the Vcube spectrum in the plot (e.g. change to 'Q' if you feed a Q cube to Vcube parameter)

Examples:

CASA <6>: tt.zeeman('test.370.340.txt','G06.05_july31.ms.contsub.ch3oh.spw0_I.image','G06.05_july31_X5de.ms_StokesI_V.image',blc=[370,340])
Running tt.ispecs to generate a new ASCII file.
Results left in test.370.340.txt
Using Vrms =  0.00534025203855
Plot left in  test.370.340.txt.png
a = 0.00151408 +- 2.17924e-05
b = -0.000582965 +- 3.82987e-05
  Out[6]
(0.0015140766121552953,
 2.1792429208692971e-05,
 -0.00058296533147814329,
 3.8298669040193728e-05)

CASA <7>: tt.zeeman('test.370.340.txt','G06.05_july31.ms.contsub.ch3oh.spw0_I.image','G06.05_july31_X5de.ms_StokesI_V.image',blc=[370,340])
Using existing ASCII file.
Set overwrite=True to generate a new one.
Using Vrms =  0.00534025203855
Plot left in  test.370.340.txt.png
a = 0.00151161 +- 2.11203e-05
b = -0.000583493 +- 3.6178e-05
  Out[7]:
(0.0015116128658256701,
 2.1120288236439519e-05,
 -0.00058349290302604079,
 3.6178009644488677e-05)

CASA <8>: tt.zeeman('test.370.340.txt','G06.05_july31.ms.contsub.ch3oh.spw0_I.image','G06.05_july31_X5de.ms_StokesI_V.image',blc=[370,340],overwrite=True)
Running tt.ispecs to generate a new ASCII file. 
Results left in test.370.340.txt
Using Vrms =  0.00534025203855
Plot left in  test.370.340.txt.png
a = 0.00151129 +- 2.02815e-05
b = -0.000581035 +- 3.85263e-05
  Out[8]:
(0.0015112891523722089,
 2.0281539437892505e-05,
 -0.00058103474858294674, 
 3.8526260063765163e-05)  

-- ToddHunter - 2015-08-03

This topic: ALMA > ToddTools > Zeeman
Topic revision: 2015-09-28, ToddHunter
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback