'Cannot make a mask for BTJD format of a Time object

I cannot make a mask using the following code:

mask = (flat_lc['time'] < 1346) | (flat_lc['time'] > 1350)

You can see what the dataframe looks like here: Dataframe

I get the following error:

'<' not supported between instances of 'Time' and 'int'

I think there has been an update recently that has changed this. The tutorial I'm following has their mask like this. I get the same error if I change the mask values to a string instead of an int.



Solution 1:[1]

the object flat_lc is a astropy Time object so I checked the documentation for that and found out you can access the values of the object by doing:

flat_lc['time'].value

The mask then becomes:

mask = (flat_lc['time'].value < 1346) | (flat_lc['time'].value>1350)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Christopher Rudolph