diff -Nru skyview-3.3.2+repack/debian/changelog skyview-3.3.4+repack/debian/changelog --- skyview-3.3.2+repack/debian/changelog 2017-12-20 11:19:00.000000000 +0000 +++ skyview-3.3.4+repack/debian/changelog 2018-01-24 21:04:14.000000000 +0000 @@ -1,3 +1,11 @@ +skyview (3.3.4+repack-1) unstable; urgency=low + + * Update VCS fields to use salsa.d.o + * New upstream version 3.3.4+repack + * Push Standards-Version to 4.1.3. No changes needed. + + -- Ole Streicher Wed, 24 Jan 2018 22:04:14 +0100 + skyview (3.3.2+repack-1) unstable; urgency=low * New upstream version 3.3.2+repack diff -Nru skyview-3.3.2+repack/debian/control skyview-3.3.4+repack/debian/control --- skyview-3.3.2+repack/debian/control 2017-12-20 11:18:25.000000000 +0000 +++ skyview-3.3.4+repack/debian/control 2018-01-24 21:04:04.000000000 +0000 @@ -11,10 +11,10 @@ libcommons-math3-java, libfits-java, libjsamp-java -Standards-Version: 4.1.2 +Standards-Version: 4.1.3 Homepage: https://skyview.gsfc.nasa.gov/ -Vcs-Git: https://anonscm.debian.org/cgit/debian-astro/packages/skyview.git -Vcs-Browser: https://anonscm.debian.org/cgit/debian-astro/packages/skyview.git +Vcs-Git: https://salsa.debian.org/debian-astro-team/skyview.git +Vcs-Browser: https://salsa.debian.org/debian-astro-team/skyview Package: skyview Architecture: all diff -Nru skyview-3.3.2+repack/skyview/data/Gridder.java skyview-3.3.4+repack/skyview/data/Gridder.java --- skyview-3.3.2+repack/skyview/data/Gridder.java 2017-11-15 09:26:24.000000000 +0000 +++ skyview-3.3.4+repack/skyview/data/Gridder.java 2018-01-24 10:25:14.000000000 +0000 @@ -236,7 +236,7 @@ double lon = qlon; - if (lon > 360) { + if (lon >= 360) { lon -= 360; } @@ -249,8 +249,12 @@ setLabel(null); } } else { - fm.setSeparators(new String[]{"\u00B0", "'", "\""}); - setLabel(fm.format(lon, lonPrec)); + if (Math.abs(lon-360) > 1.e-8) { + fm.setSeparators(new String[]{"\u00B0", "'", "\""}); + setLabel(fm.format(lon, lonPrec)); + } else { + setLabel(null); + } } // The lines of longitude that we tend to choose for // drawing are likely to be ones that touch singularities @@ -265,6 +269,12 @@ drawLine(lon-1.e-10, lon-1.e-10, latLimits[0],latLimits[1]); } for (double lat=latValues[0]; lat <= latLimits[1]; lat += latValues[1]) { + System.err.println("Lat is:"+lat); + if (Math.abs(Math.abs(lat)-90) < 1.e-5) { + // Don't draw lines at 90 degrees latitude. + System.err.println("Skipping lat 90"); + continue; + } fm.setSeparators(new String[]{"\u00B0", "'", "\""}); setLabel(fm.format(lat, latPrec)); drawLine(lonLimits[0], lonLimits[1], lat, lat); diff -Nru skyview-3.3.2+repack/skyview/executive/Imager.java skyview-3.3.4+repack/skyview/executive/Imager.java --- skyview-3.3.2+repack/skyview/executive/Imager.java 2017-11-15 09:26:24.000000000 +0000 +++ skyview-3.3.4+repack/skyview/executive/Imager.java 2018-01-24 10:25:14.000000000 +0000 @@ -495,6 +495,18 @@ int count = 1; for (String surv: survs) { + String survLc = surv.toLowerCase(); + if (survLc.equals("average")) { + if (survs.length != 3 || !Settings.has("rgb")) { + throw new IllegalArgumentException("Error: Invalid use of 'Average' survey."); + } + if (count == 3) { + new IJProcessor().generateRGB(); + } + count += 1; + continue; + } + if (survs.length > 1) { updateOutput(output, count); } diff -Nru skyview-3.3.2+repack/skyview/geometry/projecter/Cah.java skyview-3.3.4+repack/skyview/geometry/projecter/Cah.java --- skyview-3.3.2+repack/skyview/geometry/projecter/Cah.java 2017-11-15 09:26:26.000000000 +0000 +++ skyview-3.3.4+repack/skyview/geometry/projecter/Cah.java 2018-01-24 10:25:14.000000000 +0000 @@ -10,15 +10,41 @@ import skyview.geometry.Util; /** This class provides for the - * translation between coordinates and the Tiled Octahedral Tangent projection. + * translation between coordinates and Cahill style Octahedron tangent plane + * projection. + * . *

- * The projection is centered at the north pole. - * The south pole is projected to the four corners at (+/-1, +/-1). - * The equator projects to the diagonals running between the - * points (-1,0)->(0,1), (0,1)->(1,0), (1,0)->(0,-1), (-1,0)->(0,-1). - * These diagonals divide the four unit squares at the center of the coordinate - * grid into 8 right isoceles triangles. - */ + * The projection is centered at 0,45 + * The projection is bounded by a rectangle with dimensions + * 6 sqrt(2) x 2 sqrt(6) + * which is filled in the following fashion. + * + * 5 4 2 3 + * 5 5 4 4 2 2 3 3 + * 5 5 5 4 4 4 2 2 2 3 3 3 + * 5 5 4 4 6 0 2 2 3 3 + * 5 4 6 6 0 0 2 3 + * 6 6 6 0 0 0 + * 7 6 6 0 0 1 + * 7 7 6 0 1 1 + * 7 7 7 1 1 1 + * 7 7 1 1 + * 7 1 + * + * Note that each number is intended to represent an equilateral triangle so + * that the representation here is only very approximate. The + * center of the projection is the middle of the boundary between + * triangles 0 and 6. The north pole is the intersection of triangles + * 0,2,4 and 6, while the south pole is at the lonely points of 1,3,5,7 + * The northern octants are even while the southern octants are odd. + * You can envisage this figure as unwrapping the four northern octants + * of an octahedron and pressing them flat and then flipping the southern octants + * on the equator they share with a northern octant. + * + * Note that this projection is staddleable but the straddle is not currently + * available. + * + */ public class Cah extends skyview.geometry.Projecter { private static final double sqrt2 = Math.sqrt(2); @@ -45,16 +71,13 @@ return new CahDeproj(); } - private double a = Math.sqrt(6); + private double a = Math.sqrt(6); private double s3d2 = Math.sqrt(3)/2; - -// private double[][] offsets = -// { {0, 0.5*a}, {s3d2*a, -a}, {0, 0.5*a}, {2*s3d2*a, 0.5*a}, -// {0, 0.5*a}, {-2*s3d2*a, 0.5*a},{0, 0.5*a}, {-s3d2*a, -a} }; - + private double[] angles = { 30, 30, 90, 90, 270, 270, 330,330 }; + private void fillOctant(int octant) { @@ -148,22 +171,6 @@ tProj.transform(xunit, plane); double[] xp = plane.clone(); outScale[ind].transform(plane,plane); -/* - System.out.println("Scale by steps0:"+xp[0]+" "+xp[1]); - sv1.transform(xp,xp); - System.out.println("Scale by steps1:"+xp[0]+" "+xp[1]); - if (ind % 2 == 1) { - sv3a.transform(xp,xp); - System.out.println("Scale by steps3a:"+xp[0]+" "+xp[1]); - sv3b.transform(xp,xp); - System.out.println("Scale by steps3b:"+xp[0]+" "+xp[1]); - } - sv2.transform(xp,xp); - System.out.println("Scale by steps2:"+xp[0]+" "+xp[1]); - sv3.transform(xp,xp); - System.out.println("Scale by steps3:"+xp[0]+" "+xp[1]); - */ - } @@ -200,6 +207,11 @@ {5,-1}, {4,-1}, {2,-1}, {3,-1} } }; + + public boolean validPosition(double[] pos) { + return getOctant(pos[0],pos[1]) >= 0; + } + private int getOctant(double x, double y) { double tx = s3d2*a; diff -Nru skyview-3.3.2+repack/skyview/geometry/projecter/Hpx.java skyview-3.3.4+repack/skyview/geometry/projecter/Hpx.java --- skyview-3.3.2+repack/skyview/geometry/projecter/Hpx.java 2017-11-15 09:26:26.000000000 +0000 +++ skyview-3.3.4+repack/skyview/geometry/projecter/Hpx.java 2018-01-24 10:25:14.000000000 +0000 @@ -153,7 +153,7 @@ public Hpx() { this(9); } - + /** Interleaver to do calculations */ private Interleave weaver; @@ -221,15 +221,20 @@ * @return */ public boolean validPosition(double[] plane) { + if (!super.validPosition(plane)) { + return false; + } + double[] norm = normCoords(plane); // Get the tile indices. - int x = (int) Math.floor(plane[0]*invLength); - int y = (int) Math.floor(plane[1]*invLength); + int x = (int) Math.floor(norm[0]); + int y = (int) Math.floor(norm[1]); // Get the index of the tile rembering that the first tile // starts at [-2,-3] - int tile = (4*(y+3) + (x+2)); - return super.validPosition(plane) && - // It's within our 4x6 tile + int tile = (4*(y+3) + (x+2)); + + return + // It's within our 4x6 tiling x >= -2 && x < 2 && y >= -3 && y < 3 && // ... and it's not a blank tile diff -Nru skyview-3.3.2+repack/skyview/geometry/projecter/toast/ToaPixels.java skyview-3.3.4+repack/skyview/geometry/projecter/toast/ToaPixels.java --- skyview-3.3.2+repack/skyview/geometry/projecter/toast/ToaPixels.java 1970-01-01 00:00:00.000000000 +0000 +++ skyview-3.3.4+repack/skyview/geometry/projecter/toast/ToaPixels.java 2018-01-24 10:25:14.000000000 +0000 @@ -0,0 +1,63 @@ + + +package skyview.geometry.projecter.toast; + +import skyview.geometry.Util; +import skyview.geometry.projecter.Toa; + +/** + * Print out the vertices of the pixels in a TOAST projection. + * @author tmcglynn + */ +public class ToaPixels { + + public static void main(String[] args) { + int level = 0; + if (args.length > 0) { + level = Integer.parseInt(args[0]); + } else { + System.err.println("Usage: ToaPixels level [even odd]"); + System.exit(-1); + } + String even = ""; + String odd = ""; + if (args.length > 2) { + even = args[1]; + odd = args[2]; + } + + int n = (int) Math.pow(2,level); + Toa t = new Toa(); + double[][][] values = t.tile(0, 0, 0, level); + int ny = values.length; + int nx = values[0].length; + boolean isEven = true; + + for (int i=0; i 3) { + kp -= 4; + } + double a0 = ang(ps[km], ps[k]); + double a1 = ang(ps[k], ps[kp]); + double a2 = ang(ps[kp], ps[km]); + double cos_ang = ( cos(a2) - cos(a0)*cos(a1) ) / (sin(a0)*sin(a1)); + double ang; + if (cos_ang >= 1) { + ang = 0; + } else if (cos_ang <= -1) { + ang = PI; + } else { + ang = acos(cos_ang); + } + total += ang; + } + + + double area = total - 2*PI; + double fac = area*factor; + if (fac > max) { + max = fac; + } + if (fac < min) { + min = fac; + } + grand += area; + cnt += 1; + if (level < 6) { + System.out.printf("%10d %17.8g %12.6f", cnt, area, fac); + for (int k=0; k<4; k += 1) { + System.out.printf(" %8.5f %8.5f %8.5f", ps[k][0], ps[k][1], ps[k][2]); + } + System.out.println(); + } else { + System.out.printf("%10d %16.8g %12.6f\n", cnt, area, fac); + } + } + } + System.out.println("Grand total for area:"+grand); + System.out.println("Min/max:"+min+" "+max); + } + + public static void pnt(String lab, double[] p) { + System.out.println(" "+lab+" "+p[0]+" "+p[1]+" "+p[2]); + } + + public static double[] cross(double[] x, double[] y) { + double[] c = new double[3]; + c[0] = x[1]*y[2] - x[2]*y[1]; + c[1] = x[2]*y[0] - x[0]*y[2]; + c[2] = x[0]*y[1] - x[1]*y[0]; + return c; + } + + public static double norm(double[] x) { + return Math.sqrt(dot(x,x)); + } + + public static double ang(double[] x, double[] y) { + double cos_theta = dot(x,y)/norm(x)/norm(y); + if (cos_theta >= 1) { + return 0; + } else if (cos_theta <= -1) { + return Math.PI; + } + return Math.acos(cos_theta); + } + + public static double dot(double[] x, double[] y) { + double d = x[0]*y[0] + x[1]*y[1] + x[2]*y[2]; + return d; + } + +} diff -Nru skyview-3.3.2+repack/skyview/geometry/sampler/Clip.java skyview-3.3.4+repack/skyview/geometry/sampler/Clip.java --- skyview-3.3.2+repack/skyview/geometry/sampler/Clip.java 2017-11-15 09:26:26.000000000 +0000 +++ skyview-3.3.4+repack/skyview/geometry/sampler/Clip.java 2018-01-24 10:25:14.000000000 +0000 @@ -542,6 +542,7 @@ double[][] z = new double[2][x.length]; try { // Transform from pixels to the standard projection plane + inImgScalerInv.transform(new double[][]{x,y}, z); // If all the corners are invalid then blow it off @@ -595,8 +596,7 @@ } else if (y[k] > maxY) { maxY = y[k]; } - sum += x[k] + y[k]; - + sum += x[k] + y[k]; } // See if we found a NaN somewhere. @@ -647,7 +647,7 @@ for (int z=0; z savedImages; @@ -316,8 +318,7 @@ } } - private void processGrid(String gridStr) { - + private void processGrid(String gridStr) { if (gridStr != null) { @@ -389,7 +390,9 @@ private boolean processRGB(String rgbStr, String outStem, int index) { if (rgbStr != null) { - + lastWidth = output.getWidth(); + lastHeight = output.getHeight(); + lastStem = outStem; if (Settings.has("rgboffset")) { try { String[] offset = Settings.getArray("rgboffset"); @@ -428,24 +431,7 @@ rgb[index] = new ImagePlus(surveys[index], ip).getStack(); if (index == 2 || index == surveys.length-1) { - - RGBStackMerge rsm = new RGBStackMerge(); - ImageStack is = rsm.mergeStacks(output.getWidth(), output.getHeight(), 1, - rgb[0], rgb[1], rgb[2], true); - ImagePlus imp = new ImagePlus("rgb", is); - if (Settings.has("quicklook") ) { - // Get rid of .fit or .fits at the end - //System.out.println("Starting with: "+outStem); - String filename = outStem.replaceAll("\\.fits?$", ""); - // Now get rid of a terminal _\d+ - filename = filename.replaceAll("_\\d+$", ""); - filename += "_rgb.jpg"; - new FileSaver(imp).saveAsJpeg(filename); - System.err.println(" Writing 3-color image: "+filename); - } - if (Settings.has("imagej")) { - showImp(imp); - } + generateRGB(); } } return true; @@ -453,6 +439,110 @@ return false; } + public void generateRGB() { + RGBStackMerge rsm = new RGBStackMerge(); + + String[] surveys = Settings.getArray("survey"); + int avgIndex = -1; + if (surveys.length == 3) { + boolean found = false; + for (int i=0; i= 0) { + int bot = -1; + int top = -1; + for (int i=0; i<3; i += 1) { + if (i != avgIndex) { + if (bot < 0) { + bot = i; + } else { + top = i; + } + } + } + + byte[] d1 = (byte[]) rgb[bot].getProcessor(1).getPixels(); + byte[] d2 = (byte[]) rgb[top].getProcessor(1).getPixels(); + byte[] d3 = new byte[d1.length]; + for (int i=0; i 1 || fields[0].length() > 0) { + + try { + low = Double.parseDouble(fields[0]); + high = Double.parseDouble(fields[1]); + } catch (Exception e) { + System.err.println("Invalid Whiten values:"+Settings.get("whiten")); + return; + } + } + skyview.util.HistoMatcher matcher = new skyview.util.HistoMatcher(low,high); + int count = 0; + for (int i=0; i arrays = new ArrayList(); + private double[][] matches; + private double[] avg; + private double bot, top; + + public HistoMatcher(double bot, double top) { + System.err.println("HistoMatcher:"+bot+" to "+top); + if (bot >= top || bot < 0 || top > 1) { + throw new IllegalArgumentException("Invalid histogram matching points"); + } + this.bot = bot; + this.top = top; + } + + public void addList(byte[] pixels) { + arrays.add(pixels); + } + private int[] histogram(byte[] array) { + int[] count = new int[256]; + for (int i=0; i need) { + return i + (need-have)/curr; + } + have += curr; + } + return hist.length; + } + + + public void calc() { + matchPoints(); + avg(); + } + + public void matchPoints() { + matches = new double[arrays.size()][2]; + for (int i=0; i 255) { + val = 255; + } else if (val < 0) { + val = 0; + } + arr[i] = (byte) val; + } + return arr; + } +} diff -Nru skyview-3.3.2+repack/skyview.settings skyview-3.3.4+repack/skyview.settings --- skyview-3.3.2+repack/skyview.settings 2017-11-15 09:26:26.000000000 +0000 +++ skyview-3.3.4+repack/skyview.settings 2018-01-24 10:25:14.000000000 +0000 @@ -50,4 +50,4 @@ DFT_CACHE=./skycache/ # Starting with Version 3, the version is specified in the settings file. -Version=3.3.2 +Version=3.3.4