dnarayanan / powderday

powderday dust radiative transfer
BSD 3-Clause "New" or "Revised" License
22 stars 16 forks source link

Issues with pd_front_end ordering #187

Closed anchwr closed 2 years ago

anchwr commented 2 years ago

The current ordering of pd_front_end.py causes powderday runs using Enzo and/or the 'li_ml' or 'rr' dust grid options to crash. If ds_type = ds.dataset_type is called after m, xcent, ycent, zcent, dx, dy, dz, reg, ds, boost = m_gen(fname, field_add), ds_type gets set to 'ytdatacontainer_hdf5' for Enzo, rather than 'enzo_packed_3d', since the dataset m_gen returns is 'temp_enzo.h5' instead of the original simulation. However, m_gen needs to be called after cfg.par.solar is set if the user has selected the 'li_ml' or 'rr' dust grid options, since the various frontends (e.g., tipsy2pd, arepo2pd) use cfg.par.solar to calculate the dust mass fields for these dust grids. One potential solution would be to put ds_type = ds.dataset_type only before the section of code setting cfg.par.solar and to put m, xcent, ycent, zcent, dx, dy, dz, reg, ds, boost = m_gen(fname, field_add) only after the section of code setting cfg.par.solar, but I'm guessing that this causes other problems with the code.

dnarayanan commented 2 years ago

Oh wow thanks for finding this. I’m on travel so might not get to looking into this until the end of the week or so .

dnarayanan commented 2 years ago

@anchwr when you have a chance please let me know if this works for this issue for you -- if so we'll close!

anchwr commented 2 years ago

It does! Thank you so much! Sorry it took me a few days to check.

dnarayanan commented 2 years ago

awesome glad it works! thanks for reporting it, and thanks @prerakgarg07 for PR'ing it in!