Skip to content

implementation of positivity constraint #2

@mhantke

Description

@mhantke

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;
}
}

  1. 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;
    }
    }
    }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions