Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d64d6ae
not fitting but timing added
maxxtepper Dec 6, 2015
82a3baa
timing changes
maxxtepper Dec 8, 2015
25ad5ee
lots of changes all functuionality working at some level
maxxtepper Dec 9, 2015
f1175dc
Eliminated tabs in lines with mixed tabs and spaces.
jayich Jan 13, 2016
c7b7d67
pep8 fixes.
jayich Jan 13, 2016
0b9083f
spelling.
jayich Jan 13, 2016
a77ba19
cutting unused variable and module.
jayich Jan 13, 2016
a984c33
pep8 fixes.
jayich Jan 13, 2016
80e9be7
cut commented out code.
jayich Jan 13, 2016
21e0d5d
The beam profiler now displays the 1/e**2 intensity diameter.
jayich Jan 13, 2016
34751fc
Re-inserting cv2.waitKey as apparently this is essential for buttons.
jayich Jan 13, 2016
67d85ae
Clarify the conversion from camera scaled pixels to micrometers.
jayich Jan 13, 2016
1f360ea
Changed text to take up 3 boxes, teted with beam profiler, working!
maxxtepper Dec 17, 2015
4ed7371
Merge pull request #1 from CampbellGroup/physics_changes_tabs_spaces_…
jayich Jan 16, 2016
cee1a9b
Signed-off-by: Kayla Rodriguez <krodriguez106@att.net>
kaylajrox Sep 14, 2017
d1e0c88
modified comments
kaylajrox Sep 19, 2017
d58bb81
changed initial guess for gaussian fitting
kaylajrox Sep 19, 2017
057bae6
more data points taken into account in this one
kaylajrox Sep 19, 2017
4956a81
Merge branch 'kaylatest' of http://github.com/CampbellGroup/PiBeamPro…
kaylajrox Sep 19, 2017
b190447
initial guess changed
kaylajrox Sep 19, 2017
04cba53
confusion on how to implement a sort in the code
kaylajrox Sep 20, 2017
05c8742
Signed-off-by: Kayla Rodriguez <krodriguez106@att.net>
kaylajrox Sep 20, 2017
6404ba3
Signed-off-by: Kayla Rodriguez <krodriguez106@att.net>
kaylajrox Sep 20, 2017
403702c
the workspace file changed for some reason
kaylajrox Sep 20, 2017
bb4184b
function added to obtain a better guess
kaylajrox Sep 20, 2017
1408dd4
changed the gaussian fit initial guess
kaylajrox Sep 20, 2017
9c60a31
Added comments
kaylajrox Sep 20, 2017
216fdbd
changes the number of data points used
kaylajrox Sep 20, 2017
38f8d1a
Raspberry Pi cheat sheet commands
kaylajrox Sep 20, 2017
bf3c166
raspberry pi commands
kaylajrox Sep 20, 2017
ea9237c
raspberry pi commands updated
kaylajrox Sep 20, 2017
b1c6a79
finished - works better
kaylajrox Sep 20, 2017
02e215f
modified guess
kaylajrox Sep 21, 2017
06c5b6e
updating raspi commands
kaylajrox Sep 26, 2017
dfa7554
updated commands/fixes
kaylajrox Sep 27, 2017
237e23d
updated comments
kaylajrox Sep 27, 2017
9ae93db
pics
kaylajrox Sep 27, 2017
d2c0231
new comments
kaylajrox Sep 27, 2017
5b68ae2
new comments
kaylajrox Sep 27, 2017
dd0b035
new comments
kaylajrox Sep 28, 2017
6b9dc53
new comments
kaylajrox Sep 28, 2017
64eacfa
updated code
kaylajrox Oct 20, 2017
0842314
fudged conversion factor at the end. may not be correct
kaylajrox Oct 20, 2017
4a8822d
updated closest function
kaylajrox Dec 1, 2017
e6e3233
updated raspberry pi commands
kaylajrox Dec 1, 2017
916f967
pseudocode for the new closest function
kaylajrox Dec 1, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

566 changes: 361 additions & 205 deletions PiBeamProfiler.py
100755 → 100644

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Pseudocode.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Plan to Implement a Better Guess:
1. Sort (by using a function possibly) through all the y values for either row or column (will have to do for both)
sort to find the index of the value closest to 1/e**2
2. Return the index of that y value and use for the x array to find the x value that corresponds to this
output the number that corresponds to this x array index
3. Take the absolute value of the outputted number from x array (in case it is on the negative side of the axis)
and multiply this number by 2 to obtain the beam size (the diameter width)
309 changes: 309 additions & 0 deletions Raspi commands.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,309 @@
#********************************************************************************
# General Settings commands
#********************************************************************************

#********************************************************************************
# FOR RASPBERRY PI VIEWING IN HAMILITON LAB
#********************************************************************************
# Remember that the code for the beam profiler runs under the home folder code
# to access this code go onto cd /code/PiBeamProfiler and here you can edit the
# code on a text editor and pull changes from github
#*********************************************************************************

#*****************************
#Looking up Information and help
#help command helps give a summary of a command and how it works
# write the command name with this at the end to find that information
--help

#*****************************
# Moving/Retrieving Tabs/Using Terminal
#*****************************
#press alt and then press tab

#move a tab by clicking anywhere and holding alt to move the tab

#press tab to finish typing
# Example: "Pi" and then tab will finish itself most likely finish to
# PiBeamProfiler/
# this works for commands and folder names

#press up key to retrieve the last thing that was typed and
#keep clicking to find more previous commands

#things that are saved or created automatically go to the
#home directory category

#*****************************
# Basic Commands and Updates
#*****************************
# This changes the directory that the terminal uses
# Meaning you can access different folders and directories using this command
cd foldername/subfoldername

#list the contents in a directory or folder
#type this after folder name that popped up after the cd command was used
#this shows everything that is in the folder
ls

# CAUTION: keep in mind the pi has to be connected to the internet to be fully updated
#updating packages
sudo apt-get update

#upgrading packages
sudo apt-get upgrade

# This will automatically pop up in the terminal before you type a command
pi@raspberrypi:/$

#****************************
# Configurations
#****************************

#config.txt
#*************************
#this file changes basic settings of the pi such as screen rotation,
#overscan (whether the screen fits properly), and other things

# To get to the configurations document and modify
# uncomment things and reboot to apply
# ctrl X, y, ctrl M to apply
sudo nano /boot/config.txt #configure the pi document

#config.txt expanded contents:
#this file changes basic settings of the pi such as screen rotation,
#overscan (whether the screen fits properly), and other things

#sudo reboot to apply the new changes to the configuration document
sudo reboot

#This stuff is on that configuration document
# To rotate the display screen
display_rotate=0 #no rotatatin
display_rotate=1 #rotate by 90 degrees
display_rotate=2 #rotate by 180 degrees
display_rotate=3 #rotate by 270 degrees

# overscan
#to change how the display fits the screen change the overscan settings
#this will be under this file so type this code in
#overscan directions on the .txt configure document

#rotating the display will mess up the mouse settings on the screen so this might help
#this will change the x and y axis of the mouse
$ sudo apt-get install xinput #try this with/ without the $ symbol, not sure which one actually works
xinput --list
DISPLAY=:0 xinput --list
xinput set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 0 1
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 1 0


#resolve.conf
#*********************
#Access Domain Name System (what it is using for the internet)
#raspberry pi one says ucla physics domain
#expanded in internet section
sudo nano /etc/resolv.conf

#Network Configuration
#*********************
#Opening the network configurations
sudo nano /etc/network/interfaces
#expanded in internet section

#****************************
# Menu
#****************************
#Getting to the menu Options
#getting to different menu options
# this contains the camera (enable/disable), filesystem, change passowrd, overclock, and about
sudo raspi-config



#*****************************************************************************************
# Internet Help/commands
#*****************************************************************************************

#***********************
# Common/Frequent Error
#***********************
#When you get this error the internet section might help
#go to internet section to try and resolve this error
# try fixing the nameservers which is below
#add nameservers to network configuration page and then save in the way it says earlier

#Err http://archive.raspberrypi.org wheezy InRelease

#Err http://mirrordirector.raspbian.org wheezy InRelease

#Err http://archive.raspberrypi.org wheezy Release.gpg
 # Temporary failure resolving 'archive.raspberrypi.org'
#Err http://mirrordirector.raspbian.org wheezy Release.gpg
#  Temporary failure resolving 'mirrordirector.raspbian.org'
#Reading package lists... Done
#W: Failed to fetch http://mirrordirector.raspbian.org/raspbian/dists/wheezy/InRelease 

#W: Failed to fetch http://archive.raspberrypi.org/debian/dists/wheezy/InRelease 

#W: Failed to fetch http://archive.raspberrypi.org/debian/dists/wheezy/Release.gpg 
#Temporary failure resolving 'archive.raspberrypi.org'

#W: Failed to fetch http://mirrordirector.raspbian.org/raspbian/dists/wheezy/Release.gpg 
#Temporary failure resolving 'mirrordirector.raspbian.org'

#W: Some index files failed to download. They have been ignored, or old ones used instead.

#*************************
#Nameservers and Configuring the Pi to google
#*************************
#configuring the internet: first edit with this command (interfaces configuration)
sudo nano /etc/network/interfaces

#these nameservers belong to google
#add this to the resolve.conf document
nameserver 8.8.8.8
nameserver 8.8.4.4

#The top of the document currently says
#iface wlan0
#Replace it at the top with this to get it to work
auto eth0 #this should be only thing at the top

#find something that looks like this on this document and change the
#static to dhcp
iface eth0 inet dhcp #change the static to dhcp

#************************
#testing the internet speed
#************************
#enter these commands in this order
sudo apt-get install python-pip
sudo easy_install speedtest-cli
speedtest-cli #outputs the speed

#************************
# Installing a Better Web Browser
#************************
#To install something similar to chrome use this:
$ sudo apt-get install chromium-browser

#if this does not work use the update command and then rerun chromium

#*****************************************************************************************
# Camera Help/commands
#*****************************************************************************************

#Getting to the menu Options to Hopefully get the Camera Working
#this will access camera options
sudo raspi-config

#Opening up the Camera Options
raspistill

#taking a picture
#the last part is the name of the image
#It will be saved to your user's home directory with this filename
raspistill -o image.jpg

#record a video
raspivid

#To capture a 10 second video with raspberry pi
raspivid -o video.h264 -t 1000

# open the menu options
sudo raspi-config

#Fixing the Camera
#this might be useful (didnt work for me though)
#firmware is problem
# Use the following command to get the very latest (but experimental) firmware:
#DO NOT USE THIS MADE SOFTWARE NOT WORK
sudo rpi-update

#Increasing gpu memory
#go to the config.txt document described in configurations section
#increase gpu memory so that gpu_mem = 144 #this messed up beam profiler requires more power



#************************************************************************
# Coding/Using Git and Github
#************************************************************************

#*******************
# Installing/Configuring Git
#*******************
#installing git
sudo apt-get install git

#configure git
git config --global user.name "Harry Potter"
git config --global user.email "h.potter@hogwarts.prof

#text editor (you can use a different text editor this one just sets one
# and works fine)
git config --global core.editor nano

#*******************
# Basic Commands:
# cloning, pushing, pulling
#*******************

#clone a repository (still figuring out which folder it goes to?)
#use any website name and have the .git at the end of the github website
git clone https://github.com/CampbellGroup/PiBeamProfiler.git

#git commands
git checkout branchname #type in the name you want to checkout
git branch #shows you which branch you are on

#when the code on the device conflicts with code on the internet, this
#command changes the code on the device to match the one on the internet
git stash

#shows the differences between code on github and code on device
git diff

#run the code within a specified directory (you first need to do this using the cd command
python CodeName.py

#changing the code on the pi in a text editor
nano PiBeamProfiler.py

#three steps to change code and send to github on the internet
# 1
#use this one when entire files are added to a folder
git add filename
# or this one
#use this one to see changes made to certain documents already in the folder
#this goes through your changes one by one and you say whether it is okay to add them
git add -p

#2
# write a message of what you changed
git commit -m "message"

#3
#send to the internet
#NEVER PUSH MASTER
git push origin branchname

# obtain the code from the internet
git pull

#removing a folder
#make sure you are in the folder by using cd and ls
#do steps 2 and 3 to send to github
git rm -rf foldername


#running python on the raspberry pi
# CAUTION you can only run this when you are within the folder this is located which means you still have
#to run cd code/PiBeamProfiler/ first to access the python code
python codename.py
#in the beam profiler's case then run
python PiBeamProfiler.py

Loading