Skip to content

Commit

Permalink
Merge pull request #73 from desihub/fix_fiber_location
Browse files Browse the repository at this point in the history
Fix fiber location
  • Loading branch information
sbailey authored Apr 13, 2017
2 parents 59218d7 + 32d5d5a commit 4ffddfd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/fiberassign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ int main(int argc, char **argv) {
//combine the three input files
M=Targ;
printf(" Target size %d \n",M.size());
std::cout.flush();
//need to be able to match immutable target id to position in list
//check for duplicates on mtl only to allow duplication with SS
std::map<long long,int> invert_target;
Expand Down
4 changes: 2 additions & 2 deletions src/global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ void fa_write (int j, str outdir, const MTL & M, const Plates & P, const FP & pp
strcpy(tform[0], "J");
strcpy(tunit[0], "");

strcpy(ttype[1], "POSITIONER");
strcpy(ttype[1], "LOCATION");
strcpy(tform[1], "J");
strcpy(tunit[1], "");

Expand Down Expand Up @@ -1021,7 +1021,7 @@ void fa_write (int j, str outdir, const MTL & M, const Plates & P, const FP & pp
int g = A.TF[j][fib];

fiber_id[i] = fib;
positioner_id[i] = fib;
positioner_id[i] = pp[i].location;//previously absent 4/11/17
num_target[i] = P[j].av_gals[fib].size();


Expand Down
5 changes: 3 additions & 2 deletions src/structs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,11 @@ FP read_fiber_positions(const Feat& F) {
printf("before reading positioners \n");
std::cout.flush();
while (fs.eof()==0) {
double x,y; int fiber,positioner,spectro,remove;
std::istringstream(buf) >> fiber >> positioner >> spectro >> x >> y;
double x,y; int fiber,location,spectro,remove;
std::istringstream(buf) >> fiber >> location >> spectro >> x >> y;
try{
fiber_pos.fib_num=fiber;
fiber_pos.location=location;
fiber_pos.fp_x=x;
fiber_pos.fp_y=y;
int sp = F.Pacman ? inv[spectro] : spectro;
Expand Down
1 change: 1 addition & 0 deletions src/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class fpos {
int fib_num; //number of fiber(!) not positioner, read from fibpos file
double fp_x; //x position in mm of positioner
double fp_y; //y position in mm of positioner
int location; //location of fiber
int spectrom;//which spectrometer 0 - 9
std::vector<int> N;// Identify neighboring positioners : neighbors of fiber k are N[k]
dpair coords;
Expand Down

0 comments on commit 4ffddfd

Please sign in to comment.