示例#1
0
 def accumulate_bp(self, blueprint):
     self.accumulate_obs(blueprint)
     self.accumulate_plane(blueprint)
     self.accumulate_artifact(blueprint)
     self.accumulate_position(blueprint)
     self.accumulate_part(blueprint)
     meta_producer = mc.get_version(APPLICATION)
     blueprint.set('Observation.metaProducer', meta_producer)
     blueprint.set('Plane.metaProducer', meta_producer)
     blueprint.set('Artifact.metaProducer', meta_producer)
     blueprint.set('Chunk.metaProducer', meta_producer)
示例#2
0
def accumulate_bp(bp, uri):
    """Configure the telescope-specific ObsBlueprint at the CAOM model
    Observation level."""
    logging.debug('Begin accumulate_bp.')
    bp.configure_position_axes((1, 2))
    bp.configure_energy_axis(3)
    bp.configure_polarization_axis(5)
    bp.configure_observable_axis(6)

    # assume all observations are Derived, set to Simple if required
    bp.set('DerivedObservation.members', {})

    bp.set('Observation.observationID', '_get_obs_id(header)')
    bp.set('Observation.intent', '_get_obs_intent(uri)')

    # TODO - this is not correct, as it will over-write the value in the
    # existing gem2caom2 version
    bp.clear('Observation.algorithm.name')
    bp.add_fits_attribute('Observation.algorithm.name', 'SOFTWARE')

    # DB 12-04-21
    # Proposal information comes from GEMPRGID and the details should be
    # retrieved from archive.gemini.edu
    bp.clear('Observation.proposal.id')
    bp.add_fits_attribute('Observation.proposal.id', 'GEMPRGID')

    # DB 07-08-20
    # target.type for all NIFS science products, at least, could be set to
    # ‘object’.   (i.e. NIFS is never used for wider ‘field’ observations)
    bp.set('Observation.target.type', 'object')
    bp.set('Observation.telescope.geoLocationX', '_get_telescope_x(uri)')
    bp.set('Observation.telescope.geoLocationY', '_get_telescope_y(uri)')
    bp.set('Observation.telescope.geoLocationZ', '_get_telescope_z(uri)')

    bp.set('Plane.calibrationLevel', CalibrationLevel.CALIBRATED)
    bp.set('Plane.dataProductType', '_get_plane_data_product_type(header)')
    bp.clear('Plane.provenance.lastExecuted')
    bp.add_fits_attribute('Plane.provenance.lastExecuted', 'DATE')
    bp.clear('Plane.provenance.name')
    bp.add_fits_attribute('Plane.provenance.name', 'SOFTWARE')
    bp.set('Plane.provenance.producer', 'CADC')
    bp.clear('Plane.provenance.reference')
    bp.add_fits_attribute('Plane.provenance.reference', 'SOFT_DOI')
    bp.clear('Plane.provenance.version')
    bp.add_fits_attribute('Plane.provenance.version', 'SOFT_VER')

    meta_producer = mc.get_version(APPLICATION)
    bp.set('Observation.metaProducer', meta_producer)
    bp.set('Plane.metaProducer', meta_producer)
    bp.set('Artifact.metaProducer', meta_producer)
    bp.set('Chunk.metaProducer', meta_producer)

    logging.debug('Done accumulate_bp.')
示例#3
0
def accumulate_bp(bp, uri):
    """Configure the telescope-specific ObsBlueprint at the CAOM model 
    Observation level."""
    logging.debug('Begin accumulate_bp.')
    scheme, collection, f_name = mc.decompose_uri(uri)
    if f_name.startswith('d'):
        _accumulate_dao_bp(bp)
    else:
        _accumulate_skycam_bp(bp)

    meta_producer = mc.get_version(APPLICATION)
    bp.set('Observation.metaProducer', meta_producer)
    bp.set('Plane.metaProducer', meta_producer)
    bp.set('Artifact.metaProducer', meta_producer)
    bp.set('Chunk.metaProducer', meta_producer)

    bp.clear('Observation.algorithm.name')

    bp.set('Observation.telescope.name', 'get_telescope_name(header)')
    bp.set('Observation.telescope.geoLocationX', 'get_geo_x(header)')
    bp.set('Observation.telescope.geoLocationY', 'get_geo_y(header)')
    bp.set('Observation.telescope.geoLocationZ', 'get_geo_z(header)')

    bp.set('Chunk.time.axis.axis.ctype', 'TIME')
    bp.set('Chunk.time.axis.axis.cunit', 'd')
    bp.set('Chunk.time.axis.function.naxis', '1')
    bp.set('Chunk.time.axis.function.delta', 'get_time_axis_delta(header)')
    bp.set('Chunk.time.axis.function.refCoord.pix', '0.5')
    bp.set('Chunk.time.axis.function.refCoord.val',
           'get_time_axis_val(params)')

    bp.set('Chunk.observable.axis.axis.ctype', 'FLUX')
    bp.set('Chunk.observable.axis.axis.cunit', 'COUNTS')
    bp.set('Chunk.observable.axis.function.refCoord.pix', 1)

    bp.set('Chunk.energy.axis.axis.ctype', 'WAVE')
    bp.set('Chunk.energy.axis.axis.cunit', 'Angstrom')
    bp.set('Chunk.energy.specsys', 'TOPOCENT')
    bp.set('Chunk.energy.ssysobs', 'TOPOCENT')
    bp.set('Chunk.energy.ssyssrc', 'TOPOCENT')

    # derived observations
    if dn.DAOName.is_derived(uri):
        bp.set('CompositeObservation.members', 'get_members(header)')
        bp.add_fits_attribute('Observation.algorithm.name', 'PROCNAME')
    logging.debug('Done accumulate_bp.')
示例#4
0
def accumulate_bp(bp, uri):
    """Configure the telescope-specific ObsBlueprint at the CAOM model 
    Observation level."""
    logging.debug('Begin accumulate_bp.')
    bp.configure_position_axes((1, 2))
    bp.configure_time_axis(3)
    bp.configure_energy_axis(4)
    bp.configure_polarization_axis(5)
    bp.configure_observable_axis(6)

    meta_producer = mc.get_version(APPLICATION)
    bp.set('Observation.metaProducer', meta_producer)
    bp.set('Plane.metaProducer', meta_producer)
    bp.set('Artifact.metaProducer', meta_producer)
    bp.set('Chunk.metaProducer', meta_producer)

    logging.debug('Done accumulate_bp.')
示例#5
0
    def _accumulate_common_bp(self, bp):
        meta_producer = mc.get_version('dao2caom2')
        bp.set('Observation.metaProducer', meta_producer)
        bp.set('Plane.metaProducer', meta_producer)
        bp.set('Artifact.metaProducer', meta_producer)
        bp.set('Chunk.metaProducer', meta_producer)

        bp.clear('Observation.algorithm.name')

        bp.set('Observation.telescope.name', 'get_telescope_name()')
        bp.set('Observation.telescope.geoLocationX', 'get_geo_x()')
        bp.set('Observation.telescope.geoLocationY', 'get_geo_y()')
        bp.set('Observation.telescope.geoLocationZ', 'get_geo_z()')

        bp.set('Artifact.releaseType', 'data')

        bp.set('Chunk.time.axis.axis.ctype', 'TIME')
        bp.set('Chunk.time.axis.axis.cunit', 'd')
        bp.set('Chunk.time.axis.function.naxis', '1')
        bp.set(
            'Chunk.time.axis.function.delta', 'get_time_axis_delta()'
        )
        bp.set('Chunk.time.axis.function.refCoord.pix', '0.5')
        bp.set(
            'Chunk.time.axis.function.refCoord.val',
            'get_time_axis_val(params)'
        )

        bp.set('Chunk.observable.axis.axis.ctype', 'FLUX')
        bp.set('Chunk.observable.axis.axis.cunit', 'COUNTS')
        bp.set('Chunk.observable.axis.function.refCoord.pix', 1)

        bp.set('Chunk.energy.axis.axis.ctype', 'WAVE')
        bp.set('Chunk.energy.axis.axis.cunit', 'Angstrom')
        bp.set('Chunk.energy.specsys', 'TOPOCENT')
        bp.set('Chunk.energy.ssysobs', 'TOPOCENT')
        bp.set('Chunk.energy.ssyssrc', 'TOPOCENT')

        # derived observations
        if DAOName.is_derived(self._storage_name.file_uri):
            bp.set('DerivedObservation.members', [])
            bp.add_fits_attribute('Observation.algorithm.name', 'PROCNAME')
示例#6
0
    def accumulate_blueprint(self, bp, application=None):
        self.configure_axes(bp)
        meta_producer = mc.get_version(APPLICATION)
        bp.set('Observation.metaProducer', meta_producer)
        bp.set('Plane.metaProducer', meta_producer)
        bp.set('Artifact.metaProducer', meta_producer)
        bp.set('Chunk.metaProducer', meta_producer)

        bp.set('Observation.metaRelease', 'get_release_date()')
        bp.set('Observation.intent', ObservationIntentType.CALIBRATION)
        bp.set('Observation.instrument.name', 'Sky Camera')
        bp.set('Plane.calibrationLevel', 1)
        bp.set('Plane.dataProductType', DataProductType.IMAGE)
        bp.set('Plane.dataRelease', 'get_release_date()')
        bp.set('Plane.metaRelease', 'get_release_date()')
        bp.set('Plane.provenance.project', 'DAO Science Archive')
        bp.set(
            'Plane.provenance.producer',
            'NRC Herzberg Astronomy and Astrophysics Research Centre',
        )
        bp.set('Plane.provenance.name', 'DAO Sky Camera image')
        bp.set(
            'Plane.provenance.reference',
            'https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/en/dao/',
        )
        bp.set('Artifact.productType', ProductType.CALIBRATION)
        bp.set('Artifact.releaseType', 'data')

        bp.set('Chunk.energy.axis.function.delta', 3000.0)
        bp.set('Chunk.energy.axis.function.naxis', 1)
        bp.set('Chunk.energy.axis.function.refCoord.pix', 0.5)
        bp.set('Chunk.energy.axis.function.refCoord.val', 4000.0)
        bp.set('Chunk.energy.resolvingPower', 5500.0 / 3000.0)

        bp.add_fits_attribute('Chunk.time.exposure', 'EXPTIME')
        bp.add_fits_attribute('Chunk.time.resolution', 'EXPTIME')
        self._accumulate_common_bp(bp)
示例#7
0
def accumulate_wcs(bp):
    """Configure the VLASS-specific ObsBlueprint for the CAOM model
    SpatialWCS."""
    logging.debug('Begin accumulate_wcs.')
    bp.configure_position_axes((1, 2))
    bp.configure_energy_axis(3)
    bp.configure_polarization_axis(4)

    meta_producer = mc.get_version(sn.APPLICATION)
    bp.set('Observation.metaProducer', meta_producer)
    bp.set('Plane.metaProducer', meta_producer)
    bp.set('Artifact.metaProducer', meta_producer)
    bp.set('Chunk.metaProducer', meta_producer)

    # observation level
    bp.set('Observation.type', 'OBJECT')

    # over-ride use of value from default keyword 'DATE'
    bp.clear('Observation.metaRelease')
    bp.add_fits_attribute('Observation.metaRelease', 'DATE-OBS')

    bp.clear('Observation.target.name')
    bp.add_fits_attribute('Observation.target.name', 'FILNAM04')
    bp.set('Observation.target.type', 'field')

    # Clare Chandler via JJK - 21-08-18
    bp.set('Observation.instrument.name', 'S-WIDAR')
    # From JJK - 27-08-18 - slack
    bp.set('Observation.proposal.title', 'VLA Sky Survey')
    bp.set('Observation.proposal.project', 'VLASS')
    bp.set('Observation.proposal.id', 'get_proposal_id(uri)')

    # plane level
    bp.set('Plane.calibrationLevel', '2')
    bp.clear('Plane.dataProductType')
    bp.add_fits_attribute('Plane.dataProductType', 'TYPE')

    # Clare Chandler via slack - 28-08-18
    bp.clear('Plane.provenance.name')
    bp.add_fits_attribute('Plane.provenance.name', 'ORIGIN')
    bp.set('Plane.provenance.producer', 'NRAO')
    # From JJK - 27-08-18 - slack
    bp.set('Plane.provenance.project', 'VLASS')
    bp.clear('Plane.provenance.runID')
    bp.add_fits_attribute('Plane.provenance.runID', 'FILNAM08')
    bp.clear('Plane.provenance.lastExecuted')
    bp.add_fits_attribute('Plane.provenance.lastExecuted', 'DATE')

    # VLASS data is public, says Eric Rosolowsky via JJK May 30/18
    bp.clear('Plane.metaRelease')
    bp.add_fits_attribute('Plane.metaRelease', 'DATE-OBS')
    bp.clear('Plane.dataRelease')
    bp.add_fits_attribute('Plane.dataRelease', 'DATE-OBS')

    # artifact level
    bp.clear('Artifact.productType')
    bp.set('Artifact.productType', 'get_product_type(uri)')

    # chunk level
    bp.clear('Chunk.position.axis.function.cd11')
    bp.clear('Chunk.position.axis.function.cd22')
    bp.add_fits_attribute('Chunk.position.axis.function.cd11', 'CDELT1')
    bp.set('Chunk.position.axis.function.cd12', 0.0)
    bp.set('Chunk.position.axis.function.cd21', 0.0)
    bp.add_fits_attribute('Chunk.position.axis.function.cd22', 'CDELT2')

    # Clare Chandler via JJK - 21-08-18
    bp.set('Chunk.energy.bandpassName', 'S-band')