This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
R = 6371 % mean radius of the Earth, in km | |
% pre-allocate for results | |
x=cell(1,num_points) | |
y=cell(1,num_points) | |
for k=1:num_points | |
% COORDINATES OF STARTING POINT | |
lon1=xcoordinate(k) ; | |
lat1=ycoordinate(k) ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Do something if a file exists | |
if [ -f $target_dir"/$target_file" ] | |
then do something here | |
fi | |
#Calculate pi using bc | |
pi=`echo "4*a(1)" | bc -l` | |
#Convert degs to radians | |
rad=`echo "$deg*($pi/180)" | bc -l` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# flip a coin | |
FLIP=$(($(($RANDOM%10))%2)) | |
# if heads, use cowsay to present your splash | |
if [ $FLIP -eq 1 ] | |
then | |
# start with some wisdom | |
fortune -s | cowsay -n | zenity --text-info --title="Your message here" --width 500 --height 500 | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cs2cs -f "%.6f" +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs infile > outfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk '{print $(NF-2),"\t",$(NF-1)}' outfile > outfile2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
features = np.zeros([len(imlist),25]) | |
for i,f in enumerate(imlist): | |
im = np.array(Image.open(f).convert('L')) | |
h=mahotas.features.zernike_moments(im, 50, 8) | |
features[i] = h.flatten() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
features = np.zeros([len(imlist),13]) | |
for i,f in enumerate(imlist): | |
im = np.array(Image.open(f)) | |
h = mahotas.texture.haralick(im)[0] | |
features[i] = h.flatten() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
features = np.zeros([len(imlist),5]) | |
for i,f in enumerate(imlist): | |
im = np.array(Image.open(f).convert('L')) | |
Z=np.array([],np.float) | |
for k in range(5): | |
Z=np.append(Z,mahotas.moments(im, k, k)) | |
features[i]=Z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
features = np.zeros([len(imlist),162]) | |
for i,f in enumerate(imlist): | |
im = np.array(Image.open(f)) | |
h=mahotas.features.tas(im) | |
features[i] = h.flatten() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
features = np.zeros([len(imlist),162]) | |
for i,f in enumerate(imlist): | |
im = np.array(Image.open(f)) | |
h=mahotas.features.pftas(im) | |
features[i] = h.flatten() |
OlderNewer