diff --git a/.github/workflows/build_sync_container.yml b/.github/workflows/build_sync_container.yml index 9c39791..3f76cc0 100644 --- a/.github/workflows/build_sync_container.yml +++ b/.github/workflows/build_sync_container.yml @@ -35,7 +35,7 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Cache Docker layers - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ github.sha }} diff --git a/README.rst b/README.rst index ca714dc..819846e 100644 --- a/README.rst +++ b/README.rst @@ -43,7 +43,7 @@ Steps to update the alert schema (for example, when the APDB schema is updated). * set up ``sdm_schemas`` and ``cd python/lsst/alert/packet/``. * run ``python updateSchema.py $SDM_SCHEMAS_DIR/yml/apdb.yaml ./schema "6.0"`` All Generated files do not need to be altered. - * Navigate to the new schema. Copy in the previous ``lsst.vX_X.alert.avsc`` file and ``lsst.vX_X.diaNondetectionLimit.avsc``. + * Navigate to the new schema. Copy in the previous ``lsst.vX_X.alert.avsc`` file. * Within the two copied files, update ``"namespace": "lsst.vX_X",`` line at the top of each ``*.avsc`` file to the new version. * Update the contents of those avro schema files to reflect the new schema. diff --git a/python/lsst/alert/packet/schema/8/0/lsst.v8_0.MPCORB.avsc b/python/lsst/alert/packet/schema/8/0/lsst.v8_0.MPCORB.avsc new file mode 100644 index 0000000..bea038c --- /dev/null +++ b/python/lsst/alert/packet/schema/8/0/lsst.v8_0.MPCORB.avsc @@ -0,0 +1,115 @@ +{ + "type": "record", + "namespace": "lsst.v8_0", + "name": "MPCORB", + "fields": [ + { + "default": null, + "doc": "Number or provisional designation (in packed form).", + "name": "mpcDesignation", + "type": [ + "null", + "string" + ] + }, + { + "default": null, + "doc": "LSST unique identifier (if observed by LSST).", + "name": "ssObjectId", + "type": [ + "null", + "long" + ] + }, + { + "default": null, + "doc": "Absolute magnitude, H [mag].", + "name": "mpcH", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Epoch (in MJD, .0 TT) [d].", + "name": "epoch", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Mean anomaly at the epoch [deg].", + "name": "M", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Argument of perihelion, J2000.0 [deg].", + "name": "peri", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Longitude of the ascending node, J2000.0 [deg].", + "name": "node", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Inclination to the ecliptic, J2000.0 [deg].", + "name": "incl", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Orbital eccentricity.", + "name": "e", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Semimajor axis [AU].", + "name": "a", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Perihelion distance [AU].", + "name": "q", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "MJD of pericentric passage [d].", + "name": "t_p", + "type": [ + "null", + "double" + ] + } + ] +} \ No newline at end of file diff --git a/python/lsst/alert/packet/schema/8/0/lsst.v8_0.alert.avsc b/python/lsst/alert/packet/schema/8/0/lsst.v8_0.alert.avsc new file mode 100644 index 0000000..195dbec --- /dev/null +++ b/python/lsst/alert/packet/schema/8/0/lsst.v8_0.alert.avsc @@ -0,0 +1,24 @@ +{ + "namespace": "lsst.v8_0", + "type": "record", + "name": "alert", + "doc": "Rubin Avro alert schema v8.0", + "fields": [ + {"name": "diaSourceId", "type": "long", "doc": "Identifier of the triggering DiaSource"}, + {"name": "observation_reason", "type": ["null", "string"], "doc": "Scheduler reason for the image containing this diaSource (RTN-097).", "default": null}, + {"name": "target_name", "type": ["null", "string"], "doc": "Scheduler target for the image containing this diaSource (RTN-097).", "default": null}, + {"name": "diaSource", "type": "lsst.v8_0.diaSource"}, + {"name": "prvDiaSources", "type": ["null", { + "type": "array", + "items": "lsst.v8_0.diaSource"}], "default": null}, + {"name": "prvDiaForcedSources", "type": ["null", { + "type": "array", + "items": "lsst.v8_0.diaForcedSource"}], "default": null}, + {"name": "diaObject", "type": ["null", "lsst.v8_0.diaObject"], "default": null}, + {"name": "ssSource", "type": ["null", "lsst.v8_0.ssSource"], "default": null}, + {"name": "MPCORB", "type": ["null", "lsst.v8_0.MPCORB"], "default": null}, + {"name": "cutoutDifference", "type": ["null", "bytes"], "default": null}, + {"name": "cutoutScience", "type": ["null", "bytes"], "default": null}, + {"name": "cutoutTemplate", "type": ["null", "bytes"], "default": null} + ] +} diff --git a/python/lsst/alert/packet/schema/8/0/lsst.v8_0.diaForcedSource.avsc b/python/lsst/alert/packet/schema/8/0/lsst.v8_0.diaForcedSource.avsc new file mode 100644 index 0000000..e6cda94 --- /dev/null +++ b/python/lsst/alert/packet/schema/8/0/lsst.v8_0.diaForcedSource.avsc @@ -0,0 +1,95 @@ +{ + "type": "record", + "namespace": "lsst.v8_0", + "name": "diaForcedSource", + "fields": [ + { + "doc": "Unique id.", + "name": "diaForcedSourceId", + "type": "long" + }, + { + "doc": "Id of the DiaObject that this DiaForcedSource was associated with.", + "name": "diaObjectId", + "type": "long" + }, + { + "doc": "Right ascension coordinate of the position of the DiaObject [deg].", + "name": "ra", + "type": "double" + }, + { + "doc": "Declination coordinate of the position of the DiaObject [deg].", + "name": "dec", + "type": "double" + }, + { + "doc": "Id of the visit where this forcedSource was measured.", + "name": "visit", + "type": "long" + }, + { + "doc": "Id of the detector where this forcedSource was measured. Datatype short instead of byte because of DB concerns about unsigned bytes.", + "name": "detector", + "type": "int" + }, + { + "default": null, + "doc": "Point Source model flux [nJy].", + "name": "psfFlux", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Uncertainty of psfFlux [nJy].", + "name": "psfFluxErr", + "type": [ + "null", + "float" + ] + }, + { + "doc": "Effective mid-visit time for this diaForcedSource, expressed as Modified Julian Date, International Atomic Time [d].", + "name": "midpointMjdTai", + "type": "double" + }, + { + "default": null, + "doc": "Forced photometry flux for a point source model measured on the visit image centered at the DiaObject position [nJy].", + "name": "scienceFlux", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Uncertainty of scienceFlux [nJy].", + "name": "scienceFluxErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Filter band this source was observed with.", + "name": "band", + "type": [ + "null", + "string" + ] + }, + { + "doc": "Time when this record was generated.", + "name": "time_processed", + "type": { + "logicalType": "timestamp-micros", + "type": "long" + } + } + ] +} \ No newline at end of file diff --git a/python/lsst/alert/packet/schema/8/0/lsst.v8_0.diaObject.avsc b/python/lsst/alert/packet/schema/8/0/lsst.v8_0.diaObject.avsc new file mode 100644 index 0000000..a51d762 --- /dev/null +++ b/python/lsst/alert/packet/schema/8/0/lsst.v8_0.diaObject.avsc @@ -0,0 +1,728 @@ +{ + "type": "record", + "namespace": "lsst.v8_0", + "name": "diaObject", + "fields": [ + { + "doc": "Unique identifier of this DiaObject.", + "name": "diaObjectId", + "type": "long" + }, + { + "doc": "Processing time when validity of this diaObject starts.", + "name": "validityStart", + "type": { + "logicalType": "timestamp-micros", + "type": "long" + } + }, + { + "doc": "Right ascension coordinate of the position of the object [deg].", + "name": "ra", + "type": "double" + }, + { + "default": null, + "doc": "Uncertainty of ra [deg].", + "name": "raErr", + "type": [ + "null", + "float" + ] + }, + { + "doc": "Declination coordinate of the position of the object [deg].", + "name": "dec", + "type": "double" + }, + { + "default": null, + "doc": "Uncertainty of dec [deg].", + "name": "decErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Covariance between ra and dec [deg**2].", + "name": "ra_dec_Cov", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Weighted mean point-source model magnitude for u filter [nJy].", + "name": "u_psfFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of u_psfFluxMean [nJy].", + "name": "u_psfFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard deviation of the distribution of u_psfFlux [nJy].", + "name": "u_psfFluxSigma", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "The number of u-band data points.", + "name": "u_psfFluxNdata", + "type": [ + "null", + "int" + ] + }, + { + "default": null, + "doc": "Weighted mean forced photometry flux for u filter [nJy].", + "name": "u_fpFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of u_fpFluxMean [nJy].", + "name": "u_fpFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Weighted mean point-source model magnitude for g filter [nJy].", + "name": "g_psfFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of g_psfFluxMean [nJy].", + "name": "g_psfFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard deviation of the distribution of g_psfFlux [nJy].", + "name": "g_psfFluxSigma", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "The number of g-band data points.", + "name": "g_psfFluxNdata", + "type": [ + "null", + "int" + ] + }, + { + "default": null, + "doc": "Weighted mean forced photometry flux for g filter [nJy].", + "name": "g_fpFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of g_fpFluxMean [nJy].", + "name": "g_fpFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Weighted mean point-source model magnitude for r filter [nJy].", + "name": "r_psfFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of r_psfFluxMean [nJy].", + "name": "r_psfFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard deviation of the distribution of r_psfFlux [nJy].", + "name": "r_psfFluxSigma", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "The number of r-band data points.", + "name": "r_psfFluxNdata", + "type": [ + "null", + "int" + ] + }, + { + "default": null, + "doc": "Weighted mean forced photometry flux for r filter [nJy].", + "name": "r_fpFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of r_fpFluxMean [nJy].", + "name": "r_fpFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Weighted mean point-source model magnitude for i filter [nJy].", + "name": "i_psfFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of i_psfFluxMean [nJy].", + "name": "i_psfFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard deviation of the distribution of i_psfFlux [nJy].", + "name": "i_psfFluxSigma", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "The number of i-band data points.", + "name": "i_psfFluxNdata", + "type": [ + "null", + "int" + ] + }, + { + "default": null, + "doc": "Weighted mean forced photometry flux for i filter [nJy].", + "name": "i_fpFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of i_fpFluxMean [nJy].", + "name": "i_fpFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Weighted mean point-source model magnitude for z filter [nJy].", + "name": "z_psfFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of z_psfFluxMean [nJy].", + "name": "z_psfFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard deviation of the distribution of z_psfFlux [nJy].", + "name": "z_psfFluxSigma", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "The number of z-band data points.", + "name": "z_psfFluxNdata", + "type": [ + "null", + "int" + ] + }, + { + "default": null, + "doc": "Weighted mean forced photometry flux for z filter [nJy].", + "name": "z_fpFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of z_fpFluxMean [nJy].", + "name": "z_fpFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Weighted mean point-source model magnitude for y filter [nJy].", + "name": "y_psfFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of y_psfFluxMean [nJy].", + "name": "y_psfFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard deviation of the distribution of y_psfFlux [nJy].", + "name": "y_psfFluxSigma", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "The number of y-band data points.", + "name": "y_psfFluxNdata", + "type": [ + "null", + "int" + ] + }, + { + "default": null, + "doc": "Weighted mean forced photometry flux for y filter [nJy].", + "name": "y_fpFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of y_fpFluxMean [nJy].", + "name": "y_fpFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Weighted mean forced photometry flux for u filter [nJy].", + "name": "u_scienceFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of u_scienceFluxMean [nJy].", + "name": "u_scienceFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Weighted mean forced photometry flux for g filter [nJy].", + "name": "g_scienceFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of g_scienceFluxMean [nJy].", + "name": "g_scienceFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Weighted mean forced photometry flux for r filter [nJy].", + "name": "r_scienceFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of r_scienceFluxMean [nJy].", + "name": "r_scienceFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Weighted mean forced photometry flux for i filter [nJy].", + "name": "i_scienceFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of i_scienceFluxMean [nJy].", + "name": "i_scienceFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Weighted mean forced photometry flux for z filter [nJy].", + "name": "z_scienceFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of z_scienceFluxMean [nJy].", + "name": "z_scienceFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Weighted mean forced photometry flux for y filter [nJy].", + "name": "y_scienceFluxMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Standard error of y_scienceFluxMean [nJy].", + "name": "y_scienceFluxMeanErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Minimum observed u band fluxes [nJy].", + "name": "u_psfFluxMin", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum observed u band fluxes [nJy].", + "name": "u_psfFluxMax", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum slope between u band flux obsevations max(delta_flux/delta_time) [nJy/d].", + "name": "u_psfFluxMaxSlope", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Mean of the u band flux errors [nJy].", + "name": "u_psfFluxErrMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Minimum observed g band fluxes [nJy].", + "name": "g_psfFluxMin", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum observed g band fluxes [nJy].", + "name": "g_psfFluxMax", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum slope between g band flux obsevations max(delta_flux/delta_time) [nJy/d].", + "name": "g_psfFluxMaxSlope", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Mean of the g band flux errors [nJy].", + "name": "g_psfFluxErrMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Minimum observed r band fluxes [nJy].", + "name": "r_psfFluxMin", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum observed r band fluxes [nJy].", + "name": "r_psfFluxMax", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum slope between r band flux obsevations max(delta_flux/delta_time) [nJy/d].", + "name": "r_psfFluxMaxSlope", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Mean of the r band flux errors [nJy].", + "name": "r_psfFluxErrMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Minimum observed i band fluxes [nJy].", + "name": "i_psfFluxMin", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum observed i band fluxes [nJy].", + "name": "i_psfFluxMax", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum slope between i band flux obsevations max(delta_flux/delta_time) [nJy/d].", + "name": "i_psfFluxMaxSlope", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Mean of the i band flux errors [nJy].", + "name": "i_psfFluxErrMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Minimum observed z band fluxes [nJy].", + "name": "z_psfFluxMin", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum observed z band fluxes [nJy].", + "name": "z_psfFluxMax", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum slope between z band flux obsevations max(delta_flux/delta_time) [nJy/d].", + "name": "z_psfFluxMaxSlope", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Mean of the z band flux errors [nJy].", + "name": "z_psfFluxErrMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Minimum observed y band fluxes [nJy].", + "name": "y_psfFluxMin", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum observed y band fluxes [nJy].", + "name": "y_psfFluxMax", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum slope between y band flux obsevations max(delta_flux/delta_time) [nJy/d].", + "name": "y_psfFluxMaxSlope", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Mean of the y band flux errors [nJy].", + "name": "y_psfFluxErrMean", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Time of the first diaSource, expressed as Modified Julian Date, International Atomic Time.", + "name": "firstDiaSourceMjdTai", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Time of the most recent non-forced DIASource for this object, expressed as Modified Julian Date, International Atomic Time.", + "name": "lastDiaSourceMjdTai", + "type": [ + "null", + "double" + ] + }, + { + "doc": "Total number of DiaSources associated with this DiaObject.", + "name": "nDiaSources", + "type": "int" + } + ] +} \ No newline at end of file diff --git a/python/lsst/alert/packet/schema/8/0/lsst.v8_0.diaSource.avsc b/python/lsst/alert/packet/schema/8/0/lsst.v8_0.diaSource.avsc new file mode 100644 index 0000000..d867564 --- /dev/null +++ b/python/lsst/alert/packet/schema/8/0/lsst.v8_0.diaSource.avsc @@ -0,0 +1,847 @@ +{ + "type": "record", + "namespace": "lsst.v8_0", + "name": "diaSource", + "fields": [ + { + "doc": "Unique identifier of this DiaSource.", + "name": "diaSourceId", + "type": "long" + }, + { + "doc": "Id of the visit where this diaSource was measured.", + "name": "visit", + "type": "long" + }, + { + "doc": "Id of the detector where this diaSource was measured. Datatype short instead of byte because of DB concerns about unsigned bytes.", + "name": "detector", + "type": "int" + }, + { + "default": null, + "doc": "Id of the diaObject this source was associated with, if any. If not, it is set to NULL (each diaSource will be associated with either a diaObject or ssObject).", + "name": "diaObjectId", + "type": [ + "null", + "long" + ] + }, + { + "default": null, + "doc": "Id of the ssObject this source was associated with, if any. If not, it is set to NULL (each diaSource will be associated with either a diaObject or ssObject).", + "name": "ssObjectId", + "type": [ + "null", + "long" + ] + }, + { + "default": null, + "doc": "Id of the parent diaSource this diaSource has been deblended from, if any.", + "name": "parentDiaSourceId", + "type": [ + "null", + "long" + ] + }, + { + "doc": "Effective mid-visit time for this diaSource, expressed as Modified Julian Date, International Atomic Time [d].", + "name": "midpointMjdTai", + "type": "double" + }, + { + "doc": "Right ascension coordinate of the center of this diaSource [deg].", + "name": "ra", + "type": "double" + }, + { + "default": null, + "doc": "Uncertainty of ra [deg].", + "name": "raErr", + "type": [ + "null", + "float" + ] + }, + { + "doc": "Declination coordinate of the center of this diaSource [deg].", + "name": "dec", + "type": "double" + }, + { + "default": null, + "doc": "Uncertainty of dec [deg].", + "name": "decErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Covariance between ra and dec [deg**2].", + "name": "ra_dec_Cov", + "type": [ + "null", + "float" + ] + }, + { + "doc": "x position computed by a centroiding algorithm [pixel].", + "name": "x", + "type": "float" + }, + { + "default": null, + "doc": "Uncertainty of x [pixel].", + "name": "xErr", + "type": [ + "null", + "float" + ] + }, + { + "doc": "y position computed by a centroiding algorithm [pixel].", + "name": "y", + "type": "float" + }, + { + "default": null, + "doc": "Uncertainty of y [pixel].", + "name": "yErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "General centroid algorithm failure flag; set if anything went wrong when fitting the centroid. Another centroid flag field should also be set to provide more information.", + "name": "centroid_flag", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Flux in a 12 pixel radius aperture on the difference image [nJy].", + "name": "apFlux", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Estimated uncertainty of apFlux [nJy].", + "name": "apFluxErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "General aperture flux algorithm failure flag; set if anything went wrong when measuring aperture fluxes. Another apFlux flag field should also be set to provide more information.", + "name": "apFlux_flag", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Aperture did not fit within measurement image.", + "name": "apFlux_flag_apertureTruncated", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Source was detected as significantly negative.", + "name": "isNegative", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "The signal-to-noise ratio at which this source was detected in the difference image.", + "name": "snr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Flux for Point Source model. Note this actually measures the flux difference between the template and the visit image [nJy].", + "name": "psfFlux", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Uncertainty of psfFlux [nJy].", + "name": "psfFluxErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Natural log likelihood of the observed data given the point source model.", + "name": "psfLnL", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Chi^2 statistic of the point source model fit.", + "name": "psfChi2", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "The number of data points (pixels) used to fit the point source model.", + "name": "psfNdata", + "type": [ + "null", + "int" + ] + }, + { + "default": null, + "doc": "Failure to derive linear least-squares fit of psf model. Another psfFlux flag field should also be set to provide more information.", + "name": "psfFlux_flag", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Object was too close to the edge of the image to use the full PSF model.", + "name": "psfFlux_flag_edge", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Not enough non-rejected pixels in data to attempt the fit.", + "name": "psfFlux_flag_noGoodPixels", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Flux for a trailed source model. Note this actually measures the flux difference between the template and the visit image [nJy].", + "name": "trailFlux", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Uncertainty of trailFlux [nJy].", + "name": "trailFluxErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Right ascension coordinate of centroid for trailed source model [deg].", + "name": "trailRa", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Uncertainty of trailRa [deg].", + "name": "trailRaErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Declination coordinate of centroid for trailed source model [deg].", + "name": "trailDec", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Uncertainty of trailDec [deg].", + "name": "trailDecErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum likelihood fit of trail length [arcsec].", + "name": "trailLength", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Uncertainty of trailLength [nJy].", + "name": "trailLengthErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum likelihood fit of the angle between the meridian through the centroid and the trail direction (bearing) [deg].", + "name": "trailAngle", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Uncertainty of trailAngle [nJy].", + "name": "trailAngleErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Chi^2 statistic of the trailed source model fit.", + "name": "trailChi2", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "The number of data points (pixels) used to fit the trailed source model.", + "name": "trailNdata", + "type": [ + "null", + "int" + ] + }, + { + "default": null, + "doc": "This flag is set if a trailed source extends onto or past edge pixels.", + "name": "trail_flag_edge", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Maximum likelihood value for the mean absolute flux of the two lobes for a dipole model [nJy].", + "name": "dipoleMeanFlux", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Uncertainty of dipoleMeanFlux [nJy].", + "name": "dipoleMeanFluxErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum likelihood value for the difference of absolute fluxes of the two lobes for a dipole model [nJy].", + "name": "dipoleFluxDiff", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Uncertainty of dipoleFluxDiff [nJy].", + "name": "dipoleFluxDiffErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum likelihood value for the lobe separation in dipole model [arcsec].", + "name": "dipoleLength", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Maximum likelihood fit of the angle between the meridian through the centroid and the dipole direction (bearing, from negative to positive lobe) [deg].", + "name": "dipoleAngle", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Chi^2 statistic of the model fit.", + "name": "dipoleChi2", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "The number of data points (pixels) used to fit the model.", + "name": "dipoleNdata", + "type": [ + "null", + "int" + ] + }, + { + "default": null, + "doc": "Forced photometry flux for a point source model measured on the visit image centered at DiaSource position [nJy].", + "name": "scienceFlux", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Estimated uncertainty of scienceFlux [nJy].", + "name": "scienceFluxErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Forced PSF photometry on science image failed. Another forced_PsfFlux flag field should also be set to provide more information.", + "name": "forced_PsfFlux_flag", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Forced PSF flux on science image was too close to the edge of the image to use the full PSF model.", + "name": "forced_PsfFlux_flag_edge", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Forced PSF flux not enough non-rejected pixels in data to attempt the fit.", + "name": "forced_PsfFlux_flag_noGoodPixels", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Forced photometry flux for a point source model measured on the template image centered at the DiaObject position [nJy].", + "name": "templateFlux", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Uncertainty of templateFlux [nJy].", + "name": "templateFluxErr", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Adaptive second moment of the source intensity [nJy.arcsec**2].", + "name": "ixx", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Adaptive second moment of the source intensity [nJy.arcsec**2].", + "name": "iyy", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Adaptive second moment of the source intensity [nJy.arcsec**2].", + "name": "ixy", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Adaptive second moment for the PSF [nJy.arcsec**2].", + "name": "ixxPSF", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Adaptive second moment for the PSF [nJy.arcsec**2].", + "name": "iyyPSF", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Adaptive second moment for the PSF [nJy.arcsec**2].", + "name": "ixyPSF", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "General source shape algorithm failure flag; set if anything went wrong when measuring the shape. Another shape flag field should also be set to provide more information.", + "name": "shape_flag", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "No pixels to measure shape.", + "name": "shape_flag_no_pixels", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Center not contained in footprint bounding box.", + "name": "shape_flag_not_contained", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "This source is a parent source; we should only be measuring on deblended children in difference imaging.", + "name": "shape_flag_parent_source", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "A measure of extendedness, computed by comparing an object's moment-based traced radius to the PSF moments. extendedness = 1 implies a high degree of confidence that the source is extended. extendedness = 0 implies a high degree of confidence that the source is point-like.", + "name": "extendedness", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Probability (0-1) that the diaSource is astrophysical, derived from a machine learning model.", + "name": "reliability", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Filter band this source was observed with.", + "name": "band", + "type": [ + "null", + "string" + ] + }, + { + "default": null, + "doc": "Source well fit by a dipole.", + "name": "isDipole", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Attempted to fit a dipole model to this source.", + "name": "dipoleFitAttempted", + "type": [ + "null", + "boolean" + ] + }, + { + "doc": "Time when the image was processed and this DiaSource record was generated.", + "name": "time_processed", + "type": { + "logicalType": "timestamp-micros", + "type": "long" + } + }, + { + "default": null, + "doc": "Size of the square bounding box that fully contains the detection footprint [pixel].", + "name": "bboxSize", + "type": [ + "null", + "int" + ] + }, + { + "default": null, + "doc": "General pixel flags failure; set if anything went wrong when setting pixels flags from this footprint's mask. This implies that some pixelFlags for this source may be incorrectly set to False.", + "name": "pixelFlags", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Bad pixel in the DiaSource footprint.", + "name": "pixelFlags_bad", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Cosmic ray in the DiaSource footprint.", + "name": "pixelFlags_cr", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Cosmic ray in the 3x3 region around the centroid.", + "name": "pixelFlags_crCenter", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Some of the source footprint is outside usable exposure region (masked EDGE or centroid off image).", + "name": "pixelFlags_edge", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "NO_DATA pixel in the source footprint.", + "name": "pixelFlags_nodata", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "NO_DATA pixel in the 3x3 region around the centroid.", + "name": "pixelFlags_nodataCenter", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Interpolated pixel in the DiaSource footprint.", + "name": "pixelFlags_interpolated", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Interpolated pixel in the 3x3 region around the centroid.", + "name": "pixelFlags_interpolatedCenter", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "DiaSource center is off image.", + "name": "pixelFlags_offimage", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Saturated pixel in the DiaSource footprint.", + "name": "pixelFlags_saturated", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Saturated pixel in the 3x3 region around the centroid.", + "name": "pixelFlags_saturatedCenter", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "DiaSource's footprint includes suspect pixels.", + "name": "pixelFlags_suspect", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Suspect pixel in the 3x3 region around the centroid.", + "name": "pixelFlags_suspectCenter", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Streak in the DiaSource footprint.", + "name": "pixelFlags_streak", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Streak in the 3x3 region around the centroid.", + "name": "pixelFlags_streakCenter", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Injection in the DiaSource footprint.", + "name": "pixelFlags_injected", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Injection in the 3x3 region around the centroid.", + "name": "pixelFlags_injectedCenter", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Template injection in the DiaSource footprint.", + "name": "pixelFlags_injected_template", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "Template injection in the 3x3 region around the centroid.", + "name": "pixelFlags_injected_templateCenter", + "type": [ + "null", + "boolean" + ] + }, + { + "default": null, + "doc": "This flag is set if the source is part of a glint trail.", + "name": "glint_trail", + "type": [ + "null", + "boolean" + ] + } + ] +} \ No newline at end of file diff --git a/python/lsst/alert/packet/schema/8/0/lsst.v8_0.ssSource.avsc b/python/lsst/alert/packet/schema/8/0/lsst.v8_0.ssSource.avsc new file mode 100644 index 0000000..9c47378 --- /dev/null +++ b/python/lsst/alert/packet/schema/8/0/lsst.v8_0.ssSource.avsc @@ -0,0 +1,223 @@ +{ + "type": "record", + "namespace": "lsst.v8_0", + "name": "ssSource", + "fields": [ + { + "default": null, + "doc": "Unique identifier of the object.", + "name": "ssObjectId", + "type": [ + "null", + "long" + ] + }, + { + "default": null, + "doc": "Unique identifier of the observation.", + "name": "diaSourceId", + "type": [ + "null", + "long" + ] + }, + { + "default": null, + "doc": "Ecliptic longitude [deg].", + "name": "eclipticLambda", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Ecliptic latitude [deg].", + "name": "eclipticBeta", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Galactic longitude [deg].", + "name": "galacticL", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Galactic latitute [deg].", + "name": "galacticB", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Phase angle [deg].", + "name": "phaseAngle", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Heliocentric distance [AU].", + "name": "heliocentricDist", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Topocentric distace [AU].", + "name": "topocentricDist", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Predicted V-band magnitude [mag].", + "name": "predictedVMagnitude", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Residual R.A. vs. ephemeris [deg].", + "name": "residualRa", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Residual Dec vs. ephemeris [deg].", + "name": "residualDec", + "type": [ + "null", + "double" + ] + }, + { + "default": null, + "doc": "Cartesian heliocentric X coordinate (at the emit time) [AU].", + "name": "heliocentricX", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Cartesian heliocentric Y coordinate (at the emit time) [AU].", + "name": "heliocentricY", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Cartesian heliocentric Z coordinate (at the emit time) [AU].", + "name": "heliocentricZ", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Cartesian heliocentric X velocity (at the emit time) [AU/d].", + "name": "heliocentricVX", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Cartesian heliocentric Y velocity (at the emit time) [AU/d].", + "name": "heliocentricVY", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Cartesian heliocentric Z velocity (at the emit time) [AU/d].", + "name": "heliocentricVZ", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Cartesian topocentric X coordinate (at the emit time) [AU].", + "name": "topocentricX", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Cartesian topocentric Y coordinate (at the emit time) [AU].", + "name": "topocentricY", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Cartesian topocentric Z coordinate (at the emit time) [AU].", + "name": "topocentricZ", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Cartesian topocentric X velocity (at the emit time) [AU/d].", + "name": "topocentricVX", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Cartesian topocentric Y velocity (at the emit time) [AU/d].", + "name": "topocentricVY", + "type": [ + "null", + "float" + ] + }, + { + "default": null, + "doc": "Cartesian topocentric Z velocity (at the emit time) [AU/d].", + "name": "topocentricVZ", + "type": [ + "null", + "float" + ] + } + ] +} \ No newline at end of file diff --git a/python/lsst/alert/packet/schema/8/0/sample_data/alert.json b/python/lsst/alert/packet/schema/8/0/sample_data/alert.json new file mode 100644 index 0000000..f776db5 --- /dev/null +++ b/python/lsst/alert/packet/schema/8/0/sample_data/alert.json @@ -0,0 +1,93 @@ +{ + "diaSourceId": 1231321321, + "diaSource": + { + "diaSourceId": 281323062375219200, + "time_processed": 0, + "visit": 1, + "detector": 42, + "midpointMjdTai": 60902.993305483615, + "band": "r", + "programId": 1, + "ra": 351.570546978, + "dec": 0.126243049656, + "raErr": 0.00028, + "decErr": 0.00028, + "ra_dec_Cov": 0.00029, + "x": 112.1, + "y": 121.1, + "xErr": 1.2, + "yErr": 1.1, + "x_y_Cov": 1.2, + "apFlux": 1241.0, + "apFluxErr": 12.0, + "snr": 41.1, + "trailNdata": 5, + "psfFlux": 1241.0, + "psfFluxErr": 12.0 + }, + "prvDiaSources": [ + { + "diaSourceId": 281323062375219198, + "time_processed": 0, + "visit": 2, + "detector": 43, + "midpointMjdTai": 60901.993305483615, + "band": "r", + "programId": 1, + "ra": 351.570546978, + "dec": 0.126243049656, + "raErr": 0.00028, + "decErr": 0.00028, + "ra_dec_Cov": 0.00029, + "x": 112.1, + "y": 121.1, + "xErr": 1.2, + "yErr": 1.1, + "x_y_Cov": 1.2, + "apFlux": 1241.0, + "apFluxErr": 12.0, + "snr": 41.1, + "trailNdata": 5, + "psfFlux": 1241.0, + "psfFluxErr": 12.0 + }, + { + "diaSourceId": 281323062375219199, + "time_processed": 0, + "visit": 1, + "detector": 42, + "midpointMjdTai": 60900.993305483615, + "band": "r", + "programId": 1, + "ra": 351.570546978, + "dec": 0.126243049656, + "raErr": 0.00028, + "decErr": 0.00028, + "ra_dec_Cov": 0.00029, + "x": 112.1, + "y": 121.1, + "xErr": 1.2, + "yErr": 1.1, + "x_y_Cov": 1.2, + "apFlux": 1241.0, + "apFluxErr": 12.0, + "snr": 41.1, + "trailNdata": 5, + "psfFlux": 1241.0, + "psfFluxErr": 12.0 + } + ], + "diaObject": { + "diaObjectId": 281323062375219201, + "validityStart": 0, + "ra": 351.570546978, + "dec": 0.126243049656, + "raErr": 0.00028, + "decErr": 0.00028, + "ra_dec_Cov": 0.00029, + "firstDiaSourceMjdTai": 60900.993305483615, + "lastDiaSourceMjdTai": 60902.993305483615, + "nDiaSources": 2 + } +} diff --git a/python/lsst/alert/packet/schema/8/0/sample_data/fakeAlert.avro b/python/lsst/alert/packet/schema/8/0/sample_data/fakeAlert.avro new file mode 100644 index 0000000..df95d6c --- /dev/null +++ b/python/lsst/alert/packet/schema/8/0/sample_data/fakeAlert.avro @@ -0,0 +1,5 @@ +Objavro.codecnullavro.schema{"type": "record", "doc": "Rubin Avro alert schema v8.0", "name": "lsst.v8_0.alert", "fields": [{"doc": "Identifier of the triggering DiaSource", "name": "diaSourceId", "type": "long"}, {"doc": "Scheduler reason for the image containing this diaSource (RTN-097).", "default": null, "name": "observation_reason", "type": ["null", "string"]}, {"doc": "Scheduler target for the image containing this diaSource (RTN-097).", "default": null, "name": "target_name", "type": ["null", "string"]}, {"name": "diaSource", "type": {"type": "record", "name": "lsst.v8_0.diaSource", "fields": [{"doc": "Unique identifier of this DiaSource.", "name": "diaSourceId", "type": "long"}, {"doc": "Id of the visit where this diaSource was measured.", "name": "visit", "type": "long"}, {"doc": "Id of the detector where this diaSource was measured. Datatype short instead of byte because of DB concerns about unsigned bytes.", "name": "detector", "type": "int"}, {"doc": "Id of the diaObject this source was associated with, if any. If not, it is set to NULL (each diaSource will be associated with either a diaObject or ssObject).", "default": null, "name": "diaObjectId", "type": ["null", "long"]}, {"doc": "Id of the ssObject this source was associated with, if any. If not, it is set to NULL (each diaSource will be associated with either a diaObject or ssObject).", "default": null, "name": "ssObjectId", "type": ["null", "long"]}, {"doc": "Id of the parent diaSource this diaSource has been deblended from, if any.", "default": null, "name": "parentDiaSourceId", "type": ["null", "long"]}, {"doc": "Effective mid-visit time for this diaSource, expressed as Modified Julian Date, International Atomic Time [d].", "name": "midpointMjdTai", "type": "double"}, {"doc": "Right ascension coordinate of the center of this diaSource [deg].", "name": "ra", "type": "double"}, {"doc": "Uncertainty of ra [deg].", "default": null, "name": "raErr", "type": ["null", "float"]}, {"doc": "Declination coordinate of the center of this diaSource [deg].", "name": "dec", "type": "double"}, {"doc": "Uncertainty of dec [deg].", "default": null, "name": "decErr", "type": ["null", "float"]}, {"doc": "Covariance between ra and dec [deg**2].", "default": null, "name": "ra_dec_Cov", "type": ["null", "float"]}, {"doc": "x position computed by a centroiding algorithm [pixel].", "name": "x", "type": "float"}, {"doc": "Uncertainty of x [pixel].", "default": null, "name": "xErr", "type": ["null", "float"]}, {"doc": "y position computed by a centroiding algorithm [pixel].", "name": "y", "type": "float"}, {"doc": "Uncertainty of y [pixel].", "default": null, "name": "yErr", "type": ["null", "float"]}, {"doc": "General centroid algorithm failure flag; set if anything went wrong when fitting the centroid. Another centroid flag field should also be set to provide more information.", "default": null, "name": "centroid_flag", "type": ["null", "boolean"]}, {"doc": "Flux in a 12 pixel radius aperture on the difference image [nJy].", "default": null, "name": "apFlux", "type": ["null", "float"]}, {"doc": "Estimated uncertainty of apFlux [nJy].", "default": null, "name": "apFluxErr", "type": ["null", "float"]}, {"doc": "General aperture flux algorithm failure flag; set if anything went wrong when measuring aperture fluxes. Another apFlux flag field should also be set to provide more information.", "default": null, "name": "apFlux_flag", "type": ["null", "boolean"]}, {"doc": "Aperture did not fit within measurement image.", "default": null, "name": "apFlux_flag_apertureTruncated", "type": ["null", "boolean"]}, {"doc": "Source was detected as significantly negative.", "default": null, "name": "isNegative", "type": ["null", "boolean"]}, {"doc": "The signal-to-noise ratio at which this source was detected in the difference image.", "default": null, "name": "snr", "type": ["null", "float"]}, {"doc": "Flux for Point Source model. Note this actually measures the flux difference between the template and the visit image [nJy].", "default": null, "name": "psfFlux", "type": ["null", "float"]}, {"doc": "Uncertainty of psfFlux [nJy].", "default": null, "name": "psfFluxErr", "type": ["null", "float"]}, {"doc": "Natural log likelihood of the observed data given the point source model.", "default": null, "name": "psfLnL", "type": ["null", "float"]}, {"doc": "Chi^2 statistic of the point source model fit.", "default": null, "name": "psfChi2", "type": ["null", "float"]}, {"doc": "The number of data points (pixels) used to fit the point source model.", "default": null, "name": "psfNdata", "type": ["null", "int"]}, {"doc": "Failure to derive linear least-squares fit of psf model. Another psfFlux flag field should also be set to provide more information.", "default": null, "name": "psfFlux_flag", "type": ["null", "boolean"]}, {"doc": "Object was too close to the edge of the image to use the full PSF model.", "default": null, "name": "psfFlux_flag_edge", "type": ["null", "boolean"]}, {"doc": "Not enough non-rejected pixels in data to attempt the fit.", "default": null, "name": "psfFlux_flag_noGoodPixels", "type": ["null", "boolean"]}, {"doc": "Flux for a trailed source model. Note this actually measures the flux difference between the template and the visit image [nJy].", "default": null, "name": "trailFlux", "type": ["null", "float"]}, {"doc": "Uncertainty of trailFlux [nJy].", "default": null, "name": "trailFluxErr", "type": ["null", "float"]}, {"doc": "Right ascension coordinate of centroid for trailed source model [deg].", "default": null, "name": "trailRa", "type": ["null", "double"]}, {"doc": "Uncertainty of trailRa [deg].", "default": null, "name": "trailRaErr", "type": ["null", "float"]}, {"doc": "Declination coordinate of centroid for trailed source model [deg].", "default": null, "name": "trailDec", "type": ["null", "double"]}, {"doc": "Uncertainty of trailDec [deg].", "default": null, "name": "trailDecErr", "type": ["null", "float"]}, {"doc": "Maximum likelihood fit of trail length [arcsec].", "default": null, "name": "trailLength", "type": ["null", "float"]}, {"doc": "Uncertainty of trailLength [nJy].", "default": null, "name": "trailLengthErr", "type": ["null", "float"]}, {"doc": "Maximum likelihood fit of the angle between the meridian through the centroid and the trail direction (bearing) [deg].", "default": null, "name": "trailAngle", "type": ["null", "float"]}, {"doc": "Uncertainty of trailAngle [nJy].", "default": null, "name": "trailAngleErr", "type": ["null", "float"]}, {"doc": "Chi^2 statistic of the trailed source model fit.", "default": null, "name": "trailChi2", "type": ["null", "float"]}, {"doc": "The number of data points (pixels) used to fit the trailed source model.", "default": null, "name": "trailNdata", "type": ["null", "int"]}, {"doc": "This flag is set if a trailed source extends onto or past edge pixels.", "default": null, "name": "trail_flag_edge", "type": ["null", "boolean"]}, {"doc": "Maximum likelihood value for the mean absolute flux of the two lobes for a dipole model [nJy].", "default": null, "name": "dipoleMeanFlux", "type": ["null", "float"]}, {"doc": "Uncertainty of dipoleMeanFlux [nJy].", "default": null, "name": "dipoleMeanFluxErr", "type": ["null", "float"]}, {"doc": "Maximum likelihood value for the difference of absolute fluxes of the two lobes for a dipole model [nJy].", "default": null, "name": "dipoleFluxDiff", "type": ["null", "float"]}, {"doc": "Uncertainty of dipoleFluxDiff [nJy].", "default": null, "name": "dipoleFluxDiffErr", "type": ["null", "float"]}, {"doc": "Maximum likelihood value for the lobe separation in dipole model [arcsec].", "default": null, "name": "dipoleLength", "type": ["null", "float"]}, {"doc": "Maximum likelihood fit of the angle between the meridian through the centroid and the dipole direction (bearing, from negative to positive lobe) [deg].", "default": null, "name": "dipoleAngle", "type": ["null", "float"]}, {"doc": "Chi^2 statistic of the model fit.", "default": null, "name": "dipoleChi2", "type": ["null", "float"]}, {"doc": "The number of data points (pixels) used to fit the model.", "default": null, "name": "dipoleNdata", "type": ["null", "int"]}, {"doc": "Forced photometry flux for a point source model measured on the visit image centered at DiaSource position [nJy].", "default": null, "name": "scienceFlux", "type": ["null", "float"]}, {"doc": "Estimated uncertainty of scienceFlux [nJy].", "default": null, "name": "scienceFluxErr", "type": ["null", "float"]}, {"doc": "Forced PSF photometry on science image failed. Another forced_PsfFlux flag field should also be set to provide more information.", "default": null, "name": "forced_PsfFlux_flag", "type": ["null", "boolean"]}, {"doc": "Forced PSF flux on science image was too close to the edge of the image to use the full PSF model.", "default": null, "name": "forced_PsfFlux_flag_edge", "type": ["null", "boolean"]}, {"doc": "Forced PSF flux not enough non-rejected pixels in data to attempt the fit.", "default": null, "name": "forced_PsfFlux_flag_noGoodPixels", "type": ["null", "boolean"]}, {"doc": "Forced photometry flux for a point source model measured on the template image centered at the DiaObject position [nJy].", "default": null, "name": "templateFlux", "type": ["null", "float"]}, {"doc": "Uncertainty of templateFlux [nJy].", "default": null, "name": "templateFluxErr", "type": ["null", "float"]}, {"doc": "Adaptive second moment of the source intensity [nJy.arcsec**2].", "default": null, "name": "ixx", "type": ["null", "float"]}, {"doc": "Adaptive second moment of the source intensity [nJy.arcsec**2].", "default": null, "name": "iyy", "type": ["null", "float"]}, {"doc": "Adaptive second moment of the source intensity [nJy.arcsec**2].", "default": null, "name": "ixy", "type": ["null", "float"]}, {"doc": "Adaptive second moment for the PSF [nJy.arcsec**2].", "default": null, "name": "ixxPSF", "type": ["null", "float"]}, {"doc": "Adaptive second moment for the PSF [nJy.arcsec**2].", "default": null, "name": "iyyPSF", "type": ["null", "float"]}, {"doc": "Adaptive second moment for the PSF [nJy.arcsec**2].", "default": null, "name": "ixyPSF", "type": ["null", "float"]}, {"doc": "General source shape algorithm failure flag; set if anything went wrong when measuring the shape. Another shape flag field should also be set to provide more information.", "default": null, "name": "shape_flag", "type": ["null", "boolean"]}, {"doc": "No pixels to measure shape.", "default": null, "name": "shape_flag_no_pixels", "type": ["null", "boolean"]}, {"doc": "Center not contained in footprint bounding box.", "default": null, "name": "shape_flag_not_contained", "type": ["null", "boolean"]}, {"doc": "This source is a parent source; we should only be measuring on deblended children in difference imaging.", "default": null, "name": "shape_flag_parent_source", "type": ["null", "boolean"]}, {"doc": "A measure of extendedness, computed by comparing an object's moment-based traced radius to the PSF moments. extendedness = 1 implies a high degree of confidence that the source is extended. extendedness = 0 implies a high degree of confidence that the source is point-like.", "default": null, "name": "extendedness", "type": ["null", "float"]}, {"doc": "Probability (0-1) that the diaSource is astrophysical, derived from a machine learning model.", "default": null, "name": "reliability", "type": ["null", "float"]}, {"doc": "Filter band this source was observed with.", "default": null, "name": "band", "type": ["null", "string"]}, {"doc": "Source well fit by a dipole.", "default": null, "name": "isDipole", "type": ["null", "boolean"]}, {"doc": "Attempted to fit a dipole model to this source.", "default": null, "name": "dipoleFitAttempted", "type": ["null", "boolean"]}, {"doc": "Time when the image was processed and this DiaSource record was generated.", "name": "time_processed", "type": {"logicalType": "timestamp-micros", "type": "long"}}, {"doc": "Size of the square bounding box that fully contains the detection footprint [pixel].", "default": null, "name": "bboxSize", "type": ["null", "int"]}, {"doc": "General pixel flags failure; set if anything went wrong when setting pixels flags from this footprint's mask. This implies that some pixelFlags for this source may be incorrectly set to False.", "default": null, "name": "pixelFlags", "type": ["null", "boolean"]}, {"doc": "Bad pixel in the DiaSource footprint.", "default": null, "name": "pixelFlags_bad", "type": ["null", "boolean"]}, {"doc": "Cosmic ray in the DiaSource footprint.", "default": null, "name": "pixelFlags_cr", "type": ["null", "boolean"]}, {"doc": "Cosmic ray in the 3x3 region around the centroid.", "default": null, "name": "pixelFlags_crCenter", "type": ["null", "boolean"]}, {"doc": "Some of the source footprint is outside usable exposure region (masked EDGE or centroid off image).", "default": null, "name": "pixelFlags_edge", "type": ["null", "boolean"]}, {"doc": "NO_DATA pixel in the source footprint.", "default": null, "name": "pixelFlags_nodata", "type": ["null", "boolean"]}, {"doc": "NO_DATA pixel in the 3x3 region around the centroid.", "default": null, "name": "pixelFlags_nodataCenter", "type": ["null", "boolean"]}, {"doc": "Interpolated pixel in the DiaSource footprint.", "default": null, "name": "pixelFlags_interpolated", "type": ["null", "boolean"]}, {"doc": "Interpolated pixel in the 3x3 region around the centroid.", "default": null, "name": "pixelFlags_interpolatedCenter", "type": ["null", "boolean"]}, {"doc": "DiaSource center is off image.", "default": null, "name": "pixelFlags_offimage", "type": ["null", "boolean"]}, {"doc": "Saturated pixel in the DiaSource footprint.", "default": null, "name": "pixelFlags_saturated", "type": ["null", "boolean"]}, {"doc": "Saturated pixel in the 3x3 region around the centroid.", "default": null, "name": "pixelFlags_saturatedCenter", "type": ["null", "boolean"]}, {"doc": "DiaSource's footprint includes suspect pixels.", "default": null, "name": "pixelFlags_suspect", "type": ["null", "boolean"]}, {"doc": "Suspect pixel in the 3x3 region around the centroid.", "default": null, "name": "pixelFlags_suspectCenter", "type": ["null", "boolean"]}, {"doc": "Streak in the DiaSource footprint.", "default": null, "name": "pixelFlags_streak", "type": ["null", "boolean"]}, {"doc": "Streak in the 3x3 region around the centroid.", "default": null, "name": "pixelFlags_streakCenter", "type": ["null", "boolean"]}, {"doc": "Injection in the DiaSource footprint.", "default": null, "name": "pixelFlags_injected", "type": ["null", "boolean"]}, {"doc": "Injection in the 3x3 region around the centroid.", "default": null, "name": "pixelFlags_injectedCenter", "type": ["null", "boolean"]}, {"doc": "Template injection in the DiaSource footprint.", "default": null, "name": "pixelFlags_injected_template", "type": ["null", "boolean"]}, {"doc": "Template injection in the 3x3 region around the centroid.", "default": null, "name": "pixelFlags_injected_templateCenter", "type": ["null", "boolean"]}, {"doc": "This flag is set if the source is part of a glint trail.", "default": null, "name": "glint_trail", "type": ["null", "boolean"]}]}}, {"default": null, "name": "prvDiaSources", "type": ["null", {"type": "array", "items": "lsst.v8_0.diaSource"}]}, {"default": null, "name": "prvDiaForcedSources", "type": ["null", {"type": "array", "items": {"type": "record", "name": "lsst.v8_0.diaForcedSource", "fields": [{"doc": "Unique id.", "name": "diaForcedSourceId", "type": "long"}, {"doc": "Id of the DiaObject that this DiaForcedSource was associated with.", "name": "diaObjectId", "type": "long"}, {"doc": "Right ascension coordinate of the position of the DiaObject [deg].", "name": "ra", "type": "double"}, {"doc": "Declination coordinate of the position of the DiaObject [deg].", "name": "dec", "type": "double"}, {"doc": "Id of the visit where this forcedSource was measured.", "name": "visit", "type": "long"}, {"doc": "Id of the detector where this forcedSource was measured. Datatype short instead of byte because of DB concerns about unsigned bytes.", "name": "detector", "type": "int"}, {"doc": "Point Source model flux [nJy].", "default": null, "name": "psfFlux", "type": ["null", "float"]}, {"doc": "Uncertainty of psfFlux [nJy].", "default": null, "name": "psfFluxErr", "type": ["null", "float"]}, {"doc": "Effective mid-visit time for this diaForcedSource, expressed as Modified Julian Date, International Atomic Time [d].", "name": "midpointMjdTai", "type": "double"}, {"doc": "Forced photometry flux for a point source model measured on the visit image centered at the DiaObject position [nJy].", "default": null, "name": "scienceFlux", "type": ["null", "float"]}, {"doc": "Uncertainty of scienceFlux [nJy].", "default": null, "name": "scienceFluxErr", "type": ["null", "float"]}, {"doc": "Filter band this source was observed with.", "default": null, "name": "band", "type": ["null", "string"]}, {"doc": "Time when this record was generated.", "name": "time_processed", "type": {"logicalType": "timestamp-micros", "type": "long"}}]}}]}, {"default": null, "name": "diaObject", "type": ["null", {"type": "record", "name": "lsst.v8_0.diaObject", "fields": [{"doc": "Unique identifier of this DiaObject.", "name": "diaObjectId", "type": "long"}, {"doc": "Processing time when validity of this diaObject starts.", "name": "validityStart", "type": {"logicalType": "timestamp-micros", "type": "long"}}, {"doc": "Right ascension coordinate of the position of the object [deg].", "name": "ra", "type": "double"}, {"doc": "Uncertainty of ra [deg].", "default": null, "name": "raErr", "type": ["null", "float"]}, {"doc": "Declination coordinate of the position of the object [deg].", "name": "dec", "type": "double"}, {"doc": "Uncertainty of dec [deg].", "default": null, "name": "decErr", "type": ["null", "float"]}, {"doc": "Covariance between ra and dec [deg**2].", "default": null, "name": "ra_dec_Cov", "type": ["null", "float"]}, {"doc": "Weighted mean point-source model magnitude for u filter [nJy].", "default": null, "name": "u_psfFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of u_psfFluxMean [nJy].", "default": null, "name": "u_psfFluxMeanErr", "type": ["null", "float"]}, {"doc": "Standard deviation of the distribution of u_psfFlux [nJy].", "default": null, "name": "u_psfFluxSigma", "type": ["null", "float"]}, {"doc": "The number of u-band data points.", "default": null, "name": "u_psfFluxNdata", "type": ["null", "int"]}, {"doc": "Weighted mean forced photometry flux for u filter [nJy].", "default": null, "name": "u_fpFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of u_fpFluxMean [nJy].", "default": null, "name": "u_fpFluxMeanErr", "type": ["null", "float"]}, {"doc": "Weighted mean point-source model magnitude for g filter [nJy].", "default": null, "name": "g_psfFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of g_psfFluxMean [nJy].", "default": null, "name": "g_psfFluxMeanErr", "type": ["null", "float"]}, {"doc": "Standard deviation of the distribution of g_psfFlux [nJy].", "default": null, "name": "g_psfFluxSigma", "type": ["null", "float"]}, {"doc": "The number of g-band data points.", "default": null, "name": "g_psfFluxNdata", "type": ["null", "int"]}, {"doc": "Weighted mean forced photometry flux for g filter [nJy].", "default": null, "name": "g_fpFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of g_fpFluxMean [nJy].", "default": null, "name": "g_fpFluxMeanErr", "type": ["null", "float"]}, {"doc": "Weighted mean point-source model magnitude for r filter [nJy].", "default": null, "name": "r_psfFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of r_psfFluxMean [nJy].", "default": null, "name": "r_psfFluxMeanErr", "type": ["null", "float"]}, {"doc": "Standard deviation of the distribution of r_psfFlux [nJy].", "default": null, "name": "r_psfFluxSigma", "type": ["null", "float"]}, {"doc": "The number of r-band data points.", "default": null, "name": "r_psfFluxNdata", "type": ["null", "int"]}, {"doc": "Weighted mean forced photometry flux for r filter [nJy].", "default": null, "name": "r_fpFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of r_fpFluxMean [nJy].", "default": null, "name": "r_fpFluxMeanErr", "type": ["null", "float"]}, {"doc": "Weighted mean point-source model magnitude for i filter [nJy].", "default": null, "name": "i_psfFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of i_psfFluxMean [nJy].", "default": null, "name": "i_psfFluxMeanErr", "type": ["null", "float"]}, {"doc": "Standard deviation of the distribution of i_psfFlux [nJy].", "default": null, "name": "i_psfFluxSigma", "type": ["null", "float"]}, {"doc": "The number of i-band data points.", "default": null, "name": "i_psfFluxNdata", "type": ["null", "int"]}, {"doc": "Weighted mean forced photometry flux for i filter [nJy].", "default": null, "name": "i_fpFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of i_fpFluxMean [nJy].", "default": null, "name": "i_fpFluxMeanErr", "type": ["null", "float"]}, {"doc": "Weighted mean point-source model magnitude for z filter [nJy].", "default": null, "name": "z_psfFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of z_psfFluxMean [nJy].", "default": null, "name": "z_psfFluxMeanErr", "type": ["null", "float"]}, {"doc": "Standard deviation of the distribution of z_psfFlux [nJy].", "default": null, "name": "z_psfFluxSigma", "type": ["null", "float"]}, {"doc": "The number of z-band data points.", "default": null, "name": "z_psfFluxNdata", "type": ["null", "int"]}, {"doc": "Weighted mean forced photometry flux for z filter [nJy].", "default": null, "name": "z_fpFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of z_fpFluxMean [nJy].", "default": null, "name": "z_fpFluxMeanErr", "type": ["null", "float"]}, {"doc": "Weighted mean point-source model magnitude for y filter [nJy].", "default": null, "name": "y_psfFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of y_psfFluxMean [nJy].", "default": null, "name": "y_psfFluxMeanErr", "type": ["null", "float"]}, {"doc": "Standard deviation of the distribution of y_psfFlux [nJy].", "default": null, "name": "y_psfFluxSigma", "type": ["null", "float"]}, {"doc": "The number of y-band data points.", "default": null, "name": "y_psfFluxNdata", "type": ["null", "int"]}, {"doc": "Weighted mean forced photometry flux for y filter [nJy].", "default": null, "name": "y_fpFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of y_fpFluxMean [nJy].", "default": null, "name": "y_fpFluxMeanErr", "type": ["null", "float"]}, {"doc": "Weighted mean forced photometry flux for u filter [nJy].", "default": null, "name": "u_scienceFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of u_scienceFluxMean [nJy].", "default": null, "name": "u_scienceFluxMeanErr", "type": ["null", "float"]}, {"doc": "Weighted mean forced photometry flux for g filter [nJy].", "default": null, "name": "g_scienceFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of g_scienceFluxMean [nJy].", "default": null, "name": "g_scienceFluxMeanErr", "type": ["null", "float"]}, {"doc": "Weighted mean forced photometry flux for r filter [nJy].", "default": null, "name": "r_scienceFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of r_scienceFluxMean [nJy].", "default": null, "name": "r_scienceFluxMeanErr", "type": ["null", "float"]}, {"doc": "Weighted mean forced photometry flux for i filter [nJy].", "default": null, "name": "i_scienceFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of i_scienceFluxMean [nJy].", "default": null, "name": "i_scienceFluxMeanErr", "type": ["null", "float"]}, {"doc": "Weighted mean forced photometry flux for z filter [nJy].", "default": null, "name": "z_scienceFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of z_scienceFluxMean [nJy].", "default": null, "name": "z_scienceFluxMeanErr", "type": ["null", "float"]}, {"doc": "Weighted mean forced photometry flux for y filter [nJy].", "default": null, "name": "y_scienceFluxMean", "type": ["null", "float"]}, {"doc": "Standard error of y_scienceFluxMean [nJy].", "default": null, "name": "y_scienceFluxMeanErr", "type": ["null", "float"]}, {"doc": "Minimum observed u band fluxes [nJy].", "default": null, "name": "u_psfFluxMin", "type": ["null", "float"]}, {"doc": "Maximum observed u band fluxes [nJy].", "default": null, "name": "u_psfFluxMax", "type": ["null", "float"]}, {"doc": "Maximum slope between u band flux obsevations max(delta_flux/delta_time) [nJy/d].", "default": null, "name": "u_psfFluxMaxSlope", "type": ["null", "float"]}, {"doc": "Mean of the u band flux errors [nJy].", "default": null, "name": "u_psfFluxErrMean", "type": ["null", "float"]}, {"doc": "Minimum observed g band fluxes [nJy].", "default": null, "name": "g_psfFluxMin", "type": ["null", "float"]}, {"doc": "Maximum observed g band fluxes [nJy].", "default": null, "name": "g_psfFluxMax", "type": ["null", "float"]}, {"doc": "Maximum slope between g band flux obsevations max(delta_flux/delta_time) [nJy/d].", "default": null, "name": "g_psfFluxMaxSlope", "type": ["null", "float"]}, {"doc": "Mean of the g band flux errors [nJy].", "default": null, "name": "g_psfFluxErrMean", "type": ["null", "float"]}, {"doc": "Minimum observed r band fluxes [nJy].", "default": null, "name": "r_psfFluxMin", "type": ["null", "float"]}, {"doc": "Maximum observed r band fluxes [nJy].", "default": null, "name": "r_psfFluxMax", "type": ["null", "float"]}, {"doc": "Maximum slope between r band flux obsevations max(delta_flux/delta_time) [nJy/d].", "default": null, "name": "r_psfFluxMaxSlope", "type": ["null", "float"]}, {"doc": "Mean of the r band flux errors [nJy].", "default": null, "name": "r_psfFluxErrMean", "type": ["null", "float"]}, {"doc": "Minimum observed i band fluxes [nJy].", "default": null, "name": "i_psfFluxMin", "type": ["null", "float"]}, {"doc": "Maximum observed i band fluxes [nJy].", "default": null, "name": "i_psfFluxMax", "type": ["null", "float"]}, {"doc": "Maximum slope between i band flux obsevations max(delta_flux/delta_time) [nJy/d].", "default": null, "name": "i_psfFluxMaxSlope", "type": ["null", "float"]}, {"doc": "Mean of the i band flux errors [nJy].", "default": null, "name": "i_psfFluxErrMean", "type": ["null", "float"]}, {"doc": "Minimum observed z band fluxes [nJy].", "default": null, "name": "z_psfFluxMin", "type": ["null", "float"]}, {"doc": "Maximum observed z band fluxes [nJy].", "default": null, "name": "z_psfFluxMax", "type": ["null", "float"]}, {"doc": "Maximum slope between z band flux obsevations max(delta_flux/delta_time) [nJy/d].", "default": null, "name": "z_psfFluxMaxSlope", "type": ["null", "float"]}, {"doc": "Mean of the z band flux errors [nJy].", "default": null, "name": "z_psfFluxErrMean", "type": ["null", "float"]}, {"doc": "Minimum observed y band fluxes [nJy].", "default": null, "name": "y_psfFluxMin", "type": ["null", "float"]}, {"doc": "Maximum observed y band fluxes [nJy].", "default": null, "name": "y_psfFluxMax", "type": ["null", "float"]}, {"doc": "Maximum slope between y band flux obsevations max(delta_flux/delta_time) [nJy/d].", "default": null, "name": "y_psfFluxMaxSlope", "type": ["null", "float"]}, {"doc": "Mean of the y band flux errors [nJy].", "default": null, "name": "y_psfFluxErrMean", "type": ["null", "float"]}, {"doc": "Time of the first diaSource, expressed as Modified Julian Date, International Atomic Time.", "default": null, "name": "firstDiaSourceMjdTai", "type": ["null", "double"]}, {"doc": "Time of the most recent non-forced DIASource for this object, expressed as Modified Julian Date, International Atomic Time.", "default": null, "name": "lastDiaSourceMjdTai", "type": ["null", "double"]}, {"doc": "Total number of DiaSources associated with this DiaObject.", "name": "nDiaSources", "type": "int"}]}]}, {"default": null, "name": "ssSource", "type": ["null", {"type": "record", "name": "lsst.v8_0.ssSource", "fields": [{"doc": "Unique identifier of the object.", "default": null, "name": "ssObjectId", "type": ["null", "long"]}, {"doc": "Unique identifier of the observation.", "default": null, "name": "diaSourceId", "type": ["null", "long"]}, {"doc": "Ecliptic longitude [deg].", "default": null, "name": "eclipticLambda", "type": ["null", "double"]}, {"doc": "Ecliptic latitude [deg].", "default": null, "name": "eclipticBeta", "type": ["null", "double"]}, {"doc": "Galactic longitude [deg].", "default": null, "name": "galacticL", "type": ["null", "double"]}, {"doc": "Galactic latitute [deg].", "default": null, "name": "galacticB", "type": ["null", "double"]}, {"doc": "Phase angle [deg].", "default": null, "name": "phaseAngle", "type": ["null", "float"]}, {"doc": "Heliocentric distance [AU].", "default": null, "name": "heliocentricDist", "type": ["null", "float"]}, {"doc": "Topocentric distace [AU].", "default": null, "name": "topocentricDist", "type": ["null", "float"]}, {"doc": "Predicted V-band magnitude [mag].", "default": null, "name": "predictedVMagnitude", "type": ["null", "float"]}, {"doc": "Residual R.A. vs. ephemeris [deg].", "default": null, "name": "residualRa", "type": ["null", "double"]}, {"doc": "Residual Dec vs. ephemeris [deg].", "default": null, "name": "residualDec", "type": ["null", "double"]}, {"doc": "Cartesian heliocentric X coordinate (at the emit time) [AU].", "default": null, "name": "heliocentricX", "type": ["null", "float"]}, {"doc": "Cartesian heliocentric Y coordinate (at the emit time) [AU].", "default": null, "name": "heliocentricY", "type": ["null", "float"]}, {"doc": "Cartesian heliocentric Z coordinate (at the emit time) [AU].", "default": null, "name": "heliocentricZ", "type": ["null", "float"]}, {"doc": "Cartesian heliocentric X velocity (at the emit time) [AU/d].", "default": null, "name": "heliocentricVX", "type": ["null", "float"]}, {"doc": "Cartesian heliocentric Y velocity (at the emit time) [AU/d].", "default": null, "name": "heliocentricVY", "type": ["null", "float"]}, {"doc": "Cartesian heliocentric Z velocity (at the emit time) [AU/d].", "default": null, "name": "heliocentricVZ", "type": ["null", "float"]}, {"doc": "Cartesian topocentric X coordinate (at the emit time) [AU].", "default": null, "name": "topocentricX", "type": ["null", "float"]}, {"doc": "Cartesian topocentric Y coordinate (at the emit time) [AU].", "default": null, "name": "topocentricY", "type": ["null", "float"]}, {"doc": "Cartesian topocentric Z coordinate (at the emit time) [AU].", "default": null, "name": "topocentricZ", "type": ["null", "float"]}, {"doc": "Cartesian topocentric X velocity (at the emit time) [AU/d].", "default": null, "name": "topocentricVX", "type": ["null", "float"]}, {"doc": "Cartesian topocentric Y velocity (at the emit time) [AU/d].", "default": null, "name": "topocentricVY", "type": ["null", "float"]}, {"doc": "Cartesian topocentric Z velocity (at the emit time) [AU/d].", "default": null, "name": "topocentricVZ", "type": ["null", "float"]}]}]}, {"default": null, "name": "MPCORB", "type": ["null", {"type": "record", "name": "lsst.v8_0.MPCORB", "fields": [{"doc": "Number or provisional designation (in packed form).", "default": null, "name": "mpcDesignation", "type": ["null", "string"]}, {"doc": "LSST unique identifier (if observed by LSST).", "default": null, "name": "ssObjectId", "type": ["null", "long"]}, {"doc": "Absolute magnitude, H [mag].", "default": null, "name": "mpcH", "type": ["null", "float"]}, {"doc": "Epoch (in MJD, .0 TT) [d].", "default": null, "name": "epoch", "type": ["null", "double"]}, {"doc": "Mean anomaly at the epoch [deg].", "default": null, "name": "M", "type": ["null", "double"]}, {"doc": "Argument of perihelion, J2000.0 [deg].", "default": null, "name": "peri", "type": ["null", "double"]}, {"doc": "Longitude of the ascending node, J2000.0 [deg].", "default": null, "name": "node", "type": ["null", "double"]}, {"doc": "Inclination to the ecliptic, J2000.0 [deg].", "default": null, "name": "incl", "type": ["null", "double"]}, {"doc": "Orbital eccentricity.", "default": null, "name": "e", "type": ["null", "double"]}, {"doc": "Semimajor axis [AU].", "default": null, "name": "a", "type": ["null", "double"]}, {"doc": "Perihelion distance [AU].", "default": null, "name": "q", "type": ["null", "double"]}, {"doc": "MJD of pericentric passage [d].", "default": null, "name": "t_p", "type": ["null", "double"]}]}]}, {"default": null, "name": "cutoutDifference", "type": ["null", "bytes"]}, {"default": null, "name": "cutoutScience", "type": ["null", "bytes"]}, {"default": null, "name": "cutoutTemplate", "type": ["null", "bytes"]}]})K"WՍ`84 +㣖 T(߼@w5 u@̒9eVt(?̒9$ 933B?33B̌? D@Aff$B D@A +r̈V(ɿ@w5 u@̒9eVt(?̒9$ 933B?33B̌? D@Aff$B D@A +rT(ɟ@w5 u@̒9eVt(?̒9$ 933B?33B̌? D@Aff$B D@A +r̈w5 u@̒9eVt(?̒9$ 9(ɟ@(߼@)K"WՍ`84 \ No newline at end of file diff --git a/python/lsst/alert/packet/schema/8/0/sample_data/generate.py b/python/lsst/alert/packet/schema/8/0/sample_data/generate.py new file mode 100644 index 0000000..a4bed82 --- /dev/null +++ b/python/lsst/alert/packet/schema/8/0/sample_data/generate.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +import json +import lsst.alert.packet as packet +from datetime import datetime +import pandas as pd + +with open("alert.json", "r") as f: + data = json.load(f) + + data_time = datetime.now() + + data['diaSource']['time_processed'] = pd.Timestamp(data_time) + data['diaObject']['validityStart'] = pd.Timestamp(data_time) + +schema = packet.SchemaRegistry.from_filesystem(schema_root="lsst.v8_0.alert").get_by_version("8.0") +with open("fakeAlert.avro", "wb") as f: + schema.store_alerts(f, [data]) diff --git a/python/lsst/alert/packet/schema/latest.txt b/python/lsst/alert/packet/schema/latest.txt index 37722eb..cc40bca 100644 --- a/python/lsst/alert/packet/schema/latest.txt +++ b/python/lsst/alert/packet/schema/latest.txt @@ -1 +1 @@ -7.4 +8.0 diff --git a/python/lsst/alert/packet/schemaRegistry.py b/python/lsst/alert/packet/schemaRegistry.py index 6291ed1..c46737a 100644 --- a/python/lsst/alert/packet/schemaRegistry.py +++ b/python/lsst/alert/packet/schemaRegistry.py @@ -120,7 +120,7 @@ def known_ids(self): return set(self._ids) @classmethod - def from_filesystem(cls, root=None, schema_root="lsst.v7_4.alert"): + def from_filesystem(cls, root=None, schema_root="lsst.v8_0.alert"): """Populate a schema registry based on the filesystem. Walk the directory tree from the root provided, locating files named diff --git a/python/lsst/alert/packet/updateSchema.py b/python/lsst/alert/packet/updateSchema.py index bb780ab..f74872b 100644 --- a/python/lsst/alert/packet/updateSchema.py +++ b/python/lsst/alert/packet/updateSchema.py @@ -66,12 +66,9 @@ def populate_fields(apdb_table): field_dictionary_array = [] for column in apdb_table['columns']: - # We are still finalizing the time series feature names. - excluded_fields = ['validityStart', 'validityEnd', 'Periodic', 'max', 'min', - 'Science', 'Percentile', 'Max', 'Min', 'science', 'LowzGal', - 'MAD', 'Skew', 'Intercept', 'Slope', 'Stetson', 'lastNonForcedSource', - 'nDiaSources', 'ExtObj', 'isDipole', 'bboxSize', 'Time', 'time_'] + # exclude fields used only for updates after PP runs + excluded_fields = ['validityEnd', 'time_withdrawn', 'ssObjectReassocTime'] exclude = False for excluded_field in excluded_fields: if excluded_field in column['name']: @@ -89,36 +86,30 @@ def populate_fields(apdb_table): else: column['datatype'] = str(column['datatype']) + doc = '' + if 'description' in column: + doc = column['description'] + if 'fits:tunit' in column: + unit = column['fits:tunit'] + if unit: + if doc.endswith('.'): + doc = doc[:-1] + doc += f" [{unit}]." + # Check if a column is nullable. If it is, it needs a default. if 'nullable' in column: if column['nullable'] is False: - # Check if a column has a description, if so, include "doc" - if 'description' in column: - field = {'name': column['name'], - 'type': column['datatype'], - 'doc': column['description']} - else: - field = {'name': column['name'], - 'type': column['datatype'], 'doc': ''} + field = {'name': column['name'], + 'type': column['datatype'], + 'doc': doc} else: # nullable == True - if 'description' in column: - field = {'name': column['name'], - 'type': ['null', column['datatype']], - 'doc': column['description'], 'default': None} - else: - field = {'name': column['name'], - 'type': ['null', column['datatype']], - 'doc': '', 'default': None} - else: # nullable not in columns (nullable == True) - if 'description' in column: field = {'name': column['name'], 'type': ['null', column['datatype']], - 'doc': column['description'], 'default': None} - - else: - field = {"name": column['name'], - "type": ["null", column["datatype"]], - "doc": "", "default": None} + 'doc': doc, 'default': None} + else: # nullable not in columns (nullable == True) + field = {'name': column['name'], + 'type': ['null', column['datatype']], + 'doc': doc, 'default': None} field_dictionary_array.append(field) @@ -142,7 +133,8 @@ def create_schema(name, field_dictionary_list, version): version: 'string' The version number of the schema. """ - name = name[0:2].lower() + name[2:] + if name != 'MPCORB': + name = name[0:2].lower() + name[2:] schema = fastavro.parse_schema({ "name": name, "type": "record", @@ -191,7 +183,7 @@ def generate_schema(apdb_filepath, schema_path, schema_version): version_name = schema_version.split(".")[0] + "_" + schema_version.split(".")[1] - table_names = ['DiaForcedSource', 'DiaObject', 'DiaSource', 'SSObject'] + table_names = ['DiaForcedSource', 'DiaObject', 'DiaSource', 'SSSource', 'MPCORB'] for name in table_names: for table in apdb['tables']: diff --git a/test/test_io.py b/test/test_io.py index c0b925c..44911ff 100644 --- a/test/test_io.py +++ b/test/test_io.py @@ -56,7 +56,7 @@ def _mock_alerts(self, n): alerts = [] for i in range(n): alert = self.sample_alert.copy() - alert["alertId"] = i + alert["diaSourceId"] = i alerts.append(alert) return alerts @@ -71,14 +71,14 @@ def assert_alert_lists_equal(self, have_alerts, want_alerts): seems complex. A simple check is just that the two lists have the same length and that - the alertIds match. alertId is the only field that differs in a batch - of mock data created with self._mock_alerts, so this is probably - sufficient. + the diaSourceIds match. diaSourceId is the only field that differs + in a batch of mock data created with self._mock_alerts, so this is + probably sufficient. """ self.assertEqual(len(have_alerts), len(want_alerts)) for i in range(len(have_alerts)): self.assertEqual( - have_alerts[i]["alertId"], want_alerts[i]["alertId"], + have_alerts[i]["diaSourceId"], want_alerts[i]["diaSourceId"], f"alert idx={i} has mismatched IDs", )