PRO DATACUBEPRAMS,outarray,date=date,working_dir=working_dir,cubename=cubename,$ cuberot=cuberot, magmod=magmod,$ bout=bout, b0=b0,$ hydro=hydro,densprof=densprof,te=te,deltar=deltar,$ saveprams=saveprams,readprams=readprams ;+ ; ;Name: ; DATACUBEPRAMS ; ;Purpose: ; To set up the structure containing the information needed ; to run a data cube interpolation. This procedure is to be ; called by the driver routine with keyword inputs that ; with resulting structure OUTARRAY assigned to ModPramsStruct ; (with ModPramsStruct.name='datacube') ; ;Keyword inputs: ; ; CUBENAME: Filename (inluding extention and path) of the datacube ; you want to look at. File must be in the correct format, ; use make_my_cube.pro in this directory to convert your ; cube. ; ; MAGMOD: Contains magnetic fields. Default yes (1). ; ; CUBEROT: Rotation angle in degrees. Amount the datacube is to be ; rotated around the x-axis in a counterclockwise manner. The ; cube is centered at longitude zero at the equator.(The ; default viewing position for a plane-of-sky map set in ; for_get_grid is -90, so that model structures centered on ; longitude zero appear at the West limb) The z-axis points ; north-south and the x-axis goes through the equator at ; longitude zero.Imagine the x-axis is pointed at you. Won't ; work on fully 3d data sets, but will work with axisym data ; sets or with datasets that are only a subset of lat/lon ; NOTE it is redundant with viewer position angle settings ; for axisym case, but not for sub-cube cases ; DEFAULT 0 ; ; BOUT: how to handle the magnetic field ouside the ; cube. The options are: ; ; BOUT=1; no magnetic field outside the cube (DEFAULT) ; BOUT=2; radial open field. default strength. note that ; there will probably be a discontionuity at the ; edge of the cube. ; BOUT=3; dipole field. default strength. note that ; there will probably be a discontionuity at the ; edge of the cube. ; ; BO: magnitude of external field for BOUT = 2 or 3 ; DEFAULT 10 Gauss ; ; HYDRO: how to handle the plasma properties outside the cube ; volume. The options are: ; ; HYDRO=0; no plasma outside the cube (DEFAULT) ; HYDRO=1; exponential isothermal hydrostatic equilibrium ; HYDRO=2; radial hydrostatic equilibrium ; ; DENSPROF ; For HYDRO=1, DENSPROF = density at coronal base in CGS ; DEFAULT 5d8 ; For HYDRO=2, DENSPROF is array [A,B,C,D,E,F] ; dens = A*r^-B + C*r^-D + E*r^-F ; ; TE ; For HYDRO=1, isothermal temperature value ; DEFAULT 1.5D6 ; ; ; DELTAR - step for radial derivative (e.g. LINE=NINST) ; DEFAULT 0.01d0 ; ; BOOKKEEPING ; ; SAVEPRAMS - if keyword set to a string, write parameters to filename ; (which is the keyword value saveprams) ; or if set to 1, then replace with pramarray ; ; ; READPRAMS - if keyword set, read in parameters from filename ; (which is the keyword value filename) ; or if a structure than read directly ; NOTE, flagged keywords will overwritten ; ;Output: ModPramsStruct to be useed by datacube.pro ; ; Author and history: ; Laurel Rachmeler: original version ; modified for hydrostatic model consistency SEG March 2011 ; changed to procedure and add readprams/saveprams Jan 2013 SEG ; ;- COMPILE_OPT IDL2 ;default long and square brackets for array subscripts if keyword_set(readprams) then begin ; read parameter file (a structure file or structure) case datatype(readprams) of 'STR': restgen,inarray,file=readprams 'STC': inarray=readprams else: message, 'must provide a named readprams file or a structure' endcase ; ; default to inarray values ; default,cubename,inarray.cubename default, cuberot, inarray.cuberot default, Bout, inarray.bout default,b0,inarray.b0 default,hydro,inarray.hydro default,densprof,inarray.densprof default,Te,inarray.Te default,deltar,inarray.deltar default,inarray.magmod,1 endif default, cuberot, DOUBLE(0) default, Bout, 1 ; nothing outside default,b0,10 ;Gauss, default strength of the external field default,magmod,1 ;Plasma paramters default,hydro,0 ; nothing outside if hydro eq 0 then default,densprof,0d0 if hydro eq 1 then default,densprof,5d8 if hydro eq 2 then default,densprof,[3.6d8,15.3d0,0.99d8,7.34d0,0.365d8,4.31d0] ; radial power law for WSM streamer in Gibson et al. 1999 ;if hydro eq 2 then default,densprof,[2.99d8,16d0,1.55d8,6.d0,0.036d8,1.5d0] ; radial power law from Baumbach-Allen in Aschwanden default,Te,1.5d6; default external temp ; deltar default,deltar,0.01d0 ;Rotation cuberot=double(cuberot)*!pi/180.0 ;turn into a double and in radians ;Magnetic field IF (Bout GT 3) OR (Bout LT 1) THEN BEGIN print, 'invalid Bout parameter in datacubeprams.pro. Now setting Bout=1, such that there is no ambient field outside the cube.' Bout=1 ENDIF ;which data cube ; THE STRUCTURE INSIDE CUBENAME.DAT BETTER BE CALLED CUBE IF NOT KEYWORD_SET(cubename) THEN BEGIN print, 'LOOK OUT! no datacube cubename parameter set. Going to default FORWARD/MODELS/DATACUBE/cube1.dat, but it is probably not what you want!' cubename='$FORWARD/MODELS/DATACUBE/cube1.dat' ENDIF ;if you forgot the .dat on your cubename, then add it in. IF STRPOS(cubename,'.dat') LT 0 THEN cubename=cubename+'.dat' ;Restore the data cube. When it comes out, there will be a structure ;called 'cube' restore,filename=cubename ;Finishing outarray={Name:'datacube',$ Label:cube.title,$ Cuberot:Cuberot,$ Bout:double(Bout),$ b0:double(b0),$ Hydro:double(Hydro),$ DensProf:DensProf,$ Te:Te,MagMod:double(magmod),$ DeltaR:DeltaR,CubeName:CubeName};cubename changes for each possible data cube, this parameter is an input pramarray={cubename:cubename,cuberot:cuberot,bout:double(bout),b0:double(b0),$ hydro:double(hydro),densprof:densprof,te:te,deltar:deltar} ; if requested, save input parameters to a file (stored in file named saveprams if it is a string) if keyword_set(saveprams) then begin case 1 of datatype(saveprams) eq 'STR': savegen,pramarray,file=saveprams,/replace else: saveprams=pramarray endcase endif END