A 3D printing model of the solar coronal, the model needed enough lines around a few active regions to simulate the coronal images that might be made. (40 per AR and at least four AR), using the Schatten current sheet. The model needed some lines to show the overall structure over the full sphere and have enough lines so that there would be enough lines going from the surface out to the source surface so the 3D print would have the surface holding the sun. In the 3D print model of the source surface would be connected to the mount holding the model.
The WSA ( Wang-Sheeley-Arge ) model is used to derive solar wind speed. The model uses photospheric magnetograms to calculate the coronal field. It is based on the idea that, far from the Sun, the speed of the solar wind depends on the path that the wind took as it passed through the lower corona. It models the coronal magnetic field which will be used to generate a 3D printing model of the sun.
Potential field lines for the sun for the Carrington Rotation: 2196 _304 09 Oct 2017 17:06 UT
Date files can be found here:
https://drive.google.com/drive/folders/1OHV5BuqZPA6ze-E3JuK9t5SsPPSyNpkD?usp=sharing
Date files can be found here:
https://drive.google.com/drive/folders/1OHV5BuqZPA6ze-E3JuK9t5SsPPSyNpkD?usp=sharing
A request was sent to Community Coordinated Modeling Center - GSFC:
For a 3D printing model of the solar coronal, the model need enough lines around a few active regions to simulate the coronal images that might be made. (40 per AR and at least four AR), using the Schatten current sheet. The model needs some lines to show the overall structure over the full sphere and have enough lines so that there would be enough lines going from the surface out to the source surface so the 3D print would have the surface holding the sun. In the 3D print model the source surface would be connected to the mount holding the model.
For a 3D printing model of the solar coronal, the model need enough lines around a few active regions to simulate the coronal images that might be made. (40 per AR and at least four AR), using the Schatten current sheet. The model needs some lines to show the overall structure over the full sphere and have enough lines so that there would be enough lines going from the surface out to the source surface so the 3D print would have the surface holding the sun. In the 3D print model the source surface would be connected to the mount holding the model.
This Mathematica model will read each the lines x,y,z, and field strength at each point via spherical coordinates.
Notes: from CCMC:
The WSA ( Wang-Sheeley-Arge ) model records fieldlines were provide in 3 separate files, all combined in a tar file.
1. tracing inward from the outer boundary of the Schatten current sheet (5Rsun) to the source surface (at2.5Rsun) in fs2/Data/WSA-6.2/WSA_WORKING/CCMC/QuickStart/CORONA/trace_scs_outtoin
2. continuing these fieldlines from the source surface to the solar surface, in
fs2/Data/WSA-6.2/WSA_WORKING/CCMC/QuickStart/CORONA/trace_pfss_outtoin
3. drawing fieldlines from the solar surface in
fs2/Data/WSA-6.2/WSA_WORKING/CCMC/QuickStart/CORONA/trace_pfss_intoout
The fits file headers give a comprehensive description of the data in each file.
The image in
fs2/Data/WSA-6.2/WSA_WORKING/CCMC/QuickStart/PLOTS/CORONA/wsa_202411051404R000_gong_1_6_4.png
shows you the standard WSA view of the solution so you can get an idea of the field complexity.
The WSA ( Wang-Sheeley-Arge ) model records fieldlines were provide in 3 separate files, all combined in a tar file.
1. tracing inward from the outer boundary of the Schatten current sheet (5Rsun) to the source surface (at2.5Rsun) in fs2/Data/WSA-6.2/WSA_WORKING/CCMC/QuickStart/CORONA/trace_scs_outtoin
2. continuing these fieldlines from the source surface to the solar surface, in
fs2/Data/WSA-6.2/WSA_WORKING/CCMC/QuickStart/CORONA/trace_pfss_outtoin
3. drawing fieldlines from the solar surface in
fs2/Data/WSA-6.2/WSA_WORKING/CCMC/QuickStart/CORONA/trace_pfss_intoout
The fits file headers give a comprehensive description of the data in each file.
The image in
fs2/Data/WSA-6.2/WSA_WORKING/CCMC/QuickStart/PLOTS/CORONA/wsa_202411051404R000_gong_1_6_4.png
shows you the standard WSA view of the solution so you can get an idea of the field complexity.
The coupling of the PFSS and Schatten CS give kinks in the field lines at their common boundary, which WSA tries to smooth out. CCMC suggested that it might be good to explore additional smoothing there when one is converting the files into the format for the 3D printer. Also, field lines in CCMC files use the default selection of starting points which is a set of uniformly spaced points on the outer sphere, with 180 in the azimuthal direction and 90 in the latitude direction, with an additional set of 180x3 lines drawn about the plane of the ecliptic.
The fits files in the Trace directories are given as tables. The primary data extension has a 6x300x16740 array.
If we use i,j,k to index the array, each k index represents a distinct field line, with <=300 points along a field line, and 6 data values at each field line point (phi coord, theta coord, radial coord, Bphi, Btheta, Bradial). Most field lines have less than 300 points so where there is a value of -999.99, that can be ignored. Field lines are drawn both inward (‘outtoin’) from the outer boundary of the current sheet component (at 5Rsun) to make sure lots of open field lines are included, and ‘intoout’ from the solar surface to make sure closed field region fieldlines are also drawn. There are 180 x (90 + 3) = 16740 fieldlines in both of the outtoin files. These 2 files need to be combined to complete the ‘outtoin’ fieldlines. The 180x90 set (k=t to 16200) start from an evenly spaced set of grid points on the sphere at 5Rsun. The extra 180x3 lines (k=16201 to 16740) of starting points (I believe) are started from a circle of 180 point around the plane of the ecliptic and +/- delta_theta either side of the plane of the ecliptic (not sure what delta_theta is set to).
For the intoout fits file, the data array has the same dimensions. The extra points, k=16201 to 16740, seem to be unused space.
The fits files in the Trace directories are given as tables. The primary data extension has a 6x300x16740 array.
If we use i,j,k to index the array, each k index represents a distinct field line, with <=300 points along a field line, and 6 data values at each field line point (phi coord, theta coord, radial coord, Bphi, Btheta, Bradial). Most field lines have less than 300 points so where there is a value of -999.99, that can be ignored. Field lines are drawn both inward (‘outtoin’) from the outer boundary of the current sheet component (at 5Rsun) to make sure lots of open field lines are included, and ‘intoout’ from the solar surface to make sure closed field region fieldlines are also drawn. There are 180 x (90 + 3) = 16740 fieldlines in both of the outtoin files. These 2 files need to be combined to complete the ‘outtoin’ fieldlines. The 180x90 set (k=t to 16200) start from an evenly spaced set of grid points on the sphere at 5Rsun. The extra 180x3 lines (k=16201 to 16740) of starting points (I believe) are started from a circle of 180 point around the plane of the ecliptic and +/- delta_theta either side of the plane of the ecliptic (not sure what delta_theta is set to).
For the intoout fits file, the data array has the same dimensions. The extra points, k=16201 to 16740, seem to be unused space.
First method to the read the tar file generated by CCMC is using Mathematica functions:
In[]:=
tarfile=Import["C:\\Users\\gag00\\OneDrive\\Desktop\\wsa62_quickstart_run.tar"];
{"fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\QuickStart.xml", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\PREPROCESS\\syn_202411051404_gongz.fits", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\PREPROCESS\\pre_out_list.txt", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\CORONA\\trace_scs_outtoin\\202411051404R000_trace_scs_outtoin_tracing.fits", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\CORONA\\input.dat", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\CORONA\\trace_pfss_outtoin\\202411051404R000_trace_pfss_outtoin_tracing.fits", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\CORONA\\trace_pfss_intoout\\202411051404R000_trace_pfss_intoout_tracing.fits", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\CORONA\\tracer.list", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\CORONA\\gongz_date_list.txt", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\CORONA\\wsa_202411051404R000_gongz.fits", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\SUBSATELLITE\\sbe_202411051404_gongz.fits", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\RESIZE\\input.dat", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\RESIZE\\int_out_list.txt", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\RESIZE\\int_202411051404_gongz.fits", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\RESIZE\\resize.list", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\INPUT\\mrzql241105t1404c2290_040.fits.gz", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\INPUT\\input.dat", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\INPUT\\goodRun.dat", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\INPUT\\gong_current_map.dat", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\INPUT\\pregongz.list", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\INPUT\\auto_run_files.txt", "fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\PLOTS\\CORONA\\wsa_202411051404R000_gong_1_6_4.png"}
In[]:=
Dimensions[tarfile]
Out[]=
{22}
In[]:=
z1=tarfile[[1]]
Out[]=
fs2\Data\WSA-6.2\WSA_WORKING\CCMC\QuickStart\QuickStart.xml
In[]:=
z4=tarfile[[4]]
Out[]=
fs2\Data\WSA-6.2\WSA_WORKING\CCMC\QuickStart\CORONA\trace_scs_outtoin\202411051404R000_trace_scs_outtoin_tracing.fits
In[]:=
z22=tarfile[[22]]
Out[]=
fs2\Data\WSA-6.2\WSA_WORKING\CCMC\QuickStart\PLOTS\CORONA\wsa_202411051404R000_gong_1_6_4.png
In[]:=
(*Import["C:\\Users\\gag00\\OneDrive\\Desktop\\wsa62_quickstart_run.tar","fs2\\Data\\WSA-6.2\\WSA_WORKING\\CCMC\\QuickStart\\PLOTS\\CORONA\\wsa_202411051404R000_gong_1_6_4.png"]*)
Second method for reading the tar-file is on a Dell desktop using MS Windows 11, where one can right clicked on the .tar files and is able to extract all the files to file Tar Files which consisted of:
“C:\Users\gag00\OneDrive\Desktop\Tar Files\resize.list”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\pregongz.list”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\pre_out_list.txt”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\mrzql241105t1404c2290_040.fits.gz”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\int_out_list.txt”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\int_202411051404_gongz.fits”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\gongz_date_list.txt”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\202411051404R000_trace_scs_outtoin_tracing.fits”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\202411051404R000_trace_pfss_outtoin_tracing.fits”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\202411051404R000_trace_pfss_intoout_tracing.fits”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\wsa_202411051404R000_gongz.fits”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\wsa_202411051404R000_gong_1_6_4.png”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\syn_202411051404_gongz.fits”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\sbe_202411051404_gongz.fits”
These files were placed in folder named ”C:\\Users\\gag00\\OneDrive\\Desktop\\Tar Files”
For importing these files into Mathematica see the online notes:
https://www.wolfram.com/language/12/data-import-and-export/fits-updates.html
“C:\Users\gag00\OneDrive\Desktop\Tar Files\pregongz.list”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\pre_out_list.txt”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\mrzql241105t1404c2290_040.fits.gz”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\int_out_list.txt”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\int_202411051404_gongz.fits”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\gongz_date_list.txt”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\202411051404R000_trace_scs_outtoin_tracing.fits”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\202411051404R000_trace_pfss_outtoin_tracing.fits”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\202411051404R000_trace_pfss_intoout_tracing.fits”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\wsa_202411051404R000_gongz.fits”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\wsa_202411051404R000_gong_1_6_4.png”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\syn_202411051404_gongz.fits”
“C:\Users\gag00\OneDrive\Desktop\Tar Files\sbe_202411051404_gongz.fits”
These files were placed in folder named ”C:\\Users\\gag00\\OneDrive\\Desktop\\Tar Files”
For importing these files into Mathematica see the online notes:
https://www.wolfram.com/language/12/data-import-and-export/fits-updates.html
In[]:=
SetDirectory["C:\\Users\\gag00\\OneDrive\\Desktop\\Tar Files"]
Out[]=
C:\Users\gag00\OneDrive\Desktop\Tar Files
aselect=1(*1Intoout0r2Outtoin*);
File2Use=Which[aselect==1,"202411051404R000_trace_pfss_intoout_tracing.fits"(*FieldlinesfromIntoOut*),aselect==2,"202411051404R000_trace_pfss_outtoin_tracing.fits"(*FieldlinesformOuttoIn*)];
In[]:=
File2Use
Out[]=
202411051404R000_trace_pfss_intoout_tracing.fits
In[]:=
Import[File2Use,"Dimensions"]
Out[]=
1{6,300,16740}
In[]:=
datapoints=Import[File2Use,{"Data",1}];
In[]:=
aselect=2(*1Intoout0r2Outtoin*);
In[]:=
File2Use=Which[aselect==1,"202411051404R000_trace_pfss_intoout_tracing.fits"(*FieldlinesfromIntoOut*),aselect==2,"202411051404R000_trace_pfss_outtoin_tracing.fits"(*FieldlinesformOuttoIn*)];
In[]:=
File2Use
Out[]=
202411051404R000_trace_pfss_outtoin_tracing.fits
In[]:=
Import[File2Use,"Dimensions"]
Out[]=
1{6,300,16740}
In[]:=
datapoints2=Import[File2Use,{"Data",1}];
In[]:=
Dimensions[datapoints]
Out[]=
{16740,300,6}
In[]:=
Dimensions[datapoints2]
Out[]=
{16740,300,6}
In the tar file for TRACE-extrapolation-outward field lines there are 16740 =(180 x (90 + 3) field lines. Each field line could have up to 300 points for the line specification. Each field line point has the 3 spatial coordinates (Phi ,Theta ,Radius) and the 3 magnetic field components (Bphi, Btheta, Bradial). The spherical coordinates (r,theta,phi) are related to the Cartesian coordinates (x,y,z) by r = Sqrt[x^2+y^2+z^2], theta = Tan^(-1)[y/x], phi = Cos^(-1)[z/r], x = r Cos[theta] Sin[phi], y = r Sin[theta] Sin[phi], z = R Cos[phi].
In[]:=
FieldLineNo=40;
In[]:=
Clear[f]
In[]:=
f[FieldLineNo_]:=Module[{FLNo=FieldLineNo},list=datapoints[[FLNo,;;,;;]];fieldline=DeleteCases[list,{a_,b_,c_,d_,e_,f_}/;a<-900.];ns=Dimensions[fieldline];nosfl=ns[[1]];Do[phii[i]=fieldline[[i]][[1]],{i,nosfl}];Do[thetai[i]=fieldline[[i]][[2]],{i,nosfl}];Do[ri[i]=fieldline[[i]][[3]],{i,nosfl}];Do[x[i]=ri[i]Cos[phii[i]]Sin[thetai[i]],{i,nosfl}];Do[y[i]=ri[i]Sin[thetai[i]]Sin[phii[i]],{i,nosfl}];Do[z[i]=ri[i]Cos[thetai[i]],{i,nosfl}];{x[;;],y[;;],z[;;],nosfl}]
In[]:=
Clear[f2]
In[]:=
f2[FieldLineNo2_]:=Module[{FLNo2=FieldLineNo2},list2=datapoints2[[FLNo2,;;,;;]];fieldline2=DeleteCases[list2,{a_,b_,c_,d_,e_,f_}/;a<-900.];ns=Dimensions[fieldline2];nosfl2=ns[[1]];Do[phii[i]=fieldline2[[i]][[1]],{i,nosfl2}];Do[thetai[i]=fieldline2[[i]][[2]],{i,nosfl2}];Do[ri[i]=fieldline2[[i]][[3]],{i,nosfl2}];Do[x2[i]=ri[i]Cos[phii[i]]Sin[thetai[i]],{i,nosfl2}];Do[y2[i]=ri[i]Sin[thetai[i]]Sin[phii[i]],{i,nosfl2}];Do[z2[i]=ri[i]Cos[thetai[i]],{i,nosfl2}];{x2[;;],y2[;;],z2[;;],nosfl2}]
In[]:=
f[1]
Out[]=
{x[1;;All],y[1;;All],z[1;;All],98}
In[]:=
f2[1]
Out[]=
{x2[1;;All],y2[1;;All],z2[1;;All],175}
In[]:=
nosfl1=nosfl(*50*)
Out[]=
98
Correction to remove short field lines on out-in F[] :
In[]:=
NosGoodifPostive=Table[If[f[kk][[4]]>=6,kk,-1],{kk,1,16740,1}];
In[]:=
fmodlist=Select[NosGoodifPostive,#>0&];Dimensions[fmodlist]
Out[]=
{14637}
In[]:=
sumtab=Table[f[fmodlist[[kk]]];ddd=Table[{x[i],y[i],z[i]},{i,1,nosfl}],{kk,1,14000,100}];
In[]:=
nosfl12=nosfl2;
In[]:=
sumtab2=Table[f2[kk];ddd2=Table[{x2[i],y2[i],z2[i]},{i,1,nosfl2}],{kk,1,16740,100}];
In[]:=
ListLinePlot3D[sumtab]
Out[]=
----------- End of program ------(Run twice)--------
References
References
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
Creating 3D printable model of solar corona by reading CCMC files & plotting magnetic field lines
by Gilmer Allen Gary
Wolfram Community, STAFF PICKS, November 14, 2024
https://community.wolfram.com/groups/-/m/t/3319778
by Gilmer Allen Gary
Wolfram Community, STAFF PICKS, November 14, 2024
https://community.wolfram.com/groups/-/m/t/3319778