Skip to content

Month: April 2020

shutdown and reboot

One needs to be root or have sudo privileges to do this:

sudo shutdown -rv 2

-rv  2 means :

r is restart after shutdown;

v means verbose

2 means in 2 minutes

which python on which host?

we checked all 3 machines for which version of python on each

literally typing
‘which python’
gives me (at least on  all three hosts) /usr/bin/python      this is not super helpful because it doesnt say which version.

ls -als /usr/bin/python on all three hosts  is also not that helpful as it just spits back the python executable named python.

ls -als /usr/bin | grep python gives me every file in there with a name including python. Then I see that “python” and python2.6 have identical size and date on all three hosts

so the final answer is that all three are using 2.6 by default

Caution: Note that astropy is only on python 2.7 and so we should actually use 2.7  . Yuping  and/or Bruce installed 2.7 in order to “make” psrchive  .  (See Yuping’s post under “python” category.)

IDL manual breakpoint operation

using breakpoints on idlde over vncviewer (as opposed to chicken-of-the-vnc) was fraught.  The usual key combinations would not place breakpoints anywhere.  But I eventually learned that:

DOUBLE CLICKING ON GRAY BORDER AT VERY LEFT OF DESIRED LINE TOGGLES BREAKPOINT

Here is a harder way that I learned before above red easy way:

  1. select desired line
  2. shift control b toggles a breakpoint on that line.

Here is an even harder way to do it from keyboard:

help,/breakpoint  will give a list of existing breakpoints

cd, ‘full path to desired directory’ will change idl’s current directory from users home directory (the default) to another. remember apostrophes CASE SENSITIVE

printd   prints the current directory

IDL> printd
Current Directory: /data/psrdata/arecibopuppi/B1913+16/2019Aug
Directory stack is empty.

breakpoint,/set, ‘filename inside of current idl directory path [see printd above to discover current path value] ‘, 150   (use apostrophes, note final value is linenumber) CASE SENSITIVE

i think i did not see the red circle on line 150 of idlde until i recompiled.

check out help,/breakpoint to see a list of current breakpoints, including their “index” which can be used in some other breakpoint commands like breakpoint,/clear,1 (index 1)

IDL> help,/breakpoint
Index Line Attributes                                                 File
1         150      Pro=PLOTADAYSRMTOT       /data/psrdata/arecibopuppi/B1913+16/2019Aug/plotAdaysRMtot.pro

python how to find installed astropy: 2.7. Execute .py with “python2.7

The following red material is the newest guidance:
Note that since astropy is in 2.7, 2.7 should really be the default, not 2.6 as it now is. 
To run 2.7 on a program sitting in a file called “nameOfThisFile”,  Type:
“python2.7 nameOfThisFile” in command line, as Helen did in comments atop her IonRMdailyPlot.py  , which is in
/data/psrdata/usr5/rmiono/ionFR-Sobey/

Helen Du figured out the following for finding where (if) astropy is on our network:

/usr/local/lib/python2.7/site-packages (Joel changes this to 2.6 but that doesnt work. see helen’s and Joel’s update at bottom. Esp very top in red)
is where all the packages are.
Specifically, “David Hollander” pointed me to the right path. Here’s what he said:

For Ubuntu,

python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"

…is not correct.

It will point you to /usr/lib/pythonX.X/dist-packages

This folder only contains packages your operating system has automatically installed for programs to run.

On ubuntu, the site-packages folder that contains packages installed via setup_tools\easy_install\pip will be in /usr/local/lib/pythonX.X/dist-packages

The second folder is probably the more useful one if the use case is related to installation or reading source code.

If you do not use Ubuntu, you are probably safe copy-pasting the first code box into the terminal.

—————————————————————————–
additional information added by Helen shortly after the above:
Another note:
/usr/lib/python2.6/site-packages  seems to be where the packages that have the basic/initial/…(can’t think of the correct word…) packages for running Python 2.6,
while
/usr/lib64/python2.6/site-packages  has other stuff as well… including scipy, numpy, and matplotlib.