Launch Corfield/PFSS model (see https://gitlab.irap.omp.eu/motcor_models/CORFIELD_MOTCOR.git). More...
Functions | |
def | compute_field |
Computes magnetic field lines associated to seed_points from/to solar surface to/from solar source surface with a given magnetogram. More... | |
def | create_simu_folder |
Create corfield simulation arborescence. More... | |
def | create_input_file |
Create input file in corfield simulation folder. More... | |
def | init_buffer |
Initialise a buffer for output exchange. More... | |
def | decode_buffer |
Read a formatted buffer. More... | |
def | get_datacube_output |
From simu_absolute_path, get datacube output file absolute path. More... | |
def | get_fieldline_output |
From simu_absolute_path, get fieldline output file absolute path. More... | |
def | get_bssmap_output |
From simu_absolute_path, get bss map output file absolute path. More... | |
Variables | |
tuple | template_relative_path = os.path.join('dir.corona','input_corfield_pfss','corfield_params.nml.template') |
Where template file for Corfield/PFSS input file is stored. More... | |
tuple | db_connect_tool_path = os.path.join(module_corona.path_corfield_pfss,'dir.data_connect_tool') |
Local Connect tool DB in Corfield. More... | |
int | nmax_integration = 999 |
Maximum length of a Corfield fieldline. More... | |
Launch Corfield/PFSS model (see https://gitlab.irap.omp.eu/motcor_models/CORFIELD_MOTCOR.git).
For an example of how to use this module, see its unit test unittest_model_corfield_pfss.
def model_corfield_pfss.compute_field | ( | seed_phi, | |
seed_the | |||
) |
Computes magnetic field lines associated to seed_points from/to solar surface to/from solar source surface with a given magnetogram.
Use Corfield-PFSS model. Must have these parameters filled in module_corona.
Prepare a corfield simulation folder, call corfield python wrapper and manage its output.
Before, must have compiled corfield wrapper in corfield_path folder (cf Readme of Corfield/Python wrapper).
Workflow:
[in] | seed_phi | Longitude (in degree) of seed point list |
[in] | seed_lat | Latitude (in degree) of seed point list |
Checking:
def model_corfield_pfss.create_input_file | ( | template_absolute_path, | |
simu_absolute_path, | |||
seed_phi, | |||
seed_the | |||
) |
Create input file in corfield simulation folder.
In simu_absolute_path/dir.input:
Create a symbolic link to the magnetogram wanted.
Use template_absolute_path to write corfield_params.nml input file replacing some values from module_corona:
def model_corfield_pfss.create_simu_folder | ( | ) |
Create corfield simulation arborescence.
Built folders:
db_connect_tool_path/simu_name/dir.input+dir.output
With simu_name = YYYYMMDDTHHMMSSms_pid
def model_corfield_pfss.decode_buffer | ( | buffer_s | ) |
Read a formatted buffer.
where beg_i = 1 + sum_{k=1}^{i-1} 7*nsize_k is the first index of fieldline i
Returns a list fieldlines such as each element contains:
def model_corfield_pfss.get_bssmap_output | ( | simu_absolute_path, | |
map2D_src | |||
) |
From simu_absolute_path, get bss map output file absolute path.
Bss map file is something like: map2Dtype_bss.dat
[in] | simu_absolute_path | folder if the corfield simulation |
[in] | map2D_src | magnetogram source (NSO or WSO or ADAPT) |
def model_corfield_pfss.get_datacube_output | ( | simu_absolute_path, | |
map2D_type, | |||
map2D_src | |||
) |
From simu_absolute_path, get datacube output file absolute path.
Datacube output file is something like:
[in] | simu_absolute_path | folder if the corfield simulation |
[in] | map2D_type | crmap or smap |
[in] | map2D_src | magnetogram source (NSO or WSO or ADAPT) |
def model_corfield_pfss.get_fieldline_output | ( | simu_absolute_path, | |
map2D_type, | |||
map2D_src | |||
) |
From simu_absolute_path, get fieldline output file absolute path.
Fiedlines output file is something like:
[in] | simu_absolute_path | folder of the corfield simulation |
[in] | map2D_type | crmap or smap |
[in] | map2D_src | magnetogram source (NSO or WSO or ADAPT) |
def model_corfield_pfss.init_buffer | ( | seed_n | ) |
Initialise a buffer for output exchange.
model_corfield_pfss.db_connect_tool_path = os.path.join(module_corona.path_corfield_pfss,'dir.data_connect_tool') |
Local Connect tool DB in Corfield.
Corfield model has a local folder where all simulations launched by Connect_tool are stored.
model_corfield_pfss.nmax_integration = 999 |
Maximum length of a Corfield fieldline.
Given in corfield_trace.f90 routine.
model_corfield_pfss.template_relative_path = os.path.join('dir.corona','input_corfield_pfss','corfield_params.nml.template') |
Where template file for Corfield/PFSS input file is stored.