spacetelescope / wfc3tools

Python tools for HST WFC3 data calibration and analysis
https://wfc3tools.readthedocs.io/en/latest/
Other
6 stars 19 forks source link

Add environment bin to $PATH when calling calwf3.e #62

Open gbrammer opened 2 years ago

gbrammer commented 2 years ago

I was having some minor trouble with conda environments in that running wfc3tools.calwf3 with a particular Jupyter kernel associated with a conda environment was trying to execute calwf3.e from the base environment rather than the kernel environment. The proposed fix tries to derive the appropriate bin path based on the result of sys.exec_prefix and prepends this to the PATH when calling the calwf3.e subprocess. The fix should be pretty conservative in that it won't have any effect if either the environment bin path isn't found or if calwf3.e is not in it but is rather somewhere else within the PATH.