Hi Filipe,
I found that choosing positivity constraint for a complex object forces the object to have positive real and imaginary parts. Is that how it is supposed to be?
We were assuming that positivity constraint only means that the real part is forced to be positive.
We were thinking about implementing a more general way of constraining the phase shift of the object. Filipe, what do you think?
I refer to the following two parts in the code:
phasing.c: phaser_apply_constraints(...)
}else if(constraints & SpPositiveComplexObject){
if(sp_real(new_model->image->data[i]) < 0){
if(constraints & SpPositivityFlipping){
sp_real(new_model->image->data[i]) = fabs(sp_real(new_model->image->data[i]));
}else{
sp_real(new_model->image->data[i]) = 0;
}
}
if(sp_imag(new_model->image->data[i]) < 0){
if(constraints & SpPositivityFlipping){
sp_imag(new_model->image->data[i]) = fabs(sp_imag(new_model->image->data[i]));
}else{
sp_imag(new_model->image->data[i]) = 0;
}
}
- phasing_kernels.cu
}else if(constraints & SpPositiveComplexObject){
if(g[i].x < 0){
if(constraints & SpPositivityFlipping){
g[i].x = fabs(g[i].x);
}else{
g[i].x = 0;
}
}
if(g[i].y < 0){
if(constraints & SpPositivityFlipping){
g[i].y = fabs(g[i].y);
}else{
g[i].y = 0;
}
}
}
Hi Filipe,
I found that choosing positivity constraint for a complex object forces the object to have positive real and imaginary parts. Is that how it is supposed to be?
We were assuming that positivity constraint only means that the real part is forced to be positive.
We were thinking about implementing a more general way of constraining the phase shift of the object. Filipe, what do you think?
I refer to the following two parts in the code:
phasing.c: phaser_apply_constraints(...)
}else if(constraints & SpPositiveComplexObject){
if(sp_real(new_model->image->data[i]) < 0){
if(constraints & SpPositivityFlipping){
sp_real(new_model->image->data[i]) = fabs(sp_real(new_model->image->data[i]));
}else{
sp_real(new_model->image->data[i]) = 0;
}
}
if(sp_imag(new_model->image->data[i]) < 0){
if(constraints & SpPositivityFlipping){
sp_imag(new_model->image->data[i]) = fabs(sp_imag(new_model->image->data[i]));
}else{
sp_imag(new_model->image->data[i]) = 0;
}
}
}else if(constraints & SpPositiveComplexObject){
if(g[i].x < 0){
if(constraints & SpPositivityFlipping){
g[i].x = fabs(g[i].x);
}else{
g[i].x = 0;
}
}
if(g[i].y < 0){
if(constraints & SpPositivityFlipping){
g[i].y = fabs(g[i].y);
}else{
g[i].y = 0;
}
}
}