Commit 2135c4ad authored by vertighel's avatar vertighel
Browse files

Moved back bscale/bzero at the beginning of the header. Added watchdog to pyproject

parent 805c81ad
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -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]
+11 −0
Original line number Diff line number Diff line
@@ -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)
+4 −3
Original line number Diff line number Diff line
@@ -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" },
]
@@ -25,8 +25,9 @@ classifiers = [
]

dependencies = [
    "astropy",
    "numpy",
    "astropy>=7.2",
    "numpy>=2.3.5",
    "watchdog>=6.0.0"
]

[project.urls]