! DART software - Copyright UCAR. This open source software is provided
! by UCAR, "as is", without charge, subject to all terms of use at
! http://www.image.ucar.edu/DAReS/DART/DART_download
!
! $Id$
! BEGIN DART PREPROCESS KIND LIST
! RADIOSONDE_GEOPOTENTIAL_HEIGHT,   QTY_GEOPOTENTIAL_HEIGHT,    COMMON_CODE
! RADIOSONDE_LOG_SPECIFIC_HUMIDITY, QTY_SPECIFIC_HUMIDITY,      COMMON_CODE
! RADIOSONDE_POT_TEMPERATURE,       QTY_POTENTIAL_TEMPERATURE,  COMMON_CODE
! RADIOSONDE_U_WIND_COMPONENT,      QTY_U_WIND_COMPONENT,       COMMON_CODE
! RADIOSONDE_V_WIND_COMPONENT,      QTY_V_WIND_COMPONENT,       COMMON_CODE
! RADIOSONDE_AIR_TEMPERATURE,       QTY_TEMPERATURE
! EVAL_GEOPOTENTIAL_HEIGHT,         QTY_GEOPOTENTIAL_HEIGHT,    COMMON_CODE
! EVAL_LOG_SPECIFIC_HUMIDITY,       QTY_SPECIFIC_HUMIDITY,      COMMON_CODE
! EVAL_POT_TEMPERATURE,             QTY_POTENTIAL_TEMPERATURE,  COMMON_CODE
! EVAL_U_WIND_COMPONENT,            QTY_U_WIND_COMPONENT,       COMMON_CODE
! EVAL_V_WIND_COMPONENT,            QTY_V_WIND_COMPONENT,       COMMON_CODE
! EVAL_AIR_TEMPERATURE,             QTY_TEMPERATURE
! Z_TC_SYNTH,  QTY_GEOPOTENTIAL_HEIGHT,    COMMON_CODE
! U_TC_SYNTH,  QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_TC_SYNTH,  QTY_V_WIND_COMPONENT,       COMMON_CODE
! T_TC_SYNTH,  QTY_TEMPERATURE
! Z_RAOB,      QTY_GEOPOTENTIAL_HEIGHT,    COMMON_CODE
! U_RAOB,      QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_RAOB,      QTY_V_WIND_COMPONENT,       COMMON_CODE
! T_RAOB,      QTY_TEMPERATURE
! U_DROPSONDE, QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_DROPSONDE, QTY_V_WIND_COMPONENT,       COMMON_CODE
! T_DROPSONDE, QTY_TEMPERATURE
! Z_PIBAL,     QTY_GEOPOTENTIAL_HEIGHT,    COMMON_CODE
! U_PIBAL,     QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_PIBAL,     QTY_V_WIND_COMPONENT,       COMMON_CODE
! T_PIBAL,     QTY_TEMPERATURE
! U_AIREP,     QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_AIREP,     QTY_V_WIND_COMPONENT,       COMMON_CODE
! T_AIREP,     QTY_TEMPERATURE
! U_AMDAR,     QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_AMDAR,     QTY_V_WIND_COMPONENT,       COMMON_CODE
! T_AMDAR,     QTY_TEMPERATURE
! U_ACARS,     QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_ACARS,     QTY_V_WIND_COMPONENT,       COMMON_CODE
! T_ACARS,     QTY_TEMPERATURE
! U_MDCRS,     QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_MDCRS,     QTY_V_WIND_COMPONENT,       COMMON_CODE
! T_MDCRS,     QTY_TEMPERATURE
! U_CLD_WNDS1, QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_CLD_WNDS1, QTY_V_WIND_COMPONENT,       COMMON_CODE
! U_CLD_WNDS2, QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_CLD_WNDS2, QTY_V_WIND_COMPONENT,       COMMON_CODE
! U_METEO,     QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_METEO,     QTY_V_WIND_COMPONENT,       COMMON_CODE
! U_GOES,      QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_GOES,      QTY_V_WIND_COMPONENT,       COMMON_CODE
! T_TOVS_T,    QTY_TEMPERATURE
! P_SFC_LAND,  QTY_SURFACE_PRESSURE
! U_SFC_LAND,  QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_SFC_LAND,  QTY_V_WIND_COMPONENT,       COMMON_CODE
! P_SFC_SHIP,  QTY_SURFACE_PRESSURE
! U_SFC_SHIP,  QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_SFC_SHIP,  QTY_V_WIND_COMPONENT,       COMMON_CODE
! VORTEX_LON,  QTY_VORTEX_LON,             COMMON_CODE
! VORTEX_LAT,  QTY_VORTEX_LAT,             COMMON_CODE
! U_WSAT_WIND, QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_WSAT_WIND, QTY_V_WIND_COMPONENT,       COMMON_CODE
! U_SCAT_WINDS,QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_SCAT_WINDS,QTY_V_WIND_COMPONENT,       COMMON_CODE
! U_QSCAT_WIND,QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_QSCAT_WIND,QTY_V_WIND_COMPONENT,       COMMON_CODE
! U_ASCAT_WIND,QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_ASCAT_WIND,QTY_V_WIND_COMPONENT,       COMMON_CODE
! U_TERRA_WIND,QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_TERRA_WIND,QTY_V_WIND_COMPONENT,       COMMON_CODE
! U_AQUA_WIND, QTY_U_WIND_COMPONENT,       COMMON_CODE
! V_AQUA_WIND, QTY_V_WIND_COMPONENT,       COMMON_CODE
! WS_SSMI_FF1, QTY_VELOCITY
! WS_SSMI_FF2, QTY_VELOCITY
! TPPW_SSMI,   QTY_TOTAL_PRECIPITABLE_WATER, COMMON_CODE
! TPPW_WSAT,   QTY_TOTAL_PRECIPITABLE_WATER, COMMON_CODE
! END DART PREPROCESS KIND LIST
! BEGIN DART PREPROCESS USE OF SPECIAL OBS_DEF MODULE
!   use obs_def_navdas_mod, only : &
!                                  get_expected_altimeter,&
!                                  get_expected_air_temperature,&
!                                  get_expected_windspeed
! END DART PREPROCESS USE OF SPECIAL OBS_DEF MODULE
! BEGIN DART PREPROCESS GET_EXPECTED_OBS_FROM_DEF
!   case(RADIOSONDE_AIR_TEMPERATURE,EVAL_AIR_TEMPERATURE, &
!        T_RAOB,T_PIBAL,T_AIREP,T_AMDAR,T_ACARS,T_MDCRS, &
!        T_TOVS_T, T_TC_SYNTH, T_DROPSONDE)
!        call get_expected_air_temperature(state, location, obs_val, istatus)
!   case(P_SFC_LAND, P_SFC_SHIP)
!        call get_expected_altimeter(state, location, obs_val, istatus)
!   case(WS_SSMI_FF1, WS_SSMI_FF2)
!        call get_expected_windspeed(state, location, obs_val, istatus)
! END DART PREPROCESS GET_EXPECTED_OBS_FROM_DEF
! BEGIN DART PREPROCESS READ_OBS_DEF
!   case(RADIOSONDE_AIR_TEMPERATURE,EVAL_AIR_TEMPERATURE, &
!        T_RAOB,T_PIBAL,T_AIREP,T_AMDAR,T_ACARS,T_MDCRS, &
!        T_TOVS_T, T_TC_SYNTH, T_DROPSONDE)
!     continue
!   case(P_SFC_LAND, P_SFC_SHIP)
!     continue
!   case(WS_SSMI_FF1, WS_SSMI_FF2)
!     continue
! END DART PREPROCESS READ_OBS_DEF
! BEGIN DART PREPROCESS WRITE_OBS_DEF
!   case(RADIOSONDE_AIR_TEMPERATURE,EVAL_AIR_TEMPERATURE, &
!        T_RAOB,T_PIBAL,T_AIREP,T_AMDAR,T_ACARS,T_MDCRS, &
!        T_TOVS_T, T_TC_SYNTH, T_DROPSONDE)
!     continue
!   case(P_SFC_LAND, P_SFC_SHIP)
!     continue
!   case(WS_SSMI_FF1, WS_SSMI_FF2)
!     continue
! END DART PREPROCESS WRITE_OBS_DEF
! BEGIN DART PREPROCESS INTERACTIVE_OBS_DEF
!   case(RADIOSONDE_AIR_TEMPERATURE,EVAL_AIR_TEMPERATURE, &
!        T_RAOB,T_PIBAL,T_AIREP,T_AMDAR,T_ACARS,T_MDCRS, &
!        T_TOVS_T, T_TC_SYNTH, T_DROPSONDE)
!     continue
!   case(P_SFC_LAND, P_SFC_SHIP)
!     continue
!   case(WS_SSMI_FF1, WS_SSMI_FF2)
!     continue
! END DART PREPROCESS INTERACTIVE_OBS_DEF
! BEGIN DART PREPROCESS MODULE CODE


! DART software - Copyright UCAR. This open source software is provided
! by UCAR, "as is", without charge, subject to all terms of use at
! http://www.image.ucar.edu/DAReS/DART/DART_download
!
! $Id$
!> Ikeda model interfaces to DART


! DART software - Copyright UCAR. This open source software is provided
! by UCAR, "as is", without charge, subject to all terms of use at
! http://www.image.ucar.edu/DAReS/DART/DART_download
!> Lorenz 63 model interfaces to DART


! This code is not protected by the DART copyright agreement.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! MODULE CONSTANTS_MODULE
!
! This module defines constants that are used by other modules
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! MODULE MISC_DEFINITIONS_MODULE
!
! This module defines various non-meteorological constants that are used
!   by other modules for readability.
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


! DART software - Copyright UCAR. This open source software is provided
! by UCAR, "as is", without charge, subject to all terms of use at
! http://www.image.ucar.edu/DAReS/DART/DART_download
!> @mainpage Remote Memory Access version of DART code.
!>
!> Forward operator, vertical conversion
!>
!> WRF
!>
!> For distributed phb array see distributed_phb_model_mod.f90
!> \todo To do list
!> @author dart@ucar.edu
!>
!> \subpage test
!>
!> \page test
!> WRF model mod


!////////////////////////////////////////////////////!
! * Angular power spectrum calculation
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! * Intrinsic Special Functions
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! * Kernel Functions of Normalization
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! * Galaxy survey forecast
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! * Computing Al with flat sky approximation
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! * Computing BB with flat sky approximation
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! * Functions for Cosmology
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! * Utils for 2D Grid Analysis
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! * Module to generate random number
! * This code is part of forutils/RandUtils.f90
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////////////////!
! * Weak lensing bispectrum subroutines for analytic calculation
!////////////////////////////////////////////////////////////////!


!-----------------------------------------------------------------------------
!
!  Copyright (C) 1997-2013 Krzysztof M. Gorski, Eric Hivon,
!                          Benjamin D. Wandelt, Anthony J. Banday,
!                          Matthias Bartelmann, Hans K. Eriksen,
!                          Frode K. Hansen, Martin Reinecke
!
!  This file was part of HEALPix.
!
!  HEALPix is free software; you can redistribute it and/or modify
!  it under the terms of the GNU General Public License as published by
!  the Free Software Foundation; either version 2 of the License, or
!  (at your option) any later version.
!
!  HEALPix is distributed in the hope that it will be useful,
!  but WITHOUT ANY WARRANTY; without even the implied warranty of
!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!  GNU General Public License for more details.
!
!  You should have received a copy of the GNU General Public License
!  along with HEALPix; if not, write to the Free Software
!  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
!
!  For more information about HEALPix see http://healpix.sourceforge.net
!
!-----------------------------------------------------------------------------


!////////////////////////////////////////////////////!
! Conjugate Gradient Decent
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! Bispectrum calcuation in fullsky
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! Interface of Spherical Harmonic Transform
!////////////////////////////////////////////////////!


!///////////////////////////////////////////////////////////!
! * Lensing Reconstruction Kernel
!///////////////////////////////////////////////////////////!


!//////////////////////////////////////////////////////////////////!
! * Conjugate Gradient Algorithm for Gaussian-Constrained Inpainting
! * Not well tested
!//////////////////////////////////////////////////////////////////!


! -*- F90 -*-
!-----------------------------------------------------------------------------
!
!  Copyright (C) 1997-2013 Krzysztof M. Gorski, Eric Hivon,
!                          Benjamin D. Wandelt, Anthony J. Banday,
!                          Matthias Bartelmann, Hans K. Eriksen,
!                          Frode K. Hansen, Martin Reinecke
!
!
!  This file is part of HEALPix.
!
!  HEALPix is free software; you can redistribute it and/or modify
!  it under the terms of the GNU General Public License as published by
!  the Free Software Foundation; either version 2 of the License, or
!  (at your option) any later version.
!
!  HEALPix is distributed in the hope that it will be useful,
!  but WITHOUT ANY WARRANTY; without even the implied warranty of
!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!  GNU General Public License for more details.
!
!  You should have received a copy of the GNU General Public License
!  along with HEALPix; if not, write to the Free Software
!  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
!
!  For more information about HEALPix see http://healpix.sourceforge.net
!
!-----------------------------------------------------------------------------
! ---------------------------------------------------------------------
! Module [gifmod] provides five subroutines: [setcol] to set color
!   tables, [addbar] to add a color bar, [addttl] to add a title
!   string, [imgscl] to scale an image array to the color table,
!   and [gifmap] to write an array as a GIF file.
!
!
! Matthias Bartelmann and Anthony J. Banday, Dec. 1998
! Dec 2010, EH.
!     redefined AS parameter
!     replaced WHERE structure by loops in imgscl
!     used loop to flip A array in gifmap
! 2013-05-07: G95-compatible
! 2019-02-19: simplified C binding (M. Reinecke)
! ---------------------------------------------------------------------


!-----------------------------------------------------------------------------
!
!  Copyright (C) 1997-2013 Krzysztof M. Gorski, Eric Hivon,
!                          Benjamin D. Wandelt, Anthony J. Banday,
!                          Matthias Bartelmann, Hans K. Eriksen,
!                          Frode K. Hansen, Martin Reinecke
!
!
!  This file is part of HEALPix.
!
!  HEALPix is free software; you can redistribute it and/or modify
!  it under the terms of the GNU General Public License as published by
!  the Free Software Foundation; either version 2 of the License, or
!  (at your option) any later version.
!
!  HEALPix is distributed in the hope that it will be useful,
!  but WITHOUT ANY WARRANTY; without even the implied warranty of
!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!  GNU General Public License for more details.
!
!  You should have received a copy of the GNU General Public License
!  along with HEALPix; if not, write to the Free Software
!  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
!
!  For more information about HEALPix see http://healpix.sourceforge.net
!
!-----------------------------------------------------------------------------


!-----------------------------------------------------------------------------
!
!  Copyright (C) 1997-2013 Krzysztof M. Gorski, Eric Hivon,
!                          Benjamin D. Wandelt, Anthony J. Banday,
!                          Matthias Bartelmann, Hans K. Eriksen,
!                          Frode K. Hansen, Martin Reinecke
!
!
!  This file is part of HEALPix.
!
!  HEALPix is free software; you can redistribute it and/or modify
!  it under the terms of the GNU General Public License as published by
!  the Free Software Foundation; either version 2 of the License, or
!  (at your option) any later version.
!
!  HEALPix is distributed in the hope that it will be useful,
!  but WITHOUT ANY WARRANTY; without even the implied warranty of
!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!  GNU General Public License for more details.
!
!  You should have received a copy of the GNU General Public License
!  along with HEALPix; if not, write to the Free Software
!  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
!
!  For more information about HEALPix see http://healpix.sourceforge.net
!
!-----------------------------------------------------------------------------
!
! module m_indmed of Orderpack 2.0, by Michel Olagnon   http://www.fortran-2000.com/rank/
!
! edited 2012-07-16:
!         - use includes to avoid repetition of same lines of code
!           for R,D, I (and forthcoming) implementations
!         - remove SAVE attribute of IDONT, and remove IDONT from module header
!
! 2016-10-05: faster code by turning IDONT array from allocatable to stack array
!


!-----------------------------------------------------------------------------
!
!  Copyright (C) 1997-2013 Krzysztof M. Gorski, Eric Hivon,
!                          Benjamin D. Wandelt, Anthony J. Banday,
!                          Matthias Bartelmann, Hans K. Eriksen,
!                          Frode K. Hansen, Martin Reinecke
!
!
!  This file is part of HEALPix.
!
!  HEALPix is free software; you can redistribute it and/or modify
!  it under the terms of the GNU General Public License as published by
!  the Free Software Foundation; either version 2 of the License, or
!  (at your option) any later version.
!
!  HEALPix is distributed in the hope that it will be useful,
!  but WITHOUT ANY WARRANTY; without even the implied warranty of
!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!  GNU General Public License for more details.
!
!  You should have received a copy of the GNU General Public License
!  along with HEALPix; if not, write to the Free Software
!  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
!
!  For more information about HEALPix see http://healpix.sourceforge.net
!
!-----------------------------------------------------------------------------
! Written by Hans Kristian Eriksen and Snorre Boasson,
! but copying large parts from the serial HEALPix code.


!-----------------------------------------------------------------------------
!
!  Copyright (C) 1997-2013 Krzysztof M. Gorski, Eric Hivon,
!                          Benjamin D. Wandelt, Anthony J. Banday,
!                          Matthias Bartelmann, Hans K. Eriksen,
!                          Frode K. Hansen, Martin Reinecke
!
!
!  This file is part of HEALPix.
!
!  HEALPix is free software; you can redistribute it and/or modify
!  it under the terms of the GNU General Public License as published by
!  the Free Software Foundation; either version 2 of the License, or
!  (at your option) any later version.
!
!  HEALPix is distributed in the hope that it will be useful,
!  but WITHOUT ANY WARRANTY; without even the implied warranty of
!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!  GNU General Public License for more details.
!
!  You should have received a copy of the GNU General Public License
!  along with HEALPix; if not, write to the Free Software
!  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
!
!  For more information about HEALPix see http://healpix.sourceforge.net
!
!-----------------------------------------------------------------------------
!
!  This file contains the random number generator
!  used by the Planck LevelS package.
!  The generator is an F90 port of an xorshift generator described
!  in Marsaglia, Journal of Statistical Software 2003, vol 8.
!  It has a period of 2^128 - 1.
!
!  Copyright (C) 2003, 2004 Max-Planck-Society
!  Author: Martin Reinecke & Eric Hivon
!


!-----------------------------------------------------------------------------
!
!  Copyright (C) 1997-2013 Krzysztof M. Gorski, Eric Hivon,
!                          Benjamin D. Wandelt, Anthony J. Banday,
!                          Matthias Bartelmann, Hans K. Eriksen,
!                          Frode K. Hansen, Martin Reinecke
!
!
!  This file is part of HEALPix.
!
!  HEALPix is free software; you can redistribute it and/or modify
!  it under the terms of the GNU General Public License as published by
!  the Free Software Foundation; either version 2 of the License, or
!  (at your option) any later version.
!
!  HEALPix is distributed in the hope that it will be useful,
!  but WITHOUT ANY WARRANTY; without even the implied warranty of
!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!  GNU General Public License for more details.
!
!  You should have received a copy of the GNU General Public License
!  along with HEALPix; if not, write to the Free Software
!  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
!
!  For more information about HEALPix see http://healpix.sourceforge.net
!
!-----------------------------------------------------------------------------
!! Generator for uniformly distributed and Gaussian random numbers


!Module to read in name/value pairs from a file, with each line of the form line 'name = value'
!Should correctly interpret FITS headers
!Antony Lewis (http://cosmologist.info/). Released to the public domain.
!This version Apr 11, added support for INCLUDE(file); check for duplicate keys


!////////////////////////////////////////////////////!
! * LAPACK and LAPACK95
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! * Normalization of quadratic tau/rot reconstruction
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! * CMB lensing reconstruction in curvedsky
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! Point source reconstruction in Fullsky
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! Amplitude modulation reconstruction
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! Utils for curvedsky analysis
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! * CMB pol rotation angle reconstruction in curvedsky
!////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! * Imaginary CMB lensing reconstruction in curvedsky
!////////////////////////////////////////////////////!
! need update


!//////////////////////////////////////////////////////////!
! Normalization of quadratic imaginary lens reconstruction
!//////////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! * Delensing in Fullsky
!////////////////////////////////////////////////////!


!///////////////////////////////////////////////////////////!
! Point source reconstruction kernel
!///////////////////////////////////////////////////////////!


!///////////////////////////////////////////////////////////!
! 2D Cross Normalization
!///////////////////////////////////////////////////////////!


!///////////////////////////////////////////////////////////!
! 2D Lensing Reconstruction Normalization
!///////////////////////////////////////////////////////////!


!///////////////////////////////////////////////////////////!
! Normalization of tau teconstruction
!///////////////////////////////////////////////////////////!


!///////////////////////////////////////////////////////////!
! Rotation Reconstruction Kernel
!///////////////////////////////////////////////////////////!


!///////////////////////////////////////////////////////////!
! Tau reconstruction kernel
!///////////////////////////////////////////////////////////!


!///////////////////////////////////////////////////////////!
! Normalization of pol. rot. reconstruction
!///////////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! bispectrum measurement from flatsky simulations
!////////////////////////////////////////////////////!


!//////////////////////////////////////////////////////////////////!
! Conjugate Gradient Decent Algorithm
!//////////////////////////////////////////////////////////////////!


!/////////////////////////////////////////////////////////////////!
! * Calculation in flatsky
! - Not recommended for actual calculations, just for cross check
!/////////////////////////////////////////////////////////////////!


!////////////////////////////////////////////////////!
! * GW detector forecast
!////////////////////////////////////////////////////!


!/////////////////////////////////////////////////////////////////////!
! Some useful functions for computing galaxy-survey related quantities
!/////////////////////////////////////////////////////////////////////!


!///////////////////////////////////////////////////////////////////////!
! Wigner 3J, etc
!///////////////////////////////////////////////////////////////////////!


!////////////////////////////////////////////////
! Kernel of Analytic MFs upto 4th order
!////////////////////////////////////////////////


SACPZ Class for reading SAC pole-zero files downloaded from IRIS


SITE the blueprint for Site objects in GISMO


SITE the blueprint for Calibration objects in GISMO


POSIITON the blueprint for Position objects in GISMO


/**
 * Information about a granule with horizontal spatial coverage.
 *
 */


/**
 * This element stores a track pass and its tile information. It will allow a user to search by pass number and their tiles that are contained with in a cycle number.  While trying to keep this generic for all to use, this comes from a SWOT requirement where a pass represents a 1/2 orbit. This element will then hold a list of 1/2 orbits and their tiles that together represent the granules spatial extent.
 *
 */


/**
 * This element stores track information of the granule. Track information is used to allow a user to search for granules whose spatial extent is based on an orbital cycle, pass, and tile mapping. Though it is derived from the SWOT mission requirements, it is intended that this element type be generic enough so that other missions can make use of it. While track information is a type of spatial domain, it is expected that the metadata provider will provide geometry information that matches the spatial extent of the track information.
 *
 */


/**
 * This entity contains the type and value for the granule's vertical spatial domain.
 *
 */


/**
 * A boundary is set of points connected by straight lines representing a polygon on the earth. It takes a minimum of three points to make a boundary. Points must be specified in counter-clockwise order and closed (the first and last vertices are the same).
 *
 */


/**
 * This entity stores orbital coverage information of the granule. This coverage is an alternative way of expressing granule spatial coverage. This information supports orbital backtrack searching on a granule.
 *
 */


/**
 * A GPolygon specifies an area on the earth represented by a main boundary with optional boundaries for regions excluded from the main boundary.
 *
 */


/**
 * This entity holds the horizontal spatial coverage of a line. A line area contains at lease two points.
 *
 */


/**
 * This entity holds the horizontal spatial coverage of a bounding box.
 *
 */


/**
 * The longitude and latitude values of a spatially referenced point in degrees.
 *
 */


/**
 * This class contains time conversion tool.
 *
 * @author clwong
 *
 * @version
 * $Id: TimeConversion.java 4503 2010-01-27 20:40:12Z gangl $
 */


/**
 * This is an utility class which provides functions to access S3 bucket.
 * Ex. upload, download and get eTag.  Since AmazonS3Client object is thread safe,
 * we are declaring a member function to act as a factory of AmazonS3Client and reuse such client.
 */


// Note: ENVI format image = binary + .hdr file


// This is not a full geometric (ray-traced) occlusion test; it just looks to see if each face normal is pointed away from the observer.


/**
 *
 * @author zimmemi1
 *
 * Boilerplate implementation of a {@link TableColumn}
 */


/**
 *
 * @author zimmemi1
 *
 *         Basic implementation of a Table with mutable rows and event firing support. The column specifications are immutable, i.e. the {@link TableColumn} ordering and content cannot be changed.
 *
 */


/**
     *
     * @author zimmemi1
     *
     * @param <T>
     *            Optional object type associated with this event (usually the type of a single value that changed within the row)
     */


/**
     *
     * @author zimmemi1
     *
     *         Event that can be fired by a {@link Table} when a row is removed at a particular index.
     */


/**
 * Helper class that takes in a series of captured frames (png format) to generate an mp4 movie
 * @author steelrj1
 *
 */


/**
 * Runnable subclass that can act like a completion block once the animator is done with a single frame
 * @author steelrj1
 *
 */


/**
 * Collection of legacy utility methods for working with the legacy design
 * associated with {@link PolyhedralModelControlPanel}.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows the user to configure a small body with the
 * {@link ColoringMode#Plain}.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows a user to configure the coloring mode on a small body.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows the user to configure the plate coloring for the reference
 * small body {@link PolyhedralModel} with a RGB plate coloring configuration.
 *
 * @author lopeznr1
 */


/**
 * Class that provides UI controls and mechanism for the standard plate coloring
 * panel.
 *

 * This class is a composite of the following gui elements:
 *

 *
{@link ColorBarPanel}
 *
{@link ContourPanel}
 *
Custom coloring / info row removed.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows the user to configure how contours lines are displayed.
 *
 * @author lopeznr1
 */


/**
 * Collection of VTK based utility methods.
 *
 * @author lopeznr1
 */


/**
 * Collection of VTK based draw routines.
 *
 * @author lopeznr1
 */


/**
 * Collection of VTK routines associated with font functionality.
 *
 * @author lopeznr1
 */


/**
 * Immutable object that contains rectangular position and dimension.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows a user to configure a {@link FontAttr}.
 *
 * @author lopeznr1
 */


/**
 * Immutable class that defines the attributes associated with a Font.
 *
 * @author lopeznr1
 */


/**
 * Painter used to render a simple 2 dimension rectangle into a VTK scene.
 *
 * @author lopeznr1
 */


/**
 * Mutable {@link Structure} that defines a polygon.
 *
 * @author lopeznr1
 */


/**
 * Mutable {@link Structure} that defines a point.
 *
 * @author lopeznr1
 */


/**
 * Picker used to create, delete, modify or select round edge (circles, ellipses, points) structures.
 *

 * The following structure mutations are supported:
 *

 *
Ability to delete selected structures
 *
Ability to move selected structures
 *
Ability to adjust radius of relevant selected structures
 *
Ability to change flattening of relevant selected structures
 *
Ability to adjust angle of relevant selected structures
 *
Ability to change control points of a single selected structure
 *

 * Note that structures that do not define a specific attribute will not be mutated.
 *
 * @author lopeznr1
 */


/**
 * Base implementation of the {@link StructureManager} interface.
 *

 * This class provides the following functionality:
 *

 *
Management of items
 *
Logic to handle item selection
 *
Configuration of various rendering properties
 *
Base VTK render logic
 *

 *
 * @author lopeznr1
 */


/**
 * Mutable {@link Structure} that defines a polyline.
 *
 * @author lopeznr1
 */


/**
 * Class that provides management logic for a collection of structures.
 *

 * The following features are supported:
 *

 *
Event handling
 *
Management of collection of structures
 *
Support for structure selection
 *
Configuration of rendering properties
 *

 * Manager that defines a collection of methods to manage, handle notification, and customize display of a collection of
 * structures.
 *
 * @author lopeznr1
 */


/**
 * Mutable {@link Structure} that defines an ellipse.
 *
 * @author lopeznr1
 */


/**
 * Collection of miscellaneous utility methods for working with (LatLon) control
 * points.
 *
 * @author lopeznr1
 */


/**
 * Collection of miscellaneous utility methods for working with {@link Ellipse}s.
 *

 * A number of methods originated from the file (~2019Oct07):

 * edu.jhuapl.saavtk.model.structure.AbstractEllipsePolygonModel.java

 * edu.jhuapl.saavtk.model.structure.AbstractEllipse.java

 *
 * @author lopeznr1
 */


/**
 * Class that provides base functionality for line plots. Plots will be
 * generated via the JFree chart library.
 *

 * The following features is supported:
 *

 *
Event handling via {@link ItemEventListener} mechanism
 *
Management of items
 *
Support for item selection
 *
Support for automatic updating of plots when corresponding line changes.
 *
Configuration of various rendering properties
 *

 *
 * Developers that extend this class are required to implement the following
 * methods:
 *

 *
{@link #getChartPanel()}
 *
{@link #getPlotPoints(PolyLine, List, List)}
 *

 *
 * @author lopeznr1
 */


/**
	 * Private class used to keep track of state associated with a line's plot.
	 *
	 * @author lopeznr1
	 */


/**
 * Class that provides base functionality for line plots. Plots will be
 * generated via the JFree chart library.
 *

 * The following features is supported:
 *

 *
Event handling via {@link ItemEventListener} mechanism
 *
Management of items
 *
Support for item selection
 *
Support for automatic updating of plots when corresponding line changes.
 *
Configuration of various rendering properties
 *

 *
 * @author lopeznr1
 */


/**
 * Class which contains the logic to render a single {@link Polygon} using the VTK framework.
 *

 * This class supports the following:
 *

 *
Update / Refresh mechanism
 *
VTK state management
 *
Exterior rendering
 *
Interior rendering
 *

 * Note this class will update the reference structure's {@link RenderState} during a VTK state update.
 *
 * @author lopeznr1
 */


/**
 * Class which contains the logic to render a single {@link Point} using the VTK framework.
 *

 * This class supports the following:
 *

 *
Update / Refresh mechanism
 *
VTK state management
 *
Exterior rendering
 *
Interior rendering
 *

 *
 * @author lopeznr1
 */


/**
 * Class which contains the logic to render a single {@link PolyLine} using the
 * VTK framework.
 *

 * This class supports the following configurable state:
 *

 *
Closed / Unclosed
 *
Draw color
 *
TODO: Outline width
 *
TODO: Clean up logic that handles mutation of xyzPointL and
 * controlPointIdL
 *
TODO: Clean up very convoluted processing in
 * {@link #updateSegmentAt(int, List)}
 *

 * Note this class will update the reference {@link PolyLine}'s "path length"
 * during relevant VTK state updates.
 *
 * @author lopeznr1
 */


/**
 * Object which consists of 2 control points and a collection of intermediate points. The control points are specified
 * as {@link LatLon}s.
 *
 * @author lopeznr1
 */


/**
 * Class which provides an abstraction of logic used to render a single structure using the VTK framework.
 *

 * This class provides a composite of two underlying Painters:
 *

 *
The custom structure painter (relevant to the underlying structure)
 *
A label painter used to render the associated painter.
 *

 *
 * @author lopeznr1
 */


/**
 * Class which contains the logic to render a collection of control points using the VTK framework.
 *

 * This class supports the following configurable state:
 *

 *
Draw color
 *

 *
 * @author lopeznr1
 */


/**
 * Class used to render multiple {@link Structure} objects via the VTK framework.
 *

 * This class supports the following configurable state:
 *

 *
interior opacity
 *
line width
 *
offset (from surface)
 *

 *
 * @author lopeznr1
 */


/**
 * Object which defines the logic to render a single caption (structure's label) using the VTK framework.
 *

 * This class supports the following:
 *

 *
Update / Refresh mechanism
 *
VTK state management
 *
Retrieval of VTK caption
 *
Font color
 *
TODO: Font face
 *
TODO: Font style
 *
Font size
 *

 *
 * @author lopeznr1
 */


/**
 * Class which contains the logic to render a single {@link Ellipse} using the VTK framework.
 *

 * This class supports the following:
 *

 *
Update / Refresh mechanism
 *
VTK state management
 *
Exterior rendering
 *
Interior rendering
 *

 * Note this class will update the reference structure's {@link RenderState} during a VTK state update.
 *
 * @author lopeznr1
 */


/**
 * Class which contains the logic to render a single {@link PolyLine} using the VTK framework.
 *

 * This class supports the following:
 *

 *
Update / Refresh mechanism
 *
VTK state management
 *
Exterior rendering
 *

 * Note this class will update the reference structure's {@link RenderState} during a VTK state update.
 *
 * @author lopeznr1
 */


/**
 * Panel used to display a list of {@link Structure}s.
 *

 * The following functionality is supported:
 *

 *
Display a list of structures in a table.
 *
Allow user to show, hide, add, edit, or delete structures
 *
Allow user to load or save structures.
 *

 *
 * @author lopeznr1
 */


/**
 * GUI component used to prompt the user for a latitude and longitude inputs.
 * <P>
 * Inputs is specified in degrees.
 *
 * @author lopeznr1
 */


/**
 * Panel that provides the "action" area of a the structure UI.
 *

 * The following (child) action panels are supported:
 *

 *
{@link ViewPanel}
 *
{@link CreatePanel}
 *
{@link EditPanel}
 *

 *
 * @author lopeznr1
 */


/**
 * Collection of structure UI utility methods.
 *
 * @author lopeznr1
 */


/**
 * Top level panel used to display the main structure panel.
 *
 * @author lopeznr1
 */


/**
 * {@link ItemHandler} used to process {@link Structure}s.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows the user to configure a {@link RenderAttr}.
 *

 * This panel allows definition of the following:
 *

 *
Line width
 *
Radial offset
 *
Point size
 *
Responsive status feedback associated with user input.
 *

 *
 * @author lopeznr1
 */


/**
 * UI component that allows the user to specify the type of structure to create.
 *
 * @author lopeznr1
 */


/**
 * UI component that allows creation of a {@link Structure}.
 *
 * @author lopeznr1
 */


/**
 * UI component that allows the user to specify the attributes for the structure to be created.
 *
 * @author lopeznr1
 */


/**
 * Panel that provides UI elements to allow the user to edit a set of {@link Structure}s.
 *
 * @author lopeznr1
 */


/**
 * UI component that allows creation of a Structure.
 *
 * @author lopeznr1
 */


/**
 * UI component that holds miscellaneous "extra" settings.
 *
 * @author lopeznr1
 */


/**
 * Load panel that provides a custom UI for loading up structues.
 *

 * This panel provides the following features:
 *

 *
Ability to specify the structure types to be loaded
 *
Responsive status feedback associated with user input
 *
Support for defining how structures are loaded and merged into the system.
 *

 *
 * @author lopeznr1
 */


/**
 * Load panel that provides a custom UI for loading up structues.
 *

 * This panel provides the following features:
 *

 *
Textual listing of the files and associated number of (ambiguous) items.
 *
Prompt for how to load ambiguous structures (either as circles or points) into the system.
 *

 *
 * @author lopeznr1
 */


/**
 * Panel that allows the user to save a collection of {@link Structure}.
 *

 * This panel provides the following features:
 *

 *
Ability to specify the save file format.
 *
Ability to specify the {@link Structure}s types to be saved.
 *
Responsive status feedback associated with user input.
 *

 *
 * @author lopeznr1
 */


/**
 * {@link PopAction} that will show the statistics of plate data associated with the list of {@link Structure}s.
 *
 * @author lopeznr1
 */


/**
 * {@link PopAction} that will change the display interior state of the list of {@link Structure}s.
 * <p>
 * This {@link PopAction} should always be paired with a {@link JCheckBoxMenuItem} rather than a plain {@link JMenuItem}
 * - otherwise a runtime exception will be thrown.
 *
 * @author lopeznr1
 */


/**
 * {@link PopAction} that will change the lat,lon of a single {@link Structure}.
 *
 * @author lopeznr1
 */


/**
 * {@link PopAction} that exports the plate data of the list of {@link Structure}s to a user specified file.
 *
 * @author lopeznr1
 */


/**
 * {@link PopAction} that will center a single {@link Structure}.
 *
 * @author lopeznr1
 */


/**
 * {@link PopAction} that will change the visibility of the list of {@link Structure}s.
 * <P>
 * This {@link PopAction} should always be paired with a {@link JCheckBoxMenuItem} rather than a plain {@link JMenuItem}
 * - otherwise a runtime exception will be thrown.
 *
 * @author lopeznr1
 */


/**
 * {@link PopAction} that will change the labels of the list of {@link Structure}s.
 *
 * @author lopeznr1
 */


/**
 * {@link PopAction} that will save the profile plot of a single
 * {@link PolyLine}.
 * <P>
 * The {@link PolyLine} must have only 2 points.
 *
 * @author lopeznr1
 */


/**
 * {@link PopAction} that will remove the list of items from the {@link ItemManager}.
 *
 * @author lopeznr1
 */


/**
 * {@link PopAction} that will change the color for the list of {@link Structure}s.
 *
 * @author lopeznr1
 */


/**
 * Object that defines the behavior associated with this action.
 *

 * This class was originally part of the single monolithic file:
 * edu.jhuaple.saavtk.gui.panel.AbstractStructureMappingControlPanel.
 *

 * Subclasses that were implementations of {@link Action} have been refactored
 * to the package edu.jhuapl.saavtk.structure.gui.action on ~2019Sep09.
 */


/**
 * Collection of utility methods for serializing structures (or aspects of a
 * structure).
 *

 * A number of methods originated from the package (~2019Oct07):
 * edu.jhuapl.saavtk.model.structure.*
 *

 * These methods have been factored out so that serialization logic is separate
 * from classes of type {@link StructureManager}.
 *
 * @author lopeznr1
 */


/**
 * Collection of utility methods to support loading of SBMT structures and related objects.
 *

 * Most (if not all) SBMT structure file formats should be loaded via the method {@link #loadStructures(File)}.
 *

 * Internally, heuristics are used to determine the appropriate deserializer for a specific file.
 *
 * @author lopeznr1
 */


/**
 * Collection of legacy utility methods.
 *

 * Notes:
 *

 *
These methods do not fit the overall design of the redesigned structure package.
 *
No new code should rely (primarily) on these methods.
 *

 * Note some of the methods in this class are transitional and will eventually go away.
 *
 * @author lopeznr1
 */


/**
 * Collection of utility methods to support (de)serialization of SBMT structures from/to XML files.
 * <p>
 * Note some methods in this class have been refactored out so as to keep serialization code separate from model based
 * classes.
 *
 * @author lopeznr1
 */


/**
 * Collection of utility methods for working with Structures / StructureManagers.
 *

 * The functionality provided by this class can be categorized by:
 *

 *
Determining the ID that should be used for a new structure.
 *
Getting the specific structures from a list of general structures.
 *
Getting the status text for a specific structure.
 *

 *
 * @author lopeznr1
 */


/**
 * All static class to handle operations concerning which model to load when a
 * new client launches. Thread-safe.
 *
 * @author James Peachey
 *
 */


/**
 * Immutable class used to define a lidar data source.
 *
 * @author lopeznr1
 */


/**
 * Collection of utility methods useful for computing or determining various
 * attributes / parameters associated with {@link PolyModel}s.
 *
 * @author lopeznr1
 */


/**
 * Checks whether or not a point is within a cylinder. This cylinder is
 * oriented in the direction normal to the point of the small body model
 * passed into the constructor of this class.
 */


/**
 * This class was originally an enumeration (ShapeModelAuthor), but was later
 * modified to allow new members to be added dynamically. Enum-like methods were
 * provided for the benefit of existing code. The code prevents two shape model
 * types with the same identifier string.
 *
 * This class is not thread-safe.
 */


/**
 * Base ItemManager class that provides the standard functionality for an
 * {@link ItemManager} and {@link Model}.
 * <P>
 * The methods that override the Model interface are copied from the
 * {@link AbstractModel} class. ItemManager should not need to implement the the
 * {@link Model} interface and at some point this class will probably go away.
 *
 * @author lopeznr1
 */


/**
 * Static utility methods useful for manipulating coloring-related abstractions.
 *
 * @author James Peachey
 *
 */


/**
     * Implementation of {@link IndexableTuple} that is backed by a
     * {@link vtkDataArray}.
     */


/**
 * Extension of {@link BasicColoringData} that adds an association with a
 * {@link ColoringDataIO} object that may be used to load/save coloring data
 * from/to a file. It also supports returning the properties of each instance in
 * the form of {@link Metadata}.
 * <p>
 * The additional capabilities are provided using methods that are not part of
 * the {@link ColoringData} interface, so downcasting may be necessary when
 * using this class.
 *
 * @author James Peachey
 *
 */


/**
 * This class is not exactly deprecated, but its use should not be expanded, nor
 * should its inner behaviors be made more public. The reason is that, although
 * it provides a fairly general implementation of {@link LoadableColoringData},
 * its handling of the different inputs needed for CSV v. FITS v. VTK files is a
 * bit clunky and monolithic.
 *
 * @author James Peachey
 *
 */


/**
 * Implementation of {@link ColoringDataIO} for CSV files.
 * @author James Peachey
 *
 */


/**
 * Class that serves as a factory for {@link ColoringDataIO} implementations
 * capable of loading/saving arbitrary combinations of file formats. The design
 * is a hybrid singleton/factory, with a default singleton instance that returns
 * an I/O object capable of loading and saving only VTK format files.
 * <p>
 * This may also be subclassed and other instances created as needed to support
 * new file formats, and/or to handle multiple formats in the same factory.
 *
 * @author James Peachey
 *
 */


/**
 * A basic abstract implementation of {@link ColoringData} that uses
 * {@link AtomicReference}s to cache its data in the form of a
 * format-independent {@link IndexableTuple}. The data's range is similarly
 * cached.
 *

 * This class also adds an abstract method {{@link #provideData()}, through
 * which implementations may provide the data that is cached. In this way, the
 * data may be, for example, generated on the fly or loaded from a file.
 *

 * When extending this class, please also review (and possibly reimplement) the
 * method {@link #clear()}.
 *
 * @author James Peachey
 *
 */


/**
 * Implementation of {@link ColoringDataIO} for FITS files.
 *
 * @author James Peachey
 *
 */


/**
 *
 * @author James Peachey
 *
 */


/**
 * All-static class with methods for creating various implementations of
 * {@link ColoringData} and {@link LoadableColoringData}. Except as noted below,
 * for all factory methods that return {@link ColoringData}, the following are
 * true:
 *

 *
The returned instance will have loaded its data already in the form of an
 * {@link IndexableTuple}. The {@link ColoringData#clear()} method will not do
 * anything, and there is no way to "reload" the data.
 *
The returned instance may not directly be loaded or saved by a
 * {@link ColoringDataIO} object, nor may it be represented as metadata. As-is,
 * it is suitable only for use within a running program. However, the object can
 * be enhanced to make it loadable/savable, and/or represented as metadata by
 * other classes, using other factory methods (see below).
 *
If a factory method finishes execution and returns an instance, all
 * methods of that instance should execute successfully, as described for
 * {@link ColoringData}.
 *

 * Except as noted below, for all factory methods that return
 * {@link LoadableColoringData}, the following are true:
 *

 *
The returned instance will not have loaded its data. When the data are
 * first accessed using either {@link ColoringData#getData()} or
 * {@link ColoringData#getDefaultRange()}, the coloring object will attempt to
 * load the data from its associated file. The {@link ColoringData#clear()}
 * method will discard any loaded data and delete any associated
 * {@link vtkDataArray} objects. The first subsequent call that accesses the
 * data will cause the data to be reloaded.
 *
In keeping with the point above, the returned instance will also not
 * automatically save its data to its associated file.
 *
The returned instance may be saved to its file. Calling the save method
 * multiple times will result in multiple writes to that file. Existing copies
 * of the file will be overwritten without warning. The returned instance will
 * only load its data once, the first time it is needed, unless the
 * {@link ColoringData#clear()} method is called; after that the data would be
 * reloaded.
 *
The {@link LoadableColoringData#getMetadata()} method will return
 * metadata that should suffice to recreate the coloring data object. However,
 * the metadata currently does not include the file format, so it may be
 * necessary to specify how to load coloring data by specifying a
 * {@link ColoringDataIO} I/O handler object.
 *
If a factory method finishes execution and returns an instance, all
 * methods of that instance that do not access the actual coloring data should
 * execute successfully, but any attempt to access the coloring data may throw
 * an exception if the data cannot be loaded.
 *

 * None of the methods is thread-safe currently, but they could be made thread
 * safe fairly easily.
 *

 *
 * @author James Peachey
 */


/**
* Implementation of {@link ColoringDataIO} for VTK files.
* @author James Peachey
*
*/


/**
 * Collection of utility methods that provides the following functionality for {@link Ellipse} and {@link Polygon}
 * structures:
 *

 *
Generation of unified (interior) vtkPolyData from a list of {@link Structure}s.
 *
Progress mechanism via a {@link Task}
 *
TODO: Retrieval of plate data
 *

 *

 * The logic for these utility methods (~2019Oct07) is based off:

 * edu.jhuapl.saavtk.model.structure.AbstractEllipsePolygonModel
 *
 * @author lopeznr1
 */


/**
 * Model of line structures drawn on a body.
 */


/**
 * {@link PickListener} that is responsible for sending out status updates when
 * a model has been picked.
 *

 * This listener supports objects registered with the {@link ModelManager}.
 *

 * The logic for this class is based off of the removed:
 * edu.jhuapl.saavtk.gui.StatusBar
 *

 * This class is a bridge class between the old StatusBar and the new
 * {@link StatusNotifier} mechanism. This class should eventually be removed.
 *
 * @author lopeznr1
 */


/**
 * Object that is responsible for sending out status updates of the mouse
 * location over the {@link Renderer}.
 *
 * @author lopeznr1
 */


/**
 * Implementation of {@link StatusNotifier} that silently ignores all
 * notifications.
 * <P>
 * Singleton instance is acquired via: {@link QuietStatusNotifier#Instance}
 *
 * @author lopeznr1
 */


/**
 * Implementation of {@link StatusNotifier} where status updates are sent to a
 * status bar panel. This component is typically installed at the bottom of a
 * window.
 * <P>
 * Primary notification is sent to the left side and secondary notification is
 * sent to the right side.
 *
 * @author lopeznr1
 */


/**
 * Collection of (extra) utility methods associated with Pickers.
 *

 * The following functionality is provided:
 *

 *
Creation of {@link vtkCellPicker}s (empty, single, or vtkProps located on
 * a {@link PolyhedralModel})
 *
Updating of target {@link vtkProp}s for picking
 *

 *
 * @author lopeznr1
 */


/**
 * Object that manages a collection of {@link Picker}s..
 *

 * The PickManager supports the following:
 *

 *
A {@link DefaultPicker} which is always active
 *
A shared/common {@link SelectionPicker}
 *
Any custom {@link Picker}
 *

 * Only 1 non-default {@link Picker}s may be active at any time.The non-default {@link Picker}s are are activated via
 * {@link #setActivePicker(Picker)}.
 *

 * This class still relies on VTK's Interactor to accomplish manipulation of the ShapeModel. It would be ideal to do
 * away with the reliance of this VTK code and have a custom "Picker" that performs the manipulations natively via Java.
 *
 * @author lopeznr1
 */


/**
	 * Internal class used to process and dispatch all keyboard / mouse events to the actual Pickers.
	 */


/**
	 * Picker which is equivalent to a no-operation Picker.
	 * <p>
	 * This class (should have) has no state data and thus is a singleton. Currently since Picker is an class (with
	 * implementation details) rather than an interface this is not strictly true.
	 */


/**
 * Picker that works with hard edge (lines, polygons) structures that provides
 * the following supported features:
 *

 *
Support for (multiple) item deselection / selection
 *
Ability to add or delete control points
 *
Ability to drag control points
 *
Capability to specify the "active" control point
 *

 * The "active" control point is the control point that was last selected.
 * Points will be added past the "active" control point.
 *
 * @author lopeznr1
 */


/**
 * A MouseInputListener that is used to wrap another MouseInputListener so that
 * the "drag" sensitivity can be configured.
 * <P>
 * Inspiration:
 * https://stackoverflow.com/questions/522244/making-a-component-less-sensitive-to-dragging-in-swing/19003495#19003495
 */


/**
 * This class is provided to support legacy support for the former "default
 * picker" (via {@link PropertyChangeListener}) notification mechanism. This
 * class will eventually be removed so new code should be developed via the
 * {@link #addListener(PickListener)} instead.
 *
 * @author lopeznr1
 */


/**
 * Picker that provides the core functionality for the default {@link Picker}.
 *

 * This picker provide the following functionality:
 *

 *
Listener mechanism to provide notification of when objects are picked
 *
Keyboard support for various view transformations
 *

 * TODO: Eventually this Picker should not be a ProperyChangeListener but rather
 * relevant objects should be responsible for registering their
 * {@link vtkProp}s.
 *
 * @author lopeznr1
 */


/**
 * Utility class for configuration of Picker related code.
 *

 * Please note the following:
 *

 *
The method {@link #formNonDefaultPickerMap(Renderer, ModelManager)} is
 * marked for removal.
 *
The method {@link #setPickingEnabled(boolean)} should be investigated
 * further and eventually removed if possible.
 *

 *
 * @author lopeznr1
 */


/**
 * Immutable class that defines the target that was picked.
 *
 * @author lopeznr1
 */


/**
 * Collection of utility items useful for handling hooked items.
 * <P>
 * This utility class provides a single location for defining the behavior for
 * "hook" actions. A "hook" action is one where the (application) user has
 * expressed interest in a specific item by moving the mouse to the item.
 *
 * @author lopeznr1
 */


/**
 * The Picker class responds to (mouse / keyboard) events on the renderer. There
 * can be more than 1 picker active at any given time.
 * <P>
 * The PickManager class is responsible for managing all the Pickers.
 */


/**
 * Object that will handle the Picker deactivation whenever the component
 * hierarchy changes.
 */


/**
 * Implementation of {@link Picker} responsible for providing a selection capability.
 * <p>
 * This object contains a {@link AnyStructureManager} responsible for managing the structures used for the selection.
 *
 * @author lopeznr1
 */


/**
 * This class defines the top level window. Typically only one
 * {@link MainWindow} is allowed.
 * <p>
 * This object instantiates the {@link ViewManager} and as a result instantiates
 * all the "managers" used through out the program.
 */


/**
 * The purpose of this class is to add mouse wheel support to vtkRenderWindowPanel
 * which for some reason appears to be missing. It also prevents the render window
 * from accepting focus when the mouse hovers over it, which for some reason is
 * the default in the base class.
 */


/**
 * Static utility that redirects standard output and error streams so that
 * messages sent to these streams appear in a GUI-displayable form
 * ({@link JTextArea}). This utility also can "tee" the standard streams so that
 * messages sent to them are also sent to secondary output and/or error streams.
 * These two capabilities function separately, allowing the caller to choose
 * either or both behaviors.
 *

 * Once the console has been successfully configured, all its methods are safe
 * to call when running headless, though those that return GUI objects (e.g.,
 * {@link JFrame}) will throw exceptions if the GUI mode was not enabled at
 * configure time.
 *

 * When running headless, secondary streams can still be used after the console
 * is configured. See
 * {@link #configure(boolean, String, PrintStream, PrintStream)} for more
 * details.
 *

 * A copy of this class is maintained in the saatvk repository for use by the
 * SBMT. If revising it, need to test it in both contexts. The "original" class
 * is part of the timeseries package used by MIDL.
 *
 * @author Larry Brown, heavily revised 2022-07-03 by James Peachey
 *
 */


/**
 * A view is a container which contains a control panel and renderer as well as
 * a collection of managers. A view is unique to a specific body. This class is
 * used to build all built-in and custom views. All the configuration details of
 * all the built-in and custom views are contained in this class.
 */


/**
 * Thread-safe abstract extension of {@link OutputStream} that buffers input fed
 * to it via any of the standard methods {@link #write(int)},
 * {@link #write(byte[])} or {@link #write(byte[], int, int)}. In the base
 * implementation, all these methods update the buffer, then call the method
 * {@link #flushIfReady()} to flush and reset the buffer when appropriate.
 *

 * The base implementation performs a variation of auto-flush similar to but not
 * identical to {@link PrintStream}'s behavior when it is set up with autoflush
 * == true, namely, if the buffer gets full or if a byte matching newline is
 * encountered, {@link #isReadyToFlush()} will return true. {@link PrintStream}
 * flushes in these cases, BUT also flushes whenever ANY of its
 * write(...) overloades are called. Because this class flushes
 * somewhat less frequently, it does a slightly better job at keeping lines
 * together that come from the same thread.
 *

 * If subclassing this class, ensure that all operations that read or affect
 * ANY/ALL of this class's fields are synchronized on the buffer reference
 * field.
 *

 * A copy of this class is maintained in the saatvk repository for use by the
 * SBMT. If revising it, need to test it in both contexts. The "original" class
 * is part of the timeseries package used by MIDL.
 *
 * @author James Peachey
 *
 */


/**
 * Collection of AWT/Swing utilities.
 */


/**
 * Panel capable of displaying metadata that meet one of the following criteria:
 *
 * 1) Key-value pairs where the value is a scalar, e.g., String, Double, etc.
 *
 * 2) Key-value pairs where the value is an iterable. No recursion is performed
 * for iterables of iterable etc.
 *
 * @author peachjm1
 *
 */


/**
 * Input verifier on a JTextField which makes sure that input can be parsed as double.
 * This is meant to replace using a JFormattedTextField with a NumberFormat since it
 * is difficult to make the latter accept any possible valid double string (e.g.
 * any form of scientific notation). With this class, any string that can be parsed as
 * a double will be accepted in the JTextField. If it is not a valid double, it will
 * be reverted to the previous valid value.
 */


/**
 * Collection of utility methods that provide a singular location for the
 * definition, management, and retrieval of (application) colors.
 *
 * @author lopeznr1
 */


/**
 * Collection of utility methods that provide a singular location for the
 * definition, management, and retrieval of tool tips.
 *
 * @author lopeznr1
 */


/**
 * Collection of utility methods that provide a singular location for the
 * definition, management, and retrieval of icons.
 *
 * @author lopeznr1
 */


/**
 * Collection of utility methods used to adjust messages. The following
 * functionality is supported:
 *

 *
Transition to plural form
 *

 *
 * @author lopeznr1
 */


// this nested class provides the (future) ability to override methods of the GLCanvas Component


/**
 * Provide JOGL based rendering component for VTK
 *
 * @author Sebastien Jourdain - sebastien.jourdain@kitware.com
 */


/**
 * Implementation of {@link SceneChangeNotifier} that allows for the destination
 * of the notifications to be dynamically changed.
 *
 * @author lopeznr1
 */


/**
 * Class that provides a collection of utility methods associated with
 * serializations associated with {@link Renderer}s.
 * <P>
 * The class contains methods that originated from the Renderer class.
 *
 * @author lopeznr1
 */


/*
	 * private void redrawAxes() { vtkTransform transform=new vtkTransform();
	 * transform.DeepCopy(getActiveCamera().GetModelViewTransformObject());
	 * transform.Inverse(); transform.Update();
	 *
	 * axes.getActor().SetOrientation(transform.GetOrientation()); double
	 * axesViewSize=0.25; double axesViewX=-0.75; double axesViewY=-0.75; double
	 * fovRad=Math.toRadians(getActiveCamera().GetViewAngle()); double
	 * axesWorldSize=1; double tanFovHf=Math.tan(fovRad/2.); double
	 * L=axesWorldSize/axesViewSize/tanFovHf;
	 *
	 * Vector3D campos=new Vector3D(getActiveCamera().GetPosition()); Vector3D
	 * right,up,look; try { right=viewCamera.getRightUnit();
	 * up=viewCamera.getUpUnit(); look=viewCamera.getLookUnit(); } catch
	 * (MathArithmeticException e) { return; } double W=2*L*tanFovHf; Vector3D
	 * lambdaVec=right.scalarMultiply(W/2.*axesViewX).add(up.scalarMultiply(W/2.
	 * *axesViewY)).add(look.scalarMultiply(L)); Vector3D
	 * origin=campos.add(lambdaVec); axes.getActor().SetPosition(origin.toArray());
	 *
	 * Vector3D xunit=new
	 * Vector3D(transform.TransformPoint(origin.add(Vector3D.PLUS_I).toArray())) ;
	 * Vector3D yunit=new
	 * Vector3D(transform.TransformPoint(origin.add(Vector3D.PLUS_J).toArray())) ;
	 * Vector3D zunit=new
	 * Vector3D(transform.TransformPoint(origin.add(Vector3D.PLUS_K).toArray())) ;
	 * vtkCoordinate coordTransform=new vtkCoordinate();
	 * coordTransform.SetCoordinateSystemToWorld();
	 * coordTransform.SetValue(xunit.toArray()); double[]
	 * xpos=coordTransform.GetComputedDoubleViewportValue(getRenderer());
	 * coordTransform.SetValue(yunit.toArray()); double[]
	 * ypos=coordTransform.GetComputedDoubleViewportValue(getRenderer());
	 * coordTransform.SetValue(zunit.toArray()); double[]
	 * zpos=coordTransform.GetComputedDoubleViewportValue(getRenderer()); double
	 * whf=getRenderWindow().GetSize()[0]/2; double
	 * hhf=getRenderWindow().GetSize()[1]/2;
	 * coordTransform.SetValue(Vector3D.ZERO.toArray()); double[]
	 * opos=coordTransform.GetComputedDoubleViewportValue(getRenderer()); //
	 * axes.getLabelActorX().SetPosition(xpos[0]-whf,xpos[1]-hhf); //
	 * axes.getLabelActorY().SetPosition(ypos[0]-whf,ypos[1]-hhf); //
	 * axes.getLabelActorZ().SetPosition(zpos[0]-whf,zpos[1]-hhf);
	 * axes.getLabelActorX().SetPosition(xpos[0]-opos[0],xpos[1]-opos[1]);
	 * axes.getLabelActorY().SetPosition(ypos[0]-opos[0],ypos[1]-opos[1]);
	 * axes.getLabelActorZ().SetPosition(zpos[0]-opos[0],zpos[1]-opos[1]);
	 *
	 *
	 * getActiveCamera().RemoveObserver(cameraObserver);
	 * propRenderer.ResetCameraClippingRange(); double[]
	 * propRange=propRenderer.GetActiveCamera().GetClippingRange();
	 * axesRenderer.ResetCameraClippingRange(); double[]
	 * axesRange=axesRenderer.GetActiveCamera().GetClippingRange();
	 * getActiveCamera().SetClippingRange(Math.min(propRange[0],
	 * axesRange[0]),Math.max(propRange[1], axesRange[1]));
	 * cameraObserver=getActiveCamera().AddObserver("ModifiedEvent", this,
	 * "redrawAxes"); }
	 */


/**
 * Implementation of {@link SceneChangeNotifier} that silently ignores all
 * notifications.
 * <P>
 * Singleton instance is acquired via: {@link QuietSceneChangeNotifier#Instance}
 *
 * @author lopeznr1
 */


/**
 * {@link AbstractAction} that provides the logic for the configure pick
 * tolerance action.
 */


/**
 * UI panel that allows the user to configure the coloring range associated with
 * the primary model (priModel). The secondary model (secModel) will be updated
 * to reflect the coloring range of the priModel only if the boolean syncModels
 * is set to true.
 * <P>
 * It is the responsibility of any developer of this dialog ensure that the
 * method {@link #setModelConfiguration} is called with the appropriate
 * arguments. Failure to do so will result in NPEs.
 */


/**
 * {@link TableCellEditor} used to edit colors for a table cell where the data
 * model is a {@link Color}. It will be activated only if one item is selected.
 * <P>
 * This editor, when activated will present a popup color chooser dialog.
 *
 * @author lopeznr1
 */


/**
 * {@link TableCellRenderer} used to display a filled color rectangle for a
 * table cell where the data model is a {@link Color}
 */


/**
 * {@link TableCellRenderer} used to display the source.
 * <P>
 * If the source is a file, then the file name will be displayed while the tool
 * tip will reveal the parent folder.
 *
 * @author lopeznr1
 */


/**
 * This class provides the traditional mechanism for registering a
 * {@link PopupMenu} with the PopupManager. It provides the mechanism for
 * registering a {@link PopupMenu} with a {@link Model}.
 * <P>
 * This class has been retrofitted to be decoupled from the {@link PickManager}.
 *
 * @author lopeznr1
 */


/**
 * Immutable object that defines a lighting configuration.
 *

 * The following attributes are supported:
 *

 *
{@link LightingType}
 *
Position of light in {@link LatLon} (radians)
 *
Intensity (percent)
 *

 *
 * @author lopeznr1
 */


/**
 * Collection of utility methods associated with handling the configuration of
 * light (source) as used in SBMT.
 *
 * @author lopeznr1
 */


/**
 * {@link AbstractAction} that contains the logic for the "Lighting
 * Configuration" action.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows the user to configure a {@link LightCfg}.
 *
 * @author lopeznr1
 */


/**
 * UI panel that provides the functionality for lighting (configuration) of the
 * {@link Renderer}.
 *
 * @author lopeznr1
 */


/**
 * Painter used to track the status of the (instantaneous) {@link LodMode}.
 *
 * @author lopeznr1
 */


/**
 * Collection of utility methods associated with LOD configuration and
 * utilization.
 * <P>
 * The basis for the logic of the create*() methods originated from the
 * edu.jhuapl.saavtk.util.SaavtkLODActor class. That class was overloaded and
 * has been refactored - thus core generation of decimated
 * {@link vtkPolyDataMapper} logic is here.
 *
 * @author lopeznr1
 */


/**
 * {@link LodActor} which is utilized to track the "instantaneous"
 * {@link LodMode}.
 * <P>
 * The instantaneous LodMode should typically not be utilized by non-actor code.
 * This actor allows the UI to be updated with the actual instantaneous LodMode
 * to allow informative UI updates.
 *
 * @author lopeznr1
 */


/**
 * {@link vtkActor} which implements the {@link LodActor} interface and the
 * {@link AssocActor} interface. This vtkActor allows a mapping of
 * {@link vtkMapper}s to be associated with each {@link LodMode} which provides
 * a flexible and robust support of LOD (level of detail).
 *

 * Do not call the method {@link #SetMapper} but rather utilize the
 * methods {@link #setDefaultMapper} or {@link #setLodMapper}. Calling this
 * method will result in a {@link RuntimeException}. This class will internally
 * manage the installed {@link vtkMapper}s.
 *
 * @author lopeznr1
 */


/**
 * {@link AbstractAction} that contains the logic for the 'Configure LOD' menu.
 *
 * @author lopeznr1
 */


/**
 * ListCellRenderer used to render custom labels corresponding to
 * {@link LodMode}.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows the user to configure the {@link LodMode} for the specified
 * {@link Renderer}.
 *
 * @author lopeznr1
 */


/**
 * UI panel for specifying the rendering configuration associated with a
 * {@link PolyhedralModel}.
 *
 * @author lopeznr1
 */


/**
 * Collection of utility methods used to access configuration associated with
 * the main application window.
 *
 * @author lopeznr1
 */


/**
 * Invalid FeatrueAttr useful as a test harness / place holder.
 *
 * @author lopeznr1
 */


/**
 * Immutable implementation of FeatureAttr that is backed by a vtkDoubleArray.
 * <P>
 * It is imperative that there are no outside references to the provided
 * vtkDoubleArray in order to enforce the immutablity of this object.
 *
 * @author lopeznr1
 */


/**
 * Immutable class that defines a single feature property.
 * <P>
 * A FeatureType typically refers to a physical quality attribute.
 *
 * @author lopeznr1
 */


/**
 * Immutable implementation of FeatureAttr that is backed by a fixed double
 * array.
 *
 * @author lopeznr1
 */


/**
 * Immutable implementation of FeatureAttr that always returns the same value.
 *
 * @author lopeznr1
 */


/**
 * Class used to collect values associated with a specific Feature.
 * <P>
 * This class is mutable and should only be used during "construction" time of
 * FeatureAttr.
 *
 * @author lopeznr1
 */


/**
 * Painter used to render a scale bar onto a vtk scene.
 * <P>
 * This painter will register as a {@link ViewActionListener} to provide
 * automatic updates.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows for configuration of a {@link ScaleBarPainter}.
 *
 * @author lopeznr1
 */


/**
 * {@link AbstractAction} that contains the logic for the 'Config Scale Bar'
 * menu.
 *
 * @author lopeznr1
 */


/**
 * This is an all static method class for managing a global/static map of (@link
 * Colormap} objects, keyed on their names as Strings. The overall philosophy of
 * this class is for public methods never to return null or throw exceptions for
 * any input, so that the caller may trust that the returned color map
 * objects/names may safely be used.
 *
 * This class is not thread-safe.
 */


/**
 * Collection of utilities useful for working with Colormaps.
 */


/**
	 * Class that provides the (original) custom fancy Renderer for the Colormap ComboBox.
	 */


/**
 * Vtk implementation of the {@link Camera} interface.
 * <P>
 * The installed {@link CoordinateSystem} defines the camera's frame of
 * reference.
 *
 * @author lopeznr1
 */


/**
 * Invalid Camera useful as a test harness / place holder.
 * <P>
 * Please note that calling any method on this object will result in an
 * {@link UnsupportedOperationException}.
 *
 * @author lopeznr1
 */


/**
 * Immutable class that is used to define a 3D Cartesian coordinate system.
 *

 * The vectors will be normalized and are guaranteed to not be equal to the Zero
 * vector.
 *

 * TODO: Consider checking to make sure they are orthogonal to each other
 */


/**
 * Collection of utility methods useful for working with {@link Camera}s.
 *
 * @author lopeznr1
 */


/**
 * {@link AbstractAction} that contains the logic for the "Config Camera:
 * Quaternion" action.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows the user to configure a {@link View}'s camera via the
 * following parameters:
 *

 *
Camera position (x-position,y-position,z-position)
 *
Camera quaternion (q0, q1, q2, q3)
 *

 *

 * TODO: Currently the camera can not be configured via the quaternion.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows the user to configure a {@link View}'s camera via the
 * following parameters:
 *

 *
Field of view
 *
Camera position (lat,lon,alt,roll)
 *
Target position (lat, lon, line-of-sight)
 *

 *
 * @author lopeznr1
 */


/**
 * {@link AbstractAction} that contains the logic for the "Config Camera:
 * Regular" action.
 *
 * @author lopeznr1
 */


/**
 * This class manages settings concerning server availability, query latency and
 * the number of characters that may be used in a query. This class has the
 * ability to connect to the server and query a access-checking PHP script (if
 * present) to get a hint from the server what settings to use for the next
 * query.
 *

 * If a successful query is made to the access-checking script, the
 * {@link ServerSettingsManager} assumes the server is accessible, and it
 * interprets the values returned from that connection to determine the wait
 * time before another query and the maximum length of the query.
 *

 * If an exception is thrown while trying to query the access-checking script,
 * the {@link ServerSettingsManager} makes educated guesses about the cause and
 * returns heuristically tuned settings.
 *

 * This class is thread-safe.
 *
 * @author James Peachey
 *
 */


/**
     * Immutable class that holds a snapshot of the server connection settings.
     */


/**
 * Front-end to the standard Java {@link Paths} facility that properly
 * interprets input strings that mix separators from different operating systems
 * (OS), i.e., / and \ in the same inputs. In addition to methods with the same
 * signatures as methods in {@link Paths}, some additional similar methods are
 * provided that accept Iterable<String>, and that return Strings rather than
 * paths.
 *

 * It is worth stating explicitly that no path may safely use a separator from
 * another OS as a normal character, e.g., while Unix supports naming a file
 * "bad\idea.txt", this facility would interpret the \ as a separator. This is
 * not a significant limitation for code that is intended to run on multiple OS.
 *

 * Note that this would need to be updated to support an OS that uses some other
 * separator.
 *
 * @author James Peachey
 *
 */


/**
 * Singleton preferences class for managing all preferences
 */


/**
 * A facility for managing server access to URLs online. An instance of this
 * class has a root URL and manages a cache of information about URLs (which may
 * or may not be "under" this root URL's hierarchy). It also provides facilities
 * for locating and downloading URLs to the local file system.
 *
 * @author peachjm1
 *
 */


/**
 * This class contains miscellaneous geometry functions. Many of these functions
 * are from the SPICE toolkit that have been ported to Java.
 */


/**
 * Collect and store essential properties associated with a remote resource.
 * These properties are useful for determining whether it is necessary and/or
 * possible to download a remote file, or to determine the size of the file.
 */


/**
 * Utility that uses {@link Debug} to handle different types of messages. This
 * class is public because file cache code is contained in multiple packages.
 * However, this code is intended for use only by file-cache related utilities.
 *
 * @author James Peachey
 *
 */


/**
 * Immutable class that encapsulates a snapshot of the state of a resource
 * located by a {@link URL} at a particular moment.
 *
 * @author James Peachey
 *
 */


/**
 * Collect and store essential properties associated with a local file resource.
 * These properties are useful for determining whether it is necessary and/or
 * possible to download a remote file, or to determine the size of the file.
 */


/**
     * Immutable class that encapsulates a snapshot of the state of a {@link File}
     * on the local file system at a particular moment.
     *
     * @author James Peachey
     *
     */


/**
 * Immutable class used to render an icon with a solid color and draw a thin
 * border.
 */


/**
 * Utility class for initializing native libraries, either all the libraries or
 * just the ones that are usable in "headless" mode.
 */


/**
 * Immutable object used to store a position specified as latitude, longitude,
 * and radius.
 * <p>
 * Note it is unspecified whether lat and lon are in degrees or radians.
 */


/**
 * Static class containing general settings needed by any application.
 */


/**
 * Simple class to time the execution of arbitrary sections of code, possibly
 * factored into any number of classes/methods. Can work for multiple threads
 * and/or multiple runs of an application. The class itself is safe to access
 * from multiple threads, but generally it would be most useful to have distinct
 * {@link Profiler} instances for each thread.
 * <p>
 * In addition to support for timing an individual run of profiling code, the
 * class features a means to summarize the results of an arbitrary number of
 * runs.
 *
 * @author James Peachey
 *
 */


/**
 * Facility for wetting up user-name/password-based authentication using
 * {@link Authenticator}. It also includes support for storing/loading
 * credentials to/from a file.
 *
 * @author James Peachey
 *
 */


/**
 * This class is used to subdivide the bounding box of a shape model
 * into a contiguous grid of 3D cubes.
 */


/**
 * Debug messaging utility. Provides methods to retrieve debugging output and
 * error streams, which are either the corresponding {@link System} output/error
 * streams (if debugging is enabled) or a null output stream that ignores what
 * is sent to it (if debugging is disabled).
 *

 * Developers can dynamically control debug messages at a global or local level
 * using this class's static methods. However, individual instances of this
 * class are completely immutable. This is to make it less confusing to use this
 * facility in a multi-threading environment. For information on how to control
 * debugging at runtime, see the method descriptions.
 *

 * This class itself is thread safe.
 */


/**
 * Utility to manage downloads from a resource located by a {@link URL} that is
 * associated with a local {@link File}.
 *
 * @author James Peachey
 *
 */


/**
 * This class contains various utility functions for operating on a vtkPolyData.
 */


/**
 * Immutable class that combines a {@link UrlState} and {@link FileState} to
 * represent the state of a resource located via a {@link URL} and downloadable
 * to a {@link File} on the local file system.
 *
 * @author James Peachey
 *
 */


// Implementation of a map that's always backed up to a file on disk.


/**
 * This class is really still under construction. It doesn't work yet to load
 * a plate coloring from a VTK file. Problems are described inline below.
 *
 * @author James Peachey
 *
 */


/**
 * A basic abstract implementation of {@link IndexableTuple} that leaves
 * abstract the way that values are retrieved. Extend this to adapt any type of
 * double-indexed collection of doubles (double[][], List<List<Double>> etc. to
 * the {@link IndexableTuple} interface.
 *
 * @author James Peachey
 */


/**
     * A basic abstract implementation of {@link Tuple} that leaves abstract the way
     * that values are retrieved. Intended to collaborate with its parent
     * {@link BasicIndexableTuple} implementation.
     */


/**
 * Factory that adapts input collection-or-array-type objects to provide
 * implmentations of {@link IndexableTuple}. This class has several method
 * overrides for creating {@link IndexableTuple} objects conveniently with or
 * without a set of explicit names/units for the fields encapsulated by the
 * {@link Tuple}s.
 *
 * @author James Peachey
 */


/**
     * Extension of {@link BasicIndexableTuple} that uses {@link StandardTuple} in
     * the base implementation.
     */


/**
         * Extension of {@link BasicTuple} that uses {@link FunctionalLookup} to provide
         * values for its {@link Tuple}s.
         */


/**
 * Class representing information about a data file as a collection of data
 * information objects (images and/or tables).
 */


/**
 * Class that provides information about one data object (image or table) within
 * a data file.
 */


/**
	 * Textual metadata that describes the data object, for example key-value pairs,
	 * represented as a row-oriented table.
	 */


/**
	 * One row of descriptive information in the data object metadata, e.g., a
	 * single key-value pair. The definition of the row titles is contained in the
	 * info table that contains this row.
	 *
	 * Note that this represents only descriptive information, not rows of data from
	 * a table or pixels from an image.
	 */


/**
 * Table-specific data object information. In addition to the normal textual
 * metadata inherited from the base class, this class has methods to get
 * information about the table contained in the data object.
 *
 */


/**
	 * Information about a column in this table data object.
	 */


/**
	 * This exception indicates an attempt to by a subclass to read a file of the
	 * wrong format, e.g., if a FITS reader attempts to read a CSV file.
	 */


/**
	 * This exception indicates a problem with the format of the file being read,
	 * e.g., inconsistent numbers of columns in a table.
	 */


/*
 * Reader for CSV files. Current format for accepted files is:
 *
 *          [ name-0 ], [ name-1 ], ...
 *          [ units-0 ], [ units-1 ], ...
 *          value-0, value-1, ...
 *
 * where the "name" and "units" lines are optional.
 *
 * Proposed more general format (not yet implemented) for accepted files is:
 *
 * Header - (optional) metadata. If present, it may have any number of lines,
 *          but it must have the form:
 *
 *          <CSV>, first-line-content, second-line-content ...
 *          first-line-value-0, first-line-value-1, ...
 *          second-line-value-0, second-line-value-1, ...
 *          ...
 *
 *          The header is comma-delimited. All the lines except the first must have the
 *          same number of fields as the Data block (see below). The first line (including
 *          the <CSV>) must have M+1 fields, where M is the number of lines of *metadata*.
 *
 * Data -   1 or more rows of comma-separated values. Leading and trailing whitespace is ignored
 *          for each value. Double quotes are optional, but may be used to include commas or
 *          whitespace within a value. Each row in the data block must have the same
 *          number of fields (commas). Individual blank fields are acceptable and are
 *          interpreted as null strings. Note however, that null may not be an acceptable
 *          value for all contexts.
 *
 *          Example showing header and data:
 *
 *          # This example shows how to give the name and units of each column in the header.
 *          <CSV>, Name, Units
 *          File, X, Y, Z, P, Q
 *                   ,  deg,  deg,  deg,     ,   kg-m/s^2
 *          file1.txt,   3.,   4.,   5.,  17.,   42.
 *          file2.pdf,  -4.,  -2.,    7,  14.,   9.8e1
 *
 *          # This example shows how one would use a CSV file for imagefile/sumfile correspondence.
 *          <CSV>, title
 *          Image file, sum file
 *          file1.fits, file1.sum
 *          ...
 *
 * Any line anywhere that begins with whitespace followed by a # is a comment and is ignored.
 * Blank lines are also ignored.
 *
 */


/**
 * Collection of VTK based draw routines associated with the generation of
 * grids.
 * <p>
 * Currently the only supported grid is that of a LatLon grid.
 *
 * @author lopeznr1
 */


/**
 * Painter used to render a LatLon grid into a VTK scene.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows a user to configure a {@link GridAttr}.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows a user to configure a {@link LatLonSpacing}.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows the user to configure the display aspects of a
 * {@link CoordinatePainter}
 *
 * @author lopeznr1
 */


/**
 * This class contains the "main" function called at the start of the program.
 * This class sets up the top level window and other initialization.
 * The main function may take one optional argument. If there are no
 * arguments specified, then the tool starts up as usual showing a generic shape
 * by default. If one argument is specified, it is assumed to be a path
 * to a temporary shape model which is then loaded as a custom view
 * though it is not retained the next time the tool starts.
 */


/**
 * This class contains the "main" function called at the start of the program.
 * This class sets up the top level window and instantiates all the "managers" used
 * through out the program.
 */


/**
 * GroupColorProvider that will provide a ColorProvider corresponding to an
 * items index. Returned ColorProviders are selected via the relative position
 * of the item and that of a color wheel.
 * <P>
 * Since this class has no state data, the only access provided is via a
 * singleton constant.
 *
 * @author lopeznr1
 */


/**
 * GroupColorProvider that will provide a group of random ColorProviders for the
 * specified seed.
 * <P>
 * Note that same ColorProvider will be returned for a specifiec seed and a
 * specific index.
 *
 * @author lopeznr1
 */


/**
 * ColorProvider where the returned color will be a function of the specified
 * value and the baseline color.
 *
 * @author lopeznr1
 */


/**
 * ColorProvider where there is no variation based on intensity. All values will
 * be mapped to the same color.
 *
 * @author lopeznr1
 */


/**
 * Singleton instance of a {@link ColorProvider} that defines the invalid
 * {@link ColorProvider}.
 *
 * @author lopeznr1
 */


/**
 * ColorProvider where the returned color will be a function of the specified
 * value and the reference {@link ColorMapAttr}.
 * <P>
 * A reference {@link FeatureType} is defined but is not used in actual color
 * computations. The FeatureType serves as a reference to the feature being
 * colored.
 *
 * @author lopeznr1
 */


/**
 * Immutable class that provides a GroupColorProvider which always returns the
 * same ColorProvider for all items.
 *
 * @author lopeznr1
 */


/**
 * Implementation of {@link ListCellRenderer} used to render a
 * {@link ColorTable}.
 * <P>
 * This renderer will show the color table (as an iconic representation).
 *
 * @author lopeznr1
 */


/**
 * {@link EditGroupColorPanel} that provides simplistic color configuration of
 * data.
 *

 * The configuration options are:
 *

 *
A single color for all data.
 *

 *
 * @author lopeznr1
 */


/**
 * {@link TableCellEditor} used to edit colors for a table cell where the data
 * model is a {@link ColorProvider}. It will be activated only if one item is
 * selected.
 * <p>
 * This editor, when activated will present a popup color chooser dialog.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows the user to configure the display aspects of a
 * {@link ColorBarPainter}
 *
 * @author lopeznr1
 */


/**
 * UI that allows the user to select a color bar and specify the range of values
 * associated with the color bar.
 * <p>
 * Usage of this UI component requires the manual addition of various
 * {@link FeatureType}s. The {@link FeatureType#Invalid} is used to designate an
 * invalid or no choice selection. When this FeatureType is selected relevant UI
 * components will be disabled.
 *
 * @author lopeznr1
 */


/**
 * {@link EditGroupColorPanel} that provides the AutoHue color panel. There are
 * no configuration options.
 *
 * @author lopeznr1
 */


/**
 * {@link EditGroupColorPanel} that provides color configuration based on a
 * "random" seed.
 *

 * The configuration options are:
 *

 *
A seed (integer) which will seed the random function.
 *

 *
 * @author lopeznr1
 */


/**
 * Class that used to display a filled color rectangle for a table cell where
 * the data model is a {@link ColorProvider}.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows a user to configure "details" of a {@link ColorBarPainter}.
 *
 * @author lopeznr1
 */


/**
 * Panel that allows a user to configure a {@link BackgroundAttr}.
 *
 * @author lopeznr1
 */


/**
 * Immutable class that defines the attributes associated with the layout of a
 * {@link ColorBarPainter} configuration.
 *
 * @author lopeznr1
 */


/**
 * Immutable class that defines the attributes associated with the background of
 * a {@link ColorBarPainter} configuration.
 *
 * @author lopeznr1
 */


/**
 * Painter used to render a color bar into a VTK scene.
 *
 * @author lopeznr1
 */


/**
 * Collection of utility methods associated with drawing different components of
 * a {@link ColorBarPainter}. The draw routines will draw the components to a
 * "normalized" coordinate system. The normalized coordinate system will
 * <B>assume</B> the color bar is located at the origin (0, 0).
 *
 * @author lopeznr1
 */


/**
 * Collection of utility methods associated with accessing serialized
 * {@link ColorTable}s.
 *
 * @author lopeznr1
 */


/**
 * Immutable class that defines a color table (which is used for mapping
 * floating values to a color).
 *

 * A color table has the following attributes:
 *

 *
Name of the color table
 *
List of values used for interpolation
 *
List of colors corresponding to the color values
 *
The color to use for values of NaN
 *
{@link ColorSpace} for which the table mapping should occur under
 *

 *
 * @author lopeznr1
 */


/**
 * Collection of utility methods for working with {@link ColorTable}s.
 *

 * The following functionality is supported:
 *

 *
Support for a getting and setting the available system
 * {@link ColorTable}s.
 *
Support for a getting and setting the default system {@link ColorTable}s.
 *
Creation of an icon representing a {@link ColorMapAttr} /
 * {@link ColorTable}
 *
Updating a {@link vtkLookupTable} to reflect a {@link ColorMapAttr}
 *

 *
 * @author lopeznr1
 */


/**
 * Immutable class that defines the attributes associated with a
 * {@link ColorTable}.
 *

 * A color map is defined by the following:
 *

 *
Reference {@link ColorTable}
 *
Minimum value that is mapped to the color table
 *
Maximum value that is mapped to the color table
 *
Number of distinct color levels
 *
Flag that defines if a log scale will be used for color mapping
 *

 *
 * @author lopeznr1
 */


/**
 * 2018-04-24. This package was part of the initial "save state" effort (redmine
 * 1206). This package was a partly-successful attempt to keep track of the full
 * type of generics despite type erasure, similar to Guava/Gson's TypeToken
 * classes. It worked fine and was even better in some ways because it allowed
 * one to reconstruct a complicated object piece-by-piece, but was too clunky to
 * be practical.
 *
 * Leaving it in the project for the time being in case we need it after all or
 * want to refer to it in the near future, but marking it deprecated, not so
 * much because of its flaws but to prevent its accidental use.
 *
 * After a suitable time, if no use presents itself, it would be safe to remove
 * this whole package.
 */


/**
 * A Config is a class for storing models should be instantiated together for a
 * specific tool. Should be subclassed for each tool application instance. This
 * class is also used when creating (to know which tabs to create).
 */


/**
 * A key for accessing objects of a specific type in a map or configuration.
 * Instances may be used as if they were enumerated constants, but without
 * the need to limit values to a fixed set at compile-time. Since hashCode
 * and equals just call the superclass (Object) implementation, and thus
 * equals behaves as ==, instances should be declared as static final.
 *
 * @author peachjm1
 *
 * @param <ValueType> the type of value that may be retrieved with this Key.
 * Note that, while this parameter is not actually referenced in Key,
 * it is essential so that Keys identify the type of object they may access.
 */


/**
 * Extensible utility class that provides an immutable map-type lookup of values by key,
 * but also provides an ordered list of keys in the map.
 *
 * @author peachjm1
 *
 * @param <K> the type of the key used to get values from the map
 * @param <V> the type of value stored in the map
 */


/**
 * Cumulus task for performing footprint operation on a granule.
 */


/**
 * A simple command-line interface for the Footprinter class.
 */


/**
 * Class used for footprinting a granule.
 */


/**
 * Java class that maps to the PO.DAAC JSON dataset config 'footprint' field.
 */


/**
 * Java class that maps to the PO.DAAC JSON dataset config.
 */


/**
 * Footprint strategy to be used by the {@link gov.nasa.podaac.forge.Footprinter} which specifies how the footprint
 * is generated.
 * <p>
 * In this case, split on the -180:180 transition (with a bit of a fudge factor of .2)
 */


/**
 * Footprint strategy to be used by the {@link gov.nasa.podaac.forge.Footprinter} which specifies how the footprint
 * is generated. This strategy shares many common features with {@link FootprintStrategyPeriodic},
 * so it extends that class.
 */


/**
 * Footprint strategy to be used by the {@link gov.nasa.podaac.forge.Footprinter} which specifies how the footprint
 * is generated.
 */


/**
 * Harvest job message sent to RabbitMQ.
 * @author karpenko
 *
 */


/**
 * Manager message sent to RabbitMQ
 * @author karpenko
 *
 */


/**
 * A message to crawl a directory.
 * @author karpenko
 */


/**
 * A message to harvest a batch of product files
 * @author karpenko
 */


/**
 * A message to harvest collection inventory
 * @author karpenko
 */


/**
 * Utility class to work with Jar manifest files.
 *
 * @author karpenko
 */


/**
 * Helper methods to work with exceptions.
 *
 * @author karpenko
 */


/**
 * This class is used to store key, value pairs.
 *
 * @author karpenko
 */


/**
 * Utility class to read java properties files.
 *
 * @author karpenko
 */


/**
 * Helper methods to work with product IDs (LIDs and LIDVIDs).
 *
 * @author karpenko
 */


/**
 * Implementation of FieldMap interface which stores values in a set.
 * Order and number of values in PDS label XML are not preserved.
 * Only unique values are stored. Values are sorted alphabetically (as a string).
 *
 * @author karpenko
 */


/**
 * Utility class to close resources without throwing exceptions.
 *
 * @author karpenko
 */


/**
 * Implementation of FieldMap interface which stores values in a list.
 * It preserves order and number of values in PDS label XML.
 *
 * @author karpenko
 */


/**
 * Utility class to write NJSON (new-line delimited JSON) documents.
 *
 * @author karpenko
 *
 */


/**
 * Utility class to build NJson strings
 * @author karpenko
 */


/**
 * Base abstract class to write data records to a new-line-delimited JSON (NJSON) file.
 * NJSON file has 2 lines per data record: 1 - primary key, 2 - data record.
 * This is the file format used by Elasticsearch bulk load API.
 *
 * @author karpenko
 *
 * @param <Record> A data record to write.
 */


/**
 * File downloader with retry logic.
 * By default, SSL certificate and host verification is disabled for HTTPS
 * connections to support self-signed certificates. This can be turned off.
 *
 * @author karpenko
 */


/**
 * Interface to write product references extracted from PDS4 collection inventory files.
 *
 * @author karpenko
 */


/**
 * A class to write metadata extracted from PDS4 label.
 *
 * @author karpenko
 */


/**
 * A batch of product references
 *
 * @author karpenko
 */


/**
 * Utility methods to extract namespace information from XMLs.
 * @author karpenko
 */


/**
 * Mappings between LDD names (xmlns prefix), xmlns URIs and schema locations.
 * @author karpenko
 */


/**
 * Utility class to work with XML DOM model.
 * NOTE: Don't use XML DOM API for big files.
 * DOM API loads the whole XML file into memory.
 *
 * @author karpenko
 *
 */


/**
 * Utility class to work with XPath API.
 *
 * @author karpenko
 */


/**
 * Parse dates in PDS format
 * @author karpenko
 */


/**
 * Utility class to convert dates from different PDS formats
 * to "ISO instant" format.
 *
 * @author karpenko
 */


/**
 * Extract basic metadata, such as LID, VID, title from a PDS label.
 * @author karpenko
 */


/**
 * Normalizes (converts) date and boolean values into formats acceptable
 * by Elasticsearch (registry).
 * @author karpenko
 */


/**
 * A class to read records from collection inventory files in batches.
 *
 * @author karpenko
 */


/**
 * A cache of field names in Elasticsearch schema for the registry index.
 * @author karpenko
 */


/**
 * Extracts file metadata, such as file name, size, checksum.
 * @author karpenko
 */


/**
 * Metadata extracted from PDS label.
 *
 * @author karpenko
 */


/**
 * Extracts internal references
 * @author karpenko
 */


/**
 * Extracts collection metadata
 * @author karpenko
 */


/**
 * Extract metadata from a PDS bundle
 * @author karpenko
 */


/**
     * Inner class to store bundle member (collection) information.
     * @author karpenko
     */


/**
 * Extract metadata used by keyword / full-text search
 * @author karpenko
 */


/**
 * Generates key-value pairs for all fields in a PDS label.
 * @author karpenko
 */


/**
 * A rule to build external file reference
 * @author karpenko
 */


/**
 * Registry (Elasticsearch) configuration
 * @author karpenko
 */


/**
 * Product data access object.
 * Provides methods to query Elasticsearch for product information.
 * @author karpenko
 */


/**
 * Methods to build JSON requests for Elasticsearch APIs.
 * @author karpenko
 */


/**
 * Loads data from an NJSON (new-line-delimited JSON) file into Elasticsearch.
 * NJSON file has 2 lines per record: 1 - primary key, 2 - data record.
 * This is the standard file format used by Elasticsearch bulk load API.
 * Data are loaded in batches.
 *
 * @author karpenko
 */


/**
 * Parse response of an aggregation query to get latest LIDVIDs for a list of LIDs
 * @author karpenko
 */


/**
 * Common methods used by DAOs
 * @author karpenko
 */


/**
 * Parses JSON response from Elasticsearch bulk API and logs errors.
 * @author karpenko
 */


/**
 * Builds Elasticsearch JSON queries
 * @author karpenko
 */


/**
 * Elasticsearch schema DAO (Data Access Object).
 * This class provides methods to read and update Elasticsearch schema.
 *
 * @author karpenko
 */


/**
 * Parse Elasticsearch response from "/indexName/_mappings" API
 * to extract field names.
 *
 * @author karpenko
 */


/**
 *  Throw this exception when the data type for a new registry field
 *  is not found in the data dictionary and Elasticsearch schema
 *  could not be updated.
 *
 * @author karpenko
 */


/**
 * Data dictionary DAO (Data Access Object).
 * This class provides methods to read and update data dictionary.
 * @author karpenko
 */


/**
     * Inner private class to parse LDD information response from Elasticsearch.
     * @author karpenko
     */


/**
 *  This class is used by SchemaDao to parse response from Elasticsearch
 *  data dictionary query to get data types for a list of field ids.
 *
 * @author karpenko
 */


/**
     * Inner class to store one response record.
     * @author karpenko
     */


/**
 * information about LDDs stored in Elasticsearch
 * @author karpenko
 */


/**
 * LDD information
 * @author karpenko
 */


/**
 *
Process inventory files of "Product_Collection" products (PDS4 label files)
 *
 *
Parse collection inventory file, e.g., "document_collection_inventory.csv",
 * extract primary and secondary references (lidvids) and write extracted data
 * into a JSON or XML file. JSON files can be imported into Elasticsearch by
 * Registry Manager tool.
 *
 *
This class also uses "RefsCache" singleton to cache product ids (lidvids).
 *
 * @author karpenko
 */


/**
 * Processes manager commands, such as SET_ARCHIVE_STATUS
 * @author karpenko
 */


/**
 * Process fields present in PDS4 label, but missing from Elasticsearch "registry" index.
 * @author karpenko
 */


/**
 * Update Elasticsearch schema and LDDs
 * @author karpenko
 */