Background

IMPORTANT NOTE: Your data will be available to the observing program PI on the Keck Observatory Archive (KOA) a day or two after the observing run. Therefore, there is no need for you to download your data on your observing night, unless you wish to.

If you wish to download your data on your observing night, you can use either SCP, SFTP, or FTP. The prefered methods for transfering data are SCP and SFTP, because they are more secure.

What Keck computers should you use

Which computer to use depends on the instrument. Some recommendations are:

Note on SCP and SFTP versions

If you try to SCP or SFTP to one of our Solaris machines from a modern computer, the trasfer may fail due to incompatibilities in the SSH key exchange method. A workaround to this issue is to add the following aliases to your ~/.aliases, ~/.cshrc or ~/.bashrc, depending on the type of shell on your local computer (note the bash syntax in this example):

alias   kscp="scp -o KexAlgorithms=+diffie-hellman-group1-sha1 -o HostKeyAlgorithms=+ssh-dss -c 3des-cbc"
alias   ksftp="sftp -o KexAlgorithms=+diffie-hellman-group1-sha1 -o HostKeyAlgorithms=+ssh-dss -c 3des-cbc"
Then you can use the instructions for the SCP Procedure at Keck via Laptop or scp procedure from outside Keck by replacing scp with kscp. You can use the instructions for Using SFTP to transfer to a laptop with no SFTP server by replacing sftp with ksftp.

Procedures

SCP Procedure (at Keck to External Host)

WARNING: If you use thi method, the transfer can be terminated any time after sunrise, if the VNC server or the terminal where you initiated the transfer needs to be shut down.

Please follow these steps to transfer data from a Keck machine to an outside machine using scp:

  1. Launch a terminal using the VNC background menu. Which terminal to launch will depend on the instrument. This can an instrument host terminal, e.g. polo (DEIMOS) or nirspecserver (NIRSPEC), or local terminal on the VNC server, e.g. deimos (DEIMOS), nirspec (NIRSPEC) or mosfire (MOSFIRE).
  2. Change to your data directory. Use the cd command to move to your data directory. cdata is a usual alias on most instrument to change to your data directory. Note that data disks can be accessed using the syntax /s/sdataXXX or /s/sdataXXXX, depending on the instrument.
  3. Execute the scp command to transfer the data, as follows
    scp *.fits youruser@yourcomputer:YourLocalDataDir/
  4. You can close the terminal once the transfer is completed.

SCP Procedure (at Keck via Laptop)

Observers can copy data directly to their laptops while at Keck. In this case, it is best to initiate the transfer from the laptop in order to avoid having to figure out the address of the laptop. If you have the scp program installed on your laptop, please follow these steps to pull data onto your laptop from a Keck machine:

  1. Open a window on your laptop and navigate to the directory where you would like to store your data.
  2. Execute the scp command to transfer the entire contents of your data directory to the current directory on your laptop, as in:
    scp -r account@host:/path/ .
    where account is the name of your observing account, e.g. deimos7, host is the name of the instrument host or VNC server, e.g. deimos or polo, and path is the pathname to your data. For example, to copy data from the directory /s/sdata1004/deimos8/2020dec15 as user deimos8, enter:
    scp -r deimos8@deimos.keck.hawaii.edu:/s/sdata1004/deimos8/2020dec15 .

SCP Procedure (from outside of Keck)

Observers can copy data to or from Keck from external machines (whether laptops or workstations) using scp. Please follow these steps to copy data from Keck computers to your external machine:

  1. Obtain access through the Keck firewall. Please contact your WMKO Staff Astronomer for instructions. If you are running the Keck remote observing software, access though the Keck firewall is granted automatically on any of your local computer terminals.
  2. Open a window on your computer navigate to the directory where you would like to store your data.
  3. Execute the scp command to transfer the entire contents of your data directory to the current directory on your laptop, as in:
    scp -r account@host:/path/ .
    where account is the name of your observing account, e.g. deimos7, host is the name of the instrument host or VNC server, e.g. deimos or polo, and path is the pathname to your data. For example, to copy data from the directory /s/sdata1004/deimos8/2020dec15 as user deimos8, enter:
    scp -r deimos8@deimos.keck.hawaii.edu:/s/sdata1004/deimos8/2020dec15 .

SFTP Procedure (put data on your computer)

WARNING: If you use thi method, the transfer can be terminated any time after sunrise, if the VNC server or the terminal where you initiated the transfer needs to be shut down.

Please follow these steps to transfer data using SFTP:

  1. Launch a terminal using the VNC background menu. Which terminal to launch will depend on the instrument. This can an instrument host terminal, e.g. polo (DEIMOS) or nirspecserver (NIRSPEC), or local terminal on the VNC server, e.g. deimos (DEIMOS), nirspec (NIRSPEC) or mosfire (MOSFIRE).
  2. Change to your data directory. Use the cd command to move to your data directory. cdata is a usual alias on most instrument to change to your data directory. Note that data disks can be accessed using the syntax /s/sdataXXX or /s/sdataXXXX, depending on the instrument.
  3. Execute the sftp command to access your computer as follows:
    sftp youruser@yourcomputer
  4. Type
    put *.fits
    to transfer all of the FITS images in the directory.
  5. When the transfer has completed, you may use the command
    lcd directory
    to move to another directory on the Keck machine, and use put again to copy the data.
  6. When done transferring all files, type quit to end your FTP session.
  7. You can close the terminal once the transfer is completed.

FTP Procedure (put data on your computer)

IMPORTANT NOTE: Most modern Linux computers at Keck do not have FTP, e.g. deimos or nirc2. However, there are still some old Sun stations that have FTP, e.g. sshserver2. If you wish to use FTP from one of the old Sun stations:

  1. Open a secure shell to one of the SSH servers from any of the terminals in your VNC session, for instance: ssh nspec7@sshserver2 Input the password corresponding to your designated instrument numbered account.
  2. Change to your data directory. Use the cd command to move to your data directory. cdata is a usual alias on most instrument to change to your data directory. Note that data disks can be accessed using the syntax /s/sdataXXX or /s/sdataXXXX, depending on the instrument.
  3. Run the ftp command to start an FTP session.
  4. Use the command
    open my_home_site
    to open an FTP connection to your home site. Provide the proper account name and password to log in.
  5. Use the cd to move to the directory where you would like your data stored.
  6. Issue the command binary to set binary transfer mode.
  7. Issue the command prompt to turn off verification of each file transfer.
  8. Type
    put *.fits
    to transfer all of the FITS images in the directory.
  9. When the transfer has completed, you may use the command
    lcd directory
    to move to another directory on the Keck machine, and use put again to copy the data.
  10. When done transferring all files, type quit to end your FTP session, and then close the terminal.

Using SFTP to transfer to a laptop with no SFTP server

Please follow these steps to transfer data using SFTP from your computer to one of the Keck host computers:

  1. Change to the datat directory where your would like to download the data to on your local computer
  2. Launch sftp on your local computer as follows:
    sftp username@keckhostname.keck.hawaii.edu
    where keckhostname will depend on the instrument. Some examples of valid hosts are polo (DEIMOS), nirspecserver (NIRSPEC), deimos (DEIMOS), nirspec (NIRSPEC), nirc2 (NIRC2) or sshserver1.
  3. Change to your data directory. Use the cd command to move to your data directory. Note that data disks can be accessed using the syntax /s/sdataXXX or /s/sdataXXXX, depending on the instrument.
  4. Type
    get *.fits
    to transfer all of the FITS images onto your local directory.
  5. When the transfer has completed, you may use the command
    cd directory
    to move to another directory on the Keck machine, and use get again to copy the data.
  6. When done transferring all files, type quit to end your FTP session.