FAQ

 

IDL does not find the DustEMWrap routines

This can occur for a number of reasons. The most common are:

Error: CGWINDOW: Cannot find an cgWindow with window index 0.

This error occurs when calling an outdated version of cgWindow.pro from the Coyote graphics library. 

We recommend editing your preferences for the !path IDL system variable so that precedence is given to $DUSTEMWRAP_SOFT/src/idl_extern/Coyote_for_DustEMWrap/cgWindow.pro, where $DUSTEMWRAP_SOFT is the directory containing the distributed DustEMWrap software.

An easy (but not the only) way to do this is by including the following lines in your idl_startup file

defsysv,'!dustem_wrap_soft_dir',getenv('HOME')+'/path_to_dustem-wrapper_idl/'
!path=!path+':'+expand_path('+'+!dustem_wrap_soft_dir+'/src/idl_extern/')

For more information :
https://www.l3harrisgeospatial.com/docs/managing_idl_paths.html
https://www.l3harrisgeospatial.com/docs/startupfiles.html
https://www.l3harrisgeospatial.com/Support/Self-Help-Tools/Help-Articles/Help-Articles-Detail/ArtMID/10220/ArticleID/18093/How-do-I-specify-a-program-to-automatically-run-when-my-IDL-session-starts-up

The radiation field amplitude (G0) does not change, or returns to its initial value at the end of the fit, even though I am specifying it as a free parameter.

The fortran code hangs when I include a plugin that modifies the ISRF.

These behaviours can indicate that the user is trying to modify the radiation field using G0, whereas gas.G0 is taking precedence within the DustEM fortran code (or vice versa).

An important subtlety of DustEM is that the ISRF that heats the dust in the model may be controlled via (*!dustem_params).gas.G0 as well as (*!dustem_params).G0.  The default behaviour is that (*!dustem_params).G0 takes precedence. 

When fitting or fixing the amplitude of the ISRF for calculations where the radiation field in the gas should also be applied to the dust (e.g. for spinning dust calculations), users should therefore specify '(*!dustem_params).gas.G0' in the fpd/pd vector (and set its value in the corresponding fiv/iv vector). 

If you are unsure whether the DustEM fortran is using G0 or gas.G0, this can be checked by inspecting the GAS.DAT file that is created in the !dustem_data directory (defined by the user during installation of the DustEM fortran and also specified in the user's idl_startup file). If the G0 value in GAS.DAT is positive, then this G0 value is also being used for the dust-heating calculations. Negative values indicate the default behaviour, i.e. that the G0 value is taken from GRAIN.DAT.  In this default case, the contents of GAS.DAT should resemble the following

# DUSTEM : Gas quantities WNM from Wolfire et al 1995
#
# Gas temperature (K), hydrogen density, H2 density, CR rate, G0 (if>0 supersedes GRAIN.DAT), nr of charge type (e-, H+, C+, ...)
# ion density (cm-3), mass (amu), charge, polarizability (A^3)
# >>>>> 1st line is electron <<<<<<<
# >>>>> 2nd line is proton   <<<<<<<
# >>>>> 3d line is carbon   <<<<<<<
#

8.00E+03  4.00E-01  0.00E+00  5.00E-17  -1.00E+00   3

...

The terminal output during a DustEMWrap run also indicates if gas.G0 is being used rather than G0, displaying the message superseding    G0 =  ... after the GAS.DAT file is read, e.g.

===========================================
        Running DUSTEM
>>read ISRF.DAT            w-range (microns)  hnu_max(eV)  nwave
                          1.08E-02  1.00E+05  1.14E+02     199
>>read GRAIN.DAT
Run Keywords                SDIST   G0 =  1.00E-12 chi =  1.42E+11
                nsize         t_opt            M_dust/M_H  rho(g/cm3)     a-range(cm)      alpha-a0    sigma
PAH0_DL07      10            LOGN-CHRGWD-ZM   5.40E-04    2.24E+00   3.10E-08  1.20E-07   4.00E-08  4.00E-01
>>read               CHRG_PAH0_DL07.DAT
>>read                          GAS.DAT
superseding    G0 =  1.00E+00
PAH1_DL07      10            LOGN-CHRGWD-ZM   5.40E-04    2.24E+00   3.10E-08  1.20E-07   4.00E-08  4.00E-01
>>read               CHRG_PAH1_DL07.DAT
                Gra      30                      LOGN   1.66E-04    2.24E+00   3.10E-08  4.00E-06   2.00E-07  5.50E-01
                Gra      70                PLAW-ED-CV   2.21E-03    2.24E+00   3.10E-08  2.00E-04  -2.54E+00  1.07E-06  4.28E-05  3.00E+00  1.07E-06 -1.65E-01  1.00E+00
                aSil      70                PLAW-ED-CV   7.64E-03    3.50E+00   3.10E-08  2.00E-04  -3.21E+00  1.64E-05  1.00E-05  3.00E+00  1.64E-05  3.00E-01  1.00E+00

...

Image: NIRCAM/JWST, NASA, ESA, CSA, STScI; https://webbtelescope.org/news/first-images