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

finish Focus connector

adding fake secondary connector because of missing ancillary data in VO
parent d9b54581
No related branches found
No related tags found
1 merge request!9adding LINC CalibratedVisibilities and Secondary data connectors
--datasource=vo
--connector=FOCUS.LincSecondaryFake12ab3d
--data_host=http://145.38.188.72/tap/focusproject.secondary
--batch_size=1000
--adex_backend_host=http://localhost:8000/adex_backend/
--adex_resource=ancillary_dp/create
--adex_token=9519e433ba37487f1a18121dfb1957d992fbb790
--clear_collection
--collection=linc_ancillary
\ No newline at end of file
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
--adex_resource=primary_dp/create --adex_resource=primary_dp/create
--adex_token=9519e433ba37487f1a18121dfb1957d992fbb790 --adex_token=9519e433ba37487f1a18121dfb1957d992fbb790
--clear_collection --clear_collection
--collection=focus --collection=linc_visibilities
\ No newline at end of file \ No newline at end of file
--datasource=vo
--connector=FOCUS.LincSkymap
--data_host=http://145.38.188.72/tap/focusproject.skymap
--batch_size=1000
--adex_backend_host=http://localhost:8000/adex_backend/
--adex_resource=primary_dp/create
--adex_token=9519e433ba37487f1a18121dfb1957d992fbb790
--clear_collection
--collection=linc_skymap
\ No newline at end of file
import datetime import datetime
class LincSkymap():
def translate(self, row, args):
"""
parse the specific row that comes from the VO adql query,
and translate it into the standard json payload for posting to the ADEX backend REST API
:param row: the results from the ADQL query to a VO service
:param args: the commandline arguments, but only args.collection is currently used
:return: user, password, host, database, db_port
"""
freq_min = float(row['f_min'])
freq_max = float(row['f_max'])
freq_avg = (freq_max + freq_min) / 2
duration = float(row['t_end']) - float(row['t_start'])
#sampling_time = duration / time_samples
payload = dict(
pid=row['imageTitle'],
name=row['imageTitle'],
dp_type="skymap",
format=row['mime'], #this yields 'archive/tar', which is not a defined format by stakeholders
#format="other",
locality="online",
access_url=row['accref'],
ra=float(row['centerAlpha']),
dec=float(row['centerDelta']),
equinox=str(row['wcs_equinox']),
exposure_time=duration,
central_frequency=freq_avg,
frequency_resolution=None,
time_resolution=None,
bandwidth=None,
release_date=None,
data_provider="ASTRON",
PSF_size=None,
#sky_footprint=str(row['s_region']),
sky_footprint=None,
dataset_id=str(row['pipeline_run_id']),
collection=args.collection,
parent=None
)
# are these parameters that we can create the Acitivies with?
pipeline_version = row['pipeline_version'],
pipeline_access_url = row['pipeline_access_url'],
#related_products = row['related_products'],
return payload
class LincCalibratedVisibilities(): class LincCalibratedVisibilities():
def translate(self, row, args): def translate(self, row, args):
...@@ -110,3 +165,46 @@ class LincSecondary(): ...@@ -110,3 +165,46 @@ class LincSecondary():
) )
return payload return payload
class LincSecondaryFake12ab3d():
def translate(self, row, args):
""""
parse the specific row that comes from the VO adql query,
and translate it into the standard json payload for posting to the ADEX backend REST API
:param row: the results from the ADQL query to a VO service
:param args: the commandline arguments, but only args.collection is currently used
:return: user, password, host, database, db_port
"""
# check for these types from VO: inputs, inspection-plot, execution-logs, calibration-file
# translate VO speak to ADEX speak
dp_type = row['type']
if dp_type == 'inspection-plot':
dp_type = 'diagnostic-plot'
if dp_type == 'calibration-file':
dp_type = 'calibration-solution'
if dp_type == 'inputs':
dp_type = 'pipeline-config'
if dp_type == 'execution-log':
dp_type = 'execution-log'
payload = dict(
pid=row['access_url'],
name=row['access_url'],
dp_type=dp_type,
format="other",
locality="online",
access_url=row['access_url'],
dataset_id="12ab3d",
parent=None,
collection = args.collection
)
return payload
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment