Index: /tags/ipp-ps1-20210708/tools/eam/skycoverage/README
===================================================================
--- /tags/ipp-ps1-20210708/tools/eam/skycoverage/README	(revision 42961)
+++ /tags/ipp-ps1-20210708/tools/eam/skycoverage/README	(revision 42961)
@@ -0,0 +1,27 @@
+
+This directory contains the scripts which generate the sky coverage maps:
+
+coverage.mana.sh -- mana script which performs the database queries and generates the plots
+coverage.sh      -- /bin/sh wrapper providing the environment variables needed by mana
+coverage.cron    -- crontab script to run the above
+coverage.css	 -- copy of the css used by the website
+index.html       -- copy of the top-level web page
+coverage.log	 -- output from coverage.mana.sh goes here (as of 2025.09.25, this does not rotate)
+
+The script 'coverage.mana.sh' does the real work.  Output products are
+sent to the directory defined at the top of the script:
+
+$LOCALDIR = /data/ipp175.0/ipp/skycoverage
+
+After the updated plots are generated, the script runs rsync to copy
+them to the externally-visible website on ippops4 (see the variable 
+'TARGET' in that script).
+
+The ipp user has a special ssh key defined for ippops4, and
+.ssh/config specifies that key is used to connect with ippops4.  Note
+that if the target host is changed (even to 'ippops4.ifa.hawaii.edu'),
+the specified key will not be used, so be careful!
+
+2026.02.19 : we are moving web services previously on ippops4 to nippops4 (128.171.177.74)
+The .ssh/config now has an entry for nippops4 matching the old one for ippops4.
+
Index: /tags/ipp-ps1-20210708/tools/eam/skycoverage/coverage.cron
===================================================================
--- /tags/ipp-ps1-20210708/tools/eam/skycoverage/coverage.cron	(revision 42960)
+++ /tags/ipp-ps1-20210708/tools/eam/skycoverage/coverage.cron	(revision 42961)
@@ -1,2 +1,2 @@
 # crontab file for skycoverage maps
-0 8 * * * /data/ipp100.0/eugene/skycoverage.20201110/coverage.sh >> /data/ipp100.0/eugene/skycoverage.20201110/coverage.log 2>&1
+0 8 * * * /home/panstarrs/ipp/skycoverage/coverage.sh >> /home/panstarrs/ipp/skycoverage/coverage.log 2>&1
Index: /tags/ipp-ps1-20210708/tools/eam/skycoverage/coverage.css
===================================================================
--- /tags/ipp-ps1-20210708/tools/eam/skycoverage/coverage.css	(revision 42961)
+++ /tags/ipp-ps1-20210708/tools/eam/skycoverage/coverage.css	(revision 42961)
@@ -0,0 +1,71 @@
+/* internal link line: c0d0d0 : d8d0f0
+   external link line: 303070 
+   border:             0080c0
+ */
+
+body  { 
+    background-color: #a0d0e0; 
+    padding: 5px; 
+    margin: 5px
+}
+
+a:link, a:visited, a:active { 
+    text-decoration: underline; 
+    font-weight: bold; 
+    color: #ff0000
+}
+
+a.button      { 
+    text-decoration: none; 
+    font-weight: bold;   
+    color: #000000; 
+    background: #0080c0
+}
+table.pics    { 
+    text-align: left; 
+    background: #0080c0; 
+    font-size: small; 
+    color: #ffffff; 
+    padding: 2px; 
+}
+table.stats   { 
+    text-align: left; 
+    background: #ffffff; 
+    font-size: big; 
+    color: #000000; 
+    padding: 10px; 
+}
+table.index   { 
+    border: 3px solid #0080c0; 
+    text-align: left; 
+    background: #ffffff; 
+    font-size: big; 
+    color: #000000; 
+    padding: 10px; 
+}
+td.index  { 
+           text-align: right; 
+           font-size: normal;  
+           font-weight: normal;  
+           vertical-align: top;
+	   background: #d0d0ff; 
+	   background-color: #d0d0ff; 
+	   border: 3px solid #0080c0; 
+	   padding: 5px; 
+}
+tr.index  { 
+           text-align: left; 
+           font-size: small;  
+           font-weight: normal;  
+           vertical-align: top;
+	   background: #d0d0ff; 
+	   background-color: #d0d0ff; 
+	   border: 3px solid #0080c0; 
+	   padding: 5px; 
+}
+td.label  { 
+           font-size: large;  
+           font-weight: bold;  
+	   padding: 5px; 
+	   transform: rotate(90deg);
+}
Index: /tags/ipp-ps1-20210708/tools/eam/skycoverage/coverage.mana.sh
===================================================================
--- /tags/ipp-ps1-20210708/tools/eam/skycoverage/coverage.mana.sh	(revision 42960)
+++ /tags/ipp-ps1-20210708/tools/eam/skycoverage/coverage.mana.sh	(revision 42961)
@@ -2,9 +2,31 @@
 
 $DEG_RAD = 180.0 / $M_PI
-$TARGET = ippops4:/export/ippops4.0/www/localhost/htdocs/ippdata/skycoverage.20201110
-$LOCALDIR = /data/ipp100.0/eugene/skycoverage.20201110
+$TARGET = nippops4:/export/ippops4.0/www/localhost/htdocs/ippdata/skycoverage.20201110
+$LOCALDIR = /data/ipp175.0/ipp/skycoverage
+
+$cameras = gpc1 gpc2
+$filters = g r i z y w
+
 $SAVE_OUTPUT = 1
-
-$filters = g r i z y w
+$KAPA = kapa -noX -nan 0xffff 0xffff 0xffff
+$STYLE = dark
+
+if (0)
+  # test mode
+  $cameras = gpc1 
+  $filters = g
+  $SAVE_OUTPUT = 0
+  $KAPA = kapa -nan 0xffff 0xffff 0xffff
+  # $STYLE = light
+end
+
+$color_cgrid:light = black
+$color_cgrid:dark = white
+
+$color_dr1:light = grey30
+$color_dr1:dark = grey70
+
+$color_label:light = black
+$color_label:dark = white
 
 # used by dbextract.data
@@ -113,11 +135,11 @@
   box -ticks 0000 -labels 0000; 
   if ("$side" == "east") 
-    cgrid -ra-by-hour -c white -label-color white -labels -label-ra 290 -label-dec -40
+    cgrid -ra-by-hour -c $color_cgrid:$STYLE -label-color $color_label:$STYLE -labels -label-ra 90 -label-dec -40
   end
   if ("$side" == "west") 
-    cgrid -ra-by-hour -c white -label-color white -labels -label-ra  90 -label-dec -40
+    cgrid -ra-by-hour -c $color_cgrid:$STYLE -label-color $color_label:$STYLE -labels -label-ra  90 -label-dec -40
   end
   if ("$side" == "pole") 
-    cgrid -ra-by-hour -c white
+    cgrid -ra-by-hour -c $color_cgrid:$STYLE
   end
 
@@ -129,5 +151,5 @@
   section colorbar -imtool none
 
-  box -lw 2 -ticks 1000 -labels 1000 +xpad 0.0 -tickpad 0.5 -xpad 3.0 -labelpadx 2.5 -ypad 5.5 +ypad 5.5
+  box -lw 2 -ticks 1000 -labels 1000 +xpad 0.0 -tickpad 0.1 -xpad 3.0 -labelpadx 2.5 -ypad 5.5 +ypad 5.5
   label -x "Exposure Time (sec)"
 end
@@ -187,7 +209,10 @@
   lim $vzero {$vzero + $vrange} 0 1 
 
-  png -name $LOCALDIR/$camera/$filt/$filt.$camera.$side.png
-  keyword im.$side.$camera.$filt RADECSYS -w IRCS
-  wd im.$side.$camera.$filt $LOCALDIR/$camera/$filt/$filt.$camera.$side.fits -bitpix -32 -bzero 0 -bscale 1.0
+  if ($SAVE_OUTPUT)
+    png -name $LOCALDIR/$camera/$filt/$filt.$camera.$side.png
+#   keyword im.$side.$camera.$filt RADECSYS -w IRCS
+    keyword im.$side.$camera.$filt RADECSYS -w ICRS
+    wd im.$side.$camera.$filt $LOCALDIR/$camera/$filt/$filt.$camera.$side.fits -bitpix -32 -bzero 0 -bscale 1.0
+  end
 end
 
@@ -227,11 +252,16 @@
   # 10.8, 78.6 t
 
- $RCOLOR = -c white
+ $RCOLOR = -c $color_cgrid:$STYLE
 
  # northern cap:
  if (1)
-   # celestial: DEC = 0, 206.2 - 254
-   create x 206.2 254 0.1
-   set y = zero(x)
+   ## # celestial: DEC = 0, 206.2 - 254
+   ## create x 206.2 254 0.1
+   ## set y = zero(x)
+   ## cplot -pt 0 -sz 0.4 $RCOLOR x y
+   
+   # celestial: DEC = +15, 183.2 - 262
+   create x 183.2 262 0.1
+   set y = zero(x) + 15
    cplot -pt 0 -sz 0.4 $RCOLOR x y
    
@@ -241,7 +271,13 @@
    cplot -pt 0 -sz 0.4 $RCOLOR x y
    
-   # ecliptic: Beta = 10, Lambda = 113.2 - 204.6
-   create x 113.2 204.6 0.1
+   # ecliptic: Beta = 10, Lambda = 113.2 - 119.5
+   create x 113.2 119.5 0.1
    set y = zero(x) + 10
+   csystem E C x y
+   cplot -pt 0 -sz 0.4 $RCOLOR x y 
+   
+   # ecliptic: Beta = 15, Lambda = 136.9 - 176.8
+   create x 136.9 176.8 0.1
+   set y = zero(x) + 15
    csystem E C x y
    cplot -pt 0 -sz 0.4 $RCOLOR x y 
@@ -258,6 +294,6 @@
    cplot -pt 0 -sz 0.4 $RCOLOR x y 
    
-   # galactic : b = 25, l = 19.0 - 118.3
-   create x 19.0 118.3 0.1
+   # galactic : b = 25, l = 37.6 - 118.3
+   create x 37.6 118.3 0.1
    set y = zero(x) + 25
    csystem G C x y
@@ -319,9 +355,68 @@
   cplot -pt 0 -sz 0.4 $RCOLOR el eb
  end
+
+ $RCOLOR = -c $color_dr1:$STYLE
+ DR1.boundary
+end
+
+macro DR1.boundary 
+ if (1) 
+  if (0)
+    data EuclidDR1_polygon.csv
+    read -skip 1 -csv Re 1 De 2
+    cplot -pt 0 -sz 0.5 -c green Re De
+  end
+
+  # north boundary: 
+  # corner 105, 80 -> 94.7, 56.9 in ecliptic
+  create Rn 105.2 285 0.1
+  set Dn = zero(Rn) + 80
+  cplot $RCOLOR -pt box -sz 0.4 Rn Dn
+
+  # west boundary
+  create elat 50 56.9 0.1
+  set elon = zero(elat) + 95
+  csystem E C elon elat
+  cplot $RCOLOR -pt box -sz 0.4 elon elat
+
+  # south boundary west
+  create elon 95 150 0.1
+  set elat = zero(elon) + 50
+  csystem E C elon elat
+  cplot $RCOLOR -pt box -sz 0.4 elon elat
+ 
+  # south boundary east
+  create elat 50 80 0.1
+  set elon = zero(elat) + 150
+  csystem E C elon elat
+  cplot $RCOLOR -pt box -sz 0.4 elon elat
+
+  # NEP circle
+  create elon3 150 296 0.1
+  set elat3 = zero(elon3) + 80
+  csystem E C elon3 elat3
+  cplot $RCOLOR elon3 elat3 -pt box -sz 0.4
+
+  # galactic plane boundary east
+  create glon 86.5 103 0.1
+  set glat = zero(glon) + 25
+  csystem G C glon glat
+  cplot $RCOLOR -pt box -sz 0.4 glon glat
+
+  # east boundary
+  create Dn 72 80 0.1
+  set Rn = zero(Dn) + 285
+  csystem E C elon elat
+  cplot $RCOLOR -pt box -sz 0.4 Rn Dn
+
+  # DR2 south boundary
+  create elon 100.3 189.5 0.1
+  set elat = zero(elon) + 37
+  csystem E C elon elat
+  cplot $RCOLOR -pt box -sz 0.4 elon elat
+ end
 end
 
 macro get.3pi.data
-  $KAPA = kapa -noX -nan 0xffff 0xffff 0xffff
-
   $d = `date +%Y%m%d`
   $subdir = `date +%Y%m`
@@ -331,5 +426,5 @@
 
   # extract all of the data from the database:
-  foreach camera gpc1 gpc2
+  foreach camera $cameras
     dbextract.data init $camera
     foreach filter $filters
@@ -342,19 +437,32 @@
   end  
 
+  list camlist -split $cameras
+  $Ncameras = $camlist:n
+  $pngcameras = $cameras
+  if ($Ncameras > 1) 
+    $pngcameras = $cameras both
+  end
+
   foreach side east west pole
     foreach filter $filters
-      foreach camera gpc1 gpc2
+      foreach camera $cameras
         make.density.map $side $filter $camera
       end
-      set im.$side.both.$filter = im.$side.gpc1.$filter + im.$side.gpc2.$filter
-      foreach camera gpc1 gpc2 both
+      if ($Ncameras > 1) 
+        set im.$side.both.$filter = im.$side.gpc1.$filter + im.$side.gpc2.$filter
+      endif
+      foreach camera $pngcameras
         make.density.png $side $filter $camera
-        exec /bin/cp -f $LOCALDIR/$camera/$filter/$filter.$camera.$side.png $LOCALDIR/archive/$subdir/sky.$d/
+        if ($SAVE_OUTPUT)
+          exec /bin/cp -f $LOCALDIR/$camera/$filter/$filter.$camera.$side.png $LOCALDIR/archive/$subdir/sky.$d/
+        end
       end
     end
   end
 
-  # note: ssh to target
-  exec rsync --exclude=trash --exclude=coverage.mana.sh --exclude=coverage.sh --exclude=coverage.log -auv $LOCALDIR/ $TARGET/
+  if ($SAVE_OUTPUT) 
+    # note: ssh to target
+    exec rsync --exclude=trash --exclude=coverage.mana.sh --exclude=coverage.sh --exclude=coverage.log -auv $LOCALDIR/ $TARGET/
+  end
 end
 
Index: /tags/ipp-ps1-20210708/tools/eam/skycoverage/coverage.sh
===================================================================
--- /tags/ipp-ps1-20210708/tools/eam/skycoverage/coverage.sh	(revision 42960)
+++ /tags/ipp-ps1-20210708/tools/eam/skycoverage/coverage.sh	(revision 42961)
@@ -3,7 +3,11 @@
 # this script needs to set up the paths so it can run under crontab 
 
-setenv PATH /home/kiawe/eugene/src/psconfig/ipp-gentoo.lin64/bin:.:/usr/local/bin:/usr/ucb:/bin:/usr/bin::/home/kiawe/eugene/src/bin/shell:/home/kiawe/eugene/src/bin/lin64
-setenv LIBRARY_PATH /home/kiawe/eugene/src/psconfig/ipp-gentoo.lin64/lib:/home/kiawe/eugene/src/psconfig/ipp-gentoo.lin64/lib/mysql:/usr/local/lib:/usr/lib:/usr/X11R6/lib:/usr/lib64:/usr/X11R6/lib64:
-setenv LD_LIBRARY_PATH /home/kiawe/eugene/src/psconfig/ipp-gentoo.lin64/lib:/home/kiawe/eugene/src/psconfig/ipp-gentoo.lin64/lib/mysql:/usr/local/lib:/usr/lib:/usr/X11R6/lib:/usr/lib64:/usr/X11R6/lib64:
+set psconfig = /home/panstarrs/ipp/psconfig/ipp-20220906-ubuntu.lin64
 
-/data/ipp100.0/eugene/skycoverage.20201110/coverage.mana.sh
+setenv PATH $psconfig/bin:.:/usr/local/bin:/usr/ucb:/bin:/usr/bin
+setenv    LIBRARY_PATH $psconfig/lib:$psconfig/lib/mysql:/usr/local/lib:/usr/lib:/usr/X11R6/lib:/usr/lib64:/usr/X11R6/lib64:
+setenv LD_LIBRARY_PATH $LIBRARY_PATH
+
+# setenv LD_LIBRARY_PATH $psconfig/lib:$psconfig/lib/mysql:/usr/local/lib:/usr/lib:/usr/X11R6/lib:/usr/lib64:/usr/X11R6/lib64:
+
+/home/panstarrs/ipp/skycoverage/coverage.mana.sh
