Skip to content

Commit

Permalink
removed unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlouden committed Aug 11, 2016
1 parent 175b69c commit a652d62
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 225 deletions.
195 changes: 0 additions & 195 deletions c_src/_heron.c

This file was deleted.

7 changes: 2 additions & 5 deletions c_src/blocked.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,7 @@ double blocked(double **planet, int n_layers, double x2, double y2, double r2){
free(second_line);
return 0;
}
double simple_fit = find_circles_region(x1,y1,planet[k][14],x2,y2,r2)/M_PI;

// double simple_fit = find_circles_region(x1,y1,planet[k][14],x2,y2,r2)/M_PI;
// printf("total_blocked %f\n",total_blocked);
// printf("simple fit: %f\n",simple_fit);
// printf("dif: %f\n",total_blocked-simple_fit);
Expand All @@ -796,10 +795,8 @@ double blocked(double **planet, int n_layers, double x2, double y2, double r2){

}

double simple_fit = find_circles_region(x1,y1,r1,x2,y2,r2)/M_PI;

// double simple_fit = find_circles_region(x1,y1,r1,x2,y2,r2)/M_PI;
// printf("simple fit: %f\n",simple_fit);

// printf("total_blocked: %f (%f different to circle/cirlce)\n",total_blocked,total_blocked-simple_fit);

return total_blocked;
Expand Down
2 changes: 1 addition & 1 deletion c_src/generate.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ double zhang_2016(double lat, double lon, double xi, double T_n, double delta_T)
}

double **generate_planet(int n_layers){
double central, s_r, m;
double central, s_r;
int n_segments;
double **planet;

Expand Down
2 changes: 1 addition & 1 deletion c_src/heron.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ double heron(double a, double b, double c) {
}

double find_triangle_area(double *a,double *b,double *c){
double cross_term,s1,s2,s3,s4,area1,area2,area;
double s1,s2,s3,area;

s1 = sqrt(pow(a[0]-b[0],2) + pow(a[1]-b[1],2));
s2 = sqrt(pow(a[0]-c[0],2) + pow(a[1]-c[1],2));
Expand Down
1 change: 0 additions & 1 deletion c_src/intersection.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ double *line_intersect(double x1,double y1,double x2,double y2,double xc,double

double D = (x1-xc)*(y2-yc) - (x2-xc)*(y1-yc);

double disc = pow(r*dr,2) - pow(D,2);
double sgn = 1;
if(dy < 0){
sgn = -1;
Expand Down
4 changes: 0 additions & 4 deletions c_src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
double *lightcurve(int n_layers, int n_points, double *t, double tc, double per, double a, double inc, double ecc, double omega, double a_rs, double rp,double xi,double T_n,double delta_T,double u1, double u2,double star_T){
int n,j;
double phase,lambda0,phi0;
double *coords;
double p_blocked, p_bright,phase_z,phase_dz,phase_dt;

double r2 = 1.0/rp; //invert planet radius ratio - planets always have radius 1 in this code
Expand All @@ -33,8 +32,6 @@ double *lightcurve(int n_layers, int n_points, double *t, double tc, double per,

star_bright = star_bright*M_PI*pow(r2,2);

free(coords);

for (n = 0; n < n_points; n++) {

double *old_coords = separation_of_centers(t[n],tc,per,a,inc,ecc,omega,a_rs,r2);
Expand Down Expand Up @@ -92,7 +89,6 @@ double *lightcurve(int n_layers, int n_points, double *t, double tc, double per,
// each i-th pointer is now pointing to dynamic array (size 10) of actual int values
}
free(planet);
free(coords);
free(transit_coords);

return output;
Expand Down
2 changes: 1 addition & 1 deletion c_src/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ double find_circles_region(double x1, double y1, double r1, double x2, double y2
double theta1 = cross_points1[5] - cross_points1[4];

if(test_r < r2){
double theta1 = cross_points1[4] - cross_points1[5];
theta1 = cross_points1[4] - cross_points1[5];
}

double theta2 = cross_points2[4] - cross_points2[5];
Expand Down
13 changes: 0 additions & 13 deletions c_src/web.c

This file was deleted.

1 change: 0 additions & 1 deletion c_src/web.h

This file was deleted.

4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
import numpy.distutils.misc_util
import numpy as np

_test = Extension("spiderman._test", ["c_src/_test.c", "c_src/test.c"])
_web = Extension("spiderman._web",["c_src/_web.c","c_src/heron.c","c_src/segment.c","c_src/areas.c","c_src/intersection.c","c_src/generate.c","c_src/blocked.c","c_src/util.c","c_src/pyutil.c","c_src/main.c","c_src/orthographic.c","c_src/ephemeris.c","c_src/blackbody.c"])
_polar = Extension("spiderman._polar", ["c_src/_polar.c","c_src/polar.c"])

setup( name='spiderman-package',
version="0.2.2",
Expand All @@ -23,5 +21,5 @@
],
include_dirs = [np.get_include()],
install_requires = ['numpy'],
ext_modules=[_test,_web,_polar]
ext_modules=[_web]
)

0 comments on commit a652d62

Please sign in to comment.