Commit 3f2e89e8 authored by vertighel's avatar vertighel
Browse files

Modified config files directory. Moved daemon_config there. Updated...

Modified config files directory. Moved daemon_config there. Updated daemon_config. Added spectro keyword to default header
parent 52020954
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -4,7 +4,7 @@
monitor_directory = ./input_fits
monitor_directory = ./input_fits
output_directory = ./processed_fits
output_directory = ./processed_fits
observatory_config = oarpaf # or path/to/your/config.ini
observatory_config = oarpaf # or path/to/your/config.ini
# header_template =
header_template = 


[Logging]
[Logging]
level = INFO # DEBUG, INFO, WARNING, ERROR, CRITICAL
level = INFO # DEBUG, INFO, WARNING, ERROR, CRITICAL
+22 −17
Original line number Original line Diff line number Diff line
@@ -46,10 +46,15 @@ PIERSIDE = UNKNOWN | str | | Side of the camera wrt pier, if any
[Imaging]
[Imaging]
INSTRUME =            | str   |   | Instrument name
INSTRUME =            | str   |   | Instrument name
OBSTYPE =             | str   |   | Observation type
OBSTYPE =             | str   |   | Observation type
FILTER =              | str   |   | Photometric filter used

[Spectroscopy]
SLIT =                | float | 2 | [um] Slit width or fiber diameter
GRATING =             | int   |   | [l/mm] Dispersion
BLAZE =               | int   |   | [tan(theta)] R-number of the ehcelle grating


[Detector]
[Detector]
IMAGETYP =            | str   |   | Frame type
IMAGETYP =            | str   |   | Frame type
FILTER =              | str   |   | Photometric filter used
DETECTOR =            | str   |   | Detector identifier
DETECTOR =            | str   |   | Detector identifier
DETSIZE =             | str   |   | [px] Physical CCD dimensions
DETSIZE =             | str   |   | [px] Physical CCD dimensions
DETROT =              | float | 2 | [deg] Rotation offset of the detector
DETROT =              | float | 2 | [deg] Rotation offset of the detector
+2 −1
Original line number Original line Diff line number Diff line
@@ -200,7 +200,8 @@ def run():


    except IndexError:
    except IndexError:
        log.warning("Missing config file, trying default")
        log.warning("Missing config file, trying default")
        daemon_settings = load_daemon_config("daemon_config.ini")
        default_daemon_config = Path(__file__).parent / "config" / "daemon_config.ini"
        daemon_settings = load_daemon_config(default_daemon_config)


    except SystemExit:
    except SystemExit:
        log.error("Missing config file")
        log.error("Missing config file")

noche/headers/header_base_v1.ini

deleted100644 → 0
+0 −99
Original line number Original line Diff line number Diff line

#--------------------------------------------------------------------------------|

[Initial]
SIMPLE = True         | Standard FITS format
BITPIX = 16           | Array data type
NAXIS = 2             | Number of data axes
NAXIS1 =              | [px] Length of data axis 1 (X)
NAXIS2 =              | [px] Length of data axis 2 (Y)
EXTEND = True         | FITS file may contain extensions
BSCALE = 1            | Scale factor applied to data
BZERO = 32768         | Offset applied to data after scaling
OBSERVER = UNKNOWN    | Observer name
                      
[Object]              
OBJECT =              | Name of observed object
RA =                  | [hh:mm:ss.ss] Right Ascension, sexagesimal
DEC =                 | [+dd:mm:ss.ss] Declination, sexagesimal
RA_DEG =              | [deg] Right Ascension in decimal degrees
DEC_DEG =             | [deg] Declination in decimal degrees
ALT =                 | [deg] Altitude of object above horizon
AZ =                  | [deg] Azimuth of object from North (E=90)
HA =                  | [h] Hour Angle
LST =                 | [h] Local Sidereal Time
PARANGLE =            | [deg] Object Parallactic angle
POSANGLE =            | [deg] Object Position angle
AIRMASS =             | Approximate air mass
                      
[Time]                
DATE =                | [YYYY-MM-DD] File creation date
DATE-OBS =            | [YYYY-MM-DDTHH:MM:SS] UTC observation date
MJD-OBS =             | [d] Modified Julian Date of observation
                      
[Telescope]           
TELESCOP =            | Telescope name
FOCALLEN =            | [mm] Telescope focal length
APTDIA =              | [mm] Telescope aperture diameter
OBS-LONG =            | [deg] Observatory longitude (East > 0)
OBS-LAT =             | [deg] Observatory latitude (North > 0)
OBS-ELEV =            | [m] Observatory altitude above sea level
FOCUSPOS =            | [um] Focuser position
FOCUSTEM =            | [C] Focuser temperature
DEROTANG = 0          | [deg] Rotator angle, if any
PIERSIDE = UNKNOWN    | Side of the camera wrt pier, if any
                      
[Imaging]             
INSTRUME =            | Instrument name
OBSTYPE =             | Observation type
                      
[Detector]            
IMAGETYP =            | Frame type
FILTER =              | Photometric filter used
DETECTOR =            | Detector identifier
DETSIZE =             | [px] Physical CCD dimensions
DETROT =              | [deg] Rotation offset of the detector
XPIXSZ =              | [um] Pixel X axis size
YPIXSZ =              | [um] Pixel Y axis size
PIXSCALE =            | [arcsec/px] Plate scale in binning 1
SET-TEMP =            | [C] CCD temperature set point
CCD-TEMP =            | [C] CCD temperature
GAIN =                | [e-/ADU] Gain
RDNOISE =             | [e- RMS] Readout noise
EXPTIME =             | [s] Exposure time
XBINNING =            | Binning factor in X
YBINNING =            | Binning factor in Y
                      
[Ambient]             
SUNALT =              | [deg] Sun altitude (< 0 means night)
MOONDIST =            | [deg] Moon-target angular distance
MOONPHAS =            | Lunar phase (0=new, 1=full)
TEMPERAT =            | [C] Ambient temperature
                      
[WCS]                 
WCSAXES = 2           | Number of axes
CTYPE1 = RA---TAN     | Right ascension, gnomonic projection
CTYPE2 = DEC--TAN     | Declination, gnomonic projection
CUNIT1 = deg          | Units of coordinate axis 1
CUNIT2 = deg          | Units of coordinate axis 2
CRPIX1 =              | [px] X reference pixel
CRPIX2 =              | [px] Y reference pixel
CRVAL1 =              | [deg] RA at reference pixel
CRVAL2 =              | [deg] DEC at reference pixel
CDELT1 =              | [deg/px] RA pixel scale
CDELT2 =              | [deg/px] DEC pixel scale
PC1_1 = -1.0          | Rotation matrix element
PC1_2 = 0.0           | Rotation matrix element
PC2_1 = 0.0           | Rotation matrix element
PC2_2 = 1.0           | Rotation matrix element
RADESYS = ICRS        | Coordinate system reference frame
EQUINOX = 2000.0      | [yr] Equinox of coordinates
                      
[Final]               
FILEORIG =            | Original file name
SWCREATE =            | Software that created FILEORIG
CHECKSUM =            | Checksum of header
DATASUM =             | Data sum of FITS file
ORIGIN = NOCHE v0.1   | Origin of FITS file
COMMENT = NOCTIS common header
HISTORY = Updated by NOCHE
+10 −6
Original line number Original line Diff line number Diff line
@@ -60,7 +60,7 @@ class Noche:
        self._location = None
        self._location = None
        self._obstime = None
        self._obstime = None


        self._head_dir = "headers"
        self._head_dir = "config"
        self._obs_dir = "observatories"
        self._obs_dir = "observatories"


        self._header_dict = {}
        self._header_dict = {}
@@ -99,10 +99,14 @@ class Noche:
        """
        """
        log.debug(sys._getframe().f_code.co_name)
        log.debug(sys._getframe().f_code.co_name)


        default_header_ini = "header_base_v1.ini"
        
        if not path:
        if not path:
            path = Path(__file__).parent / self._head_dir / "header_base_v1_with_format.ini"
            path = Path(__file__).parent / self._head_dir / default_header_ini
            log.info(path)
        else:
            path = Path(path)
            
            
        log.info(path)
        config = self._load_config(path)          
        config = self._load_config(path)          
            
            
        for section in config.sections():
        for section in config.sections():