diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml index 55ed96a..84dac8d 100644 --- a/.github/workflows/run_test.yml +++ b/.github/workflows/run_test.yml @@ -45,5 +45,6 @@ jobs: ANOMALY_TG_TOKEN: ${{ secrets.ANOMALY_TG_TOKEN }} run: | pip install fink-utils --upgrade + pip install py4j ./run_tests.sh curl -s https://codecov.io/bash | bash diff --git a/fink_filters/filter_anomaly_notification/filter.py b/fink_filters/filter_anomaly_notification/filter.py index 69fd490..8ff8876 100755 --- a/fink_filters/filter_anomaly_notification/filter.py +++ b/fink_filters/filter_anomaly_notification/filter.py @@ -115,8 +115,8 @@ def anomaly_notification_( ... send_to_tg=False, channel_id=None, ... send_to_slack=False, channel_name=None) >>> print(pdf_anomalies['objectId'].values) - ['ZTF21acoshvy' 'ZTF18aaypnnd' 'ZTF18abgjtxx' 'ZTF18aapgymv' 'ZTF18aaakhsv' - 'ZTF18abhxigz' 'ZTF18aapoack' 'ZTF19aboujyi' 'ZTF18abbtxsx' 'ZTF18actxdmj'] + ['ZTF21acoshvy' 'ZTF18abgjtxx' 'ZTF19acevxhv' 'ZTF19aboujyi' 'ZTF18aapgymv' + 'ZTF18abbtxsx' 'ZTF18aaakhsv' 'ZTF18aaypnnd' 'ZTF18aapoack' 'ZTF18abzvnya'] """ # Filtering by coordinates if cut_coords: diff --git a/fink_filters/filter_early_kn_candidates/filter.py b/fink_filters/filter_early_kn_candidates/filter.py index e0a5310..5cac406 100644 --- a/fink_filters/filter_early_kn_candidates/filter.py +++ b/fink_filters/filter_early_kn_candidates/filter.py @@ -32,7 +32,8 @@ from fink_filters.tester import spark_unit_tests -def perform_classification(drb, classtar, jd, jdstarthist, ndethist, cdsxmatch, fid, +def perform_classification( + drb, classtar, jd, jdstarthist, ndethist, cdsxmatch, fid, magpsf, sigmapsf, ra, dec, roid): """ """ @@ -129,8 +130,10 @@ def perform_classification(drb, classtar, jd, jdstarthist, ndethist, cdsxmatch, ) # for a test on "many" objects, you may wait 1s to stay under the # query limit. - table = SDSS.query_region(pos, fields=['type'], - radius=5 * u.arcsec) + table = SDSS.query_region( + pos, fields=['type'], + radius=5 * u.arcsec + ) type_close_objects = [] if table is not None: type_close_objects = table['type'] @@ -302,14 +305,14 @@ def early_kn_candidates( jd.astype(float)[f_kn] - jdstarthist.astype(float)[f_kn] ) # Redefine notations relative to candidates - fid = np.array(fid)[f_kn] - jd = np.array(jd)[f_kn] - mag = magpsf[f_kn] - err_mag = sigmapsf[f_kn] - field = field[f_kn] + fid = np.array(fid.values)[f_kn] + jd = np.array(jd.values)[f_kn] + mag = magpsf.values[f_kn] + err_mag = sigmapsf.values[f_kn] + field = field.values[f_kn] dict_filt = {1: 'g', 2: 'r'} - for i, alertID in enumerate(objectId[f_kn]): + for i, alertID in enumerate(objectId[f_kn].values): # information to send alert_text = """ *Fink Science Portal:* @@ -442,7 +445,7 @@ def early_kn_candidates( # DWF channel and requirements dwf_ztf_fields = [1525, 530, 482, 1476, 388, 1433] dwf_in_env = ('KNWEBHOOK_DWF' in os.environ) - if (int(field.values[i]) in dwf_ztf_fields) and dwf_in_env: + if (int(field[i]) in dwf_ztf_fields) and dwf_in_env: requests.post( os.environ['KNWEBHOOK_DWF'], json={