top of page
TIPS
  • To convert multiple images to pdf file in Mac

for f in *.PS;do convert ./"$f" ./"${f%}.pdf"; done;

 

  • Concatenate/merge pdf files into one file in mac:

Use the following command in the terminal - 

 "/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" -o newfilename.pdf file1.pdf file2.pdf

​

 

  • To search for string in all files and subfolders:

 grep -r . -e "test"

where, the option r indicates a recursive search, 'e' to execute.

​

  • To search and replace string in all files and subfolders:

find . -type f -exec sed -i 's/originaltext/newtext/g' {} +

 

  • Customized matplotlibrc file that gives a publishable level plot.  An example of the customized plot is here .

All you have to do is copy the matplotlibrc file in the directory where your python code is running.  Don't forget to remove the '.odt' extension.

 

  • Installation tips for SLUG stellar population synthesis code

SLUG mentions that it requires three libraries GSL, BOOST and CFITSIO.  For ubuntu,

To install GSL, use the command 

sudo apt-get install gsl-bin libgsl0-dev

After successful installation, a gsl folder is created  /usr/include/gsl.
Alternatively, you can use the command 'locate gsl' to look for the directories where gsl is installed.

 

To install BOOST, use 

sudo apt-get install libboost-all-dev

 

Create environment variables to indicate the location of these files.

 

export C_INCLUDE_PATH="/usr/include/:/opt/cfitsio"
export LIBRARY_PATH="/usr/lib:/usr/local/lib"

The slug website doesn't give much information about the compilation.  However, after you download the slug folder, go to slug2/doc/html/compiling.html webpage.  It has got somewhat clear explanation.

 

 

Troubleshoot
  • Error in APLpy show_region() :

                AttributeError: ‘Header’ object has no attribute ‘ascardlist’

This problem can be solved by updating the wcs_helper.py with the changes mentioned (changes are indicated with '+')  in this webpage.

To change the file, you might have to give write permissions to the file and the folder  'pyregion'.  In my computer, the path to the folder is /Library/Python/2.7/site-packages/pyregion.

​

  •  Cannot open display xgterm error:

                 The solution can be found here:  http://dvisagie.blogspot.com/2012/08/fix-ssh-y-with-other-macs-osx-108.html

​

  • Error while running ellipse  IRAF task:

                 PANIC in `/iraf/iraf/extern/stsdas/bin.macintel/x_isophote.e': Write to IPC with no reader

                 ERROR: software terminate (interrupt)

Solution:  Try with 'ecl' terminal instead of cl or vocl.

​

  •  Error while running ellipse IRAF task in interactive mode:

                Running object locator... ERROR: Cannot open file (dev$graphcap)

​

  • Error while running IRAF task 'tcreate':

               ERROR:  Line 2 is too long

This error comes when there is no new line character at the end of the input files - column definition file or the input data file.  So, you just have to make sure that there is an empty line at the end of the file.

 

  • Error while running ellipse task in PyRAF:

               Can not find object. Please, enter initial guess for starting isophote center:

PyRAF does not seem to be able to locate the parameters defined in a pset.    For example, X0 .and Y0 initial guess values for ellipse task are set in the geompar pset.  So, when these values are initalized using command iraf.GEOMPAR.setParam('X0', '123'), we get an error like the one above.  As a work around, initialize the params using the command iraf.ELLIPSE.setParam('X0', '23').  Here we are setting the parameter using the high-level task.

bottom of page