Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#525 closed defect (fixed)

Spectral plotting broken

Reported by: MatthewWhiting Owned by: MatthewWhiting
Priority: normal Milestone: Release-1.6.2
Component: Output Version: 1.6.1
Severity: normal Keywords:
Cc:

Description (last modified by MatthewWhiting)

As reported by Anne Klitsch, there is a WCS error coming up in the spectral plotting.

This is actually happening in the verification scripts as well, and so definitely needs to be fixed!

Original report:

My name is Anne Klitsch and I am a PhD student at ESO in Germany. I am interested in galaxies connected to
known Lyman alpha absorbers. We have a number of observations from ALMA targeting CO emission lines in 
fields with known intervening absorbers and I want to use Duchamp as a source finder. I have tried to install i
on my mac book and it runs in principle smoothly. However, if I run Duchamp on one of my cubes or even if I 
run the verification script I get the following error: 
ERROR <pixToWCSSingle> : WCS Error Code = 8: stat=3 : One or more of the pixel coordinates were invalid

Change History (5)

comment:1 Changed 7 years ago by MatthewWhiting

Origin appears to be due to the following code in spectraUtils.cc

    double xloc,yloc;
    size_t spatpos=0;
    std::vector<Voxel> voxlist;
    if(objNum>=0){
      if(this->par.getSpectralMethod()=="sum"){
	xloc=double(this->objectList->at(objNum).getXcentre());
	yloc=double(this->objectList->at(objNum).getYcentre());
	voxlist = this->objectList->at(objNum).getPixelSet();
      }
      else{
	spatpos = this->objectList->at(objNum).getXPeak() +
	xdim*this->objectList->at(objNum).getYPeak();
      }
    }

    if(this->head.isWCS()){
//       double xval = double(this->objectList->at(objNum).getXcentre());
//       double yval = double(this->objectList->at(objNum).getYcentre());
//       for(double zval=0;zval<zdim;zval++)
// 	specx[int(zval)] = this->head.pixToVel(xval,yval,zval);
      for(double zval=0;zval<zdim;zval++)
	specx[int(zval)] = this->head.pixToVel(xloc,yloc,zval);
    }
    else
      for(double zval=0;zval<zdim;zval++) specx[int(zval)] = zval;

In the mode Anne is using, we use the second part of the getSpectralMethod if clause, which does not set xloc or yloc. And it is these that are used in the pixToVel call, which is where the WCS error is coming from. Defining xloc & yloc should solve the problem.

comment:2 Changed 7 years ago by MatthewWhiting

Fixed accordingly in [1429]-[1431] (mucked up some commits.. :)

comment:3 Changed 7 years ago by MatthewWhiting

Resolution: fixed
Status: newclosed

comment:4 Changed 7 years ago by MatthewWhiting

Description: modified (diff)

comment:5 Changed 7 years ago by MatthewWhiting

Description: modified (diff)
Note: See TracTickets for help on using tickets.