From 78c3a27ebcd7e6f3cf3286da97c330cb304cce42 Mon Sep 17 00:00:00 2001
From: vertighel <davide.ricci82@gmail.com>
Date: Sun, 11 May 2025 23:51:32 +0200
Subject: [PATCH] Added pierside

---
 noche/headers/header_base_v1.ini | 3 ++-
 noche/noche.py                   | 3 +++
 noche/observatories/opc.ini      | 9 +++++----
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/noche/headers/header_base_v1.ini b/noche/headers/header_base_v1.ini
index 90ba1e9..0ea58a7 100644
--- a/noche/headers/header_base_v1.ini
+++ b/noche/headers/header_base_v1.ini
@@ -39,7 +39,8 @@ 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
diff --git a/noche/noche.py b/noche/noche.py
index 482feb4..4060ae4 100644
--- a/noche/noche.py
+++ b/noche/noche.py
@@ -459,6 +459,9 @@ class Noche:
         if not angle:
             angle = self.header["DEROTANG"] + self.header["DETROT"]
 
+        if self.header["PIERSIDE"].upper() == "WEST":
+            angle += 180        
+            
         angle = np.deg2rad(angle)
 
         crval_ra = self._coord.ra.deg
diff --git a/noche/observatories/opc.ini b/noche/observatories/opc.ini
index 5615e5f..28bd114 100644
--- a/noche/observatories/opc.ini
+++ b/noche/observatories/opc.ini
@@ -19,10 +19,10 @@ RDNOISE =                         # [e- RMS] Readout noise
 [Mapping]
 NAXIS1 = NAXIS1                   # [px] X Dimensions of detector
 NAXIS2 = NAXIS2                   # [px] Y dimension of detector
-# OBSERVER =                        # Observer name
+# OBSERVER =                       # Observer name
 OBJECT   = OBJECT                 # Name of observed object
-RA = RA_OBJ                           # In sexagesimal or decimal format
-DEC = DEC_OBJ                         # In sexagesimal or decimal format
+RA = OBJCTRA                      # In sexagesimal or decimal format
+DEC = OBJCTDEC                    # In sexagesimal or decimal format
 DATE-OBS = DATE-OBS               # [YYYY-MM-DDTHH:MM:SS] UTC observation date
 FOCUSTEM = FOCUSTEM               # [C] Focuser temperature
 FOCUSPOS = FOCUSPOS               # [um] Focuser position
@@ -35,8 +35,9 @@ XBINNING = XBINNING               # Binning factor in X
 YBINNING = YBINNING               # Binning factor in Y
 # TEMPERAT =                        # [C] Ambient temperature
 SWCREATE = SWCREATE               # Software that created FILEORIG
+PIERSIDE = PIERSIDE               # Side of the camera wrt pier, if any 
 
 [Formula]
-#RA = (x)/15
+
 
 [Tweak]
-- 
GitLab