I have opened a FITS file in pyfits. The HEADER file reads XTENSION='BINTABLE'
with DIMENSION= 52989R x 36C
with 36 column tags like, 'ZBEST'
, 'ZQUALITY'
, 'M_B'
, 'UB'
, 'PGAL'
etc.
Now, I have to choose objects from the data with 'ZQUALITY' greater than 2 & 'PGAL' equals to 3. Then I have to make a histogram for the 'ZBEST' of the corresponding objects obeying the above conditions. Also I have to plot 'M_B' vs 'UB' for those objects.
At last I want to slice the 'ZBEST' into three slices (zbest < 0.5), (0.5 < zbest < 1.0), (zbest > 1.0) and want to plot histogram and 'M_B' vs 'UB' diagram of them separately.
I am stuck at choosing the data obeying the two conditions. Can anyone please tell me how can I choose the objects from the data satisfying both the conditions ('ZQUALITY' > 2 & 'PGAL' == 3 )? I am using like: data.field[('zquality' > 2) & ('pgal'==3)]
but it's not working.