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 https://github.com/danmoser/pyhdust/blob/master/LICENSE
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

set_suf(vfmt='')[source]

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.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).

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

arg1/arg2 +arg3

Return type:

int, float

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

Note

can be useful to emphasize important feature

See also

MainClass2

Warning

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]
###CONFIG. OPTIONS
#MODEL NUMBER
modn = ‘02’
#The following filter will be applied to the SOURCE selection (string
# fmt)
selsources = ‘*’

#SUPERFICIAL DENSITY PROFILE EXPONENT
mvals = [1.5,2.0,2.5,3.0]
#VERTICAL DENSITY PROFILE EXPONENT
mhvals = [1.5]
#FRACTION OF TEFF OF PRIMARY STAR
#This parameter sets if it you be FIXED to OB=1.1 case
hvals = [72.]
#DISK RADIUS EQUATORIAL...
rdvals = [30.]
#SIGMA_0 VALUES
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
###END CONFIG.

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 = 'user@gmail.com

#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’,

‘q1’,’q2’]

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],
[177.998,244.636,290.596,324.272,338.298],
[192.612,267.017,318.288,355.320,370.638],
[202.059,281.667,335.158,373.716,389.782],
[209.244,292.409,358.626,410.439,430.844],
[214.407,297.661,357.799,402.628,420.683]]
vrots = [[259.759,354.834,417.792,464.549,483.847],
[252.050,346.163,406.388,449.818,468.126],
[245.127,336.834,399.983,448.076,467.806],
[239.522,329.496,388.734,432.532,450.806],
[234.301,321.139,379.297,423.241,441.122],
[228.538,313.797,370.343,412.488,429.914],
[219.126,299.656,354.547,395.821,413.008],
[211.544,288.840,341.081,380.426,396.978],
[203.438,279.328,328.666,365.697,380.660],
[197.823,268.964,316.901,353.568,368.506],
[192.620,262.688,308.208,341.963,356.410],
[187.003,255.125,299.737,332.511,346.043]]

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 geneve_par.pro file.