From 41f9ef6a4f7ccd05f915f0a3e2ec1b545d94fb63 Mon Sep 17 00:00:00 2001 From: Alexis Koralewski Date: Fri, 29 Sep 2023 18:39:26 +0200 Subject: [PATCH] update Image save method (add sky_field indexes) --- src/core/pyros_django/seq_submit/models.py | 5 +++++ 1 file changed, 5 insertions(+), 0 deletions(-) diff --git a/src/core/pyros_django/seq_submit/models.py b/src/core/pyros_django/seq_submit/models.py index fde7607..168f5fe 100644 --- a/src/core/pyros_django/seq_submit/models.py +++ b/src/core/pyros_django/seq_submit/models.py @@ -585,6 +585,11 @@ class Image(models.Model): file_out = img_obj.join(img_obj.fname) naxis1 = img_obj.getkwd("NAXIS1") naxis2 = img_obj.getkwd("NAXIS2") + sky_field = img_obj._wcs.wcs2skyfield(naxis1, naxis2) + self.coscrval1 = sky_field["coscrval"] + self.coscrval2 = sky_field["coscrval2"] + self.sincrval1 = sky_field["sincrval1"] + self.sincrval2 = sky_field["sincrval2"] sky_field_as_json = json.dumps(img_obj._wcs.wcs2skyfield(naxis1, naxis2)) self.sky_field = sky_field_as_json # Save as default, if save parameter is passed, save only if is True -- libgit2 0.21.2