Skip to content

Commit

Permalink
make DATE-OBS format match the FITS(ISO) standard
Browse files Browse the repository at this point in the history
  • Loading branch information
yuedong0607 committed Oct 4, 2024
1 parent a250b3b commit 7b47d3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions roman_imsim/sca.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ def buildImage(self, config, base, image_num, obj_num, logger):
full_image.header = galsim.FitsHeader()
full_image.header['EXPTIME'] = self.exptime
full_image.header['MJD-OBS'] = self.mjd
full_image.header['DATE-OBS'] = str(Time(self.mjd,format='mjd').datetime)
full_image.header['DATE-OBS'] = str(Time(self.mjd,format='mjd').datetime.isoformat())

This comment has been minimized.

Copy link
@wmwv

wmwv Oct 4, 2024

Time(self.mjd,format='mjd').datetime.isoformat() promises to return a string, so the str(...) isn't needed.

isoformat(...) method of datetime.datetime instance
    [sep] -> string in ISO 8601 format, YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].
    sep is used to separate the year from the time, and defaults to 'T'.
    The optional argument timespec specifies the number of additional terms
    of the time to include. Valid options are 'auto', 'hours', 'minutes',
    'seconds', 'milliseconds' and 'microseconds'.
full_image.header['FILTER'] = self.filter
full_image.header['ZPTMAG'] = 2.5*np.log10(self.exptime*roman.collecting_area)

base['current_image'] = full_image

if 'image_pos' in config and 'world_pos' in config:
raise GalSimConfigValueError(
raise galsim.GalSimConfigValueError(
"Both image_pos and world_pos specified for Scattered image.",
(config['image_pos'], config['world_pos']))

Expand Down

0 comments on commit 7b47d3c

Please sign in to comment.