Loading noche/config/header_base_v1.ini +8 −8 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ #---------------------|-type--|%.f|----------------------------------------------| [Initial] # SIMPLE = True | bool | | Standard FITS format # BITPIX = 16 | int | | Array data type # NAXIS = 2 | int | | Number of data axes # NAXIS1 = | int | | [px] Length of data axis 1 (X) # NAXIS2 = | int | | [px] Length of data axis 2 (Y) # EXTEND = True | bool | | FITS file may contain extensions # BSCALE = 1 | int | | Scale factor applied to data # BZERO = 32768 | int | | Offset applied to data after scaling SIMPLE = True | bool | | Standard FITS format BITPIX = 16 | int | | Array data type NAXIS = 2 | int | | Number of data axes NAXIS1 = | int | | [px] Length of data axis 1 (X) NAXIS2 = | int | | [px] Length of data axis 2 (Y) EXTEND = True | bool | | FITS file may contain extensions BSCALE = 1 | int | | Scale factor applied to data BZERO = 32768 | int | | Offset applied to data after scaling OBSERVER = UNKNOWN | str | | Observer name [Object] Loading noche/noche.py +11 −0 Original line number Diff line number Diff line Loading @@ -597,6 +597,17 @@ class Noche: data = self.hdu.data # Original data original_hdu = fits.ImageHDU(header=self.hdu.header, name="ORIGINAL") noche_hdu = fits.PrimaryHDU(data=data, header=self.header) # Fix position of BSCALE and BZERO bscale_card = noche_hdu.header.cards['BSCALE'] bzero_card = noche_hdu.header.cards['BZERO'] noche_hdu.header.pop('BSCALE') noche_hdu.header.pop('BZERO') noche_hdu.header.insert("NAXIS2", bscale_card, after=True) noche_hdu.header.insert('BSCALE', bzero_card, after=True) print(noche_hdu.header) hdul = fits.HDUList([noche_hdu, original_hdu]) hdul.writeto(filename, overwrite=overwrite, checksum=True) Loading pyproject.toml +4 −3 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "noche" version = "0.1.0" version = "0.2.0" authors = [ { name="Davide Ricci", email="davide.ricci@inaf.it" }, ] Loading @@ -25,8 +25,9 @@ classifiers = [ ] dependencies = [ "astropy", "numpy", "astropy>=7.2", "numpy>=2.3.5", "watchdog>=6.0.0" ] [project.urls] Loading Loading
noche/config/header_base_v1.ini +8 −8 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ #---------------------|-type--|%.f|----------------------------------------------| [Initial] # SIMPLE = True | bool | | Standard FITS format # BITPIX = 16 | int | | Array data type # NAXIS = 2 | int | | Number of data axes # NAXIS1 = | int | | [px] Length of data axis 1 (X) # NAXIS2 = | int | | [px] Length of data axis 2 (Y) # EXTEND = True | bool | | FITS file may contain extensions # BSCALE = 1 | int | | Scale factor applied to data # BZERO = 32768 | int | | Offset applied to data after scaling SIMPLE = True | bool | | Standard FITS format BITPIX = 16 | int | | Array data type NAXIS = 2 | int | | Number of data axes NAXIS1 = | int | | [px] Length of data axis 1 (X) NAXIS2 = | int | | [px] Length of data axis 2 (Y) EXTEND = True | bool | | FITS file may contain extensions BSCALE = 1 | int | | Scale factor applied to data BZERO = 32768 | int | | Offset applied to data after scaling OBSERVER = UNKNOWN | str | | Observer name [Object] Loading
noche/noche.py +11 −0 Original line number Diff line number Diff line Loading @@ -597,6 +597,17 @@ class Noche: data = self.hdu.data # Original data original_hdu = fits.ImageHDU(header=self.hdu.header, name="ORIGINAL") noche_hdu = fits.PrimaryHDU(data=data, header=self.header) # Fix position of BSCALE and BZERO bscale_card = noche_hdu.header.cards['BSCALE'] bzero_card = noche_hdu.header.cards['BZERO'] noche_hdu.header.pop('BSCALE') noche_hdu.header.pop('BZERO') noche_hdu.header.insert("NAXIS2", bscale_card, after=True) noche_hdu.header.insert('BSCALE', bzero_card, after=True) print(noche_hdu.header) hdul = fits.HDUList([noche_hdu, original_hdu]) hdul.writeto(filename, overwrite=overwrite, checksum=True) Loading
pyproject.toml +4 −3 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "noche" version = "0.1.0" version = "0.2.0" authors = [ { name="Davide Ricci", email="davide.ricci@inaf.it" }, ] Loading @@ -25,8 +25,9 @@ classifiers = [ ] dependencies = [ "astropy", "numpy", "astropy>=7.2", "numpy>=2.3.5", "watchdog>=6.0.0" ] [project.urls] Loading