MCFOST API
Various functions to make the communication between xenomorph and MCFOST a bit easier. These are broadly written with running on a HPC-cluster in mind.
generate_para(paraname, density_file, distance=2400, photons=10000000.0, T_photons=2000000.0, resolution=600, gas_2_dust=100, root_dir='')
WIP -- Generates a .para file to be used in the MCFOST run. Todo: - allow multiple stars to be generated in the para file. - generate the para file inside the root_dir?
Parameters:
Name | Type | Description | Default |
---|---|---|---|
paraname
|
str
|
The name that you'd like to give to this parameter file. A '.para' is automatically appended to the end of this input. |
required |
density_file
|
str
|
The name of the .fits file generated by |
required |
distance
|
float
|
The distance (in pc) to the system. |
2400
|
photons
|
int
|
The number of photons to use in the imaging computation. |
10000000.0
|
T_photons
|
int
|
The number of photons to use in the T computation |
2000000.0
|
resolution
|
int
|
The pixel side length of the computed image. |
600
|
gas_2_dust
|
float
|
The mass of gas relative to the dust in each particle |
100
|
root_dir
|
str
|
The directory where you'd like the output of the job to be. |
''
|
Source code in xenomorph\mcfost.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
generate_slurm(slurmname, wavelength, para_file, density_file, cpus=4, run_hours=10, memory=4, root_dir='', job_name='mcfost-transfer', email='ryan.white1@hdr.mq.edu.au', mcfost_setup='~/setup_mcfost')
Generates a slurm script to run a single radiative transfer calculation on a xenomorph-generated spiral. The script will generate the temperature profile of the (currently default-only) dust, and then image it and the specified wavelength.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
slurmname
|
str
|
The name that you'd like to give to this slurm script. A '.q' is automatically appended to the end of this input. |
required |
wavelength
|
int or float
|
The wavelength (in microns) that you'd like to generate the image for. |
required |
para_file
|
str
|
The name of the MCFOST parameter file for the system. |
required |
density_file
|
str
|
The name of the .fits file generated by |
required |
cpus
|
int
|
The number of CPUs you'd like to allocate to running this MCFOST job. A power of 2 is usually good. |
4
|
run_hours
|
int
|
How many (wall-time) hours you'd like to set the job to run before the scheduling system cancels it. |
10
|
memory
|
float or int
|
The amount of memory (in GB) to allocate to the job. In my experience they typically use of order a few hundred MB, so setting 1-4GB is usually safe. |
4
|
root_dir
|
str
|
The directory where you'd like the output of the job to be. |
''
|
job_name
|
str
|
A name for the job (only visible on the HPC queue system). |
'mcfost-transfer'
|
email
|
str
|
The email of the user, should they want email updates on how the job is doing. Mine by default :) |
'ryan.white1@hdr.mq.edu.au'
|
mcfost_setup
|
str
|
The location (and name) of the mcfost_setup file. This file is meant to be read each time an MCFOST job is run on a HPC.
A typical ~/setup_mcfost file will look like:
export PATH=/ |
'~/setup_mcfost'
|
Source code in xenomorph\mcfost.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
|
mcfost_points(stardata, shells, shell_mass, filename, n_t=1000, n_points=400, root_dir='')
Generates points that can be fed into a new version of MCFOST for radiative transfer calculations. Once generated, you could use these points with MCFOST via:
mcfost
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stardata
|
dict
|
The system parameter file. |
required |
shells
|
int
|
The number of shells to generate |
required |
shell_mass
|
float
|
The mass (in units of Solar masses) of each dust shell. This assumes MCFOST is using a 1:100 dust:gas mass ratio, so the actual mass will be multiplied by 100. That is, the user-entered mass here is just for the dust. |
required |
filename
|
str
|
The name of the file to save the points into. This must include a '.fits' suffix. |
required |
n_t
|
int
|
The number of rings to generate in each shell |
1000
|
n_points
|
int
|
The number of points to generate in each ring |
400
|
root_dir
|
str
|
The directory where you'd like the output of the job to be. |
''
|
Source code in xenomorph\mcfost.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|