Skip to content
Snippets Groups Projects
Commit e4826b6b authored by Nico Vermaas's avatar Nico Vermaas
Browse files

Merge remote-tracking branch 'origin/SDC-926-add-focus-connectors' into...

Merge remote-tracking branch 'origin/SDC-926-add-focus-connectors' into SDC-926-add-focus-connectors
parents f6331a88 a9cc6360
No related branches found
No related tags found
1 merge request!9adding LINC CalibratedVisibilities and Secondary data connectors
Pipeline #46882 passed
......@@ -7,3 +7,4 @@
--adex_token=9519e433ba37487f1a18121dfb1957d992fbb790
--clear_collection
--collection=lotts-dr2
--simulate_post
\ No newline at end of file
......@@ -24,7 +24,7 @@ class ContinuumImagesConnector():
access_url=row['accref'],
ra=float(row['centeralpha']),
dec=float(row['centerdelta']),
equinox=str(row['wcs_equinox']),
equinox="2000.0",
exposure_time=None,
central_frequency=freq_avg,
......@@ -45,9 +45,9 @@ class ContinuumImagesConnector():
)
# useful settings, do something with it?
dateobs = row['dateobs']
mime = row['mime']
bandpassid = row['bandpassid'],
#dateobs = row['dateobs']
#mime = row['mime']
#bandpassid = row['bandpassid'],
return payload
......
......@@ -19,7 +19,7 @@ class LotssDR2Mosaics():
access_url=row['accref'],
ra=float(row['centeralpha']),
dec=float(row['centerdelta']),
equinox=str(row['wcs_equinox']),
equinox="2000.0",
exposure_time=None,
central_frequency=None,
......@@ -39,11 +39,11 @@ class LotssDR2Mosaics():
)
# useful settings, do something with it?
collection = 'lotss_dr2_mosaics'
dataset_ids = row['lofar_obsids'],
dateobs = row['dateobs']
mime = row['mime']
bandpassid = row['bandpassid'],
#collection = 'lotss_dr2_mosaics'
#dataset_ids = row['lofar_obsids'],
#dateobs = row['dateobs']
#mime = row['mime']
#bandpassid = row['bandpassid'],
return payload
import types
import unittest
import argparse
from scraper.postgres.connectors.apertif import Inspectionplots
......@@ -11,11 +12,9 @@ class TestConnectorPostgresApertif(unittest.TestCase):
pid = 5
url = 'some_access_url'
dataset_id = 23
row = (name, pid, url, '', '', dataset_id)
args_collection = [1, 2, 3]
args = types.SimpleNamespace(collection=args_collection)
args = argparse.Namespace(collection='my_collection')
expected = {
'pid': pid,
......@@ -26,7 +25,7 @@ class TestConnectorPostgresApertif(unittest.TestCase):
'access_url': url,
'dataset_id': str(dataset_id),
'parent': None,
'collection': args_collection,
'collection': 'my_collection',
}
# act
......
import argparse
import unittest
from scraper.vo.connectors.Apertif_DR1 import ContinuumImagesConnector
from scraper.vo.connectors.LotssDR2 import LotssDR2Mosaics
# TODO: implement
class TestConnectorVOApertif(unittest.TestCase):
pass
def test_continuum_images_translate(self):
# arrange
row = {
'accref': 'https://vo.astron.nl/getproduct/APERTIF_DR1/190807041_AP_B001/image_mf_02.fits',
'freqmin' : 1360.36,
'freqmax' : 1360.36,
'imagetitle': '190807041_AP_B001',
'pub_did': 'ivo://astron.nl/~?APERTIF_DR1/190807041_AP_B001/image_mf_02.fits',
'centeralpha': 208.360378733881,
'centerdelta': 52.3613884370237,
'wcs_equinox': '2000.0',
'obsid': '190807041',
}
args = argparse.Namespace(collection='apertif-dr1')
expected = {'pid': 'ivo://astron.nl/~?APERTIF_DR1/190807041_AP_B001/image_mf_02.fits',
'name': '190807041_AP_B001',
'dp_type': 'science_skymap',
'format': 'fits',
'locality': 'online',
'access_url': 'https://vo.astron.nl/getproduct/APERTIF_DR1/190807041_AP_B001/image_mf_02.fits',
'ra': 208.360378733881,
'dec': 52.3613884370237,
'equinox': '2000.0',
'exposure_time': None,
'central_frequency': 1360.3599853515625,
'frequency_resolution': None,
'time_resolution': None,
'bandwidth': None,
'release_date': '2023-03-20T12:34:21.433848',
'data_provider': 'ASTRON',
'PSF_size': None,
'sky_footprint': None,
'dataset_id': '190807041',
'collection': 'apertif-dr1',
'parent': None}
expected = expected
# act
connector = ContinuumImagesConnector()
actual = connector.translate(row=row, args=args)
# assert contents ignoring order
self.assertCountEqual(actual, expected)
# TODO: implement
class TestConnectorVOFocus(unittest.TestCase):
pass
# TODO: implement
class TestConnectorVOLotssDR2(unittest.TestCase):
pass
def test_mosaics_translate(self):
# arrange
row = {
'accref': 'https://vo.astron.nl/getproduct/APERTIF_DR1/190807041_AP_B001/image_mf_02.fits',
'freqmin': 1360.36,
'freqmax': 1360.36,
'imagetitle': '190807041_AP_B001',
'data_pid': '21.12136/ede3eff0-266a-465a-af68-6f292391485f',
'centeralpha': 208.360378733881,
'centerdelta': 52.3613884370237,
'wcs_equinox': '2000.0',
'lofar_obsids': [689778],
}
args = argparse.Namespace(collection='lotts-dr2')
expected = {'pid': '21.12136/ede3eff0-266a-465a-af68-6f292391485f',
'name': 'P000+23_mosaic-blanked.fits',
'dp_type': 'unknown',
'format': 'other',
'locality': 'online',
'access_url': 'https://vo.astron.nl/getproduct/LoTSS-DR2/P000%2B23',
'ra': 0.03125,
'dec': 23.3953,
'equinox': '2000.0',
'exposure_time': None,
'central_frequency': None,
'frequency_resolution': None,
'time_resolution': None,
'bandwidth': None,
'release_date': '2023-03-20T14:01:36.328040',
'data_provider': 'ASTRON',
'PSF_size': None,
'sky_footprint': None,
'dataset_id': '689778',
'parent': None,
'collection': 'lotts-dr2'}
expected = expected
# act
connector = LotssDR2Mosaics()
actual = connector.translate(row=row, args=args)
# assert contents ignoring order
self.assertCountEqual(actual, expected)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment