Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAD-175: Add ePSF, ABVegaOffset, and ApCorr Schemas #452

Merged
merged 9 commits into from
Oct 11, 2024
1 change: 1 addition & 0 deletions changes/452.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added ePSF, ABVegaOffset, and ApCorr schemas
15 changes: 15 additions & 0 deletions src/rad/resources/manifests/datamodels-1.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ tags:
description: |-
Mosaic WCS parameters
# Reference Modules
- tag_uri: asdf://stsci.edu/datamodels/roman/tags/reference_files/abvegaoffset-1.0.0
schema_uri: asdf://stsci.edu/datamodels/roman/schemas/reference_files/abvegaoffset-1.0.0
title: AB Vega Offset reference schema
description: |-
AB Vega Offset reference schema
- tag_uri: asdf://stsci.edu/datamodels/roman/tags/reference_files/apcorr-1.0.0
schema_uri: asdf://stsci.edu/datamodels/roman/schemas/reference_files/apcorr-1.0.0
title: Aperture correction reference schema
description: |-
Aperture correction reference schema
- tag_uri: asdf://stsci.edu/datamodels/roman/tags/reference_files/dark-1.0.0
schema_uri: asdf://stsci.edu/datamodels/roman/schemas/reference_files/dark-1.0.0
title: Dark reference schema
Expand All @@ -171,6 +181,11 @@ tags:
title: Distortion reference schema
description: |-
Distortion reference schema
- tag_uri: asdf://stsci.edu/datamodels/roman/tags/reference_files/epsf-1.0.0
schema_uri: asdf://stsci.edu/datamodels/roman/schemas/reference_files/epsf-1.0.0
title: ePSF reference schema
description: |-
ePSF reference schema
- tag_uri: asdf://stsci.edu/datamodels/roman/tags/reference_files/flat-1.0.0
schema_uri: asdf://stsci.edu/datamodels/roman/schemas/reference_files/flat-1.0.0
title: Flat reference schema
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
%YAML 1.1
---
$schema: asdf://stsci.edu/datamodels/roman/schemas/rad_schema-1.0.0
id: asdf://stsci.edu/datamodels/roman/schemas/reference_files/abvegaoffset-1.0.0

title: AB Vega Offset Reference File Schema

datamodel_name: AbvegaoffsetRefModel

type: object
properties:
meta:
allOf:
- $ref: ref_common-1.0.0
- type: object
properties:
reftype:
type: string
enum: [ABVEGAOFFSET]
data:
type: object
patternProperties:
"^(F062|F087|F106|F129|F146|F158|F184|F213|GRISM|PRISM|DARK)$":
type: object
properties:
abvega_offset:
title: AB-Vega Magntiude Offset
description: Magnitude difference between the AB and Vega magnitude
systems. Found by calculating the AB magnitude of Vega within
the optical element bandpass.
type: number
required: [abvega_offset]
required: [meta, data]
flowStyle: block
propertyOrder: [meta, data]
...
67 changes: 67 additions & 0 deletions src/rad/resources/schemas/reference_files/apcorr-1.0.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
%YAML 1.1
---
$schema: asdf://stsci.edu/datamodels/roman/schemas/rad_schema-1.0.0
id: asdf://stsci.edu/datamodels/roman/schemas/reference_files/apcorr-1.0.0

title: Aperture Correction Reference File Schema

datamodel_name: ApcorrRefModel

type: object
properties:
meta:
allOf:
- $ref: ref_common-1.0.0
- type: object
properties:
reftype:
type: string
enum: [APCORR]
data:
type: object
patternProperties:
"^(F062|F087|F106|F129|F146|F158|F184|F213|GRISM|PRISM|DARK)$":
type: object
properties:
ap_corrections:
title: Aperture Corrections
description: The aperture correction for each enclosed energy
fraction, corresponding to 1 / ee_fractions.
tag: tag:stsci.edu:asdf/core/ndarray-1.*
datatype: float64
exact_datatype: true
ndim: 1
ee_fractions:
title: Enclosed Energy Fractions
description: Fractions of the enclosed energy of the PSF at which
to estimate the aperture correction and enclosed energy radii.
tag: tag:stsci.edu:asdf/core/ndarray-1.*
datatype: float64
exact_datatype: true
ndim: 1
ee_radii:
title: Enclosed Energy Radii
description: Radius, in pixels, within which the enclosed energy
fractions are met. The indexing matches that of
"ee_fractions".
tag: tag:stsci.edu:asdf/core/ndarray-1.*
datatype: float64
exact_datatype: true
ndim: 1
sky_background_rin:
title: Inner Radius for the Sky Background
description: Inner radius, in pixels, to use when estimating the
local sky background within an annulus between this
radius and "sky_background_rout".
type: number
sky_background_rout:
title: Outer Radius for the Sky Background
description: Outer radius, in pixels, to use when estimating the
local sky background within an annulus between this
radius and "sky_background_rin".
type: number
PaulHuwe marked this conversation as resolved.
Show resolved Hide resolved
required: [ap_corrections, ee_fractions, ee_radii, sky_background_rin, sky_background_rout]
required: [meta, data]
flowStyle: block
propertyOrder: [meta, data]
...
75 changes: 75 additions & 0 deletions src/rad/resources/schemas/reference_files/epsf-1.0.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
%YAML 1.1
---
$schema: asdf://stsci.edu/datamodels/roman/schemas/rad_schema-1.0.0
id: asdf://stsci.edu/datamodels/roman/schemas/reference_files/epsf-1.0.0

title: ePSF Reference File Schema

datamodel_name: EpsfRefModel

type: object
properties:
meta:
allOf:
- $ref: ref_common-1.0.0
- $ref: ref_optical_element-1.0.0
- type: object
properties:
reftype:
type: string
enum: [EPSF]
oversample:
title: Oversampling Factor
description: Factor by which the WFI pixels have been oversampled
to generate the PSF.
type: integer
effective_temperature:
title: Effective Temperature
description: Effective temperature (K) of the simulated source(s)
used to generate the PSF model.
type: array
items:
type: integer
Comment on lines +26 to +32
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tddesjardins , somewhere we should document things like what the metallicity & gravity of the source were---or maybe this is an ideal blackbody? I don't know where that documentation would go.

I don't know if there's a world where we would ever expect the temperature of Roman to vary enough to lead us to have different PSFs as a function of temperature, but if there were, we would probably rue calling this "effective_temperature."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The info on that is in the description or history of the file. I can't recall which I put it into. But it's thoroughly documented, believe me.

As for temperature, these are models for the moment, so we have effective temperatures. We spoke about how the on-orbit version of this will likely need a small schema change to represent observables, so it may be color, for instance. As for some kind of spacecraft temperature, we still won't know for a while, but my best guess is that it's likely to depend on something like ota_temperature, i.e., temperature measured somewhere in the primary/secondary mirror assembly. I just asked a GSFC person next to me, and they basically said this is unknowable at this point.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I understand that these are stellar effective temperatures, I just wonder whether we're setting ourselves up for confusion if there ends up being another axis "ota_temperature" and then one starts wondering what the effective temperature is the effective temperature of. i.e., would we save confusion if we called these "stellar_effective_temperature" instead. If you expect we'll change the name of this down the road to color or something instead then there's no need to worry about this now, though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have concerns that if we enter this in as a "model only" keyword, we will have to make an entirely different schema & datamodel for release (which may have future downstream ramifications). If RTB wishes to keep the two separate, this is fine, but if we want to be able to use both interchangeably, I support renaming in a form similar to what @schlafly suggested. @tddesjardins - what say you?

defocus:
title: Defocus Waves
description: Number of defocus waves applied to the PSF.
type: array
items:
type: integer
pixel_x:
title: X Position
description: X-axis position of the PSF models. The order of the
positions corresponds to the order of the PSFs in the psf array.
type: array
items:
type: number
pixel_y:
title: Y Position
description: Y-axis position of the PSF models. The order of the
positions corresponds to the order of the PSFs in the psf array.
type: array
items:
type: number
required: [pixel_x, pixel_y]
psf:
title: ePSF Stamps
description: Postage stamps of ePSF models. The 4-dimensional array is
ordered by (defocus, effective_temperature, pixel_x, pixel_y)
in the file metadata.
tag: tag:stsci.edu:asdf/core/ndarray-1.*
datatype: float32
exact_datatype: true
ndim: 4
extended_psf:
title: Extended ePSF Stamp
description: Postage stamp of a bright ePSF model with extended wings.
If present, a single, in-focus, monochromatic ePSF is generated at
the center of the detector.
tag: tag:stsci.edu:asdf/core/ndarray-1.*
datatype: float32
exact_datatype: true
ndim: 2
required: [meta, psf]
flowStyle: block
propertyOrder: [meta, psf, extended_psf]
...