input: module of Hdust input tools

PyHdust input module: Hdust input tools.

Definitions on Classes: - fname: is the original file for reference (kept as stated in the input). The following variables are defined based on the fname. - proj: directory to the project (mandatory) - modn: ‘modn’ structure - suf: only the suffix. - one use Class.set_fname(fname) to update everything. - convention is to use “_” as separador. So, use “-” for a given name, as for the projects.

co-author:Rodrigo Vieira
license:GNU GPL v3.0
class pyhdust.input.AeriMod(fname)[source]

docstring for AeriMod

class pyhdust.input.Disk(proj=None, modn='mod01')[source]

Disk class

set_disk(renv=18.6, mh=1.5, ht=60.0, nr=2.0, dval=1000000000000.0, hseq=False, alpha=0.5, mu=0.5, R0r=100, vt=0.0, denstype=None, **kwargs)[source]

denstype = [‘n0’, ‘sig0’, ‘mdot’]

sig0 means g/cm2 instead of n0


vfmt = dict(zip([‘renv’, ‘dval’, ‘ht’, ‘M’, “n”], [‘{:04.1f}’, ‘{:.1e}’, ‘{:02.0f}’, ‘{:04.1f}’, ‘{:.1f}’]))

class pyhdust.input.HdustMod(fname=None)[source]

HdustMod doc

class pyhdust.input.Input(proj=None, modn='mod01')[source]

Input class; no fname (ie., specific suf/model defined)

  • Criado no novo make_inpjob.
  • Terminando verificação de existência prévia de *.inp e *.sed2
  • Incluído verificação do *_SEI.sed2
class pyhdust.input.PhotMod(fname)[source]

docstring for AeriMod

pyhdust.input.check_inp(mods=None, step1=['step1', 20], step1_ref=['step1_refine', 30], cust_sim=[['SED', 'SED']], ignore_comm=True)[source]

To be executed in the PROJECT folder.

mods = array of model folders. Ex: [“mod01”, “mod02”]. None do it for all.

cust_sim = specifies a pair of simulation-prefix to be check (by default, these are equal).

ignore_comm = ignore already comments simulations inputs.

WARNING: It assumes that SUFFIX inside inp file is consistent with the filename. The function also removes the *.oar and *.job files.

pyhdust.input.makeCSGrid_bistabWind1Dust(modn='01', renv=[18.6], rcs=[5.0], dm_dOmega=[1.5e-05], v_0=[10.0], v_inf=[1200.0], beta_v=[2], A1=[49], A2=[-0.7], A3=[0.0], m_dth=[92.0], grain_dust_ratio=[200.0], grain_dens=[1.0], selsources='*', path=None)[source]

Great a CS Grid for HDUST for wind+dust shell (1) both in bi-stability

Based on Carciofi+2010 and used in the B[e] grid between IAG/ON (Brazil).

  • arg1 (int, float,..) – the first value
  • arg2 (int, float,..) – the first value

arg1/arg2 +arg3

Return type:

int, float

>>> import template
>>> a = template.MainClass1()
>>> a.function1(1,1,1)


can be useful to emphasize important feature

See also



arg2 must be non-zero.

pyhdust.input.makeDiskGrid(modn='01', mhvals=[1.5], hvals=[60.0], rdvals=[18.6], mvals=[2.0], sig0vals=[1.0], convSig2Rho=False, doFVDD=False, sBdays=None, sBfiles=None, selsources='*', alpha=0.5, mu=0.5, R0r=300, Mdot11=False, path=None)[source]
modn = ‘02’
#The following filter will be applied to the SOURCE selection (string
# fmt)
selsources = ‘*’

mvals = [1.5,2.0,2.5,3.0]
mhvals = [1.5]
#This parameter sets if it you be FIXED to OB=1.1 case
hvals = [72.]
rdvals = [30.]
sig0vals = _np.logspace(_np.log10(0.02),_np.log10(4.0),7)

#Do the Full VDD model for the corresponding sig0?
doFVDD = True
alpha = 0.5
mu = 0.5
#WARNING: it only generates a single R0 value per batch. If you want to
# change it, run it twice (or more)
R0r = 300

Mdot11 = TODO

WARNING: if convSig2Rho=True, the routine assumes sig0vals contains
rho0vals. For that, (sBfiles==None or sBdays==None) and doFVDD==False.
pyhdust.input.makeInpJob(modn='01', nodes=512, simulations=['SED'], docases=[1, 3], sim1='step1', sim2='step1_ref', composition='pureH', controls='controls', gridcells='grid', observers='observers', images=[''], perturbations=None, clusters=['job'], srcid='', walltime='24:00:00', wcheck=False, email='$USER@localhost', chkout=False, st1max=20, st1refmax=24, ctrM=False, touch=False, srcNf=None, path=None)[source]

Create INP+JOB files to run Hdust.

All SOURCE files must initiate by “Be_”. Otherwise, the makeInpJob will not work. This is to satisfies the criteria of a specific disk model for each source star.

### Start edit here ### modn = ‘02’

#clusters config # job = AlphaCrucis; oar = MesoCentre Licallo; ge = MesoCentre FRIPP clusters = [‘job’,’oar’,’ge’,’bgq’] clusters = [‘oar’] nodes = 48 #if wcheck == True, walltime will be AUTOMATICALLY estimated walltime = ‘3:00:00’ wcheck = True email = ‘

#Check if the outputs already exist chkout = True #Above the values below, the step1 will be considered done! st1max = 26 st1refmax = 30 #Gera inp+job so’ para o source com ‘1.45’ no nome #Nao funciona caracteres especiais como * ou ? srcid = ‘1.45’ srcid = ‘’ #Se um dos 3 casos nao estiver presente, ele gera input comentado. docases = [1,2,3] #1 = step1 <> Gera inp+job so’ para mod#/mod#.txt (SEM source, so disco) #habilita ADDSUFFIX; retira OBSERVERS e IMAGES sim1 = ‘step1’ #2 = step1_refine sim2 = ‘step1_refine’ #3 = outros <> Gera inp+job so’ para mod#/mod#SOURCE.txt (post-proc.) #retira ADDSUFFIX; adiciona OBSERVERS (e talvez IMAGES) simulations = [‘sed’,’h’,’brg’,’halpha’,’uv’] simulations = [‘sed_sig’,’brg_M’,’halpha_M’,’uv’,’j’,’h’,’k’,’l’,’m’,’n’,


simulations = [‘SED’,’Ha’] images = [‘’,’h’,’brg’,’halpha’,’uv’] images = simulations[:] composition = ‘pureH’ controls = ‘no_op’ controls = ‘controls’ ctrM = False gridcells = ‘grid’ observers = ‘obs’ touch = True ###stop edition here

pyhdust.input.makeNoDiskGrid(modn, selsources, path=None)[source]

#Create a model list with random disk parameters (“noCS” in filename)

INPUT: modn = ‘01’; selsources = ‘*’ (filter that is applied to the SOURCE selection).

OUTPUT: Files written

pyhdust.input.makeSimulDens(dbase, basesim)[source]

Sets the SED simulations number of photos so that the signal/noise level is approximately constant at visible polarization.

|dbase = _np.logspace(_np.log10(0.02),_np.log10(4.0),7) |basesim = ‘simulation/sed.txt’

pyhdust.input.makeSimulLine(basesims, Rs, hwidth, Ms, Obs, lsuffix, path='source/')[source]
vrots = [[167.023,229.187,271.072,301.299,313.702],
vrots = [[259.759,354.834,417.792,464.549,483.847],

basesims = [‘simulation/Brg.txt’,’simulation/Ha.txt’]
Rs = [12000, 20000]

Ms = [4.00,5.00,7.00,9.00,12.00,15.00]
Ms = [14.6, 12.5, 10.8, 9.6, 8.6, 7.7, 6.4, 5.5, 4.8, 4.2, 3.8, 3.4]
Obs = [1.1,1.2,1.3,1.4,1.45]
suffix = ‘H0.30_Z0.014_bE_Ell’
pyhdust.input.makeSourceGrid(masses, rps, lums, Ws, betas, path=None)[source]

Arbitrary values (no stellar model info), for the SELF-CONSISTENT RIGID ROTATOR setup.

OUTPUT: The combination of the values of all lists in the path/source/ folder.

Example: 2 of each parameters results in 32 models (2^5)

pyhdust.input.makeStarGrid(oblats, Hfs, path=None)[source]

Based on GENEVA models.

INPUT: oblats = [1.1,1.2,1.3,1.4,1.45] (example)
Hfs = [0.3] (example)

Masses list a Z value are inside file.