mardi 8 septembre 2020

Degenerate result from if condition

I'm trying to create a flag column for a catalog based on a mask ( ra, dec plot). When i use the mask (from a .reg file) and make the plot i get a correct result as shown below enter image description here

However when i try to plot again based on the FLAG i 'm trying to create i get points in the white square that is supposed to be empty. I create the flag in this way

`FLAG_BORDER=np.zeros(len(t))
for i in range(len(t)):
    if  ralist[i] in raborder and declist[i] in decborder:
        FLAG_BORDER[i] = 1
    else:
        FLAG_BORDER[i] = 0`

where t is my table , ralist an array with all ra values , raborder an array with ra values that are supposed to be flagged with 1 created from the mask. I understand that i'm getting degenerate results because some points have the same for one of the two coordinates. How can i put in the code a "filter" to avoid this degeneracy?

Aucun commentaire:

Enregistrer un commentaire