NB. Polarization from HOT stellar atmospheres. NB. Usage: load 'extract_hot.ijs', load 'Set_LMN.ijs' NB. run Set_LMN'' once, then do, e.g., NB. Z=. 't380g350' Extract 4000 (for T=35,000, log g=3.5) NB. The output is: 'mu theta(rad) theta(deg)'=. 0{Z NB. 'Ia Qa pol'=. 1{Z (1 is wavelength index) NB. where Ia = Ia(mu) for (#mua) values of mu NB. dimensions of "Z" are ((#lams),3,(#mua)) require 'files' NB. note: must run Set_LMN'' first. Extract=: dyad define nl=. # nus=. 3e18% lams=: y dir=. '/your_path/STERNE_HOT.d/' out_file=. dir,'temp0' in_file=. dir,x,'p00.summary' 2!:1 'awk ''NR >7'' <',in_file,' >',out_file NB. 2!:1 ... : execute awk command to strip off 1st 7 lines of file opN=. mread out_file NB. read in atmosphere table opN=. (nl,50,13)$ ,opN NB. reformat to separate wavelength groups print 'Wavelengths: ';lams load'/juno/jph/J6/SPLINES/splines.ijs' load'/your_path/IQMsi.ijs' load'/your_path/IQs.ijs' load'/your_path/s_and_p.ijs' frame_s=: < (#ttt)$0 NB. ttt is tau grid defined (ttt=: ) in "Set_LMN" frame_p=: < (#ttt)$0 mua=: 0 0.0001 0.0003 0.001 0.0015 0.002 0.003 0.005 0.0075 0.01 0.013 0.016 theta=. acos mua=: mua, (4}. _101}. int01 200),(50}. int01 100) I0=. IQMsi ttt;mua frame=. < (3,(#mua))$mua, theta, (180*theta%1p1) ind=. _1 while. (ind=. >:ind)s frame_p=: frame_p,< >p NB. 'Ia Qa pol'=: (I0;mua) IQs s;p frame=. frame, < >(I0;mua) IQs s;p end. frame_s=: >}. frame_s frame_p=: >}. frame_p >frame ) mread=: (0&".)@('m'&fread) NB. read in a data matrix Bnu=: 1.47449934e_47&*@(^&3@])% -&1@(^@(4.799243e_11&*@(] % [))) NB. Here we assume the directory "STERNE_HOT.d" contains the model NB. atmosphere files with names like "t380g350p00.summary" from the NB. website "http://star.arm.ac.uk/~csj/models/Grid.html" NB. (these model listings give kappa for a wavelength of 4000A only)