head	8.7;
access;
symbols;
locks; strict;
comment	@ * @;


8.7
date	2026.05.11.12.01.10;	author mcalabre;	state Exp;
branches;
next	8.6;

8.6
date	2026.03.29.13.53.56;	author mcalabre;	state Exp;
branches
	8.6.1.1;
next	8.5;

8.5
date	2025.12.06.13.47.41;	author mcalabre;	state Exp;
branches
	8.5.1.1;
next	8.4;

8.4
date	2024.10.28.13.56.16;	author mcalabre;	state Exp;
branches
	8.4.1.1;
next	8.3;

8.3
date	2024.05.13.16.33.00;	author mcalabre;	state Exp;
branches
	8.3.1.1;
next	8.2;

8.2
date	2023.11.16.10.00.29;	author mcalabre;	state Exp;
branches
	8.2.1.1;
next	8.1;

8.1
date	2023.07.05.17.12.07;	author mcalabre;	state Exp;
branches
	8.1.1.1;
next	8.0;

8.0
date	2023.07.01.06.15.04;	author mcalabre;	state Exp;
branches
	8.0.1.1;
next	7.13;

7.13
date	2022.10.07.03.43.35;	author mcalabre;	state Exp;
branches
	7.13.1.1;
next	7.12;

7.12
date	2022.09.09.04.57.58;	author mcalabre;	state Exp;
branches
	7.12.1.1;
next	7.11;

7.11
date	2022.04.26.06.13.52;	author mcalabre;	state Exp;
branches
	7.11.1.1;
next	7.10;

7.10
date	2022.04.23.14.25.15;	author mcalabre;	state Exp;
branches
	7.10.1.1;
next	7.9;

7.9
date	2022.03.25.15.14.48;	author mcalabre;	state Exp;
branches
	7.9.1.1;
next	7.8;

7.8
date	2022.03.25.06.11.49;	author mcalabre;	state Exp;
branches
	7.8.1.1;
next	7.7;

7.7
date	2021.07.12.06.36.49;	author mcalabre;	state Exp;
branches
	7.7.1.1;
next	7.6;

7.6
date	2021.04.13.12.57.01;	author mcalabre;	state Exp;
branches
	7.6.1.1;
next	7.5;

7.5
date	2021.03.20.05.54.58;	author mcalabre;	state Exp;
branches
	7.5.1.1;
next	7.4;

7.4
date	2021.01.31.02.24.51;	author mcalabre;	state Exp;
branches
	7.4.1.1;
next	7.3;

7.3
date	2020.06.03.03.37.02;	author mcalabre;	state Exp;
branches
	7.3.1.1;
next	7.2;

7.2
date	2020.03.09.07.31.23;	author mcalabre;	state Exp;
branches
	7.2.1.1;
next	7.1;

7.1
date	2019.12.31.13.25.19;	author mcalabre;	state Exp;
branches
	7.1.1.1;
next	6.4;

6.4
date	2019.08.15.09.30.18;	author mcalabre;	state Exp;
branches
	6.4.1.1;
next	6.3;

6.3
date	2019.07.12.07.33.39;	author mcalabre;	state Exp;
branches
	6.3.1.1;
next	6.2;

6.2
date	2018.10.20.10.03.13;	author mcalabre;	state Exp;
branches
	6.2.1.1;
next	6.1;

6.1
date	2018.10.19.08.35.17;	author mcalabre;	state Exp;
branches
	6.1.1.1;
next	5.20;

5.20
date	2018.10.05.05.32.41;	author mcalabre;	state Exp;
branches
	5.20.1.1;
next	5.19;

5.19
date	2018.07.26.15.37.04;	author mcalabre;	state Exp;
branches
	5.19.1.1;
next	5.18;

5.18
date	2018.01.10.08.32.14;	author mcalabre;	state Exp;
branches
	5.18.1.1;
next	5.17;

5.17
date	2017.09.18.08.44.23;	author mcalabre;	state Exp;
branches
	5.17.1.1;
next	5.16;

5.16
date	2017.01.15.04.25.01;	author mcalabre;	state Exp;
branches
	5.16.1.1;
next	5.15;

5.15
date	2016.04.05.12.55.10;	author mcalabre;	state Exp;
branches
	5.15.1.1;
next	5.14;

5.14
date	2016.02.07.10.49.31;	author mcalabre;	state Exp;
branches
	5.14.1.1;
next	5.13;

5.13
date	2016.01.26.08.51.13;	author mcalabre;	state Exp;
branches
	5.13.1.1;
next	5.12;

5.12
date	2015.11.15.02.13.00;	author mcalabre;	state Exp;
branches
	5.12.1.1;
next	5.11;

5.11
date	2015.10.18.09.13.05;	author mcalabre;	state Exp;
branches
	5.11.1.1;
next	5.10;

5.10
date	2015.10.09.08.19.15;	author mcalabre;	state Exp;
branches
	5.10.1.1;
next	5.9;

5.9
date	2015.07.21.09.20.01;	author mcalabre;	state Exp;
branches
	5.9.1.1;
next	5.8;

5.8
date	2015.07.08.11.03.59;	author mcalabre;	state Exp;
branches
	5.8.1.1;
next	5.7;

5.7
date	2015.06.29.02.44.16;	author mcalabre;	state Exp;
branches
	5.7.1.1;
next	5.6;

5.6
date	2015.06.14.07.11.24;	author mcalabre;	state Exp;
branches
	5.6.1.1;
next	5.5;

5.5
date	2015.05.05.13.16.31;	author mcalabre;	state Exp;
branches
	5.5.1.1;
next	5.4;

5.4
date	2015.04.21.14.41.05;	author mcalabre;	state Exp;
branches
	5.4.1.1;
next	5.3;

5.3
date	2015.04.21.02.50.51;	author mcalabre;	state Exp;
branches
	5.3.1.1;
next	5.2;

5.2
date	2015.04.15.12.35.07;	author mcalabre;	state Exp;
branches
	5.2.1.1;
next	5.1;

5.1
date	2015.04.07.10.56.36;	author mcalabre;	state Exp;
branches
	5.1.1.1;
next	5.0;

5.0
date	2015.04.05.12.24.59;	author mcalabre;	state Exp;
branches
	5.0.1.1;
next	4.25;

4.25
date	2014.12.14.14.29.36;	author mcalabre;	state Exp;
branches
	4.25.1.1;
next	4.24;

4.24
date	2014.09.18.15.25.00;	author mcalabre;	state Exp;
branches
	4.24.1.1;
next	4.23;

4.23
date	2014.05.13.05.50.51;	author mcalabre;	state Exp;
branches
	4.23.1.1;
next	4.22;

4.22
date	2014.04.12.15.03.52;	author mcalabre;	state Exp;
branches
	4.22.1.1;
next	4.21;

4.21
date	2014.03.24.05.12.27;	author mcalabre;	state Exp;
branches
	4.21.1.1;
next	4.20;

4.20
date	2013.12.18.05.42.49;	author mcalabre;	state Exp;
branches
	4.20.1.1;
next	4.19;

4.19
date	2013.09.29.14.17.51;	author mcalabre;	state Exp;
branches
	4.19.1.1;
next	4.18;

4.18
date	2013.07.13.10.00.04;	author mcalabre;	state Exp;
branches
	4.18.1.1;
next	4.17;

4.17
date	2013.01.29.05.29.20;	author cal103;	state Exp;
branches
	4.17.1.1;
next	4.16;

4.16
date	2012.11.07.04.42.44;	author cal103;	state Exp;
branches
	4.16.1.1;
next	4.15;

4.15
date	2012.09.26.14.26.05;	author cal103;	state Exp;
branches
	4.15.1.1;
next	4.14;

4.14
date	2012.07.13.10.02.27;	author cal103;	state Exp;
branches
	4.14.1.1;
next	4.13;

4.13
date	2012.03.14.07.39.30;	author cal103;	state Exp;
branches
	4.13.1.1;
next	4.12;

4.12
date	2012.02.29.07.57.56;	author cal103;	state Exp;
branches
	4.12.1.1;
next	4.11;

4.11
date	2012.02.20.23.30.02;	author cal103;	state Exp;
branches
	4.11.1.1;
next	4.10;

4.10
date	2012.02.05.23.41.44;	author cal103;	state Exp;
branches
	4.10.1.1;
next	4.9;

4.9
date	2012.01.24.05.40.29;	author cal103;	state Exp;
branches
	4.9.1.1;
next	4.8;

4.8
date	2011.08.15.08.05.53;	author cal103;	state Exp;
branches
	4.8.1.1;
next	4.7;

4.7
date	2011.02.07.07.03.42;	author cal103;	state Exp;
branches
	4.7.1.1;
next	4.6;

4.6
date	2010.11.16.06.15.31;	author cal103;	state Exp;
branches
	4.6.1.1;
next	4.5;

4.5
date	2010.07.16.07.01.25;	author cal103;	state Exp;
branches
	4.5.1.1;
next	4.4;

4.4
date	2009.08.06.07.41.33;	author cal103;	state Exp;
branches
	4.4.1.1;
next	4.3;

4.3
date	2007.12.27.05.41.36;	author cal103;	state Exp;
branches
	4.3.1.1;
next	4.2;

4.2
date	2005.09.22.08.53.12;	author cal103;	state Exp;
branches
	4.2.1.1;
next	4.1;

4.1
date	2005.08.28.06.17.40;	author cal103;	state Exp;
branches;
next	4.0;

4.0
date	2005.02.04.05.45.39;	author cal103;	state Exp;
branches;
next	3.6;

3.6
date	2004.08.25.04.21.33;	author cal103;	state Exp;
branches;
next	3.5;

3.5
date	2004.06.28.01.48.38;	author mcalabre;	state Exp;
branches;
next	3.4;

3.4
date	2004.02.11.00.15.03;	author mcalabre;	state Exp;
branches;
next	3.3;

3.3
date	2003.10.21.08.51.00;	author mcalabre;	state Exp;
branches;
next	3.2;

3.2
date	2003.09.09.04.04.04;	author mcalabre;	state Exp;
branches;
next	3.1;

3.1
date	2003.04.28.03.50.41;	author mcalabre;	state Exp;
branches;
next	3.0;

3.0
date	2003.04.01.04.03.42;	author mcalabre;	state Exp;
branches;
next	;

4.2.1.1
date	2005.12.05.02.39.43;	author cal103;	state Exp;
branches;
next	4.2.1.2;

4.2.1.2
date	2006.08.02.00.14.58;	author cal103;	state Exp;
branches;
next	4.2.1.3;

4.2.1.3
date	2007.07.12.08.10.28;	author cal103;	state Exp;
branches;
next	4.2.1.4;

4.2.1.4
date	2007.08.08.08.40.48;	author cal103;	state Exp;
branches;
next	4.2.1.5;

4.2.1.5
date	2007.12.03.05.02.17;	author cal103;	state Exp;
branches;
next	;

4.3.1.1
date	2007.12.27.13.23.47;	author cal103;	state Exp;
branches;
next	4.3.1.2;

4.3.1.2
date	2008.04.02.06.17.13;	author cal103;	state Exp;
branches;
next	4.3.1.3;

4.3.1.3
date	2009.07.22.05.10.07;	author cal103;	state Exp;
branches;
next	;

4.4.1.1
date	2009.08.10.08.52.49;	author cal103;	state Exp;
branches;
next	4.4.1.2;

4.4.1.2
date	2010.01.19.03.42.50;	author cal103;	state Exp;
branches;
next	4.4.1.3;

4.4.1.3
date	2010.07.07.13.21.01;	author cal103;	state Exp;
branches;
next	;

4.5.1.1
date	2010.07.16.07.05.31;	author cal103;	state Exp;
branches;
next	;

4.6.1.1
date	2010.11.16.06.16.19;	author cal103;	state Exp;
branches;
next	4.6.1.2;

4.6.1.2
date	2011.01.14.06.33.16;	author cal103;	state Exp;
branches;
next	;

4.7.1.1
date	2011.02.07.07.04.22;	author cal103;	state Exp;
branches;
next	4.7.1.2;

4.7.1.2
date	2011.07.21.03.43.08;	author cal103;	state Exp;
branches;
next	4.7.1.3;

4.7.1.3
date	2011.08.09.02.43.50;	author cal103;	state Exp;
branches;
next	4.7.1.4;

4.7.1.4
date	2011.08.10.06.52.12;	author cal103;	state Exp;
branches;
next	4.7.1.5;

4.7.1.5
date	2011.08.15.05.54.51;	author cal103;	state Exp;
branches;
next	;

4.8.1.1
date	2011.08.15.08.07.06;	author cal103;	state Exp;
branches;
next	4.8.1.2;

4.8.1.2
date	2012.01.24.05.23.06;	author cal103;	state Exp;
branches;
next	;

4.9.1.1
date	2012.01.24.05.41.45;	author cal103;	state Exp;
branches;
next	4.9.1.2;

4.9.1.2
date	2012.02.02.08.11.36;	author cal103;	state Exp;
branches;
next	;

4.10.1.1
date	2012.02.05.23.42.46;	author cal103;	state Exp;
branches;
next	;

4.11.1.1
date	2012.02.20.23.31.13;	author cal103;	state Exp;
branches;
next	4.11.1.2;

4.11.1.2
date	2012.02.29.07.17.38;	author cal103;	state Exp;
branches;
next	;

4.12.1.1
date	2012.02.29.07.59.10;	author cal103;	state Exp;
branches;
next	;

4.13.1.1
date	2012.03.14.07.40.37;	author cal103;	state Exp;
branches;
next	4.13.1.2;

4.13.1.2
date	2012.07.13.03.34.20;	author cal103;	state Exp;
branches;
next	;

4.14.1.1
date	2012.07.13.10.04.44;	author cal103;	state Exp;
branches;
next	4.14.1.2;

4.14.1.2
date	2012.09.26.07.53.12;	author cal103;	state Exp;
branches;
next	;

4.15.1.1
date	2012.09.26.14.27.51;	author cal103;	state Exp;
branches;
next	;

4.16.1.1
date	2012.11.07.04.45.56;	author cal103;	state Exp;
branches;
next	4.16.1.2;

4.16.1.2
date	2012.11.29.04.40.32;	author cal103;	state Exp;
branches;
next	4.16.1.3;

4.16.1.3
date	2013.01.29.05.09.44;	author cal103;	state Exp;
branches;
next	;

4.17.1.1
date	2013.01.29.05.32.32;	author cal103;	state Exp;
branches;
next	;

4.18.1.1
date	2013.07.13.10.02.37;	author mcalabre;	state Exp;
branches;
next	;

4.19.1.1
date	2013.09.29.14.20.38;	author mcalabre;	state Exp;
branches;
next	;

4.20.1.1
date	2013.12.18.05.46.55;	author mcalabre;	state Exp;
branches;
next	4.20.1.2;

4.20.1.2
date	2014.03.21.06.32.19;	author mcalabre;	state Exp;
branches;
next	;

4.21.1.1
date	2014.03.24.05.15.28;	author mcalabre;	state Exp;
branches;
next	;

4.22.1.1
date	2014.04.12.15.06.32;	author mcalabre;	state Exp;
branches;
next	;

4.23.1.1
date	2014.05.13.05.53.49;	author mcalabre;	state Exp;
branches;
next	;

4.24.1.1
date	2014.09.18.15.28.09;	author mcalabre;	state Exp;
branches;
next	;

4.25.1.1
date	2014.12.14.14.32.45;	author mcalabre;	state Exp;
branches;
next	4.25.1.2;

4.25.1.2
date	2015.01.06.01.01.06;	author mcalabre;	state Exp;
branches;
next	4.25.1.3;

4.25.1.3
date	2015.04.03.01.15.21;	author mcalabre;	state Exp;
branches;
next	4.25.1.4;

4.25.1.4
date	2015.04.03.02.42.22;	author mcalabre;	state Exp;
branches;
next	;

5.0.1.1
date	2015.04.05.12.28.00;	author mcalabre;	state Exp;
branches;
next	;

5.1.1.1
date	2015.04.07.11.01.10;	author mcalabre;	state Exp;
branches;
next	;

5.2.1.1
date	2015.04.15.12.39.14;	author mcalabre;	state Exp;
branches;
next	;

5.3.1.1
date	2015.04.21.02.54.02;	author mcalabre;	state Exp;
branches;
next	;

5.4.1.1
date	2015.04.21.14.44.28;	author mcalabre;	state Exp;
branches;
next	5.4.1.2;

5.4.1.2
date	2015.04.23.11.03.11;	author mcalabre;	state Exp;
branches;
next	;

5.5.1.1
date	2015.05.05.13.21.00;	author mcalabre;	state Exp;
branches;
next	;

5.6.1.1
date	2015.06.14.07.14.44;	author mcalabre;	state Exp;
branches;
next	5.6.1.2;

5.6.1.2
date	2015.06.18.08.12.52;	author mcalabre;	state Exp;
branches;
next	;

5.7.1.1
date	2015.06.29.02.47.24;	author mcalabre;	state Exp;
branches;
next	;

5.8.1.1
date	2015.07.08.11.07.18;	author mcalabre;	state Exp;
branches;
next	;

5.9.1.1
date	2015.07.21.09.28.07;	author mcalabre;	state Exp;
branches;
next	;

5.10.1.1
date	2015.10.09.08.22.35;	author mcalabre;	state Exp;
branches;
next	;

5.11.1.1
date	2015.10.18.09.16.27;	author mcalabre;	state Exp;
branches;
next	;

5.12.1.1
date	2015.11.15.02.16.14;	author mcalabre;	state Exp;
branches;
next	5.12.1.2;

5.12.1.2
date	2016.01.25.05.17.04;	author mcalabre;	state Exp;
branches;
next	;

5.13.1.1
date	2016.01.26.08.54.32;	author mcalabre;	state Exp;
branches;
next	;

5.14.1.1
date	2016.02.07.10.52.44;	author mcalabre;	state Exp;
branches;
next	5.14.1.2;

5.14.1.2
date	2016.03.21.06.09.11;	author mcalabre;	state Exp;
branches;
next	;

5.15.1.1
date	2016.04.05.12.58.35;	author mcalabre;	state Exp;
branches;
next	5.15.1.2;

5.15.1.2
date	2017.01.15.04.14.00;	author mcalabre;	state Exp;
branches;
next	;

5.16.1.1
date	2017.01.15.04.28.59;	author mcalabre;	state Exp;
branches;
next	;

5.17.1.1
date	2017.09.18.08.45.59;	author mcalabre;	state Exp;
branches;
next	5.17.1.2;

5.17.1.2
date	2018.01.10.08.25.34;	author mcalabre;	state Exp;
branches;
next	;

5.18.1.1
date	2018.01.10.08.33.04;	author mcalabre;	state Exp;
branches;
next	5.18.1.2;

5.18.1.2
date	2018.07.05.09.41.35;	author mcalabre;	state Exp;
branches;
next	;

5.19.1.1
date	2018.07.26.15.41.40;	author mcalabre;	state Exp;
branches;
next	;

5.20.1.1
date	2018.10.05.05.33.33;	author mcalabre;	state Exp;
branches;
next	;

6.1.1.1
date	2018.10.19.08.36.15;	author mcalabre;	state Exp;
branches;
next	;

6.2.1.1
date	2018.10.20.10.04.15;	author mcalabre;	state Exp;
branches;
next	6.2.1.2;

6.2.1.2
date	2019.05.10.01.56.50;	author mcalabre;	state Exp;
branches;
next	6.2.1.3;

6.2.1.3
date	2019.07.11.02.19.06;	author mcalabre;	state Exp;
branches;
next	;

6.3.1.1
date	2019.07.12.07.34.37;	author mcalabre;	state Exp;
branches;
next	;

6.4.1.1
date	2019.08.15.09.31.29;	author mcalabre;	state Exp;
branches;
next	6.4.1.2;

6.4.1.2
date	2019.12.31.03.28.03;	author mcalabre;	state Exp;
branches;
next	;

7.1.1.1
date	2019.12.31.13.28.19;	author mcalabre;	state Exp;
branches;
next	;

7.2.1.1
date	2020.03.09.07.34.50;	author mcalabre;	state Exp;
branches;
next	;

7.3.1.1
date	2020.06.03.03.38.10;	author mcalabre;	state Exp;
branches;
next	7.3.1.2;

7.3.1.2
date	2020.08.17.11.19.09;	author mcalabre;	state Exp;
branches;
next	7.3.1.3;

7.3.1.3
date	2021.01.19.14.09.10;	author mcalabre;	state Exp;
branches;
next	7.3.1.4;

7.3.1.4
date	2021.01.28.12.29.30;	author mcalabre;	state Exp;
branches;
next	;

7.4.1.1
date	2021.01.31.02.26.24;	author mcalabre;	state Exp;
branches;
next	;

7.5.1.1
date	2021.03.20.05.56.42;	author mcalabre;	state Exp;
branches;
next	7.5.1.2;

7.5.1.2
date	2021.04.13.09.21.51;	author mcalabre;	state Exp;
branches;
next	;

7.6.1.1
date	2021.04.13.13.00.35;	author mcalabre;	state Exp;
branches;
next	;

7.7.1.1
date	2021.07.12.06.38.27;	author mcalabre;	state Exp;
branches;
next	7.7.1.2;

7.7.1.2
date	2022.03.25.06.05.59;	author mcalabre;	state Exp;
branches;
next	;

7.8.1.1
date	2022.03.25.06.14.14;	author mcalabre;	state Exp;
branches;
next	;

7.9.1.1
date	2022.03.25.15.16.40;	author mcalabre;	state Exp;
branches;
next	;

7.10.1.1
date	2022.04.23.14.26.54;	author mcalabre;	state Exp;
branches;
next	;

7.11.1.1
date	2022.04.26.06.15.32;	author mcalabre;	state Exp;
branches;
next	;

7.12.1.1
date	2022.09.09.05.00.36;	author mcalabre;	state Exp;
branches;
next	;

7.13.1.1
date	2022.10.07.03.45.47;	author mcalabre;	state Exp;
branches;
next	7.13.1.2;

7.13.1.2
date	2023.06.15.04.17.19;	author mcalabre;	state Exp;
branches;
next	;

8.0.1.1
date	2023.07.01.06.22.44;	author mcalabre;	state Exp;
branches;
next	;

8.1.1.1
date	2023.07.05.17.15.00;	author mcalabre;	state Exp;
branches;
next	;

8.2.1.1
date	2023.11.16.10.05.57;	author mcalabre;	state Exp;
branches;
next	8.2.1.2;

8.2.1.2
date	2024.04.02.14.01.58;	author mcalabre;	state Exp;
branches;
next	8.2.1.3;

8.2.1.3
date	2024.05.08.15.25.52;	author mcalabre;	state Exp;
branches;
next	8.2.1.4;

8.2.1.4
date	2024.05.13.10.27.56;	author mcalabre;	state Exp;
branches;
next	;

8.3.1.1
date	2024.05.13.16.35.39;	author mcalabre;	state Exp;
branches;
next	8.3.1.2;

8.3.1.2
date	2024.07.09.07.02.24;	author mcalabre;	state Exp;
branches;
next	;

8.4.1.1
date	2024.10.28.13.58.41;	author mcalabre;	state Exp;
branches;
next	8.4.1.2;

8.4.1.2
date	2025.11.26.13.53.47;	author mcalabre;	state Exp;
branches;
next	8.4.1.3;

8.4.1.3
date	2025.12.06.13.37.16;	author mcalabre;	state Exp;
branches;
next	;

8.5.1.1
date	2025.12.06.14.05.15;	author mcalabre;	state Exp;
branches;
next	8.5.1.2;

8.5.1.2
date	2026.03.29.13.36.16;	author mcalabre;	state Exp;
branches;
next	;

8.6.1.1
date	2026.03.29.14.19.26;	author mcalabre;	state Exp;
branches;
next	;


desc
@Header file and usage notes for the driver routines for WCS spectral
coordinate transformations; contains the definition of the "spcprm" struct.
@


8.7
log
@WCSLIB 8.7
@
text
@/*============================================================================
  WCSLIB 8.7 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2026, Mark Calabretta

  This file is part of WCSLIB.

  WCSLIB is free software: you can redistribute it and/or modify it under the
  terms of the GNU Lesser General Public License as published by the Free
  Software Foundation, either version 3 of the License, or (at your option)
  any later version.

  WCSLIB 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 Lesser General Public License for
  more details.

  You should have received a copy of the GNU Lesser General Public License
  along with WCSLIB.  If not, see http://www.gnu.org/licenses.

  Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
  http://www.atnf.csiro.au/computing/software/wcs
  $Id: spc.h,v 8.6.1.1 2026/03/29 14:19:26 mcalabre Exp mcalabre $
*=============================================================================
*
* WCSLIB 8.7 - C routines that implement the FITS World Coordinate System
* (WCS) standard.  Refer to the README file provided with WCSLIB for an
* overview of the library.
*
*
* Summary of the spc routines
* ---------------------------
* Routines in this suite implement the part of the FITS World Coordinate
* System (WCS) standard that deals with spectral coordinates, as described in
*
=   "Representations of world coordinates in FITS",
=   Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I)
=
=   "Representations of spectral coordinates in FITS",
=   Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L.
=   2006, A&A, 446, 747 (WCS Paper III)
*
* These routines define methods to be used for computing spectral world
* coordinates from intermediate world coordinates (a linear transformation
* of image pixel coordinates), and vice versa.  They are based on the spcprm
* struct which contains all information needed for the computations.  The
* struct contains some members that must be set by the user, and others that
* are maintained by these routines, somewhat like a C++ class but with no
* encapsulation.
*
* Routine spcini() is provided to initialize the spcprm struct with default
* values, spcfree() reclaims any memory that may have been allocated to store
* an error message, spcsize() computes its total size including allocated
* memory, spcenq() returns information about the state of the struct, and
* spcprt() prints its contents.
*
* spcperr() prints the error message(s) (if any) stored in a spcprm struct.
*
* A setup routine, spcset(), computes intermediate values in the spcprm struct
* from parameters in it that were supplied by the user.  The struct always
* needs to be set up by spcset() but it need not be called explicitly - refer
* to the explanation of spcprm::flag.
*
* spcx2s() and spcs2x() implement the WCS spectral coordinate transformations.
* In fact, they are high level driver routines for the lower level spectral
* coordinate transformation routines described in spx.h.
*
* A number of routines are provided to aid in analysing or synthesising sets
* of FITS spectral axis keywords:
*
*   - spctype() checks a spectral CTYPEia keyword for validity and returns
*     information derived from it.
*
*   - Spectral keyword analysis routine spcspxe() computes the values of the
*     X-type spectral variables for the S-type variables supplied.
*
*   - Spectral keyword synthesis routine, spcxpse(), computes the S-type
*     variables for the X-types supplied.
*
*   - Given a set of spectral keywords, a translation routine, spctrne(),
*     produces the corresponding set for the specified spectral CTYPEia.
*
*   - spcaips() translates AIPS-convention spectral CTYPEia and VELREF
*     keyvalues.
*
* Spectral variable types - S, P, and X:
* --------------------------------------
* A few words of explanation are necessary regarding spectral variable types
* in FITS.
*
* Every FITS spectral axis has three associated spectral variables:
*
*   S-type: the spectral variable in which coordinates are to be
*     expressed.  Each S-type is encoded as four characters and is
*     linearly related to one of four basic types as follows:
*
*     F (Frequency):
*       - 'FREQ':  frequency
*       - 'AFRQ':  angular frequency
*       - 'ENER':  photon energy
*       - 'WAVN':  wave number
*       - 'VRAD':  radio velocity
*
*     W (Wavelength in vacuo):
*       - 'WAVE':  wavelength
*       - 'VOPT':  optical velocity
*       - 'ZOPT':  redshift
*
*     A (wavelength in Air):
*       - 'AWAV':  wavelength in air
*
*     V (Velocity):
*       - 'VELO':  relativistic velocity
*       - 'BETA':  relativistic beta factor
*
*     The S-type forms the first four characters of the CTYPEia keyvalue,
*     and CRVALia and CDELTia are expressed as S-type quantities so that
*     they provide a first-order approximation to the S-type variable at
*     the reference point.
*
*     Note that 'AFRQ', angular frequency, is additional to the variables
*     defined in WCS Paper III.
*
*   P-type: the basic spectral variable (F, W, A, or V) with which the
*     S-type variable is associated (see list above).
*
*     For non-grism axes, the P-type is encoded as the eighth character of
*     CTYPEia.
*
*   X-type: the basic spectral variable (F, W, A, or V) for which the
*     spectral axis is linear, grisms excluded (see below).
*
*     For non-grism axes, the X-type is encoded as the sixth character of
*     CTYPEia.
*
*   Grisms: Grism axes have normal S-, and P-types but the axis is linear,
*     not in any spectral variable, but in a special "grism parameter".
*     The X-type spectral variable is either W or A for grisms in vacuo or
*     air respectively, but is encoded as 'w' or 'a' to indicate that an
*     additional transformation is required to convert to or from the
*     grism parameter.  The spectral algorithm code for grisms also has a
*     special encoding in CTYPEia, either 'GRI' (in vacuo) or 'GRA' (in air).
*
* In the algorithm chain, the non-linear transformation occurs between the
* X-type and the P-type variables; the transformation between P-type and
* S-type variables is always linear.
*
* When the P-type and X-type variables are the same, the spectral axis is
* linear in the S-type variable and the second four characters of CTYPEia
* are blank.  This can never happen for grism axes.
*
* As an example, correlating radio spectrometers always produce spectra that
* are regularly gridded in frequency; a redshift scale on such a spectrum is
* non-linear.  The required value of CTYPEia would be 'ZOPT-F2W', where the
* desired S-type is 'ZOPT' (redshift), the P-type is necessarily 'W'
* (wavelength), and the X-type is 'F' (frequency) by the nature of the
* instrument.
*
* Air-to-vacuum wavelength conversion:
* ------------------------------------
* Please refer to the prologue of spx.h for important comments relating to the
* air-to-vacuum wavelength conversion.
*
* Argument checking:
* ------------------
* The input spectral values are only checked for values that would result in
* floating point exceptions.  In particular, negative frequencies and
* wavelengths are allowed, as are velocities greater than the speed of
* light.  The same is true for the spectral parameters - rest frequency and
* wavelength.
*
* Accuracy:
* ---------
* No warranty is given for the accuracy of these routines (refer to the
* copyright notice); intending users must satisfy for themselves their
* adequacy for the intended purpose.  However, closure effectively to within
* double precision rounding error was demonstrated by test routine tspc.c
* which accompanies this software.
*
*
* spcini() - Default constructor for the spcprm struct
* ----------------------------------------------------
* spcini() sets all members of a spcprm struct to default values.  It should
* be used to initialize every spcprm struct.
*
* PLEASE NOTE: If the spcprm struct has already been initialized then, before
* reinitializing it, spcfree() should be used to free any memory that may have
* been allocated to store an error message.  Else a memory leak may result.
*
* Given and returned:
*   spc       struct spcprm*
*                       Spectral transformation parameters.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null spcprm pointer passed.
*
*
* spcfree() - Destructor for the spcprm struct
* --------------------------------------------
* spcfree() frees any memory that may have been allocated to store an error
* message in the spcprm struct.
*
* Given and returned:
*   spc       struct spcprm*
*                       Spectral transformation parameters.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null spcprm pointer passed.
*
*
* spcsize() - Compute the size of a spcprm struct
* -----------------------------------------------
* spcsize() computes the full size of a spcprm struct, including allocated
* memory.
*
* Given:
*   spc       const struct spcprm*
*                       Spectral transformation parameters.
*
*                       If NULL, the base size of the struct and the allocated
*                       size are both set to zero.
*
* Returned:
*   sizes     int[2]    The first element is the base size of the struct as
*                       returned by sizeof(struct spcprm).  The second element
*                       is the total allocated size, in bytes.  This figure
*                       includes memory allocated for the constituent struct,
*                       spcprm::err.
*
*                       It is not an error for the struct not to have been set
*                       up via spcset().
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*
*
* spcenq() - enquire about the state of a spcprm struct
* -----------------------------------------------------
* spcenq() may be used to obtain information about the state of a spcprm
* struct.  The function returns a true/false answer for the enquiry asked.
*
* Given:
*   spc       const struct spcprm*
*                       Spectral transformation parameters.
*
*   enquiry   int       Enquiry according to the following parameters:
*                         SPCENQ_MEM: memory in the struct is being managed by
*                                     WCSLIB (see spcini()).
*                         SPCENQ_SET: the struct has been set up by spcset().
*                         SPCENQ_BYP: the struct is in bypass mode (see
*                                     spcset()).
*                       These may be combined by logical OR, e.g.
*                       SPCENQ_MEM | SPCENQ_SET.  The enquiry result will be
*                       the logical AND of the individual results.
*
* Function return value:
*             int       Enquiry result:
*                         0: No.
*                         1: Yes.
*
*
* spcprt() - Print routine for the spcprm struct
* ----------------------------------------------
* spcprt() prints the contents of a spcprm struct using wcsprintf().  Mainly
* intended for diagnostic purposes.
*
* Given:
*   spc       const struct spcprm*
*                       Spectral transformation parameters.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null spcprm pointer passed.
*
*
* spcperr() - Print error messages from a spcprm struct
* -----------------------------------------------------
* spcperr() prints the error message(s) (if any) stored in a spcprm struct.
* If there are no errors then nothing is printed.  It uses wcserr_prt(), q.v.
*
* Given:
*   spc       const struct spcprm*
*                       Spectral transformation parameters.
*
*   prefix    const char *
*                       If non-NULL, each output line will be prefixed with
*                       this string.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null spcprm pointer passed.
*
*
* spcset() - Setup routine for the spcprm struct
* ----------------------------------------------
* spcset() sets up a spcprm struct according to information supplied within
* it.
*
* Note that this routine need not be called directly; it will be invoked by
* spcx2s() and spcs2x() if spcprm::flag is anything other than a predefined
* magic value.
*
* spcset() normally operates regardless of the value of spcprm::flag; i.e.
* even if a struct was previously set up it will be reset unconditionally.
* However, a spcprm struct may be put into "bypass" mode by invoking spcset()
* initially with spcprm::flag == 1 (rather than 0).  spcset() will return
* immediately if invoked on a struct in that state.  To take a struct out of
* bypass mode, simply reset spcprm::flag to zero.  See also spcenq().
*
* Given and returned:
*   spc       struct spcprm*
*                       Spectral transformation parameters.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null spcprm pointer passed.
*                         2: Invalid spectral parameters.
*
*                       For returns > 1, a detailed error message is set in
*                       spcprm::err if enabled, see wcserr_enable().
*
*
* spcx2s() - Transform to spectral coordinates
* --------------------------------------------
* spcx2s() transforms intermediate world coordinates to spectral coordinates.
*
* Given and returned:
*   spc       struct spcprm*
*                       Spectral transformation parameters.
*
* Given:
*   nx        int       Vector length.
*
*   sx        int       Vector stride.
*
*   sspec     int       Vector stride.
*
*   x         const double[]
*                       Intermediate world coordinates, in SI units.
*
* Returned:
*   spec      double[]  Spectral coordinates, in SI units.
*
*   stat      int[]     Status return value status for each vector element:
*                         0: Success.
*                         1: Invalid value of x.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null spcprm pointer passed.
*                         2: Invalid spectral parameters.
*                         3: One or more of the x coordinates were invalid,
*                            as indicated by the stat vector.
*
*                       For returns > 1, a detailed error message is set in
*                       spcprm::err if enabled, see wcserr_enable().
*
*
* spcs2x() - Transform spectral coordinates
* -----------------------------------------
* spcs2x() transforms spectral world coordinates to intermediate world
* coordinates.
*
* Given and returned:
*   spc       struct spcprm*
*                       Spectral transformation parameters.
*
* Given:
*   nspec     int       Vector length.
*
*   sspec     int       Vector stride.
*
*   sx        int       Vector stride.
*
*   spec      const double[]
*                       Spectral coordinates, in SI units.
*
* Returned:
*   x         double[]  Intermediate world coordinates, in SI units.
*
*   stat      int[]     Status return value status for each vector element:
*                         0: Success.
*                         1: Invalid value of spec.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null spcprm pointer passed.
*                         2: Invalid spectral parameters.
*                         4: One or more of the spec coordinates were
*                            invalid, as indicated by the stat vector.
*
*                       For returns > 1, a detailed error message is set in
*                       spcprm::err if enabled, see wcserr_enable().
*
*
* spctype() - Spectral CTYPEia keyword analysis
* ---------------------------------------------
* spctype() checks whether a CTYPEia keyvalue is a valid spectral axis type
* and if so returns information derived from it relating to the associated S-,
* P-, and X-type spectral variables (see explanation above).
*
* The return arguments are guaranteed not be modified if CTYPEia is not a
* valid spectral type; zero-pointers may be specified for any that are not of
* interest.
*
* A deprecated form of this function, spctyp(), lacks the wcserr** parameter.
*
* Given:
*   ctype     const char[9]
*                       The CTYPEia keyvalue, (eight characters with null
*                       termination).
*
* Returned:
*   stype     char[]    The four-letter name of the S-type spectral variable
*                       copied or translated from ctype.  If a non-zero
*                       pointer is given, the array must accomodate a null-
*                       terminated string of length 5.
*
*   scode     char[]    The three-letter spectral algorithm code copied or
*                       translated from ctype.  Logarithmic ('LOG') and
*                       tabular ('TAB') codes are also recognized.  If a
*                       non-zero pointer is given, the array must accomodate a
*                       null-terminated string of length 4.
*
*   sname     char[]    Descriptive name of the S-type spectral variable.
*                       If a non-zero pointer is given, the array must
*                       accomodate a null-terminated string of length 22.
*
*   units     char[]    SI units of the S-type spectral variable.  If a
*                       non-zero pointer is given, the array must accomodate a
*                       null-terminated string of length 8.
*
*   ptype     char*     Character code for the P-type spectral variable
*                       derived from ctype, one of 'F', 'W', 'A', or 'V'.
*
*   xtype     char*     Character code for the X-type spectral variable
*                       derived from ctype, one of 'F', 'W', 'A', or 'V'.
*                       Also, 'w' and 'a' are synonymous to 'W' and 'A' for
*                       grisms in vacuo and air respectively.  Set to 'L' or
*                       'T' for logarithmic ('LOG') and tabular ('TAB') axes.
*
*   restreq   int*      Multivalued flag that indicates whether rest
*                       frequency or wavelength is required to compute
*                       spectral variables for this CTYPEia:
*                         0: Not required.
*                         1: Required for the conversion between S- and
*                            P-types (e.g. 'ZOPT-F2W').
*                         2: Required for the conversion between P- and
*                            X-types (e.g. 'BETA-W2V').
*                         3: Required for the conversion between S- and
*                            P-types, and between P- and X-types, but not
*                            between S- and X-types (this applies only for
*                            'VRAD-V2F', 'VOPT-V2W', and 'ZOPT-V2W').
*                        Thus the rest frequency or wavelength is required for
*                        spectral coordinate computations (i.e. between S- and
*                        X-types) only if restreq%3 != 0.
*
*   err       struct wcserr **
*                       If enabled, for function return values > 1, this
*                       struct will contain a detailed error message, see
*                       wcserr_enable().  May be NULL if an error message is
*                       not desired.  Otherwise, the user is responsible for
*                       deleting the memory allocated for the wcserr struct.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         2: Invalid spectral parameters (not a spectral
*                            CTYPEia).
*
*
* spcspxe() - Spectral keyword analysis
* ------------------------------------
* spcspxe() analyses the CTYPEia and CRVALia FITS spectral axis keyword values
* and returns information about the associated X-type spectral variable.
*
* A deprecated form of this function, spcspx(), lacks the wcserr** parameter.
*
* Given:
*   ctypeS    const char[9]
*                       Spectral axis type, i.e. the CTYPEia keyvalue, (eight
*                       characters with null termination).  For non-grism
*                       axes, the character code for the P-type spectral
*                       variable in the algorithm code (i.e. the eighth
*                       character of CTYPEia) may be set to '?' (it will not
*                       be reset).
*
*   crvalS    double    Value of the S-type spectral variable at the reference
*                       point, i.e. the CRVALia keyvalue, SI units.
*
*   restfrq,
*   restwav   double    Rest frequency [Hz] and rest wavelength in vacuo [m],
*                       only one of which need be given, the other should be
*                       set to zero.
*
* Returned:
*   ptype     char*     Character code for the P-type spectral variable
*                       derived from ctypeS, one of 'F', 'W', 'A', or 'V'.
*
*   xtype     char*     Character code for the X-type spectral variable
*                       derived from ctypeS, one of 'F', 'W', 'A', or 'V'.
*                       Also, 'w' and 'a' are synonymous to 'W' and 'A' for
*                       grisms in vacuo and air respectively; crvalX and dXdS
*                       (see below) will conform to these.
*
*   restreq   int*      Multivalued flag that indicates whether rest frequency
*                       or wavelength is required to compute spectral
*                       variables for this CTYPEia, as for spctype().
*
*   crvalX    double*   Value of the X-type spectral variable at the reference
*                       point, SI units.
*
*   dXdS      double*   The derivative, dX/dS, evaluated at the reference
*                       point, SI units.  Multiply the CDELTia keyvalue by
*                       this to get the pixel spacing in the X-type spectral
*                       coordinate.
*
*   err       struct wcserr **
*                       If enabled, for function return values > 1, this
*                       struct will contain a detailed error message, see
*                       wcserr_enable().  May be NULL if an error message is
*                       not desired.  Otherwise, the user is responsible for
*                       deleting the memory allocated for the wcserr struct.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         2: Invalid spectral parameters.
*
*
* spcxpse() - Spectral keyword synthesis
* -------------------------------------
* spcxpse(), for the spectral axis type specified and the value provided for
* the X-type spectral variable at the reference point, deduces the value of
* the FITS spectral axis keyword CRVALia and also the derivative dS/dX which
* may be used to compute CDELTia.  See above for an explanation of the S-,
* P-, and X-type spectral variables.
*
* A deprecated form of this function, spcxps(), lacks the wcserr** parameter.
*
* Given:
*   ctypeS    const char[9]
*                       The required spectral axis type, i.e. the CTYPEia
*                       keyvalue, (eight characters with null termination).
*                       For non-grism axes, the character code for the P-type
*                       spectral variable in the algorithm code (i.e. the
*                       eighth character of CTYPEia) may be set to '?' (it
*                       will not be reset).
*
*   crvalX    double    Value of the X-type spectral variable at the reference
*                       point (N.B. NOT the CRVALia keyvalue), SI units.
*
*   restfrq,
*   restwav   double    Rest frequency [Hz] and rest wavelength in vacuo [m],
*                       only one of which need be given, the other should be
*                       set to zero.
*
* Returned:
*   ptype     char*     Character code for the P-type spectral variable
*                       derived from ctypeS, one of 'F', 'W', 'A', or 'V'.
*
*   xtype     char*     Character code for the X-type spectral variable
*                       derived from ctypeS, one of 'F', 'W', 'A', or 'V'.
*                       Also, 'w' and 'a' are synonymous to 'W' and 'A' for
*                       grisms; crvalX and cdeltX must conform to these.
*
*   restreq   int*      Multivalued flag that indicates whether rest frequency
*                       or wavelength is required to compute spectral
*                       variables for this CTYPEia, as for spctype().
*
*   crvalS    double*   Value of the S-type spectral variable at the reference
*                       point (i.e. the appropriate CRVALia keyvalue), SI
*                       units.
*
*   dSdX      double*   The derivative, dS/dX, evaluated at the reference
*                       point, SI units.  Multiply this by the pixel spacing
*                       in the X-type spectral coordinate to get the CDELTia
*                       keyvalue.
*
*   err       struct wcserr **
*                       If enabled, for function return values > 1, this
*                       struct will contain a detailed error message, see
*                       wcserr_enable().  May be NULL if an error message is
*                       not desired.  Otherwise, the user is responsible for
*                       deleting the memory allocated for the wcserr struct.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         2: Invalid spectral parameters.
*
*
* spctrne() - Spectral keyword translation
* ---------------------------------------
* spctrne() translates a set of FITS spectral axis keywords into the
* corresponding set for the specified spectral axis type.  For example, a
* 'FREQ' axis may be translated into 'ZOPT-F2W' and vice versa.
*
* A deprecated form of this function, spctrn(), lacks the wcserr** parameter.
*
* Given:
*   ctypeS1   const char[9]
*                       Spectral axis type, i.e. the CTYPEia keyvalue, (eight
*                       characters with null termination).  For non-grism
*                       axes, the character code for the P-type spectral
*                       variable in the algorithm code (i.e. the eighth
*                       character of CTYPEia) may be set to '?' (it will not
*                       be reset).
*
*   crvalS1   double    Value of the S-type spectral variable at the reference
*                       point, i.e. the CRVALia keyvalue, SI units.
*
*   cdeltS1   double    Increment of the S-type spectral variable at the
*                       reference point, SI units.
*
*   restfrq,
*   restwav   double    Rest frequency [Hz] and rest wavelength in vacuo [m],
*                       only one of which need be given, the other should be
*                       set to zero.  Neither are required if the translation
*                       is between wave-characteristic types, or between
*                       velocity-characteristic types.  E.g., required for
*                       'FREQ'     -> 'ZOPT-F2W', but not required for
*                       'VELO-F2V' -> 'ZOPT-F2W'.
*
* Given and returned:
*   ctypeS2   char[9]   Required spectral axis type (eight characters with
*                       null termination).  The first four characters are
*                       required to be given and are never modified.  The
*                       remaining four, the algorithm code, are completely
*                       determined by, and must be consistent with, ctypeS1
*                       and the first four characters of ctypeS2.  A non-zero
*                       status value will be returned if they are inconsistent
*                       (see below).  However, if the final three characters
*                       are specified as "???", or if just the eighth
*                       character is specified as '?', the correct algorithm
*                       code will be substituted (applies for grism axes as
*                       well as non-grism).
*
* Returned:
*   crvalS2   double*   Value of the new S-type spectral variable at the
*                       reference point, i.e. the new CRVALia keyvalue, SI
*                       units.
*
*   cdeltS2   double*   Increment of the new S-type spectral variable at the
*                       reference point, i.e. the new CDELTia keyvalue, SI
*                       units.
*
*   err       struct wcserr **
*                       If enabled, for function return values > 1, this
*                       struct will contain a detailed error message, see
*                       wcserr_enable().  May be NULL if an error message is
*                       not desired.  Otherwise, the user is responsible for
*                       deleting the memory allocated for the wcserr struct.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         2: Invalid spectral parameters.
*
*                       A status value of 2 will be returned if restfrq or
*                       restwav are not specified when required, or if ctypeS1
*                       or ctypeS2 are self-inconsistent, or have different
*                       spectral X-type variables.
*
*
* spcaips() - Translate AIPS-convention spectral keywords
* -------------------------------------------------------
* spcaips() translates AIPS-convention spectral CTYPEia and VELREF keyvalues.
*
* Given:
*   ctypeA    const char[9]
*                       CTYPEia keyvalue possibly containing an
*                       AIPS-convention spectral code (eight characters, need
*                       not be null-terminated).
*
*   velref    int       AIPS-convention VELREF code.  It has the following
*                       integer values:
*                         1: LSR kinematic, originally described simply as
*                            "LSR" without distinction between the kinematic
*                            and dynamic definitions.
*                         2: Barycentric, originally described as "HEL"
*                            meaning heliocentric.
*                         3: Topocentric, originally described as "OBS"
*                            meaning geocentric but widely interpreted as
*                            topocentric.
*                       AIPS++ extensions to VELREF are also recognized:
*                         4: LSR dynamic.
*                         5: Geocentric.
*                         6: Source rest frame.
*                         7: Galactocentric.
*
*                       For an AIPS 'VELO' axis, a radio convention velocity
*                       (VRAD) is denoted by adding 256 to VELREF, otherwise
*                       an optical velocity (VOPT) is indicated (this is not
*                       applicable to 'FREQ' or 'FELO' axes).  Setting velref
*                       to 0 or 256 chooses between optical and radio velocity
*                       without specifying a Doppler frame, provided that a
*                       frame is encoded in ctypeA.  If not, i.e. for
*                       ctypeA = 'VELO', ctype will be returned as 'VELO'.
*
*                       VELREF takes precedence over CTYPEia in defining the
*                       Doppler frame, e.g.
*
=                         ctypeA = 'VELO-HEL';
=                         velref = 1;
*
*                       returns ctype = 'VOPT' with specsys set to 'LSRK'.
*
*                       If omitted from the header, the default value of
*                       VELREF is 0.
*
* Returned:
*   ctype     char[9]   Translated CTYPEia keyvalue, or a copy of ctypeA if no
*                       translation was performed (in which case any trailing
*                       blanks in ctypeA will be replaced with nulls).
*
*   specsys   char[9]   Doppler reference frame indicated by VELREF or else
*                       by CTYPEia with value corresponding to the SPECSYS
*                       keyvalue in the FITS WCS standard.  May be returned
*                       blank if neither specifies a Doppler frame, e.g.
*                       ctypeA = 'FELO' and velref%256 == 0.
*
* Function return value:
*             int       Status return value:
*                        -1: No translation required (not an error).
*                         0: Success.
*                         2: Invalid value of VELREF.
*
*
* spcprm struct - Spectral transformation parameters
* --------------------------------------------------
* The spcprm struct contains information required to transform spectral
* coordinates.  It consists of certain members that must be set by the user
* ("given") and others that are set by the WCSLIB routines ("returned").  Some
* of the latter are supplied for informational purposes while others are for
* internal use only.
*
*   int flag
*     (Given and returned) This flag must be set to zero (or 1, see spcset())
*     whenever any of the following spcprm members are set or changed:
*
*       - spcprm::type,
*       - spcprm::code,
*       - spcprm::crval,
*       - spcprm::restfrq,
*       - spcprm::restwav,
*       - spcprm::pv[].
*
*     This signals the initialization routine, spcset(), to recompute the
*     returned members of the spcprm struct.  spcset() will reset flag to
*     indicate that this has been done.
*
*   char type[8]
*     (Given) Four-letter spectral variable type, e.g "ZOPT" for
*     CTYPEia = 'ZOPT-F2W'.  (Declared as char[8] for alignment reasons.)
*
*   char code[4]
*     (Given) Three-letter spectral algorithm code, e.g "F2W" for
*     CTYPEia = 'ZOPT-F2W'.
*
*   double crval
*     (Given) Reference value (CRVALia), SI units.
*
*   double restfrq
*     (Given) The rest frequency [Hz], and ...
*
*   double restwav
*     (Given) ... the rest wavelength in vacuo [m], only one of which need be
*     given, the other should be set to zero.  Neither are required if the
*     X and S spectral variables are both wave-characteristic, or both
*     velocity-characteristic, types.
*
*   double pv[7]
*     (Given) Grism parameters for 'GRI' and 'GRA' algorithm codes:
*       - 0: G, grating ruling density.
*       - 1: m, interference order.
*       - 2: alpha, angle of incidence [deg].
*       - 3: n_r, refractive index at the reference wavelength, lambda_r.
*       - 4: n'_r, dn/dlambda at the reference wavelength, lambda_r (/m).
*       - 5: epsilon, grating tilt angle [deg].
*       - 6: theta, detector tilt angle [deg].
*
* The remaining members of the spcprm struct are maintained by spcset() and
* must not be modified elsewhere:
*
*   double w[6]
*     (Returned) Intermediate values:
*       - 0: Rest frequency or wavelength (SI).
*       - 1: The value of the X-type spectral variable at the reference point
*           (SI units).
*       - 2: dX/dS at the reference point (SI units).
*      The remainder are grism intermediates.
*
*   int isGrism
*     (Returned) Grism coordinates?
*       - 0: no,
*       - 1: in vacuum,
*       - 2: in air.
*
*   int padding1
*     (An unused variable inserted for alignment purposes only.)
*
*   struct wcserr *err
*     (Returned) If enabled, when an error status is returned, this struct
*     contains detailed information about the error, see wcserr_enable().
*
*   void *padding2
*     (An unused variable inserted for alignment purposes only.)
*   int (*spxX2P)(SPX_ARGS)
*     (For internal use only) The first and ...
*   int (*spxP2S)(SPX_ARGS)
*     (For internal use only) ... the second of the pointers to the
*     transformation functions in the two-step algorithm chain X -> P -> S in
*     the pixel-to-spectral direction where the non-linear transformation is
*     from X to P.  The argument list, SPX_ARGS, is defined in spx.h.
*
*   int (*spxS2P)(SPX_ARGS)
*     (For internal use only) The first and ...
*   int (*spxP2X)(SPX_ARGS)
*     (For internal use only) ... the second of the pointers to the
*     transformation functions in the two-step algorithm chain S -> P -> X in
*     the spectral-to-pixel direction where the non-linear transformation is
*     from P to X.  The argument list, SPX_ARGS, is defined in spx.h.
*
*
* Global variable: const char *spc_errmsg[] - Status return messages
* ------------------------------------------------------------------
* Error messages to match the status value returned from each function.
*
*===========================================================================*/

#ifndef WCSLIB_SPC
#define WCSLIB_SPC

#include "spx.h"

#ifdef __cplusplus
extern "C" {
#endif

enum spcenq_enum {
  SPCENQ_SET = 2,		// spcprm struct has been set up.
  SPCENQ_BYP = 4,		// spcprm struct is in bypass mode.
};

extern const char *spc_errmsg[];

enum spc_errmsg_enum {
  SPCERR_NO_CHANGE       = -1,	// No change.
  SPCERR_SUCCESS         =  0,	// Success.
  SPCERR_NULL_POINTER    =  1,	// Null spcprm pointer passed.
  SPCERR_BAD_SPEC_PARAMS =  2,	// Invalid spectral parameters.
  SPCERR_BAD_X           =  3,	// One or more of x coordinates were
				// invalid.
  SPCERR_BAD_SPEC        =  4 	// One or more of the spec coordinates were
				// invalid.
};

struct spcprm {
  // Initialization flag (see the prologue above).
  //--------------------------------------------------------------------------
  int    flag;			// Set to zero to force initialization.

  // Parameters to be provided (see the prologue above).
  //--------------------------------------------------------------------------
  char   type[8];		// Four-letter spectral variable type.
  char   code[4];		// Three-letter spectral algorithm code.

  double crval;			// Reference value (CRVALia), SI units.
  double restfrq;		// Rest frequency, Hz.
  double restwav;		// Rest wavelength, m.

  double pv[7];			// Grism parameters:
				//   0: G, grating ruling density.
				//   1: m, interference order.
				//   2: alpha, angle of incidence.
				//   3: n_r, refractive index at lambda_r.
				//   4: n'_r, dn/dlambda at lambda_r.
				//   5: epsilon, grating tilt angle.
				//   6: theta, detector tilt angle.

  // Information derived from the parameters supplied.
  //--------------------------------------------------------------------------
  double w[6];			// Intermediate values.
				//   0: Rest frequency or wavelength (SI).
				//   1: CRVALX (SI units).
				//   2: CDELTX/CDELTia = dX/dS (SI units).
				// The remainder are grism intermediates.

  int    isGrism;		// Grism coordinates?  1: vacuum, 2: air.
  int    padding1;		// (Dummy inserted for alignment purposes.)

  // Error messaging, if enabled.
  //--------------------------------------------------------------------------
  struct wcserr *err;

  //--------------------------------------------------------------------------
  // Private - the remainder are for internal use.
  //--------------------------------------------------------------------------
  void *padding2;		// (Dummy inserted for alignment purposes.)

  int (*spxX2P)(SPX_ARGS);	// Pointers to the transformation functions
  int (*spxP2S)(SPX_ARGS);	// in the two-step algorithm chain in the
				// pixel-to-spectral direction.

  int (*spxS2P)(SPX_ARGS);	// Pointers to the transformation functions
  int (*spxP2X)(SPX_ARGS);	// in the two-step algorithm chain in the
				// spectral-to-pixel direction.
};

// Size of the spcprm struct in int units, used by the Fortran wrappers.
#define SPCLEN (sizeof(struct spcprm)/sizeof(int))


int spcini(struct spcprm *spc);

int spcfree(struct spcprm *spc);

int spcsize(const struct spcprm *spc, int sizes[2]);

int spcenq(const struct spcprm *spc, int enquiry);

int spcprt(const struct spcprm *spc);

int spcperr(const struct spcprm *spc, const char *prefix);

int spcset(struct spcprm *spc);

int spcx2s(struct spcprm *spc, int nx, int sx, int sspec,
           const double x[], double spec[], int stat[]);

int spcs2x(struct spcprm *spc, int nspec, int sspec, int sx,
           const double spec[], double x[], int stat[]);

int spctype(const char ctype[9], char stype[], char scode[], char sname[],
            char units[], char *ptype, char *xtype, int *restreq,
            struct wcserr **err);

int spcspxe(const char ctypeS[9], double crvalS, double restfrq,
            double restwav, char *ptype, char *xtype, int *restreq,
            double *crvalX, double *dXdS, struct wcserr **err);

int spcxpse(const char ctypeS[9], double crvalX, double restfrq,
            double restwav, char *ptype, char *xtype, int *restreq,
            double *crvalS, double *dSdX, struct wcserr **err);

int spctrne(const char ctypeS1[9], double crvalS1, double cdeltS1,
            double restfrq, double restwav, char ctypeS2[9], double *crvalS2,
            double *cdeltS2, struct wcserr **err);

int spcaips(const char ctypeA[9], int velref, char ctype[9], char specsys[9]);


// Deprecated.
#define spcini_errmsg spc_errmsg
#define spcprt_errmsg spc_errmsg
#define spcset_errmsg spc_errmsg
#define spcx2s_errmsg spc_errmsg
#define spcs2x_errmsg spc_errmsg

int spctyp(const char ctype[9], char stype[], char scode[], char sname[],
           char units[], char *ptype, char *xtype, int *restreq);
int spcspx(const char ctypeS[9], double crvalS, double restfrq,
           double restwav, char *ptype, char *xtype, int *restreq,
           double *crvalX, double *dXdS);
int spcxps(const char ctypeS[9], double crvalX, double restfrq,
           double restwav, char *ptype, char *xtype, int *restreq,
           double *crvalS, double *dSdX);
int spctrn(const char ctypeS1[9], double crvalS1, double cdeltS1,
           double restfrq, double restwav, char ctypeS2[9], double *crvalS2,
           double *cdeltS2);

#ifdef __cplusplus
}
#endif

#endif // WCSLIB_SPC
@


8.6
log
@WCSLIB 8.6
@
text
@d2 1
a2 1
  WCSLIB 8.6 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: spc.h,v 8.5.1.2 2026/03/29 13:36:16 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 8.6 - C routines that implement the FITS World Coordinate System
@


8.6.1.1
log
@WCSLIB 8.6 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 8.6 2026/03/29 13:53:56 mcalabre Exp $
@


8.5
log
@WCSLIB 8.5
@
text
@d2 2
a3 2
  WCSLIB 8.5 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2025, Mark Calabretta
d21 2
a22 2
  http://www.atnf.csiro.au/people/Mark.Calabretta
  $Id: spc.h,v 8.4.1.3 2025/12/06 13:37:16 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 8.5 - C routines that implement the FITS World Coordinate System
@


8.5.1.1
log
@WCSLIB 8.5 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 8.5 2025/12/06 13:47:41 mcalabre Exp $
@


8.5.1.2
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2026, Mark Calabretta
d21 2
a22 2
  http://www.atnf.csiro.au/computing/software/wcs
  $Id: spc.h,v 8.5.1.1 2025/12/06 14:05:15 mcalabre Exp mcalabre $
@


8.4
log
@WCSLIB 8.4
@
text
@d2 2
a3 2
  WCSLIB 8.4 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2024, Mark Calabretta
d22 1
a22 1
  $Id: spc.h,v 8.3.1.2 2024/07/09 07:02:24 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 8.4 - C routines that implement the FITS World Coordinate System
d185 3
a187 4
* PLEASE NOTE: If the spcprm struct has already been initialized, then before
* reinitializing, it spcfree() should be used to free any memory that may have
* been allocated to store an error message.  A memory leak may otherwise
* result.
d204 1
a204 1
* Given:
d713 2
a714 2
=                         ctypeA = 'VELO-HEL'
=                         velref = 1
@


8.4.1.1
log
@WCSLIB 8.4 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 8.4 2024/10/28 13:56:16 mcalabre Exp $
@


8.4.1.2
log
@In spcfree(), spc is given and returned.
@
text
@d22 1
a22 1
  $Id: spc.h,v 8.4.1.1 2024/10/28 13:58:41 mcalabre Exp mcalabre $
d185 4
a188 3
* PLEASE NOTE: If the spcprm struct has already been initialized then, before
* reinitializing it, spcfree() should be used to free any memory that may have
* been allocated to store an error message.  Else a memory leak may result.
d205 1
a205 1
* Given and returned:
d714 2
a715 2
=                         ctypeA = 'VELO-HEL';
=                         velref = 1;
@


8.4.1.3
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2025, Mark Calabretta
d22 1
a22 1
  $Id: spc.h,v 8.4.1.2 2025/11/26 13:53:47 mcalabre Exp mcalabre $
@


8.3
log
@WCSLIB 8.3
@
text
@d2 1
a2 1
  WCSLIB 8.3 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: spc.h,v 8.2.1.4 2024/05/13 10:27:56 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 8.3 - C routines that implement the FITS World Coordinate System
d820 1
a820 1
*     (Returned) The first and ...
d822 4
a825 4
*     (Returned) ... the second of the pointers to the transformation
*     functions in the two-step algorithm chain X -> P -> S in the
*     pixel-to-spectral direction where the non-linear transformation is from
*     X to P.  The argument list, SPX_ARGS, is defined in spx.h.
d828 1
a828 1
*     (Returned) The first and ...
d830 4
a833 4
*     (Returned) ... the second of the pointers to the transformation
*     functions in the two-step algorithm chain S -> P -> X in the
*     spectral-to-pixel direction where the non-linear transformation is from
*     P to X.  The argument list, SPX_ARGS, is defined in spx.h.
d903 1
a903 1
  // Error handling
a906 1
  // Private
d908 4
a911 1
  void   *padding2;		// (Dummy inserted for alignment purposes.)
@


8.3.1.1
log
@WCSLIB 8.3 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 8.3 2024/05/13 16:33:00 mcalabre Exp $
@


8.3.1.2
log
@Tweaked comments in the prologue and within the struct definition.
@
text
@d22 1
a22 1
  $Id: spc.h,v 8.3.1.1 2024/05/13 16:35:39 mcalabre Exp mcalabre $
d820 1
a820 1
*     (For internal use only) The first and ...
d822 4
a825 4
*     (For internal use only) ... the second of the pointers to the
*     transformation functions in the two-step algorithm chain X -> P -> S in
*     the pixel-to-spectral direction where the non-linear transformation is
*     from X to P.  The argument list, SPX_ARGS, is defined in spx.h.
d828 1
a828 1
*     (For internal use only) The first and ...
d830 4
a833 4
*     (For internal use only) ... the second of the pointers to the
*     transformation functions in the two-step algorithm chain S -> P -> X in
*     the spectral-to-pixel direction where the non-linear transformation is
*     from P to X.  The argument list, SPX_ARGS, is defined in spx.h.
d903 1
a903 1
  // Error messaging, if enabled.
d907 1
d909 1
a909 4
  // Private - the remainder are for internal use.
  //--------------------------------------------------------------------------
  void *padding2;		// (Dummy inserted for alignment purposes.)

@


8.2
log
@WCSLIB 8.2
@
text
@d2 2
a3 2
  WCSLIB 8.2 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2023, Mark Calabretta
d22 1
a22 1
  $Id: spc.h,v 8.1.1.1 2023/07/05 17:15:00 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 8.2 - C routines that implement the FITS World Coordinate System
d53 2
a54 1
* memory, and spcprt() prints its contents.
d242 25
d310 7
d749 2
a750 2
*     (Given and returned) This flag must be set to zero whenever any of the
*     following spcprm structure members are set or changed:
d851 4
d928 2
@


8.2.1.1
log
@WCSLIB 8.2 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 8.2 2023/11/16 10:00:29 mcalabre Exp $
@


8.2.1.2
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2024, Mark Calabretta
d22 1
a22 1
  $Id: spc.h,v 8.2.1.1 2023/11/16 10:05:57 mcalabre Exp mcalabre $
@


8.2.1.3
log
@Documented bypass mode in spcset() and added spcenq().
@
text
@d22 1
a22 1
  $Id: spc.h,v 8.2.1.2 2024/04/02 14:01:58 mcalabre Exp mcalabre $
d53 1
a53 2
* memory, spcenq() returns information about the state of the struct, and
* spcprt() prints its contents.
a240 26
* spcenq() - enquire about the state of a spcprm struct
* -----------------------------------------------------
* spcenq() may be used to obtain information about the state of a spcprm
* struct.  The function returns a true/false answer for the enquiry asked.
*
* Given:
*   spc       const struct spcprm*
*                       Spectral transformation parameters.
*
*   enquiry   int       Enquiry according to the following parameters:
*                         SPCENQ_MEM: memory in the struct is being managed by
*                                     WCSLIB (see spcini()).
*                         SPCENQ_SET: the struct has been set up by spcset().
*                         SPCENQ_BYP: the struct is in bypass mode, which
*                                     implies that it has been set up (see
*                                     spcset()).
*                       These may be combined by logical OR, e.g.
*                       SPCENQ_MEM | SPCENQ_SET.  The enquiry result will be
*                       the logical AND of the individual results.
*
* Function return value:
*             int       Enquiry result:
*                         0: No.
*                         1: Yes.
*
*
a283 7
* spcset() normally operates regardless of the value of spcprm::flag; i.e.
* even if a struct was previously set up it will be reset unconditionally.
* However, a spcprm struct may be put into "bypass" mode by invoking spcset()
* initially with spcprm::flag == 1 (rather than 0).  spcset() will return
* immediately if invoked on a struct in that state.  To take a struct out of
* bypass mode, simply reset spcprm::flag to zero.  See also spcenq().
*
d716 2
a717 2
*     (Given and returned) This flag must be set to zero (or 1, see spcset())
*     whenever any of the following spcprm members are set or changed:
a817 4
enum spcenq_enum {
  SPCENQ_SET = 2,		// spcprm struct has been set up.
  SPCENQ_BYP = 4,		// spcprm struct is in bypass mode.
};
a890 2

int spcenq(const struct spcprm *spc, int enquiry);
@


8.2.1.4
log
@Amended the prologue comment for spcenq().
@
text
@d22 1
a22 1
  $Id: spc.h,v 8.2.1.3 2024/05/08 15:25:52 mcalabre Exp mcalabre $
d255 2
a256 1
*                         SPCENQ_BYP: the struct is in bypass mode (see
@


8.1
log
@WCSLIB 8.1
@
text
@d2 1
a2 1
  WCSLIB 8.1 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: spc.h,v 8.0.1.1 2023/07/01 06:22:44 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 8.1 - C routines that implement the FITS World Coordinate System
@


8.1.1.1
log
@WCSLIB 8.1 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 8.1 2023/07/05 17:12:07 mcalabre Exp $
@


8.0
log
@WCSLIB 8.0
@
text
@d2 1
a2 1
  WCSLIB 8.0 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: spc.h,v 7.13.1.2 2023/06/15 04:17:19 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 8.0 - C routines that implement the FITS World Coordinate System
@


8.0.1.1
log
@WCSLIB 8.0 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 8.0 2023/07/01 06:15:04 mcalabre Exp $
@


7.13
log
@WCSLIB 7.13
@
text
@d2 2
a3 2
  WCSLIB 7.13 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2022, Mark Calabretta
d22 1
a22 1
  $Id: spc.h,v 7.12.1.1 2022/09/09 05:00:36 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.13 - C routines that implement the FITS World Coordinate System
@


7.13.1.1
log
@WCSLIB 7.13 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 7.13 2022/10/07 03:43:35 mcalabre Exp $
@


7.13.1.2
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2023, Mark Calabretta
d22 1
a22 1
  $Id: spc.h,v 7.13.1.1 2022/10/07 03:45:47 mcalabre Exp mcalabre $
@


7.12
log
@WCSLIB 7.12
@
text
@d2 1
a2 1
  WCSLIB 7.12 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: spc.h,v 7.11.1.1 2022/04/26 06:15:32 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.12 - C routines that implement the FITS World Coordinate System
@


7.12.1.1
log
@WCSLIB 7.12 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 7.12 2022/09/09 04:57:58 mcalabre Exp $
@


7.11
log
@WCSLIB 7.11
@
text
@d2 1
a2 1
  WCSLIB 7.11 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: spc.h,v 7.10.1.1 2022/04/23 14:26:54 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.11 - C routines that implement the FITS World Coordinate System
@


7.11.1.1
log
@WCSLIB 7.11 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 7.11 2022/04/26 06:13:52 mcalabre Exp $
@


7.10
log
@WCSLIB 7.10
@
text
@d2 1
a2 1
  WCSLIB 7.10 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: spc.h,v 7.9.1.1 2022/03/25 15:16:40 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.10 - C routines that implement the FITS World Coordinate System
@


7.10.1.1
log
@WCSLIB 7.10 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 7.10 2022/04/23 14:25:15 mcalabre Exp $
@


7.9
log
@WCSLIB 7.9
@
text
@d2 1
a2 1
  WCSLIB 7.9 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: spc.h,v 7.8.1.1 2022/03/25 06:14:14 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.9 - C routines that implement the FITS World Coordinate System
@


7.9.1.1
log
@WCSLIB 7.9 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 7.9 2022/03/25 15:14:48 mcalabre Exp $
@


7.8
log
@WCSLIB 7.8
@
text
@d2 1
a2 1
  WCSLIB 7.8 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: spc.h,v 7.7.1.2 2022/03/25 06:05:59 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.8 - C routines that implement the FITS World Coordinate System
@


7.8.1.1
log
@WCSLIB 7.8 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 7.8 2022/03/25 06:11:49 mcalabre Exp $
@


7.7
log
@WCSLIB 7.7
@
text
@d2 2
a3 2
  WCSLIB 7.7 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2021, Mark Calabretta
d22 1
a22 1
  $Id: spc.h,v 7.6.1.1 2021/04/13 13:00:35 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.7 - C routines that implement the FITS World Coordinate System
@


7.7.1.1
log
@WCSLIB 7.7 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 7.7 2021/07/12 06:36:49 mcalabre Exp $
@


7.7.1.2
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2022, Mark Calabretta
d22 1
a22 1
  $Id: spc.h,v 7.7.1.1 2021/07/12 06:38:27 mcalabre Exp mcalabre $
@


7.6
log
@WCSLIB 7.6
@
text
@d2 1
a2 1
  WCSLIB 7.6 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: spc.h,v 7.5.1.2 2021/04/13 09:21:51 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.6 - C routines that implement the FITS World Coordinate System
@


7.6.1.1
log
@WCSLIB 7.6 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 7.6 2021/04/13 12:57:01 mcalabre Exp $
@


7.5
log
@WCSLIB 7.5
@
text
@d2 1
a2 1
  WCSLIB 7.5 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: spc.h,v 7.4.1.1 2021/01/31 02:26:24 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.5 - C routines that implement the FITS World Coordinate System
d52 2
a53 1
* an error message, and spcprt() prints its contents.
d214 27
d889 2
@


7.5.1.1
log
@WCSLIB 7.5 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 7.5 2021/03/20 05:54:58 mcalabre Exp $
@


7.5.1.2
log
@Added new function spcsize().
@
text
@d22 1
a22 1
  $Id: spc.h,v 7.5.1.1 2021/03/20 05:56:42 mcalabre Exp mcalabre $
d52 1
a52 2
* an error message, spcsize() computes its total size including allocated
* memory, and spcprt() prints its contents.
a212 27
* spcsize() - Compute the size of a spcprm struct
* -----------------------------------------------
* spcsize() computes the full size of a spcprm struct, including allocated
* memory.
*
* Given:
*   spc       const struct spcprm*
*                       Spectral transformation parameters.
*
*                       If NULL, the base size of the struct and the allocated
*                       size are both set to zero.
*
* Returned:
*   sizes     int[2]    The first element is the base size of the struct as
*                       returned by sizeof(struct spcprm).  The second element
*                       is the total allocated size, in bytes.  This figure
*                       includes memory allocated for the constituent struct,
*                       spcprm::err.
*
*                       It is not an error for the struct not to have been set
*                       up via spcset().
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*
*
a860 2

int spcsize(const struct spcprm *spc, int sizes[2]);
@


7.4
log
@WCSLIB 7.4
@
text
@d2 1
a2 1
  WCSLIB 7.4 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: spc.h,v 7.3.1.4 2021/01/28 12:29:30 mcalabre Exp $
d25 1
a25 1
* WCSLIB 7.4 - C routines that implement the FITS World Coordinate System
@


7.4.1.1
log
@WCSLIB 7.4 development branch.
@
text
@d22 1
a22 1
  $Id: spc.h,v 7.4 2021/01/31 02:24:51 mcalabre Exp $
@


7.3
log
@WCSLIB 7.3
@
text
@d2 2
a3 3

  WCSLIB 7.3 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2020, Mark Calabretta
a19 2
  Direct correspondence concerning WCSLIB to mark@@calabretta.id.au

d22 1
a22 1
  $Id: spc.h,v 7.2.1.1 2020/03/09 07:34:50 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.3 - C routines that implement the FITS World Coordinate System
d794 8
a801 8
  SPCERR_NO_CHANGE       = -1,	/* No change. */
  SPCERR_SUCCESS         =  0,	/* Success. */
  SPCERR_NULL_POINTER    =  1,	/* Null spcprm pointer passed. */
  SPCERR_BAD_SPEC_PARAMS =  2,	/* Invalid spectral parameters. */
  SPCERR_BAD_X           =  3,	/* One or more of x coordinates were
				   invalid. */
  SPCERR_BAD_SPEC        =  4 	/* One or more of the spec coordinates were
				   invalid. */
d805 29
a833 29
  /* Initialization flag (see the prologue above).                          */
  /*------------------------------------------------------------------------*/
  int    flag;			/* Set to zero to force initialization.     */

  /* Parameters to be provided (see the prologue above).                    */
  /*------------------------------------------------------------------------*/
  char   type[8];		/* Four-letter spectral variable type.      */
  char   code[4];		/* Three-letter spectral algorithm code.    */

  double crval;			/* Reference value (CRVALia), SI units.     */
  double restfrq;		/* Rest frequency, Hz.                      */
  double restwav;		/* Rest wavelength, m.                      */

  double pv[7];			/* Grism parameters:                        */
				/*   0: G, grating ruling density.          */
				/*   1: m, interference order.              */
				/*   2: alpha, angle of incidence.          */
				/*   3: n_r, refractive index at lambda_r.  */
				/*   4: n'_r, dn/dlambda at lambda_r.       */
				/*   5: epsilon, grating tilt angle.        */
				/*   6: theta, detector tilt angle.         */

  /* Information derived from the parameters supplied.                      */
  /*------------------------------------------------------------------------*/
  double w[6];			/* Intermediate values.                     */
				/*   0: Rest frequency or wavelength (SI).  */
				/*   1: CRVALX (SI units).                  */
				/*   2: CDELTX/CDELTia = dX/dS (SI units).  */
				/* The remainder are grism intermediates.   */
d835 2
a836 2
  int    isGrism;		/* Grism coordinates?  1: vacuum, 2: air.   */
  int    padding1;		/* (Dummy inserted for alignment purposes.) */
d838 2
a839 2
  /* Error handling                                                         */
  /*------------------------------------------------------------------------*/
d842 10
a851 10
  /* Private                                                                */
  /*------------------------------------------------------------------------*/
  void   *padding2;		/* (Dummy inserted for alignment purposes.) */
  int (*spxX2P)(SPX_ARGS);	/* Pointers to the transformation functions */
  int (*spxP2S)(SPX_ARGS);	/* in the two-step algorithm chain in the   */
				/* pixel-to-spectral direction.             */

  int (*spxS2P)(SPX_ARGS);	/* Pointers to the transformation functions */
  int (*spxP2X)(SPX_ARGS);	/* in the two-step algorithm chain in the   */
				/* spectral-to-pixel direction.             */
d854 1
a854 1
/* Size of the spcprm struct in int units, used by the Fortran wrappers. */
d893 1
a893 1
/* Deprecated. */
d916 1
a916 1
#endif /* WCSLIB_SPC */
@


7.3.1.1
log
@WCSLIB 7.3 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 7.3 2020/06/03 03:37:02 mcalabre Exp $
@


7.3.1.2
log
@Switched to C99 style commenting (i.e. using //) within the code.
@
text
@d2 1
d25 1
a25 1
  $Id: spc.h,v 7.3.1.1 2020/06/03 03:38:10 mcalabre Exp mcalabre $
d797 8
a804 8
  SPCERR_NO_CHANGE       = -1,	// No change.
  SPCERR_SUCCESS         =  0,	// Success.
  SPCERR_NULL_POINTER    =  1,	// Null spcprm pointer passed.
  SPCERR_BAD_SPEC_PARAMS =  2,	// Invalid spectral parameters.
  SPCERR_BAD_X           =  3,	// One or more of x coordinates were
				// invalid.
  SPCERR_BAD_SPEC        =  4 	// One or more of the spec coordinates were
				// invalid.
d808 29
a836 29
  // Initialization flag (see the prologue above).
  //--------------------------------------------------------------------------
  int    flag;			// Set to zero to force initialization.

  // Parameters to be provided (see the prologue above).
  //--------------------------------------------------------------------------
  char   type[8];		// Four-letter spectral variable type.
  char   code[4];		// Three-letter spectral algorithm code.

  double crval;			// Reference value (CRVALia), SI units.
  double restfrq;		// Rest frequency, Hz.
  double restwav;		// Rest wavelength, m.

  double pv[7];			// Grism parameters:
				//   0: G, grating ruling density.
				//   1: m, interference order.
				//   2: alpha, angle of incidence.
				//   3: n_r, refractive index at lambda_r.
				//   4: n'_r, dn/dlambda at lambda_r.
				//   5: epsilon, grating tilt angle.
				//   6: theta, detector tilt angle.

  // Information derived from the parameters supplied.
  //--------------------------------------------------------------------------
  double w[6];			// Intermediate values.
				//   0: Rest frequency or wavelength (SI).
				//   1: CRVALX (SI units).
				//   2: CDELTX/CDELTia = dX/dS (SI units).
				// The remainder are grism intermediates.
d838 2
a839 2
  int    isGrism;		// Grism coordinates?  1: vacuum, 2: air.
  int    padding1;		// (Dummy inserted for alignment purposes.)
d841 2
a842 2
  // Error handling
  //--------------------------------------------------------------------------
d845 10
a854 10
  // Private
  //--------------------------------------------------------------------------
  void   *padding2;		// (Dummy inserted for alignment purposes.)
  int (*spxX2P)(SPX_ARGS);	// Pointers to the transformation functions
  int (*spxP2S)(SPX_ARGS);	// in the two-step algorithm chain in the
				// pixel-to-spectral direction.

  int (*spxS2P)(SPX_ARGS);	// Pointers to the transformation functions
  int (*spxP2X)(SPX_ARGS);	// in the two-step algorithm chain in the
				// spectral-to-pixel direction.
d857 1
a857 1
// Size of the spcprm struct in int units, used by the Fortran wrappers.
d896 1
a896 1
// Deprecated.
d919 1
a919 1
#endif // WCSLIB_SPC
@


7.3.1.3
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2021, Mark Calabretta
d24 1
a24 1
  $Id: spc.h,v 7.3.1.2 2020/08/17 11:19:09 mcalabre Exp mcalabre $
@


7.3.1.4
log
@Removed my email address from the copyright notice.
@
text
@d20 2
d24 1
a24 1
  $Id: spc.h,v 7.3.1.3 2021/01/19 14:09:10 mcalabre Exp mcalabre $
@


7.2
log
@WCSLIB 7.2
@
text
@d3 1
a3 1
  WCSLIB 7.2 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 7.1.1.1 2019/12/31 13:28:19 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 7.2 - C routines that implement the FITS World Coordinate System
@


7.2.1.1
log
@WCSLIB 7.2 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 7.2 2020/03/09 07:31:23 mcalabre Exp $
@


7.1
log
@WCSLIB 7.1
@
text
@d3 1
a3 1
  WCSLIB 7.1 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 6.4.1.2 2019/12/31 03:28:03 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 7.1 - C routines that implement the FITS World Coordinate System
@


7.1.1.1
log
@WCSLIB 7.1 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 7.1 2019/12/31 13:25:19 mcalabre Exp $
@


6.4
log
@WCSLIB 6.4
@
text
@d3 2
a4 2
  WCSLIB 6.4 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2019, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 6.3.1.1 2019/07/12 07:34:37 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 6.4 - C routines that implement the FITS World Coordinate System
@


6.4.1.1
log
@WCSLIB 6.4 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 6.4 2019/08/15 09:30:18 mcalabre Exp $
@


6.4.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2020, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 6.4.1.1 2019/08/15 09:31:29 mcalabre Exp mcalabre $
@


6.3
log
@WCSLIB 6.3
@
text
@d3 1
a3 1
  WCSLIB 6.3 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 6.2.1.3 2019/07/11 02:19:06 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 6.3 - C routines that implement the FITS World Coordinate System
@


6.3.1.1
log
@WCSLIB 6.3 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 6.3 2019/07/12 07:33:39 mcalabre Exp $
@


6.2
log
@WCSLIB 6.2
@
text
@d3 2
a4 2
  WCSLIB 6.2 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2018, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 6.1.1.1 2018/10/19 08:36:15 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System
d185 5
@


6.2.1.1
log
@WCSLIB 6.2 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $
@


6.2.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2019, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 6.2.1.1 2018/10/20 10:04:15 mcalabre Exp mcalabre $
@


6.2.1.3
log
@In the usage notes for spcini(), note that, before reinitialising a spcprm
struct, spcfree() should be used to free any memory that may have been
allocated for an error message.
@
text
@d25 1
a25 1
  $Id: spc.h,v 6.2.1.2 2019/05/10 01:56:50 mcalabre Exp mcalabre $
a184 5
*
* PLEASE NOTE: If the spcprm struct has already been initialized, then before
* reinitializing, it spcfree() should be used to free any memory that may have
* been allocated to store an error message.  A memory leak may otherwise
* result.
@


6.1
log
@WCSLIB 6.1
@
text
@d3 1
a3 1
  WCSLIB 6.1 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.20.1.1 2018/10/05 05:33:33 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 6.1 - C routines that implement the FITS World Coordinate System
@


6.1.1.1
log
@WCSLIB 6.1 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 6.1 2018/10/19 08:35:17 mcalabre Exp $
@


5.20
log
@WCSLIB 5.20
@
text
@d3 1
a3 1
  WCSLIB 5.20 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.19.1.1 2018/07/26 15:41:40 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.20 - C routines that implement the FITS World Coordinate System
@


5.20.1.1
log
@WCSLIB 5.20 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.20 2018/10/05 05:32:41 mcalabre Exp $
@


5.19
log
@WCSLIB 5.19
@
text
@d3 1
a3 1
  WCSLIB 5.19 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.18.1.2 2018/07/05 09:41:35 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.19 - C routines that implement the FITS World Coordinate System
@


5.19.1.1
log
@WCSLIB 5.19 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.19 2018/07/26 15:37:04 mcalabre Exp $
@


5.18
log
@WCSLIB 5.18
@
text
@d3 1
a3 1
  WCSLIB 5.18 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.17.1.2 2018/01/10 08:25:34 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.18 - C routines that implement the FITS World Coordinate System
d97 18
a114 18
*     F: frequency
*       'FREQ':  frequency
*       'AFRQ':  angular frequency
*       'ENER':  photon energy
*       'WAVN':  wave number
*       'VRAD':  radio velocity
*
*     W: wavelength in vacuo
*       'WAVE':  wavelength
*       'VOPT':  optical velocity
*       'ZOPT':  redshift
*
*     A: wavelength in air
*       'AWAV':  wavelength in air
*
*     V: velocity
*       'VELO':  relativistic velocity
*       'BETA':  relativistic beta factor
d158 5
@


5.18.1.1
log
@WCSLIB 5.18 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.18 2018/01/10 08:32:14 mcalabre Exp $
@


5.18.1.2
log
@Added a cross-reference to a note in spx.h concerning the air-to-vacuum
wavelength conversion.  Fixed a formatting problem in the manual for the
section explaining spectral variable types.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.18.1.1 2018/01/10 08:33:04 mcalabre Exp mcalabre $
d97 18
a114 18
*     F (Frequency):
*       - 'FREQ':  frequency
*       - 'AFRQ':  angular frequency
*       - 'ENER':  photon energy
*       - 'WAVN':  wave number
*       - 'VRAD':  radio velocity
*
*     W (Wavelength in vacuo):
*       - 'WAVE':  wavelength
*       - 'VOPT':  optical velocity
*       - 'ZOPT':  redshift
*
*     A (wavelength in Air):
*       - 'AWAV':  wavelength in air
*
*     V (Velocity):
*       - 'VELO':  relativistic velocity
*       - 'BETA':  relativistic beta factor
a157 5
*
* Air-to-vacuum wavelength conversion:
* ------------------------------------
* Please refer to the prologue of spx.h for important comments relating to the
* air-to-vacuum wavelength conversion.
@


5.17
log
@WCSLIB 5.17
@
text
@d3 2
a4 2
  WCSLIB 5.17 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2017, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 5.16.1.1 2017/01/15 04:28:59 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.17 - C routines that implement the FITS World Coordinate System
@


5.17.1.1
log
@WCSLIB 5.17 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.17 2017/09/18 08:44:23 mcalabre Exp $
@


5.17.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2018, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 5.17.1.1 2017/09/18 08:45:59 mcalabre Exp mcalabre $
@


5.16
log
@WCSLIB 5.16
@
text
@d3 1
a3 1
  WCSLIB 5.16 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.15.1.2 2017/01/15 04:14:00 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.16 - C routines that implement the FITS World Coordinate System
@


5.16.1.1
log
@WCSLIB 5.16 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.16 2017/01/15 04:25:01 mcalabre Exp $
@


5.15
log
@WCSLIB 5.15
@
text
@d3 2
a4 2
  WCSLIB 5.15 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2016, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 5.14.1.2 2016/03/21 06:09:11 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.15 - C routines that implement the FITS World Coordinate System
@


5.15.1.1
log
@WCSLIB 5.15 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.15 2016/04/05 12:55:10 mcalabre Exp $
@


5.15.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2017, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 5.15.1.1 2016/04/05 12:58:35 mcalabre Exp mcalabre $
@


5.14
log
@WCSLIB 5.14
@
text
@d3 1
a3 1
  WCSLIB 5.14 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.13.1.1 2016/01/26 08:54:32 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.14 - C routines that implement the FITS World Coordinate System
d650 3
@


5.14.1.1
log
@WCSLIB 5.14 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.14 2016/02/07 10:49:31 mcalabre Exp $
@


5.14.1.2
log
@In the prologue for spcaips(), record that the default value of VELREF is 0.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.14.1.1 2016/02/07 10:52:44 mcalabre Exp mcalabre $
a649 3
*
*                       If omitted from the header, the default value of
*                       VELREF is 0.
@


5.13
log
@WCSLIB 5.13
@
text
@d3 1
a3 1
  WCSLIB 5.13 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.12.1.2 2016/01/25 05:17:04 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.13 - C routines that implement the FITS World Coordinate System
@


5.13.1.1
log
@WCSLIB 5.13 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.13 2016/01/26 08:51:13 mcalabre Exp $
@


5.12
log
@WCSLIB 5.12
@
text
@d3 2
a4 2
  WCSLIB 5.12 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2015, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 5.11.1.1 2015/10/18 09:16:27 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.12 - C routines that implement the FITS World Coordinate System
@


5.12.1.1
log
@WCSLIB 5.12 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.12 2015/11/15 02:13:00 mcalabre Exp $
@


5.12.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2016, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 5.12.1.1 2015/11/15 02:16:14 mcalabre Exp mcalabre $
@


5.11
log
@WCSLIB 5.11
@
text
@d3 1
a3 1
  WCSLIB 5.11 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.10.1.1 2015/10/09 08:22:35 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.11 - C routines that implement the FITS World Coordinate System
@


5.11.1.1
log
@WCSLIB 5.11 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.11 2015/10/18 09:13:05 mcalabre Exp $
@


5.10
log
@WCSLIB 5.10
@
text
@d3 1
a3 1
  WCSLIB 5.10 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.9.1.1 2015/07/21 09:28:07 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.10 - C routines that implement the FITS World Coordinate System
@


5.10.1.1
log
@WCSLIB 5.10 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.10 2015/10/09 08:19:15 mcalabre Exp $
@


5.9
log
@WCSLIB 5.9
@
text
@d3 1
a3 1
  WCSLIB 5.9 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.8.1.1 2015/07/08 11:07:18 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.9 - C routines that implement the FITS World Coordinate System
@


5.9.1.1
log
@WCSLIB 5.9 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.9 2015/07/21 09:20:01 mcalabre Exp $
@


5.8
log
@WCSLIB 5.8
@
text
@d3 1
a3 1
  WCSLIB 5.8 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.7.1.1 2015/06/29 02:47:24 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.8 - C routines that implement the FITS World Coordinate System
@


5.8.1.1
log
@WCSLIB 5.8 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.8 2015/07/08 11:03:59 mcalabre Exp $
@


5.7
log
@WCSLIB 5.7
@
text
@d3 1
a3 1
  WCSLIB 5.7 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.6.1.2 2015/06/18 08:12:52 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.7 - C routines that implement the FITS World Coordinate System
@


5.7.1.1
log
@WCSLIB 5.7 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.7 2015/06/29 02:44:16 mcalabre Exp $
@


5.6
log
@WCSLIB 5.6
@
text
@d3 1
a3 1
  WCSLIB 5.6 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.5.1.1 2015/05/05 13:21:00 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.6 - C routines that implement the FITS World Coordinate System
d57 2
d221 19
d853 2
@


5.6.1.1
log
@WCSLIB 5.6 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.6 2015/06/14 07:11:24 mcalabre Exp $
@


5.6.1.2
log
@Added spcperr() for convenience in reporting errors.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.6.1.1 2015/06/14 07:14:44 mcalabre Exp mcalabre $
a56 2
* spcperr() prints the error message(s) (if any) stored in a spcprm struct.
*
a218 19
* spcperr() - Print error messages from a spcprm struct
* -----------------------------------------------------
* spcperr() prints the error message(s) (if any) stored in a spcprm struct.
* If there are no errors then nothing is printed.  It uses wcserr_prt(), q.v.
*
* Given:
*   spc       const struct spcprm*
*                       Spectral transformation parameters.
*
*   prefix    const char *
*                       If non-NULL, each output line will be prefixed with
*                       this string.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null spcprm pointer passed.
*
*
a831 2

int spcperr(const struct spcprm *spc, const char *prefix);
@


5.5
log
@WCSLIB 5.5
@
text
@d3 1
a3 1
  WCSLIB 5.5 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.4.1.2 2015/04/23 11:03:11 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.5 - C routines that implement the FITS World Coordinate System
@


5.5.1.1
log
@WCSLIB 5.5 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.5 2015/05/05 13:16:31 mcalabre Exp $
@


5.4
log
@WCSLIB 5.4
@
text
@d3 1
a3 1
  WCSLIB 5.4 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.3.1.1 2015/04/21 02:54:02 mcalabre Exp mcalabre $
d28 3
a30 12
* WCSLIB 5.4 - C routines that implement the spectral coordinate systems
* recognized by the FITS World Coordinate System (WCS) standard.  Refer to
*
*   "Representations of world coordinates in FITS",
*   Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (Paper I)
*
*   "Representations of spectral coordinates in FITS",
*   Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L.
*   2006, A&A, 446, 747 (Paper III)
*
* Refer to the README file provided with WCSLIB for an overview of the
* library.
d35 17
a51 8
* These routines implement the part of the FITS WCS standard that deals with
* spectral coordinates.  They define methods to be used for computing spectral
* world coordinates from intermediate world coordinates (a linear
* transformation of image pixel coordinates), and vice versa.  They are based
* on the spcprm struct which contains all information needed for the
* computations.  The struct contains some members that must be set by the
* user, and others that are maintained by these routines, somewhat like a
* C++ class but with no encapsulation.
@


5.4.1.1
log
@WCSLIB 5.4 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.4 2015/04/21 14:41:05 mcalabre Exp $
@


5.4.1.2
log
@Boilerplate change to the prologue to ensure that references to the WCS
Papers appear in the doxygen manual.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.4.1.1 2015/04/21 14:44:28 mcalabre Exp mcalabre $
d28 12
a39 3
* WCSLIB 5.4 - C routines that implement the FITS World Coordinate System
* (WCS) standard.  Refer to the README file provided with WCSLIB for an
* overview of the library.
d44 8
a51 17
* Routines in this suite implement the part of the FITS World Coordinate
* System (WCS) standard that deals with spectral coordinates, as described in
*
=   "Representations of world coordinates in FITS",
=   Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I)
=
=   "Representations of spectral coordinates in FITS",
=   Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L.
=   2006, A&A, 446, 747 (WCS Paper III)
*
* These routines define methods to be used for computing spectral world
* coordinates from intermediate world coordinates (a linear transformation
* of image pixel coordinates), and vice versa.  They are based on the spcprm
* struct which contains all information needed for the computations.  The
* struct contains some members that must be set by the user, and others that
* are maintained by these routines, somewhat like a C++ class but with no
* encapsulation.
@


5.3
log
@WCSLIB 5.3
@
text
@d3 1
a3 1
  WCSLIB 5.3 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.2.1.1 2015/04/15 12:39:14 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.3 - C routines that implement the spectral coordinate systems
@


5.3.1.1
log
@WCSLIB 5.3 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.3 2015/04/21 02:50:51 mcalabre Exp $
@


5.2
log
@WCSLIB 5.2
@
text
@d3 1
a3 1
  WCSLIB 5.2 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.1.1.1 2015/04/07 11:01:10 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.2 - C routines that implement the spectral coordinate systems
@


5.2.1.1
log
@WCSLIB 5.2 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.2 2015/04/15 12:35:07 mcalabre Exp $
@


5.1
log
@WCSLIB 5.1
@
text
@d3 1
a3 1
  WCSLIB 5.1 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 5.0.1.1 2015/04/05 12:28:00 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.1 - C routines that implement the spectral coordinate systems
@


5.1.1.1
log
@WCSLIB 5.1 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.1 2015/04/07 10:56:36 mcalabre Exp $
@


5.0
log
@WCSLIB 5.0
@
text
@d3 1
a3 1
  WCSLIB 5.0 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 4.25.1.4 2015/04/03 02:42:22 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.0 - C routines that implement the spectral coordinate systems
@


5.0.1.1
log
@WCSLIB 5.0 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 5.0 2015/04/05 12:24:59 mcalabre Exp $
@


4.25
log
@WCSLIB 4.25
@
text
@d3 2
a4 2
  WCSLIB 4.25 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2014, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 4.24.1.1 2014/09/18 15:28:09 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 4.25 - C routines that implement the spectral coordinate systems
d722 1
a722 1
*     (Returned) If enabled, when an error status is returned this structure
a753 1
#include "wcserr.h"
d871 1
a871 1
	   double *crvalX, double *dXdS);
d874 1
a874 1
	   double *crvalS, double *dSdX);
@


4.25.1.1
log
@WCSLIB 4.25 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.25 2014/12/14 14:29:36 mcalabre Exp $
@


4.25.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2015, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 4.25.1.1 2014/12/14 14:32:45 mcalabre Exp mcalabre $
@


4.25.1.3
log
@No need to include wcserr.h.  Prologue wording tweaks.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.25.1.2 2015/01/06 01:01:06 mcalabre Exp mcalabre $
d722 1
a722 1
*     (Returned) If enabled, when an error status is returned, this struct
d754 1
@


4.25.1.4
log
@Dealt with aberrant tabs.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.25.1.3 2015/04/03 01:15:21 mcalabre Exp mcalabre $
d871 1
a871 1
           double *crvalX, double *dXdS);
d874 1
a874 1
           double *crvalS, double *dSdX);
@


4.24
log
@WCSLIB 4.24
@
text
@d3 1
a3 1
  WCSLIB 4.24 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 4.23.1.1 2014/05/13 05:53:49 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 4.24 - C routines that implement the spectral coordinate systems
@


4.24.1.1
log
@WCSLIB 4.24 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.24 2014/09/18 15:25:00 mcalabre Exp $
@


4.23
log
@WCSLIB 4.23
@
text
@d3 1
a3 1
  WCSLIB 4.23 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 4.22.1.1 2014/04/12 15:06:32 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 4.23 - C routines that implement the spectral coordinate systems
@


4.23.1.1
log
@WCSLIB 4.23 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.23 2014/05/13 05:50:51 mcalabre Exp $
@


4.22
log
@WCSLIB 4.22
@
text
@d3 1
a3 1
  WCSLIB 4.22 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 4.21.1.1 2014/03/24 05:15:28 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 4.22 - C routines that implement the spectral coordinate systems
@


4.22.1.1
log
@WCSLIB 4.22 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.22 2014/04/12 15:03:52 mcalabre Exp $
@


4.21
log
@WCSLIB 4.21
@
text
@d3 1
a3 1
  WCSLIB 4.21 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 4.20.1.2 2014/03/21 06:32:19 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 4.21 - C routines that implement the spectral coordinate systems
@


4.21.1.1
log
@WCSLIB 4.21 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.21 2014/03/24 05:12:27 mcalabre Exp $
@


4.20
log
@WCSLIB 4.20
@
text
@d3 2
a4 2
  WCSLIB 4.20 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2013, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 4.19.1.1 2013/09/29 14:20:38 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 4.20 - C routines that implement the spectral coordinate systems
@


4.20.1.1
log
@WCSLIB 4.20 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.20 2013/12/18 05:42:49 mcalabre Exp $
@


4.20.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2014, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 4.20.1.1 2013/12/18 05:46:55 mcalabre Exp mcalabre $
@


4.19
log
@WCSLIB 4.19
@
text
@d3 1
a3 1
  WCSLIB 4.19 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 4.18.1.1 2013/07/13 10:02:37 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 4.19 - C routines that implement the spectral coordinate systems
@


4.19.1.1
log
@WCSLIB 4.19 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.19 2013/09/29 14:17:51 mcalabre Exp $
@


4.18
log
@WCSLIB 4.18
@
text
@d3 1
a3 1
  WCSLIB 4.18 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 4.17.1.1 2013/01/29 05:32:32 cal103 Exp cal103 $
d28 1
a28 1
* WCSLIB 4.18 - C routines that implement the spectral coordinate systems
@


4.18.1.1
log
@WCSLIB 4.18 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.18 2013/07/13 10:00:04 mcalabre Exp $
@


4.17
log
@WCSLIB 4.17
@
text
@d3 1
a3 1
  WCSLIB 4.17 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 4.16.1.3 2013/01/29 05:09:44 cal103 Exp cal103 $
d28 1
a28 1
* WCSLIB 4.17 - C routines that implement the spectral coordinate systems
@


4.17.1.1
log
@WCSLIB 4.17 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.17 2013/01/29 05:29:20 cal103 Exp $
@


4.16
log
@WCSLIB 4.16
@
text
@d3 2
a4 2
  WCSLIB 4.16 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2012, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 4.15.1.1 2012/09/26 14:27:51 cal103 Exp cal103 $
d28 1
a28 1
* WCSLIB 4.16 - C routines that implement the spectral coordinate systems
d842 1
a842 1
int spctype(const char ctype[], char stype[], char scode[], char sname[],
d846 1
a846 1
int spcspxe(const char ctypeS[], double crvalS, double restfrq,
d850 1
a850 1
int spcxpse(const char ctypeS[], double crvalX, double restfrq,
d854 2
a855 2
int spctrne(const char ctypeS1[], double crvalS1, double cdeltS1,
            double restfrq, double restwav, char ctypeS2[], double *crvalS2,
d858 1
a858 1
int spcaips(const char ctypeA[], int velref, char ctype[], char specsys[]);
d868 1
a868 1
int spctyp(const char ctype[], char stype[], char scode[], char sname[],
d870 8
a877 8
int spcspx(const char ctypeS[], double crvalS, double restfrq, double restwav,
           char *ptype, char *xtype, int *restreq, double *crvalX,
           double *dXdS);
int spcxps(const char ctypeS[], double crvalX, double restfrq, double restwav,
           char *ptype, char *xtype, int *restreq, double *crvalS,
           double *dSdX);
int spctrn(const char ctypeS1[], double crvalS1, double cdeltS1,
           double restfrq, double restwav, char ctypeS2[], double *crvalS2,
@


4.16.1.1
log
@WCSLIB 4.16 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.16 2012/11/07 04:42:44 cal103 Exp $
@


4.16.1.2
log
@Indicate the expected size of arrays in several function prototypes.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.16.1.1 2012/11/07 04:45:56 cal103 Exp cal103 $
d842 1
a842 1
int spctype(const char ctype[9], char stype[], char scode[], char sname[],
d846 1
a846 1
int spcspxe(const char ctypeS[9], double crvalS, double restfrq,
d850 1
a850 1
int spcxpse(const char ctypeS[9], double crvalX, double restfrq,
d854 2
a855 2
int spctrne(const char ctypeS1[9], double crvalS1, double cdeltS1,
            double restfrq, double restwav, char ctypeS2[9], double *crvalS2,
d858 1
a858 1
int spcaips(const char ctypeA[9], int velref, char ctype[9], char specsys[9]);
d868 1
a868 1
int spctyp(const char ctype[9], char stype[], char scode[], char sname[],
d870 8
a877 8
int spcspx(const char ctypeS[9], double crvalS, double restfrq,
           double restwav, char *ptype, char *xtype, int *restreq,
	   double *crvalX, double *dXdS);
int spcxps(const char ctypeS[9], double crvalX, double restfrq,
           double restwav, char *ptype, char *xtype, int *restreq,
	   double *crvalS, double *dSdX);
int spctrn(const char ctypeS1[9], double crvalS1, double cdeltS1,
           double restfrq, double restwav, char ctypeS2[9], double *crvalS2,
@


4.16.1.3
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2013, Mark Calabretta
d25 1
a25 1
  $Id: spc.h,v 4.16.1.2 2012/11/29 04:40:32 cal103 Exp cal103 $
@


4.15
log
@WCSLIB 4.15
@
text
@d3 1
a3 1
  WCSLIB 4.15 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 4.14.1.2 2012/09/26 07:53:12 cal103 Exp cal103 $
d28 1
a28 1
* WCSLIB 4.15 - C routines that implement the spectral coordinate systems
@


4.15.1.1
log
@WCSLIB 4.15 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.15 2012/09/26 14:26:05 cal103 Exp $
@


4.14
log
@WCSLIB 4.14
@
text
@d3 1
a3 1
  WCSLIB 4.14 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: spc.h,v 4.13.1.2 2012/07/13 03:34:20 cal103 Exp cal103 $
d28 1
a28 1
* WCSLIB 4.14 - C routines that implement the spectral coordinate systems
d380 5
a384 3
*                       For function return values > 1, this struct will
*                       contain a detailed error message.  May be NULL if an
*                       error message is not desired.
d440 5
a444 3
*                       For function return values > 1, this struct will
*                       contain a detailed error message.  May be NULL if an
*                       error message is not desired.
d502 5
a506 3
*                       For function return values > 1, this struct will
*                       contain a detailed error message.  May be NULL if an
*                       error message is not desired.
d570 5
a574 3
*                       For function return values > 1, this struct will
*                       contain a detailed error message.  May be NULL if an
*                       error message is not desired.
@


4.14.1.1
log
@WCSLIB 4.14 development branch.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.14 2012/07/13 10:02:27 cal103 Exp $
@


4.14.1.2
log
@In the prologue of spctype(), spcspxe(), spcxpse(), and spctrne(), advise
that the user is responsible for deleting the memory allocated for the
wcserr struct.
@
text
@d25 1
a25 1
  $Id: spc.h,v 4.14.1.1 2012/07/13 10:04:44 cal103 Exp cal103 $
d380 3
a382 5
*                       If enabled, for function return values > 1, this
*                       struct will contain a detailed error message, see
*                       wcserr_enable().  May be NULL if an error message is
*                       not desired.  Otherwise, the user is responsible for
*                       deleting the memory allocated for the wcserr struct.
d438 3
a440 5
*                       If enabled, for function return values > 1, this
*                       struct will contain a detailed error message, see
*                       wcserr_enable().  May be NULL if an error message is
*                       not desired.  Otherwise, the user is responsible for
*                       deleting the memory allocated for the wcserr struct.
d498 3
a500 5
*                       If enabled, for function return values > 1, this
*                       struct will contain a detailed error message, see
*                       wcserr_enable().  May be NULL if an error message is
*                       not desired.  Otherwise, the user is responsible for
*                       deleting the memory allocated for the wcserr struct.
d564 3
a566 5
*                       If enabled, for function return values > 1, this
*                       struct will contain a detailed error message, see
*                       wcserr_enable().  May be NULL if an error message is
*                       not desired.  Otherwise, the user is responsible for
*                       deleting the memory allocated for the wcserr struct.
@


4.13
log
@WCSLIB 4.13
@
text
@d3 1
a3 1
  WCSLIB 4.13 - an implementation of the FITS WCS standard.
d19 1
a19 1
  along with WCSLIB.  If not, see <http://www.gnu.org/licenses/>.
d21 5
a25 11
  Correspondence concerning WCSLIB may be directed to:
    Internet email: mcalabre@@atnf.csiro.au
    Postal address: Dr. Mark Calabretta
                    Australia Telescope National Facility, CSIRO
                    PO Box 76
                    Epping NSW 1710
                    AUSTRALIA

  Author: Mark Calabretta, Australia Telescope National Facility
  http://www.atnf.csiro.au/~mcalabre/index.html
  $Id: spc.h,v 4.12.1.1 2012/02/29 07:59:10 cal103 Exp cal103 $
d28 1
a28 1
* WCSLIB 4.13 - C routines that implement the spectral coordinate systems
@


4.13.1.1
log
@WCSLIB 4.13 development branch.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.13 2012/03/14 07:39:30 cal103 Exp $
@


4.13.1.2
log
@Changed contact details.
@
text
@d19 1
a19 1
  along with WCSLIB.  If not, see http://www.gnu.org/licenses.
d21 11
a31 5
  Direct correspondence concerning WCSLIB to mark@@calabretta.id.au

  Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
  http://www.atnf.csiro.au/people/Mark.Calabretta
  $Id: spc.h,v 4.13.1.1 2012/03/14 07:40:37 cal103 Exp cal103 $
@


4.12
log
@WCSLIB 4.12
@
text
@d3 1
a3 1
  WCSLIB 4.12 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: spc.h,v 4.11.1.2 2012/02/29 07:17:38 cal103 Exp cal103 $
d34 1
a34 1
* WCSLIB 4.12 - C routines that implement the spectral coordinate systems
@


4.12.1.1
log
@WCSLIB 4.12 development branch.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.12 2012/02/29 07:57:56 cal103 Exp $
@


4.11
log
@WCSLIB 4.11
@
text
@d3 1
a3 1
  WCSLIB 4.11 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: spc.h,v 4.10.1.1 2012/02/05 23:42:46 cal103 Exp cal103 $
d34 1
a34 1
* WCSLIB 4.11 - C routines that implement the spectral coordinate systems
d419 1
a419 5
*                       set to zero.  Neither are required if the translation
*                       is between wave-characteristic types, or between
*                       velocity-characteristic types.  E.g., required for
*                       'FREQ'     -> 'ZOPT-F2W', but not required for
*                       'VELO-F2V' -> 'ZOPT-F2W'.
d479 1
a479 5
*                       set to zero.  Neither are required if the translation
*                       is between wave-characteristic types, or between
*                       velocity-characteristic types.  E.g., required for
*                       'FREQ'     -> 'ZOPT-F2W', but not required for
*                       'VELO-F2V' -> 'ZOPT-F2W'.
@


4.11.1.1
log
@WCSLIB 4.11 development branch.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.11 2012/02/20 23:30:02 cal103 Exp $
@


4.11.1.2
log
@Fixed a comment relating spuriously to translation of spectral types in
the prologues of spcspxe() and spcxpse() - it appears to have come from
spctrne().
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.11.1.1 2012/02/20 23:31:13 cal103 Exp cal103 $
d419 5
a423 1
*                       set to zero.
d483 5
a487 1
*                       set to zero.
@


4.10
log
@WCSLIB 4.10
@
text
@d3 1
a3 1
  WCSLIB 4.10 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: spc.h,v 4.9.1.2 2012/02/02 08:11:36 cal103 Exp cal103 $
d34 1
a34 1
* WCSLIB 4.10 - C routines that implement the spectral coordinate systems
@


4.10.1.1
log
@WCSLIB 4.10 development branch.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.10 2012/02/05 23:41:44 cal103 Exp $
@


4.9
log
@WCSLIB 4.9
@
text
@d3 1
a3 1
  WCSLIB 4.9 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: spc.h,v 4.8.1.2 2012/01/24 05:23:06 cal103 Exp cal103 $
d34 1
a34 1
* WCSLIB 4.9 - C routines that implement the spectral coordinate systems
d87 2
a88 2
*   - spcaips() translates AIPS-convention spectral keywords, CTYPEn and
*     VELREF, into CTYPEia and SPECSYSa.
d595 1
a595 2
* spcaips() translates AIPS-convention spectral keywords, CTYPEn and VELREF,
* into CTYPEia and SPECSYSa.
d599 3
a601 2
*                       CTYPEia keyvalue (eight characters, need not be null-
*                       terminated).
d618 1
d620 7
a626 4
*                       is denoted by adding 256 to VELREF, otherwise an
*                       optical velocity is indicated (not applicable to
*                       'FELO' axes).  Unrecognized values of VELREF are
*                       simply ignored.
d629 1
a629 1
*                       Doppler frame, e.g. if
d631 2
a632 2
=                         CTYPEn = 'VELO-HEL'
=                         VELREF = 1
d634 1
a634 1
*                       the Doppler frame is set to LSRK.
d638 2
a639 1
*                       translation was performed (null-filled).
d641 5
a645 2
*   specsys   char[9]   Doppler reference frame indicated by VELREF or else by
*                       CTYPEn.
d651 1
d770 5
a774 4
  SPCERR_SUCCESS         = 0,	/* Success. */
  SPCERR_NULL_POINTER    = 1,	/* Null spcprm pointer passed. */
  SPCERR_BAD_SPEC_PARAMS = 2,	/* Invalid spectral parameters. */
  SPCERR_BAD_X           = 3,	/* One or more of x coordinates were
d776 1
a776 1
  SPCERR_BAD_SPEC        = 4 	/* One or more of the spec coordinates were
@


4.9.1.1
log
@WCSLIB 4.9 development branch.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.9 2012/01/24 05:40:29 cal103 Exp $
@


4.9.1.2
log
@spcaips() will now return an error status for invalid values of velref.
Worked over its prologue comments.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.9.1.1 2012/01/24 05:41:45 cal103 Exp cal103 $
d87 2
a88 2
*   - spcaips() translates AIPS-convention spectral CTYPEia and VELREF
*     keyvalues.
d595 2
a596 1
* spcaips() translates AIPS-convention spectral CTYPEia and VELREF keyvalues.
d600 2
a601 3
*                       CTYPEia keyvalue possibly containing an
*                       AIPS-convention spectral code (eight characters, need
*                       not be null-terminated).
a617 1
*
d619 4
a622 7
*                       (VRAD) is denoted by adding 256 to VELREF, otherwise
*                       an optical velocity (VOPT) is indicated (this is not
*                       applicable to 'FREQ' or 'FELO' axes).  Setting velref
*                       to 0 or 256 chooses between optical and radio velocity
*                       without specifying a Doppler frame, provided that a
*                       frame is encoded in ctypeA.  If not, i.e. for
*                       ctypeA = 'VELO', ctype will be returned as 'VELO'.
d625 1
a625 1
*                       Doppler frame, e.g.
d627 2
a628 2
=                         ctypeA = 'VELO-HEL'
=                         velref = 1
d630 1
a630 1
*                       returns ctype = 'VOPT' with specsys set to 'LSRK'.
d634 1
a634 2
*                       translation was performed (in which case any trailing
*                       blanks in ctypeA will be replaced with nulls).
d636 2
a637 5
*   specsys   char[9]   Doppler reference frame indicated by VELREF or else
*                       by CTYPEia with value corresponding to the SPECSYS
*                       keyvalue in the FITS WCS standard.  May be returned
*                       blank if neither specifies a Doppler frame, e.g.
*                       ctypeA = 'FELO' and velref%256 == 0.
a642 1
*                         2: Invalid value of VELREF.
d761 4
a764 5
  SPCERR_NO_CHANGE       = -1,	/* No change. */
  SPCERR_SUCCESS         =  0,	/* Success. */
  SPCERR_NULL_POINTER    =  1,	/* Null spcprm pointer passed. */
  SPCERR_BAD_SPEC_PARAMS =  2,	/* Invalid spectral parameters. */
  SPCERR_BAD_X           =  3,	/* One or more of x coordinates were
d766 1
a766 1
  SPCERR_BAD_SPEC        =  4 	/* One or more of the spec coordinates were
@


4.8
log
@WCSLIB 4.8
@
text
@d3 2
a4 2
  WCSLIB 4.8 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2011, Mark Calabretta
d31 1
a31 1
  $Id: spc.h,v 4.7.1.5 2011/08/15 05:54:51 cal103 Exp cal103 $
d34 1
a34 1
* WCSLIB 4.8 - C routines that implement the spectral coordinate systems
@


4.8.1.1
log
@WCSLIB 4.8 development branch.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.8 2011/08/15 08:05:53 cal103 Exp $
@


4.8.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2012, Mark Calabretta
d31 1
a31 1
  $Id: spc.h,v 4.8.1.1 2011/08/15 08:07:06 cal103 Exp cal103 $
@


4.7
log
@WCSLIB 4.7
@
text
@d3 1
a3 1
  WCSLIB 4.7 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: spc.h,v 4.6.1.2 2011/01/14 06:33:16 cal103 Exp cal103 $
d34 1
a34 1
* WCSLIB 4.7 - C routines that implement the spectral coordinate systems
d60 2
a61 1
* values, and another, spcprt(), to print its contents.
d75 1
a75 1
*   - spctyp() checks a spectral CTYPEia keyword for validity and returns
d78 1
a78 1
*   - Spectral keyword analysis routine spcspx() computes the values of the
d81 1
a81 1
*   - Spectral keyword synthesis routine, spcxps(), computes the S-type
d84 1
a84 1
*   - Given a set of spectral keywords, a translation routine, spctrn(),
d195 15
d212 2
a213 1
* spcprt() prints the contents of a spcprm struct.
d244 3
d258 1
d260 1
d262 1
d268 1
d281 3
d296 1
d298 1
d300 1
d306 1
d319 2
d322 6
a327 5
* spctyp() - Spectral CTYPEia keyword analysis
* --------------------------------------------
* spctyp() checks whether a CTYPEia keyvalue is a valid spectral axis type and
* if so returns information derived from it relating to the associated S-, P-,
* and X-type spectral variables (see explanation above).
d333 2
d345 1
d351 1
d355 1
d359 1
d362 1
d368 1
d385 5
d397 1
a397 1
* spcspx() - Spectral keyword analysis
d399 1
a399 1
* spcspx() analyses the CTYPEia and CRVALia FITS spectral axis keyword values
d402 2
d412 1
d415 1
d428 1
d434 1
d437 2
a438 1
*                       variables for this CTYPEia, as for spctyp().
d441 1
d447 5
d458 1
a458 1
* spcxps() - Spectral keyword synthesis
d460 1
a460 1
* spcxps(), for the spectral axis type specified and the value provided for
d466 2
d476 1
d479 1
d492 1
d497 1
d500 2
a501 1
*                       variables for this CTYPEia, as for spctyp().
d505 1
d511 5
d522 1
a522 1
* spctrn() - Spectral keyword translation
d524 1
a524 1
* spctrn() translates a set of FITS spectral axis keywords into the
d528 2
d538 1
d541 1
d544 1
d572 1
d577 5
d602 1
d635 1
d715 1
a715 1
*   int padding
d718 6
d751 1
d760 9
d773 1
a773 1
  int   flag;			/* Set to zero to force initialization.     */
d801 6
a806 2
  int isGrism;			/* Grism coordinates?  1: vacuum, 2: air.   */
  int padding;			/* (Dummy inserted for alignment purposes.) */
d808 3
d826 2
d838 26
a865 1

a868 1

a871 1

a875 10
int spcaips(const char ctypeA[], int velref, char ctype[], char specsys[]);


/* Deprecated. */
#define spcini_errmsg spc_errmsg
#define spcprt_errmsg spc_errmsg
#define spcset_errmsg spc_errmsg
#define spcx2s_errmsg spc_errmsg
#define spcs2x_errmsg spc_errmsg

@


4.7.1.1
log
@WCSLIB 4.7 development branch.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.7 2011/02/07 07:03:42 cal103 Exp $
@


4.7.1.2
log
@Added error messaging based on wcserr.  Changes supplied by Michael
Droettboom (STScI) with respect to the released WCSLIB 4.7 sources.
@
text
@a226 3
* If the return value >= 2, a detailed error message is set in the
* spc->err struct.  See wcserr.h for error handling instructions.
*                         
a256 2
* If the return value >= 2, a detailed error message is set in the
* spc->err struct.  See wcserr.h for error handling instructions.
a257 1
*                            
a287 2
* If the return value >= 2, a detailed error message is set in the
* spc->err struct.  See wcserr.h for error handling instructions.
a288 1
* 
a298 4
* An alternate form of this function, spctyp_err(), has an additional
* wcserr* parameter for retrieving detailed error messages.  See
* wcserr.h for more information.
*
a341 4
*   err       struct wcserr *
*                       When the return value >= 2, this structure
*                       will contain a detailed error message.  May be NULL
*                       if an error message is not desired.
a354 4
* An alternate form of this function, spcspx_err(), has an additional
* wcserr* parameter for retrieving detailed error messages.  See
* wcserr.h for more information.
* 
d391 1
a391 1
*                       
a405 4
* An alternate form of this function, spcxps_err(), has an additional
* wcserr* parameter for retrieving detailed error messages.  See
* wcserr.h for more information.
* 
d442 1
a442 1
*                       
a454 4
* An alternate form of this function, spctrn_err(), has an additional
* wcserr* parameter for retrieving detailed error messages.  See
* wcserr.h for more information.
* 
a631 4
*   struct wcserr err
*     (Returned) When an error status is returned, this
*     structure contains detailed information about the error.
*     
a658 1
#include "wcserr.h"
a666 7
enum spc_errmsg_enum {
  SPCERR_SUCCESS         = 0, /* Success */
  SPCERR_NULL_POINTER    = 1, /* Null spcprm pointer passed */
  SPCERR_BAD_SPEC_PARAMS = 2, /* Invalid spectral parameters */
  SPCERR_BAD_X           = 3, /* One or more of x coordinates were invalid */
  SPCERR_BAD_SPEC        = 4  /* One or more of the spec coordinates were invalid */
};
a701 6
  /* Error handling                                                         */
  /*------------------------------------------------------------------------*/
  struct wcserr err;
  
  /* Private                                                                */
  /*------------------------------------------------------------------------*/
a729 4
int spctyp_err(const char ctype[], char stype[], char scode[], char sname[],
               char units[], char *ptype, char *xtype, int *restreq,
               struct wcserr *err);
  
a733 4
int spcspx_err(const char ctypeS[], double crvalS, double restfrq, double restwav,
               char *ptype, char *xtype, int *restreq, double *crvalX,
               double *dXdS, struct wcserr *err);
  
a737 4
int spcxps_err(const char ctypeS[], double crvalX, double restfrq, double restwav,
               char *ptype, char *xtype, int *restreq, double *crvalS,
               double *dSdX, struct wcserr *err);
  
a741 4
int spctrn_err(const char ctypeS1[], double crvalS1, double cdeltS1,
               double restfrq, double restwav, char ctypeS2[], double *crvalS2,
               double *cdeltS2, struct wcserr *err);
  
@


4.7.1.3
log
@Revised implementation of Michael Droettboom's error messaging system.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.7.1.1 2011/02/07 07:04:22 cal103 Exp cal103 $
d60 1
a60 2
* values, spcfree() reclaims any memory that may have been allocated to store
* an error message, and spcprt() prints its contents.
d74 1
a74 1
*   - spctype() checks a spectral CTYPEia keyword for validity and returns
d77 1
a77 1
*   - Spectral keyword analysis routine spcspxe() computes the values of the
d80 1
a80 1
*   - Spectral keyword synthesis routine, spcxpse(), computes the S-type
d83 1
a83 1
*   - Given a set of spectral keywords, a translation routine, spctrne(),
a193 15
* spcfree() - Destructor for the spcprm struct
* --------------------------------------------
* spcfree() frees any memory that may have been allocated to store an error
* message in the spcprm struct.
*
* Given:
*   spc       struct spcprm*
*                       Spectral transformation parameters.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null spcprm pointer passed.
*
*
d196 1
a196 2
* spcprt() prints the contents of a spcprm struct using wcsprintf().  Mainly
* intended for diagnostic purposes.
d227 3
a229 3
*                       For returns > 1, a detailed error message is set in
*                       spcprm::err.
*
a240 1
*
a241 1
*
a242 1
*
a247 1
*
d260 2
a261 3
*                       For returns > 1, a detailed error message is set in
*                       spcprm::err.
*
d263 1
a274 1
*
a275 1
*
a276 1
*
a281 1
*
d294 2
a295 2
*                       For returns > 1, a detailed error message is set in
*                       spcprm::err.
d297 6
a302 6
*
* spctype() - Spectral CTYPEia keyword analysis
* ---------------------------------------------
* spctype() checks whether a CTYPEia keyvalue is a valid spectral axis type
* and if so returns information derived from it relating to the associated S-,
* P-, and X-type spectral variables (see explanation above).
d308 3
a310 1
* A deprecated form of this function, spctyp(), lacks the wcserr** parameter.
a321 1
*
a326 1
*
a329 1
*
a332 1
*
a334 1
*
a339 1
*
d355 4
a358 5
*
*   err       struct wcserr **
*                       For function return values > 1, this struct will
*                       contain a detailed error message.  May be NULL if an
*                       error message is not desired.
d367 1
a367 1
* spcspxe() - Spectral keyword analysis
d369 1
a369 1
* spcspxe() analyses the CTYPEia and CRVALia FITS spectral axis keyword values
d372 4
a375 2
* A deprecated form of this function, spcspx(), lacks the wcserr** parameter.
*
a383 1
*
a385 1
*
a397 1
*
a402 1
*
d405 1
a405 2
*                       variables for this CTYPEia, as for spctype().
*
a407 1
*
d412 1
a412 6
*
*   err       struct wcserr **
*                       For function return values > 1, this struct will
*                       contain a detailed error message.  May be NULL if an
*                       error message is not desired.
*
d419 1
a419 1
* spcxpse() - Spectral keyword synthesis
d421 1
a421 1
* spcxpse(), for the spectral axis type specified and the value provided for
d427 4
a430 2
* A deprecated form of this function, spcxps(), lacks the wcserr** parameter.
*
a438 1
*
a440 1
*
a452 1
*
a456 1
*
d459 1
a459 2
*                       variables for this CTYPEia, as for spctype().
*
a462 1
*
d467 1
a467 6
*
*   err       struct wcserr **
*                       For function return values > 1, this struct will
*                       contain a detailed error message.  May be NULL if an
*                       error message is not desired.
*
d474 1
a474 1
* spctrne() - Spectral keyword translation
d476 1
a476 1
* spctrne() translates a set of FITS spectral axis keywords into the
d480 4
a483 2
* A deprecated form of this function, spctrn(), lacks the wcserr** parameter.
*
a491 1
*
a493 1
*
a495 1
*
a522 1
*
a526 5
*   err       struct wcserr **
*                       For function return values > 1, this struct will
*                       contain a detailed error message.  May be NULL if an
*                       error message is not desired.
*
a546 1
*
a578 1
*
d661 4
a664 4
*   struct wcserr *err
*     (Returned) When an error status is returned, this structure contains
*     detailed information about the error.
*
d702 5
a706 7
  SPCERR_SUCCESS         = 0,	/* Success. */
  SPCERR_NULL_POINTER    = 1,	/* Null spcprm pointer passed. */
  SPCERR_BAD_SPEC_PARAMS = 2,	/* Invalid spectral parameters. */
  SPCERR_BAD_X           = 3,	/* One or more of x coordinates were
				   invalid. */
  SPCERR_BAD_SPEC        = 4 	/* One or more of the spec coordinates were
				   invalid. */
d745 2
a746 2
  struct wcserr *err;

a763 2
int spcfree(struct spcprm *spc);

a773 26
int spctype(const char ctype[], char stype[], char scode[], char sname[],
            char units[], char *ptype, char *xtype, int *restreq,
            struct wcserr **err);

int spcspxe(const char ctypeS[], double crvalS, double restfrq,
            double restwav, char *ptype, char *xtype, int *restreq,
            double *crvalX, double *dXdS, struct wcserr **err);

int spcxpse(const char ctypeS[], double crvalX, double restfrq,
            double restwav, char *ptype, char *xtype, int *restreq,
            double *crvalS, double *dSdX, struct wcserr **err);

int spctrne(const char ctypeS1[], double crvalS1, double cdeltS1,
            double restfrq, double restwav, char ctypeS2[], double *crvalS2,
            double *cdeltS2, struct wcserr **err);

int spcaips(const char ctypeA[], int velref, char ctype[], char specsys[]);


/* Deprecated. */
#define spcini_errmsg spc_errmsg
#define spcprt_errmsg spc_errmsg
#define spcset_errmsg spc_errmsg
#define spcx2s_errmsg spc_errmsg
#define spcs2x_errmsg spc_errmsg

d776 5
d784 5
d792 5
d801 14
@


4.7.1.4
log
@Clarify that detailed error messages are only returned in wcserr if enabled.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.7.1.3 2011/08/09 02:43:50 cal103 Exp cal103 $
d245 1
a245 1
*                       spcprm::err if enabled, see wcserr_enable().
d282 1
a282 1
*                       spcprm::err if enabled, see wcserr_enable().
d320 1
a320 1
*                       spcprm::err if enabled, see wcserr_enable().
d719 2
a720 2
*     (Returned) If enabled, when an error status is returned this structure
*     contains detailed information about the error, see wcserr_enable().
@


4.7.1.5
log
@Added padding to the spcprm struct to cater for the Fortran wrappers in
SunOS 5.9.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.7.1.4 2011/08/10 06:52:12 cal103 Exp cal103 $
d715 1
a715 1
*   int padding1
a721 2
*   void *padding2
*     (An unused variable inserted for alignment purposes only.)
d771 1
a771 1
  int    flag;			/* Set to zero to force initialization.     */
d799 2
a800 2
  int    isGrism;		/* Grism coordinates?  1: vacuum, 2: air.   */
  int    padding1;		/* (Dummy inserted for alignment purposes.) */
a807 1
  void   *padding2;		/* (Dummy inserted for alignment purposes.) */
@


4.6
log
@WCSLIB 4.6
@
text
@d3 2
a4 2
  WCSLIB 4.6 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2010, Mark Calabretta
d31 1
a31 1
  $Id: spc.h,v 4.5.1.1 2010/07/16 07:05:31 cal103 Exp cal103 $
d34 1
a34 1
* WCSLIB 4.6 - C routines that implement the spectral coordinate systems
@


4.6.1.1
log
@WCSLIB 4.6 development branch.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.6 2010/11/16 06:15:31 cal103 Exp $
@


4.6.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2011, Mark Calabretta
d31 1
a31 1
  $Id: spc.h,v 4.6.1.1 2010/11/16 06:16:19 cal103 Exp cal103 $
@


4.5
log
@WCSLIB 4.5
@
text
@d3 1
a3 1
  WCSLIB 4.5 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: spc.h,v 4.4.1.3 2010/07/07 13:21:01 cal103 Exp cal103 $
d34 1
a34 1
* WCSLIB 4.5 - C routines that implement the spectral coordinate systems
@


4.5.1.1
log
@WCSLIB 4.5 development branch.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.5 2010/07/16 07:01:25 cal103 Exp $
@


4.4
log
@WCSLIB 4.4
@
text
@d3 2
a4 2
  WCSLIB 4.4 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2009, Mark Calabretta
d31 1
a31 1
  $Id: spc.h,v 4.3.1.3 2009/07/22 05:10:07 cal103 Exp cal103 $
d34 1
a34 1
* WCSLIB 4.4 - C routines that implement the spectral coordinate systems
d86 3
d293 1
a293 2
* and X-type spectral variables (see explanation above).  It recognizes and
* translates AIPS-convention spectral CTYPEia keyvalues.
d462 1
a462 3
*                       be reset).  AIPS-convention spectral types are
*                       accepted for ctypeS1 but the Doppler frame encoded
*                       within them will not be used.
a489 3
*                       AIPS-convention spectral types are not accepted for
*                       ctypeS2.
*
d509 50
d742 2
@


4.4.1.1
log
@WCSLIB 4.4 development branch.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.4 2009/08/06 07:41:33 cal103 Exp $
@


4.4.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2010, Mark Calabretta
d31 1
a31 1
  $Id: spc.h,v 4.4.1.1 2009/08/10 08:52:49 cal103 Exp cal103 $
@


4.4.1.3
log
@New function spcaips() handles translation of AIPS spectral types,
also taking account of VELREF.
@
text
@d31 1
a31 1
  $Id: spc.h,v 4.4.1.2 2010/01/19 03:42:50 cal103 Exp cal103 $
a85 3
*   - spcaips() translates AIPS-convention spectral keywords, CTYPEn and
*     VELREF, into CTYPEia and SPECSYSa.
*
d290 2
a291 1
* and X-type spectral variables (see explanation above).
d460 3
a462 1
*                       be reset).
d490 3
a511 50
* spcaips() - Translate AIPS-convention spectral keywords
* -------------------------------------------------------
* spcaips() translates AIPS-convention spectral keywords, CTYPEn and VELREF,
* into CTYPEia and SPECSYSa.
*
* Given:
*   ctypeA    const char[9]
*                       CTYPEia keyvalue (eight characters, need not be null-
*                       terminated).
*   velref    int       AIPS-convention VELREF code.  It has the following
*                       integer values:
*                         1: LSR kinematic, originally described simply as
*                            "LSR" without distinction between the kinematic
*                            and dynamic definitions.
*                         2: Barycentric, originally described as "HEL"
*                            meaning heliocentric.
*                         3: Topocentric, originally described as "OBS"
*                            meaning geocentric but widely interpreted as
*                            topocentric.
*                       AIPS++ extensions to VELREF are also recognized:
*                         4: LSR dynamic.
*                         5: Geocentric.
*                         6: Source rest frame.
*                         7: Galactocentric.
*                       For an AIPS 'VELO' axis, a radio convention velocity
*                       is denoted by adding 256 to VELREF, otherwise an
*                       optical velocity is indicated (not applicable to
*                       'FELO' axes).  Unrecognized values of VELREF are
*                       simply ignored.
*
*                       VELREF takes precedence over CTYPEia in defining the
*                       Doppler frame, e.g. if
*
=                         CTYPEn = 'VELO-HEL'
=                         VELREF = 1
*
*                       the Doppler frame is set to LSRK.
*
* Returned:
*   ctype     char[9]   Translated CTYPEia keyvalue, or a copy of ctypeA if no
*                       translation was performed (null-filled).
*   specsys   char[9]   Doppler reference frame indicated by VELREF or else by
*                       CTYPEn.
*
* Function return value:
*             int       Status return value:
*                        -1: No translation required (not an error).
*                         0: Success.
*
*
a694 2
int spcaips(const char ctypeA[], int velref, char ctype[], char specsys[]);

@


4.3
log
@WCSLIB 4.3
@
text
@d3 2
a4 2
    WCSLIB 4.3 - an implementation of the FITS WCS standard.
    Copyright (C) 1995-2007, Mark Calabretta
d6 1
a6 1
    This file is part of WCSLIB.
d8 24
a31 24
    WCSLIB is free software: you can redistribute it and/or modify it under
    the terms of the GNU Lesser General Public License as published by the
    Free Software Foundation, either version 3 of the License, or (at your
    option) any later version.

    WCSLIB 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 Lesser General Public License for
    more details.

    You should have received a copy of the GNU Lesser General Public License
    along with WCSLIB.  If not, see <http://www.gnu.org/licenses/>.

    Correspondence concerning WCSLIB may be directed to:
       Internet email: mcalabre@@atnf.csiro.au
       Postal address: Dr. Mark Calabretta
                       Australia Telescope National Facility, CSIRO
                       PO Box 76
                       Epping NSW 1710
                       AUSTRALIA

    Author: Mark Calabretta, Australia Telescope National Facility
    http://www.atnf.csiro.au/~mcalabre/index.html
    $Id: spc.h,v 4.2.1.5 2007/12/03 05:02:17 cal103 Exp cal103 $
d34 2
a35 2
*   WCSLIB 4.3 - C routines that implement the spectral coordinate systems
*   recognized by the FITS World Coordinate System (WCS) standard.  Refer to
d37 2
a38 2
*      "Representations of world coordinates in FITS",
*      Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (Paper I)
d40 565
a604 560
*      "Representations of spectral coordinates in FITS",
*      Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L.
*      2006, A&A, 446, 747 (Paper III)
*
*   Refer to the README file provided with WCSLIB for an overview of the
*   library.
*
*
*   Summary of the spc* routines
*   ----------------------------
*   These routines implement the part of the FITS WCS standard that deals
*   with spectral coordinates.  They define methods to be used for computing
*   spectral world coordinates from intermediate world coordinates (a linear
*   transformation of image pixel coordinates), and vice versa.  They are
*   based on the spcprm struct, described in detail below, which contains all
*   information needed for the computations.  The struct contains some
*   members that must be set by the caller, and others that are maintained by
*   these routines, somewhat like a C++ class but with no encapsulation.
*
*   Routine spcini() is provided to initialize the spcprm struct with default
*   values, and another, spcprt(), to print its contents.
*
*   A setup routine, spcset(), computes intermediate values in the spcprm
*   struct from parameters in it that were supplied by the caller.  The
*   struct always needs to be set up by spcset() but it need not be called
*   explicitly - see the explanation of spc.flag below.
*
*   spcx2s() and spcs2x() implement the WCS spectral coordinate
*   transformations.  In fact, they are high level driver routines for the
*   lower level spectral coordinate transformation routines described in
*   spx.h.
*
*   A number of routines are provided to aid in analysing or synthesising sets
*   of FITS spectral axis keywords:
*
*      spctyp() checks a spectral CTYPEia keyword for validity and returns
*      information derived from it.
*
*      Spectral keyword analysis routine spcspx() computes the values of the
*      X-type spectral variables for the S-type variables supplied.
*
*      Spectral keyword synthesis routine, spcxps(), computes the S-type
*      variables for the X-types supplied.
*
*      Given a set of spectral keywords, a translation routine, spctrn(),
*      produces the corresponding set for the specified spectral CTYPEia.
*
*
*   Default constructor for the spcprm struct; spcini()
*   ---------------------------------------------------
*   spcini() sets all members of a spcprm struct to default values.  It should
*   be used to initialize every spcprm struct.
*
*   Given and returned:
*      spc      struct spcprm*
*                        Spectral transformation parameters (see below).
*
*   Function return value:
*               int      Status return value:
*                           0: Success.
*                           1: Null spcprm pointer passed.
*
*
*   Print routine for the spcprm struct; spcprt()
*   ---------------------------------------------
*   spcprt() prints the contents of a spcprm struct.
*
*   Given:
*      spc      const struct spcprm*
*                        Spectral transformation parameters (see below).
*
*   Function return value:
*               int      Status return value:
*                           0: Success.
*                           1: Null spcprm pointer passed.
*
*
*   Setup routine; spcset()
*   -----------------------
*   spcset() sets up a spcprm struct according to information supplied within
*   it (see "Spectral transformation parameters" below).
*
*   Note that this routine need not be called directly; it will be invoked by
*   spcx2s() and spcs2x() if the "flag" struct member is anything other than a
*   predefined magic value.
*
*   Given and returned:
*      spc      struct spcprm*
*                        Spectral transformation parameters (see below).
*
*   Function return value:
*               int      Status return value:
*                           0: Success.
*                           1: Null spcprm pointer passed.
*                           2: Invalid spectral parameters.
*
*
*   Transform to spectral coordinates; spcx2s()
*   -------------------------------------------
*   spcx2s() transforms intermediate world coordinates to spectral
*   coordinates.
*
*   Given and returned:
*      spc      struct spcprm*
*                        Spectral transformation parameters (see below).
*
*   Given:
*      nx       int      Vector length, see below.
*      sx       int      Vector stride, see below.
*      sspec    int      Vector stride, see below.
*      x        const double[]
*                        Intermediate world coordinates, in SI units.
*
*   Returned:
*      spec     double[] Spectral coordinates, in SI units.
*      stat     int[]    Status return value status for each vector element:
*                           0: Success.
*                           1: Invalid value of x.
*
*   Function return value:
*               int      Status return value:
*                           0: Success.
*                           1: Null spcprm pointer passed.
*                           2: Invalid spectral parameters.
*                           3: One or more of the x coordinates were invalid,
*                              as indicated by the stat vector.
*
*
*   Transform spectral coordinates; spcs2x()
*   ----------------------------------------
*   spcs2x() transforms spectral world coordinates to intermediate world
*   coordinates.
*
*   Given and returned:
*      spc      struct spcprm*
*                        Spectral transformation parameters (see below).
*
*   Given:
*      nspec    int      Vector length, see below.
*      sspec    int      Vector stride, see below.
*      sx       int      Vector stride, see below.
*      spec     const double[]
*                        Spectral coordinates, in SI units.
*
*   Returned:
*      x        double[] Intermediate world coordinates, in SI units.
*      stat     int[]    Status return value status for each vector element:
*                           0: Success.
*                           1: Invalid value of spec.
*
*   Function return value:
*               int      Status return value:
*                           0: Success.
*                           1: Null spcprm pointer passed.
*                           2: Invalid spectral parameters.
*                           4: One or more of the spec coordinates were
*                              invalid, as indicated by the stat vector.
*
*
*   Spectral CTYPEia keyword analysis; spctyp()
*   -------------------------------------------
*   spctyp() checks whether a CTYPEia keyvalue is a valid spectral axis type
*   and if so returns information derived from it relating to the associated
*   S-, P-, and X-type spectral variables (explained below).  It recognizes
*   and translates AIPS-convention spectral CTYPEia keyvalues.
*
*   The return arguments are guaranteed not be modified if CTYPEia is not a
*   valid spectral type; zero-pointers may be specified for any that are not
*   of interest.
*
*   Given:
*      ctype    const char[9]
*                        The CTYPEia keyvalue, (eight characters with null
*                        termination).
*
*   Returned:
*      stype    char[]   The four-letter name of the S-type spectral variable
*                        copied or translated from ctype.  If a non-zero
*                        pointer is given, the array must accomodate a null-
*                        terminated string of length 5.
*      scode    char[]   The three-letter spectral algorithm code copied or
*                        translated from ctype.  Logarithmic (LOG) and tabular
*                        (TAB) codes are also recognized.  If a non-zero
*                        pointer is given, the array must accomodate a null-
*                        terminated string of length 4.
*      sname    char[]   Descriptive name of the S-type spectral variable.
*                        If a non-zero pointer is given, the array must
*                        accomodate a null-terminated string of length 22.
*      units    char[]   SI units of the S-type spectral variable.
*                        If a non-zero pointer is given, the array must
*                        accomodate a null-terminated string of length 8.
*      ptype    char*    Character code for the P-type spectral variable
*                        derived from ctype, one of 'F', 'W', 'A', or 'V'.
*      xtype    char*    Character code for the X-type spectral variable
*                        derived from ctype, one of 'F', 'W', 'A', or 'V'.
*                        Also, 'w' and 'a' are synonymous to 'W' and 'A' for
*                        grisms in vacuo and air respectively.  Set to 'L' or
*                        'T' for logarithmic (LOG) and tabular (TAB) axes.
*      restreq  int*     Multivalued flag that indicates whether rest
*                        frequency or wavelength is required to compute
*                        spectral variables for this CTYPEia:
*                          0: Not required.
*                          1: Required for the conversion between S- and
*                             P-types (e.g. ZOPT-F2W).
*                          2: Required for the conversion between P- and
*                             X-types (e.g. BETA-W2V).
*                          3: Required for the conversion between S- and
*                             P-types, and between P- and X-types, but not
*                             between S- and X-types (this applies only for
*                             VRAD-V2F, VOPT-V2W, and ZOPT-V2W).
*                         Thus the rest frequency or wavelength is required
*                         for spectral coordinate computations (i.e. S-X) only
*                         if restreq%3 != 0.
*
*   Function return value:
*               int      Status return value:
*                           0: Success.
*                           2: Invalid spectral parameters (not a spectral
*                              CTYPEia).
*
*
*   Spectral keyword analysis; spcspx()
*   -----------------------------------
*   spcspx() analyses the CTYPEia and CRVALia FITS spectral axis keyword
*   values and returns information about the associated X-type spectral
*   variable.
*
*   Given:
*      ctypeS   const char[9]
*                        Spectral axis type, i.e. the CTYPEia keyvalue, (eight
*                        characters with null termination).  For non-grism
*                        axes, the character code for the P-type spectral
*                        variable in the algorithm code (i.e. the eighth
*                        character of CTYPEia) may be set to '?' (it will not
*                        be reset).
*      crvalS   double   Value of the S-type spectral variable at the
*                        reference point, i.e. the CRVALia keyvalue, SI units.
*      restfrq  double   Rest frequency (Hz) and rest wavelength in vacuo (m),
*      restwav  double   only one of which need be given, the other should be
*                        set to zero.  Neither are required if the translation
*                        is between wave-characteristic types, or between
*                        velocity-characteristic types.  E.g., required for
*                        'FREQ'     -> 'ZOPT-F2W', but not required for
*                        'VELO-F2V' -> 'ZOPT-F2W'.
*
*   Returned:
*      ptype    char*    Character code for the P-type spectral variable
*                        derived from ctypeS, one of 'F', 'W', 'A', or 'V'.
*      xtype    char*    Character code for the X-type spectral variable
*                        derived from ctypeS, one of 'F', 'W', 'A', or 'V'.
*                        Also, 'w' and 'a' are synonymous to 'W' and 'A' for
*                        grisms in vacuo and air respectively; crvalX and dXdS
*                        (below) will conform to these.
*      restreq  int*     Multivalued flag that indicates whether rest
*                        frequency or wavelength is required to compute
*                        spectral variables for this CTYPEia, as for spctyp().
*      crvalX   double*  Value of the X-type spectral variable at the
*                        reference point, SI units.
*      dXdS     double*  The derivative, dX/dS, evaluated at the reference
*                        point, SI units.  Multiply the CDELTia keyvalue by
*                        this to get the pixel spacing in the X-type spectral
*                        coordinate.
*
*   Function return value:
*               int      Status return value:
*                           0: Success.
*                           2: Invalid spectral parameters.
*
*
*   Spectral keyword synthesis; spcxps()
*   ------------------------------------
*   spcxps(), for the spectral axis type specified and the value provided for
*   the X-type spectral variable at the reference point, deduces the value of
*   the FITS spectral axis keyword CRVALia and also the derivative dS/dX which
*   may be used to compute CDELTia.  See below for an explanation of the S-,
*   P-, and X-type spectral variables.
*
*   Given:
*      ctypeS   const char[9]
*                        The required spectral axis type, i.e. the CTYPEia
*                        keyvalue, (eight characters with null termination).
*                        For non-grism axes, the character code for the P-type
*                        spectral variable in the algorithm code (i.e. the
*                        eighth character of CTYPEia) may be set to '?' (it
*                        will not be reset).
*      crvalX   double   Value of the X-type spectral variable at the
*                        reference point (N.B. NOT the CRVALia keyvalue), SI
*                        units.
*      restfrq  double   Rest frequency (Hz) and rest wavelength in vacuo (m),
*      restwav  double   only one of which need be given, the other should be
*                        set to zero.  Neither are required if the translation
*                        is between wave-characteristic types, or between
*                        velocity-characteristic types.  E.g., required for
*                        'FREQ'     -> 'ZOPT-F2W', but not required for
*                        'VELO-F2V' -> 'ZOPT-F2W'.
*
*   Returned:
*      ptype    char*    Character code for the P-type spectral variable
*                        derived from ctypeS, one of 'F', 'W', 'A', or 'V'.
*      xtype    char*    Character code for the X-type spectral variable
*                        derived from ctypeS, one of 'F', 'W', 'A', or 'V'.
*                        Also, 'w' and 'a' are synonymous to 'W' and 'A' for
*                        grisms; crvalX and cdeltX must conform to these.
*      restreq  int*     Multivalued flag that indicates whether rest
*                        frequency or wavelength is required to compute
*                        spectral variables for this CTYPEia, as for spctyp().
*      crvalS   double*  Value of the S-type spectral variable at the
*                        reference point (i.e. the appropriate CRVALia
*                        keyvalue), SI units.
*      dSdX     double*  The derivative, dS/dX, evaluated at the reference
*                        point, SI units.  Multiply this by the pixel spacing
*                        in the X-type spectral coordinate to get the CDELTia
*                        keyvalue.
*
*   Function return value:
*               int      Status return value:
*                           0: Success.
*                           2: Invalid spectral parameters.
*
*
*   Spectral keyword translation; spctrn()
*   --------------------------------------
*   spctrn() translates a set of FITS spectral axis keywords into the
*   corresponding set for the specified spectral axis type.  For example, a
*   'FREQ' axis may be translated into 'ZOPT-F2W' and vice versa.
*
*   Given:
*      ctypeS1  const char[9]
*                        Spectral axis type, i.e. the CTYPEia keyvalue, (eight
*                        characters with null termination).  For non-grism
*                        axes, the character code for the P-type spectral
*                        variable in the algorithm code (i.e. the eighth
*                        character of CTYPEia) may be set to '?' (it will not
*                        be reset).  AIPS-convention spectral types are
*                        accepted for ctypeS1 but the Doppler frame encoded
*                        within them will not be used.
*      crvalS1  double   Value of the S-type spectral variable at the
*                        reference point, i.e. the CRVALia keyvalue, SI units.
*      cdeltS1  double   Increment of the S-type spectral variable at the
*                        reference point, SI units.
*      restfrq  double   Rest frequency (Hz) and rest wavelength in vacuo (m),
*      restwav  double   only one of which need be given, the other should be
*                        set to zero.  Neither are required if the translation
*                        is between wave-characteristic types, or between
*                        velocity-characteristic types.  E.g., required for
*                        'FREQ'     -> 'ZOPT-F2W', but not required for
*                        'VELO-F2V' -> 'ZOPT-F2W'.
*
*   Given and returned:
*      ctypeS2  char[9]  Required spectral axis type (eight characters with
*                        null termination).  The first four characters are
*                        required to be given and are never modified.  The
*                        remaining four, the algorithm code, are completely
*                        determined by, and must be consistent with, ctypeS1
*                        and the first four characters of ctypeS2.  A non-zero
*                        status value will be returned if they are
*                        inconsistent (see below).  However, if the final
*                        three characters are specified as "???", or if just
*                        the eighth character is specified as '?', the correct
*                        algorithm code will be substituted (applies for grism
*                        axes as well as non-grism).
*
*                        AIPS-convention spectral types are not accepted for
*                        ctypeS2.
*
*   Returned:
*      crvalS2  double*  Value of the new S-type spectral variable at the
*                        reference point, i.e. the new CRVALia keyvalue, SI
*                        units.
*      cdeltS2  double*  Increment of the new S-type spectral variable at the
*                        reference point, i.e. the new CDELTia keyvalue, SI
*                        units.
*
*   Function return value:
*               int      Status return value:
*                           0: Success.
*                           2: Invalid spectral parameters.
*
*                        A status value of 2 will be returned if restfrq or
*                        restwav are not specified when required, or if
*                        ctypeS1 or ctypeS2 are self-inconsistent, or have
*                        different spectral X-type variables.
*
*
*   Spectral variable types: S, P, and X
*   ------------------------------------
*   Every FITS spectral axis has three associated spectral variables:
*
*      S-type: the spectral variable in which coordinates are to be expressed.
*              Each S-type is encoded as four characters and is linearly
*              related to one of four basic types as follows:
*
*              F, frequency:
*                FREQ  frequency
*                AFRQ  angular frequency
*                ENER  photon energy
*                WAVN  wave number
*                VRAD  radio velocity
*
*              W, wavelength in vacuo:
*                WAVE  wavelength
*                VOPT  optical velocity
*                ZOPT  redshift
*
*              A, wavelength in air:
*                AWAV  wavelength in air
*
*              V, velocity:
*                VELO  relativistic velocity
*                BETA  relativistic beta factor
*
*              The S-type forms the first four characters of the CTYPEia
*              keyvalue, and CRVALia and CDELTia are expressed as S-type
*              quantities so that they provide a first-order approximation to
*              the S-type variable at the reference point.
*
*      P-type: the basic spectral variable (F, W, A, or V) with which the
*              S-type variable is associated, as in the above list.
*
*              For non-grism axes, the P-type is encoded as the eighth
*              character of CTYPEia.
*
*      X-type: the basic spectral variable (F, W, A, or V) for which the
*              spectral axis is linear (except for grisms, see below).
*
*              For non-grism axes, the X-type is encoded as the sixth
*              character of CTYPEia.
*
*   Grism axes have normal S-, and P-types but the axis is linear, not in any
*   spectral variable, but in a special "grism parameter".  The X-type
*   spectral variable is either W or A for grisms in vacuo or air
*   respectively, but is encoded as 'w' or 'a' to indicate that an additional
*   transformation is required to convert to or from the grism parameter.  The
*   spectral algorithm code for grisms also has a special encoding in CTYPEia,
*   either '-GRI' (in vacuo) or '-GRA' (in air).
*
*   In the algorithm chain, the non-linear transformation occurs between the
*   X-type and the P-type variables; the transformation between P-type and
*   S-type variables is always linear.
*
*   When the P-type and X-type variables are the same, the spectral axis is
*   linear in the S-type variable and the second four characters of CTYPEia
*   are blank.  This can never happen for grism axes.
*
*   As an example, correlating radio spectrometers always produce spectra that
*   are regularly gridded in frequency; a redshift scale on such a spectrum is
*   non-linear.  The required value of CTYPEia would be 'ZOPT-F2W', where the
*   S-type is 'ZOPT' (redshift), the P-type is necessarily 'W' (wavelength),
*   and the X-type is 'F' (frequency) by the nature of the instrument.
*
*
*   Spectral transformation parameters
*   ----------------------------------
*   The spcprm struct consists of the following elements that must be
*   supplied:
*
*      int flag
*         This flag must be set to zero whenever any of the following spcprm
*         structure members are set or changed: type, code, crval, restfrq,
*         restwav, or pv[].  This signals the initialization routine,
*         spcset(), to recompute intermediaries.
*
*      char type[8]
*         Four-letter spectral variable type, e.g "ZOPT" for
*         CTYPEia = "ZOPT-F2W".  (Declared as char[8] for alignment reasons.)
*
*      char code[4]
*         Three-letter spectral algorithm code, e.g "F2W" for
*         CTYPEia = "ZOPT-F2W".
*
*      double crval
*         Reference value (CRVALia), SI units.
*
*      double restfrq, restwav
*         Rest frequency (Hz) and rest wavelength in vacuo (m), only one of
*         which need be given, the other should be set to zero.  Neither are
*         required if the X and S spectral variables are both wave-
*         characteristic, or both velocity-characteristic, types.
*
*      double pv[7]
*         Grism parameters for "-GRI" and "-GRA" algorithm codes:
*            0: G, grating ruling density.
*            1: m, interference order.
*            2: alpha, angle of incidence.
*            3: n_r, refractive index at lambda_r.
*            4: n'_r, dn/dlambda at lambda_r.
*            5: epsilon, grating tilt angle.
*            6: theta, detector tilt angle.
*
*   The remaining members of the spcprm struct are maintained by spcset() and
*   must not be modified elsewhere:
*
*      double w[6]
*         Intermediate values:
*            0: Rest frequency or wavelength (SI).
*            1: The value of the X-type spectral variable at the reference
*               point (SI units).
*            2: dX/dS at the reference point (SI units).
*         The remainder are grism intermediates.
*
*      int isGrism
*         Grism coordinates?  1: vacuum, 2: air.
*
*      int (*spxX2P)(SPX_ARGS)
*      int (*spxP2S)(SPX_ARGS)
*         Pointers to the transformation functions in the two-step algorithm
*         chain X -> P -> S in the pixel-to-spectral direction.
*
*      int (*spxS2P)(SPX_ARGS)
*      int (*spxP2X)(SPX_ARGS)
*         Pointers to the transformation functions in the two-step algorithm
*         chain S -> P -> X in the spectral-to-pixel direction.
*
*
*   Vector lengths and strides
*   --------------------------
*   Vector computation in the spectral code mainly speeds it by amortising the
*   function call overhead.  The vector length function argument refers to the
*   number of spectral coordinates in both the input and output spectral
*   vectors.
*
*   The vector stride arguments allow the caller to specify that successive
*   elements of a vector are not contiguous in memory.  This applies equally
*   to vectors given to, or returned from a function.  As a simple example
*   consider the following two arrangements in memory of a spectral vector
*   s[], with four elements, s1, s2, s3, and s4, together with x[] and y[]
*   vectors:
*
*      1) s1 s2 s3 s4 x1 x2 x3 x4 y1 y2 y3 y4
*
*      2) x1 y1 s1 x2 y2 s2 x3 y3 s3 x4 y4 s4
*
*   In (1), the address of s[] is s1, its stride is 1, and length 4.
*   In (2), the address of s[] is s1, its stride is 3, and length 4.
*
*   If the vector length is 1 then the stride is ignored and may be set to 0.
*
*
*   Status return values
*   --------------------
*   Error messages to match the status value returned from each function are
*   are encoded in the spc_errmsg character array.
*
*
*   Argument checking
*   -----------------
*   The input spectral values are only checked for values that would result
*   in floating point exceptions.  In particular, negative frequencies and
*   wavelengths are allowed, as are velocities greater than the speed of
*   light.  The same is true for the spectral parameters - rest frequency and
*   wavelength.
*
*
*   Accuracy
*   --------
*   No warranty is given for the accuracy of these routines (refer to the
*   copyright notice above); intending users must satisfy for themselves their
*   adequacy for the intended purpose.  However, closure effectively to within
*   double precision rounding error was demonstrated by test routine tspc.c
*   which accompanies this software.
a618 5
#define spcini_errmsg spc_errmsg
#define spcprt_errmsg spc_errmsg
#define spcset_errmsg spc_errmsg
#define spcx2s_errmsg spc_errmsg
#define spcs2x_errmsg spc_errmsg
d622 12
a633 12
   /* Initialization flag (see the prologue above).                         */
   /*-----------------------------------------------------------------------*/
   int    flag;			/* Set to zero to force initialization.     */

   /* Parameters to be provided (see the prologue above).                   */
   /*-----------------------------------------------------------------------*/
   char   type[8];		/* Four-letter spectral variable type.      */
   char   code[4];		/* Three-letter spectral algorithm code.    */

   double crval;		/* Reference value (CRVALia), SI units.     */
   double restfrq;		/* Rest frequency, Hz.                      */
   double restwav;		/* Rest wavelength, m.                      */
d635 1
a635 1
   double pv[7];		/* Grism parameters:                        */
d644 3
a646 3
   /* Information derived from the parameters supplied.                     */
   /*-----------------------------------------------------------------------*/
   double w[6];			/* Intermediate values.                     */
d652 2
a653 2
   int isGrism;			/* Grism coordinates?  1: vacuum, 2: air.   */
   int padding;			/* (Dummy inserted for alignment purposes.) */
d655 2
a656 2
   int (*spxX2P)(SPX_ARGS);	/* Pointers to the transformation functions */
   int (*spxP2S)(SPX_ARGS);	/* in the two-step algorithm chain in the   */
d659 2
a660 2
   int (*spxS2P)(SPX_ARGS);	/* Pointers to the transformation functions */
   int (*spxP2X)(SPX_ARGS);	/* in the two-step algorithm chain in the   */
d664 1
d668 14
a681 13
int spcini(struct spcprm *);
int spcprt(const struct spcprm *);
int spcset(struct spcprm *);
int spcx2s(struct spcprm *, int, int, int, const double[], double[], int[]);
int spcs2x(struct spcprm *, int, int, int, const double[], double[], int[]);
int spctyp(const char[], char[], char[], char[], char[], char *, char *,
           int *);
int spcspx(const char[], double, double, double, char *, char *, int *,
           double *, double *);
int spcxps(const char[], double, double, double, char *, char *, int *,
           double *, double *);
int spctrn(const char[], double, double, double, double, char[], double *,
           double *);
d683 19
@


4.3.1.1
log
@WCSLIB 4.3 development branch.
@
text
@d3 2
a4 2
    WCSLIB 4.4 - an implementation of the FITS WCS standard.
    Copyright (C) 1995-2008, Mark Calabretta
d31 1
a31 1
    $Id: spc.h,v 4.3 2007/12/27 05:41:36 cal103 Exp cal103 $
d34 1
a34 1
*   WCSLIB 4.4 - C routines that implement the spectral coordinate systems
@


4.3.1.2
log
@Replaced references to text "above" or "below" with "(see ... above|below)"
so that they can be parsed out of the doxygen markup.
@
text
@d31 1
a31 1
    $Id: spc.h,v 4.3.1.1 2007/12/27 13:23:47 cal103 Exp cal103 $
d48 2
a49 2
*   Summary of the spc routines
*   ---------------------------
d54 4
a57 4
*   based on the spcprm struct (see below) which contains all information
*   needed for the computations.  The struct contains some members that must
*   be set by the caller, and others that are maintained by these routines,
*   somewhat like a C++ class but with no encapsulation.
d65 1
a65 1
*   explicitly - refer to the explanation of spc.flag (see below).
d147 3
a149 3
*      nx       int      Vector length (see below).
*      sx       int      Vector stride (see below).
*      sspec    int      Vector stride (see below).
d178 3
a180 3
*      nspec    int      Vector length (see below).
*      sspec    int      Vector stride (see below).
*      sx       int      Vector stride (see below).
d203 2
a204 2
*   S-, P-, and X-type spectral variables (see explanation below).  It
*   recognizes and translates AIPS-convention spectral CTYPEia keyvalues.
d292 1
a292 1
*                        (see below) will conform to these.
d457 1
a457 1
*              S-type variable is associated (see list above).
d463 1
a463 1
*              spectral axis is linear, grisms excluded (see below).
d596 1
a596 1
*   copyright notice); intending users must satisfy for themselves their
@


4.3.1.3
log
@Changes required for generation of the manual using doxextr and doxygen,
including naming of arguments in function prototypes.
@
text
@d3 2
a4 2
  WCSLIB 4.4 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2009, Mark Calabretta
d6 1
a6 1
  This file is part of WCSLIB.
d8 24
a31 24
  WCSLIB is free software: you can redistribute it and/or modify it under the
  terms of the GNU Lesser General Public License as published by the Free
  Software Foundation, either version 3 of the License, or (at your option)
  any later version.

  WCSLIB 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 Lesser General Public License for
  more details.

  You should have received a copy of the GNU Lesser General Public License
  along with WCSLIB.  If not, see <http://www.gnu.org/licenses/>.

  Correspondence concerning WCSLIB may be directed to:
    Internet email: mcalabre@@atnf.csiro.au
    Postal address: Dr. Mark Calabretta
                    Australia Telescope National Facility, CSIRO
                    PO Box 76
                    Epping NSW 1710
                    AUSTRALIA

  Author: Mark Calabretta, Australia Telescope National Facility
  http://www.atnf.csiro.au/~mcalabre/index.html
  $Id: spc.h,v 4.3.1.2 2008/04/02 06:17:13 cal103 Exp cal103 $
d34 2
a35 2
* WCSLIB 4.4 - C routines that implement the spectral coordinate systems
* recognized by the FITS World Coordinate System (WCS) standard.  Refer to
d37 2
a38 2
*   "Representations of world coordinates in FITS",
*   Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (Paper I)
d40 560
a599 565
*   "Representations of spectral coordinates in FITS",
*   Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L.
*   2006, A&A, 446, 747 (Paper III)
*
* Refer to the README file provided with WCSLIB for an overview of the
* library.
*
*
* Summary of the spc routines
* ---------------------------
* These routines implement the part of the FITS WCS standard that deals with
* spectral coordinates.  They define methods to be used for computing spectral
* world coordinates from intermediate world coordinates (a linear
* transformation of image pixel coordinates), and vice versa.  They are based
* on the spcprm struct which contains all information needed for the
* computations.  The struct contains some members that must be set by the
* user, and others that are maintained by these routines, somewhat like a
* C++ class but with no encapsulation.
*
* Routine spcini() is provided to initialize the spcprm struct with default
* values, and another, spcprt(), to print its contents.
*
* A setup routine, spcset(), computes intermediate values in the spcprm struct
* from parameters in it that were supplied by the user.  The struct always
* needs to be set up by spcset() but it need not be called explicitly - refer
* to the explanation of spcprm::flag.
*
* spcx2s() and spcs2x() implement the WCS spectral coordinate transformations.
* In fact, they are high level driver routines for the lower level spectral
* coordinate transformation routines described in spx.h.
*
* A number of routines are provided to aid in analysing or synthesising sets
* of FITS spectral axis keywords:
*
*   - spctyp() checks a spectral CTYPEia keyword for validity and returns
*     information derived from it.
*
*   - Spectral keyword analysis routine spcspx() computes the values of the
*     X-type spectral variables for the S-type variables supplied.
*
*   - Spectral keyword synthesis routine, spcxps(), computes the S-type
*     variables for the X-types supplied.
*
*   - Given a set of spectral keywords, a translation routine, spctrn(),
*     produces the corresponding set for the specified spectral CTYPEia.
*
* Spectral variable types - S, P, and X:
* --------------------------------------
* A few words of explanation are necessary regarding spectral variable types
* in FITS.
*
* Every FITS spectral axis has three associated spectral variables:
*
*   S-type: the spectral variable in which coordinates are to be
*     expressed.  Each S-type is encoded as four characters and is
*     linearly related to one of four basic types as follows:
*
*     F: frequency
*       'FREQ':  frequency
*       'AFRQ':  angular frequency
*       'ENER':  photon energy
*       'WAVN':  wave number
*       'VRAD':  radio velocity
*
*     W: wavelength in vacuo
*       'WAVE':  wavelength
*       'VOPT':  optical velocity
*       'ZOPT':  redshift
*
*     A: wavelength in air
*       'AWAV':  wavelength in air
*
*     V: velocity
*       'VELO':  relativistic velocity
*       'BETA':  relativistic beta factor
*
*     The S-type forms the first four characters of the CTYPEia keyvalue,
*     and CRVALia and CDELTia are expressed as S-type quantities so that
*     they provide a first-order approximation to the S-type variable at
*     the reference point.
*
*     Note that 'AFRQ', angular frequency, is additional to the variables
*     defined in WCS Paper III.
*
*   P-type: the basic spectral variable (F, W, A, or V) with which the
*     S-type variable is associated (see list above).
*
*     For non-grism axes, the P-type is encoded as the eighth character of
*     CTYPEia.
*
*   X-type: the basic spectral variable (F, W, A, or V) for which the
*     spectral axis is linear, grisms excluded (see below).
*
*     For non-grism axes, the X-type is encoded as the sixth character of
*     CTYPEia.
*
*   Grisms: Grism axes have normal S-, and P-types but the axis is linear,
*     not in any spectral variable, but in a special "grism parameter".
*     The X-type spectral variable is either W or A for grisms in vacuo or
*     air respectively, but is encoded as 'w' or 'a' to indicate that an
*     additional transformation is required to convert to or from the
*     grism parameter.  The spectral algorithm code for grisms also has a
*     special encoding in CTYPEia, either 'GRI' (in vacuo) or 'GRA' (in air).
*
* In the algorithm chain, the non-linear transformation occurs between the
* X-type and the P-type variables; the transformation between P-type and
* S-type variables is always linear.
*
* When the P-type and X-type variables are the same, the spectral axis is
* linear in the S-type variable and the second four characters of CTYPEia
* are blank.  This can never happen for grism axes.
*
* As an example, correlating radio spectrometers always produce spectra that
* are regularly gridded in frequency; a redshift scale on such a spectrum is
* non-linear.  The required value of CTYPEia would be 'ZOPT-F2W', where the
* desired S-type is 'ZOPT' (redshift), the P-type is necessarily 'W'
* (wavelength), and the X-type is 'F' (frequency) by the nature of the
* instrument.
*
* Argument checking:
* ------------------
* The input spectral values are only checked for values that would result in
* floating point exceptions.  In particular, negative frequencies and
* wavelengths are allowed, as are velocities greater than the speed of
* light.  The same is true for the spectral parameters - rest frequency and
* wavelength.
*
* Accuracy:
* ---------
* No warranty is given for the accuracy of these routines (refer to the
* copyright notice); intending users must satisfy for themselves their
* adequacy for the intended purpose.  However, closure effectively to within
* double precision rounding error was demonstrated by test routine tspc.c
* which accompanies this software.
*
*
* spcini() - Default constructor for the spcprm struct
* ----------------------------------------------------
* spcini() sets all members of a spcprm struct to default values.  It should
* be used to initialize every spcprm struct.
*
* Given and returned:
*   spc       struct spcprm*
*                       Spectral transformation parameters.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null spcprm pointer passed.
*
*
* spcprt() - Print routine for the spcprm struct
* ----------------------------------------------
* spcprt() prints the contents of a spcprm struct.
*
* Given:
*   spc       const struct spcprm*
*                       Spectral transformation parameters.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null spcprm pointer passed.
*
*
* spcset() - Setup routine for the spcprm struct
* ----------------------------------------------
* spcset() sets up a spcprm struct according to information supplied within
* it.
*
* Note that this routine need not be called directly; it will be invoked by
* spcx2s() and spcs2x() if spcprm::flag is anything other than a predefined
* magic value.
*
* Given and returned:
*   spc       struct spcprm*
*                       Spectral transformation parameters.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null spcprm pointer passed.
*                         2: Invalid spectral parameters.
*
*
* spcx2s() - Transform to spectral coordinates
* --------------------------------------------
* spcx2s() transforms intermediate world coordinates to spectral coordinates.
*
* Given and returned:
*   spc       struct spcprm*
*                       Spectral transformation parameters.
*
* Given:
*   nx        int       Vector length.
*   sx        int       Vector stride.
*   sspec     int       Vector stride.
*   x         const double[]
*                       Intermediate world coordinates, in SI units.
*
* Returned:
*   spec      double[]  Spectral coordinates, in SI units.
*   stat      int[]     Status return value status for each vector element:
*                         0: Success.
*                         1: Invalid value of x.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null spcprm pointer passed.
*                         2: Invalid spectral parameters.
*                         3: One or more of the x coordinates were invalid,
*                            as indicated by the stat vector.
*
*
* spcs2x() - Transform spectral coordinates
* -----------------------------------------
* spcs2x() transforms spectral world coordinates to intermediate world
* coordinates.
*
* Given and returned:
*   spc       struct spcprm*
*                       Spectral transformation parameters.
*
* Given:
*   nspec     int       Vector length.
*   sspec     int       Vector stride.
*   sx        int       Vector stride.
*   spec      const double[]
*                       Spectral coordinates, in SI units.
*
* Returned:
*   x         double[]  Intermediate world coordinates, in SI units.
*   stat      int[]     Status return value status for each vector element:
*                         0: Success.
*                         1: Invalid value of spec.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null spcprm pointer passed.
*                         2: Invalid spectral parameters.
*                         4: One or more of the spec coordinates were
*                            invalid, as indicated by the stat vector.
*
*
* spctyp() - Spectral CTYPEia keyword analysis
* --------------------------------------------
* spctyp() checks whether a CTYPEia keyvalue is a valid spectral axis type and
* if so returns information derived from it relating to the associated S-, P-,
* and X-type spectral variables (see explanation above).  It recognizes and
* translates AIPS-convention spectral CTYPEia keyvalues.
*
* The return arguments are guaranteed not be modified if CTYPEia is not a
* valid spectral type; zero-pointers may be specified for any that are not of
* interest.
*
* Given:
*   ctype     const char[9]
*                       The CTYPEia keyvalue, (eight characters with null
*                       termination).
*
* Returned:
*   stype     char[]    The four-letter name of the S-type spectral variable
*                       copied or translated from ctype.  If a non-zero
*                       pointer is given, the array must accomodate a null-
*                       terminated string of length 5.
*   scode     char[]    The three-letter spectral algorithm code copied or
*                       translated from ctype.  Logarithmic ('LOG') and
*                       tabular ('TAB') codes are also recognized.  If a
*                       non-zero pointer is given, the array must accomodate a
*                       null-terminated string of length 4.
*   sname     char[]    Descriptive name of the S-type spectral variable.
*                       If a non-zero pointer is given, the array must
*                       accomodate a null-terminated string of length 22.
*   units     char[]    SI units of the S-type spectral variable.  If a
*                       non-zero pointer is given, the array must accomodate a
*                       null-terminated string of length 8.
*   ptype     char*     Character code for the P-type spectral variable
*                       derived from ctype, one of 'F', 'W', 'A', or 'V'.
*   xtype     char*     Character code for the X-type spectral variable
*                       derived from ctype, one of 'F', 'W', 'A', or 'V'.
*                       Also, 'w' and 'a' are synonymous to 'W' and 'A' for
*                       grisms in vacuo and air respectively.  Set to 'L' or
*                       'T' for logarithmic ('LOG') and tabular ('TAB') axes.
*   restreq   int*      Multivalued flag that indicates whether rest
*                       frequency or wavelength is required to compute
*                       spectral variables for this CTYPEia:
*                         0: Not required.
*                         1: Required for the conversion between S- and
*                            P-types (e.g. 'ZOPT-F2W').
*                         2: Required for the conversion between P- and
*                            X-types (e.g. 'BETA-W2V').
*                         3: Required for the conversion between S- and
*                            P-types, and between P- and X-types, but not
*                            between S- and X-types (this applies only for
*                            'VRAD-V2F', 'VOPT-V2W', and 'ZOPT-V2W').
*                        Thus the rest frequency or wavelength is required for
*                        spectral coordinate computations (i.e. between S- and
*                        X-types) only if restreq%3 != 0.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         2: Invalid spectral parameters (not a spectral
*                            CTYPEia).
*
*
* spcspx() - Spectral keyword analysis
* ------------------------------------
* spcspx() analyses the CTYPEia and CRVALia FITS spectral axis keyword values
* and returns information about the associated X-type spectral variable.
*
* Given:
*   ctypeS    const char[9]
*                       Spectral axis type, i.e. the CTYPEia keyvalue, (eight
*                       characters with null termination).  For non-grism
*                       axes, the character code for the P-type spectral
*                       variable in the algorithm code (i.e. the eighth
*                       character of CTYPEia) may be set to '?' (it will not
*                       be reset).
*   crvalS    double    Value of the S-type spectral variable at the reference
*                       point, i.e. the CRVALia keyvalue, SI units.
*   restfrq,
*   restwav   double    Rest frequency [Hz] and rest wavelength in vacuo [m],
*                       only one of which need be given, the other should be
*                       set to zero.  Neither are required if the translation
*                       is between wave-characteristic types, or between
*                       velocity-characteristic types.  E.g., required for
*                       'FREQ'     -> 'ZOPT-F2W', but not required for
*                       'VELO-F2V' -> 'ZOPT-F2W'.
*
* Returned:
*   ptype     char*     Character code for the P-type spectral variable
*                       derived from ctypeS, one of 'F', 'W', 'A', or 'V'.
*   xtype     char*     Character code for the X-type spectral variable
*                       derived from ctypeS, one of 'F', 'W', 'A', or 'V'.
*                       Also, 'w' and 'a' are synonymous to 'W' and 'A' for
*                       grisms in vacuo and air respectively; crvalX and dXdS
*                       (see below) will conform to these.
*   restreq   int*      Multivalued flag that indicates whether rest frequency
*                       or wavelength is required to compute spectral
*                       variables for this CTYPEia, as for spctyp().
*   crvalX    double*   Value of the X-type spectral variable at the reference
*                       point, SI units.
*   dXdS      double*   The derivative, dX/dS, evaluated at the reference
*                       point, SI units.  Multiply the CDELTia keyvalue by
*                       this to get the pixel spacing in the X-type spectral
*                       coordinate.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         2: Invalid spectral parameters.
*
*
* spcxps() - Spectral keyword synthesis
* -------------------------------------
* spcxps(), for the spectral axis type specified and the value provided for
* the X-type spectral variable at the reference point, deduces the value of
* the FITS spectral axis keyword CRVALia and also the derivative dS/dX which
* may be used to compute CDELTia.  See above for an explanation of the S-,
* P-, and X-type spectral variables.
*
* Given:
*   ctypeS    const char[9]
*                       The required spectral axis type, i.e. the CTYPEia
*                       keyvalue, (eight characters with null termination).
*                       For non-grism axes, the character code for the P-type
*                       spectral variable in the algorithm code (i.e. the
*                       eighth character of CTYPEia) may be set to '?' (it
*                       will not be reset).
*   crvalX    double    Value of the X-type spectral variable at the reference
*                       point (N.B. NOT the CRVALia keyvalue), SI units.
*   restfrq,
*   restwav   double    Rest frequency [Hz] and rest wavelength in vacuo [m],
*                       only one of which need be given, the other should be
*                       set to zero.  Neither are required if the translation
*                       is between wave-characteristic types, or between
*                       velocity-characteristic types.  E.g., required for
*                       'FREQ'     -> 'ZOPT-F2W', but not required for
*                       'VELO-F2V' -> 'ZOPT-F2W'.
*
* Returned:
*   ptype     char*     Character code for the P-type spectral variable
*                       derived from ctypeS, one of 'F', 'W', 'A', or 'V'.
*   xtype     char*     Character code for the X-type spectral variable
*                       derived from ctypeS, one of 'F', 'W', 'A', or 'V'.
*                       Also, 'w' and 'a' are synonymous to 'W' and 'A' for
*                       grisms; crvalX and cdeltX must conform to these.
*   restreq   int*      Multivalued flag that indicates whether rest frequency
*                       or wavelength is required to compute spectral
*                       variables for this CTYPEia, as for spctyp().
*   crvalS    double*   Value of the S-type spectral variable at the reference
*                       point (i.e. the appropriate CRVALia keyvalue), SI
*                       units.
*   dSdX      double*   The derivative, dS/dX, evaluated at the reference
*                       point, SI units.  Multiply this by the pixel spacing
*                       in the X-type spectral coordinate to get the CDELTia
*                       keyvalue.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         2: Invalid spectral parameters.
*
*
* spctrn() - Spectral keyword translation
* ---------------------------------------
* spctrn() translates a set of FITS spectral axis keywords into the
* corresponding set for the specified spectral axis type.  For example, a
* 'FREQ' axis may be translated into 'ZOPT-F2W' and vice versa.
*
* Given:
*   ctypeS1   const char[9]
*                       Spectral axis type, i.e. the CTYPEia keyvalue, (eight
*                       characters with null termination).  For non-grism
*                       axes, the character code for the P-type spectral
*                       variable in the algorithm code (i.e. the eighth
*                       character of CTYPEia) may be set to '?' (it will not
*                       be reset).  AIPS-convention spectral types are
*                       accepted for ctypeS1 but the Doppler frame encoded
*                       within them will not be used.
*   crvalS1   double    Value of the S-type spectral variable at the reference
*                       point, i.e. the CRVALia keyvalue, SI units.
*   cdeltS1   double    Increment of the S-type spectral variable at the
*                       reference point, SI units.
*   restfrq,
*   restwav   double    Rest frequency [Hz] and rest wavelength in vacuo [m],
*                       only one of which need be given, the other should be
*                       set to zero.  Neither are required if the translation
*                       is between wave-characteristic types, or between
*                       velocity-characteristic types.  E.g., required for
*                       'FREQ'     -> 'ZOPT-F2W', but not required for
*                       'VELO-F2V' -> 'ZOPT-F2W'.
*
* Given and returned:
*   ctypeS2   char[9]   Required spectral axis type (eight characters with
*                       null termination).  The first four characters are
*                       required to be given and are never modified.  The
*                       remaining four, the algorithm code, are completely
*                       determined by, and must be consistent with, ctypeS1
*                       and the first four characters of ctypeS2.  A non-zero
*                       status value will be returned if they are inconsistent
*                       (see below).  However, if the final three characters
*                       are specified as "???", or if just the eighth
*                       character is specified as '?', the correct algorithm
*                       code will be substituted (applies for grism axes as
*                       well as non-grism).
*
*                       AIPS-convention spectral types are not accepted for
*                       ctypeS2.
*
* Returned:
*   crvalS2   double*   Value of the new S-type spectral variable at the
*                       reference point, i.e. the new CRVALia keyvalue, SI
*                       units.
*   cdeltS2   double*   Increment of the new S-type spectral variable at the
*                       reference point, i.e. the new CDELTia keyvalue, SI
*                       units.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         2: Invalid spectral parameters.
*
*                       A status value of 2 will be returned if restfrq or
*                       restwav are not specified when required, or if ctypeS1
*                       or ctypeS2 are self-inconsistent, or have different
*                       spectral X-type variables.
*
*
* spcprm struct - Spectral transformation parameters
* --------------------------------------------------
* The spcprm struct contains information required to transform spectral
* coordinates.  It consists of certain members that must be set by the user
* ("given") and others that are set by the WCSLIB routines ("returned").  Some
* of the latter are supplied for informational purposes while others are for
* internal use only.
*
*   int flag
*     (Given and returned) This flag must be set to zero whenever any of the
*     following spcprm structure members are set or changed:
*
*       - spcprm::type,
*       - spcprm::code,
*       - spcprm::crval,
*       - spcprm::restfrq,
*       - spcprm::restwav,
*       - spcprm::pv[].
*
*     This signals the initialization routine, spcset(), to recompute the
*     returned members of the spcprm struct.  spcset() will reset flag to
*     indicate that this has been done.
*
*   char type[8]
*     (Given) Four-letter spectral variable type, e.g "ZOPT" for
*     CTYPEia = 'ZOPT-F2W'.  (Declared as char[8] for alignment reasons.)
*
*   char code[4]
*     (Given) Three-letter spectral algorithm code, e.g "F2W" for
*     CTYPEia = 'ZOPT-F2W'.
*
*   double crval
*     (Given) Reference value (CRVALia), SI units.
*
*   double restfrq
*     (Given) The rest frequency [Hz], and ...
*
*   double restwav
*     (Given) ... the rest wavelength in vacuo [m], only one of which need be
*     given, the other should be set to zero.  Neither are required if the
*     X and S spectral variables are both wave-characteristic, or both
*     velocity-characteristic, types.
*
*   double pv[7]
*     (Given) Grism parameters for 'GRI' and 'GRA' algorithm codes:
*       - 0: G, grating ruling density.
*       - 1: m, interference order.
*       - 2: alpha, angle of incidence [deg].
*       - 3: n_r, refractive index at the reference wavelength, lambda_r.
*       - 4: n'_r, dn/dlambda at the reference wavelength, lambda_r (/m).
*       - 5: epsilon, grating tilt angle [deg].
*       - 6: theta, detector tilt angle [deg].
*
* The remaining members of the spcprm struct are maintained by spcset() and
* must not be modified elsewhere:
*
*   double w[6]
*     (Returned) Intermediate values:
*       - 0: Rest frequency or wavelength (SI).
*       - 1: The value of the X-type spectral variable at the reference point
*           (SI units).
*       - 2: dX/dS at the reference point (SI units).
*      The remainder are grism intermediates.
*
*   int isGrism
*     (Returned) Grism coordinates?
*       - 0: no,
*       - 1: in vacuum,
*       - 2: in air.
*
*   int padding
*     (An unused variable inserted for alignment purposes only.)
*
*   int (*spxX2P)(SPX_ARGS)
*     (Returned) The first and ...
*   int (*spxP2S)(SPX_ARGS)
*     (Returned) ... the second of the pointers to the transformation
*     functions in the two-step algorithm chain X -> P -> S in the
*     pixel-to-spectral direction where the non-linear transformation is from
*     X to P.  The argument list, SPX_ARGS, is defined in spx.h.
*
*   int (*spxS2P)(SPX_ARGS)
*     (Returned) The first and ...
*   int (*spxP2X)(SPX_ARGS)
*     (Returned) ... the second of the pointers to the transformation
*     functions in the two-step algorithm chain S -> P -> X in the
*     spectral-to-pixel direction where the non-linear transformation is from
*     P to X.  The argument list, SPX_ARGS, is defined in spx.h.
*
*
* Global variable: const char *spc_errmsg[] - Status return messages
* ------------------------------------------------------------------
* Error messages to match the status value returned from each function.
d614 5
d622 12
a633 12
  /* Initialization flag (see the prologue above).                          */
  /*------------------------------------------------------------------------*/
  int   flag;			/* Set to zero to force initialization.     */

  /* Parameters to be provided (see the prologue above).                    */
  /*------------------------------------------------------------------------*/
  char   type[8];		/* Four-letter spectral variable type.      */
  char   code[4];		/* Three-letter spectral algorithm code.    */

  double crval;			/* Reference value (CRVALia), SI units.     */
  double restfrq;		/* Rest frequency, Hz.                      */
  double restwav;		/* Rest wavelength, m.                      */
d635 1
a635 1
  double pv[7];			/* Grism parameters:                        */
d644 3
a646 3
  /* Information derived from the parameters supplied.                      */
  /*------------------------------------------------------------------------*/
  double w[6];			/* Intermediate values.                     */
d652 2
a653 2
  int isGrism;			/* Grism coordinates?  1: vacuum, 2: air.   */
  int padding;			/* (Dummy inserted for alignment purposes.) */
d655 2
a656 2
  int (*spxX2P)(SPX_ARGS);	/* Pointers to the transformation functions */
  int (*spxP2S)(SPX_ARGS);	/* in the two-step algorithm chain in the   */
d659 2
a660 2
  int (*spxS2P)(SPX_ARGS);	/* Pointers to the transformation functions */
  int (*spxP2X)(SPX_ARGS);	/* in the two-step algorithm chain in the   */
a663 1
/* Size of the spcprm struct in int units, used by the Fortran wrappers. */
d667 13
a679 14
int spcini(struct spcprm *spc);

int spcprt(const struct spcprm *spc);

int spcset(struct spcprm *spc);

int spcx2s(struct spcprm *spc, int nx, int sx, int sspec,
           const double x[], double spec[], int stat[]);

int spcs2x(struct spcprm *spc, int nspec, int sspec, int sx,
           const double spec[], double x[], int stat[]);

int spctyp(const char ctype[], char stype[], char scode[], char sname[],
           char units[], char *ptype, char *xtype, int *restreq);
a680 19
int spcspx(const char ctypeS[], double crvalS, double restfrq, double restwav,
           char *ptype, char *xtype, int *restreq, double *crvalX,
           double *dXdS);

int spcxps(const char ctypeS[], double crvalX, double restfrq, double restwav,
           char *ptype, char *xtype, int *restreq, double *crvalS,
           double *dSdX);

int spctrn(const char ctypeS1[], double crvalS1, double cdeltS1,
           double restfrq, double restwav, char ctypeS2[], double *crvalS2,
           double *cdeltS2);


/* Deprecated. */
#define spcini_errmsg spc_errmsg
#define spcprt_errmsg spc_errmsg
#define spcset_errmsg spc_errmsg
#define spcx2s_errmsg spc_errmsg
#define spcs2x_errmsg spc_errmsg
@


4.2
log
@WCSLIB 4.2: changed #include of WCSLIB headers from <...> form to "...".
@
text
@d2 30
a31 29
*
*   WCSLIB 4.2 - an implementation of the FITS WCS standard.
*   Copyright (C) 1995-2005, Mark Calabretta
*
*   WCSLIB 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.
*
*   WCSLIB 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 WCSLIB; if not, write to the Free Software Foundation, Inc.,
*   59 Temple Place, Suite 330, Boston, MA  02111-1307, USA
*
*   Correspondence concerning WCSLIB may be directed to:
*      Internet email: mcalabre@@atnf.csiro.au
*      Postal address: Dr. Mark Calabretta
*                      Australia Telescope National Facility, CSIRO
*                      PO Box 76
*                      Epping NSW 1710
*                      AUSTRALIA
*
*   Author: Mark Calabretta, Australia Telescope National Facility
*   http://www.atnf.csiro.au/~mcalabre/index.html
*   $Id: spc.h,v 4.1 2005/08/28 06:17:40 cal103 Exp cal103 $
d34 1
a34 1
*   WCSLIB 4.2 - C routines that implement the spectral coordinate systems
d38 1
a38 1
*      Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (paper I)
d41 2
a42 2
*      Greisen, E.W., Valdes, F.G., Calabretta, M.R., & Allen, S.L. 2005, A&A,
*      (paper III, in preparation)
d44 2
d47 3
a49 2
*   Summary of routines
*   -------------------
d653 1
a661 1
   int padding;			/* (Dummy inserted for alignment purposes.) */
d683 1
a683 1
};
@


4.2.1.1
log
@WCSLIB 4.2 development branch.
@
text
@d3 1
a3 1
*   WCSLIB 4.3 - an implementation of the FITS WCS standard.
d30 1
a30 1
*   $Id: spc.h,v 4.2 2005/09/22 08:53:12 cal103 Exp cal103 $
d33 1
a33 1
*   WCSLIB 4.3 - C routines that implement the spectral coordinate systems
@


4.2.1.2
log
@Removed an extraneous ';' following the closing '}' of the 'extern "C" {'
block provided for use in C++.
@
text
@d4 1
a4 1
*   Copyright (C) 1995-2006, Mark Calabretta
d30 1
a30 1
*   $Id: spc.h,v 4.2.1.1 2005/12/05 02:39:43 cal103 Exp cal103 $
d37 1
a37 1
*      Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (Paper I)
d40 2
a41 2
*      Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L.
*      2006, A&A, 446, 747 (Paper III)
d679 1
a679 1
}
@


4.2.1.3
log
@Changed the position of the existing padding variable to get alignment on
64-bit machines.
@
text
@d4 1
a4 1
*   Copyright (C) 1995-2007, Mark Calabretta
d30 1
a30 1
*   $Id: spc.h,v 4.2.1.2 2006/08/02 00:14:58 cal103 Exp cal103 $
a648 1
   int padding;			/* (Dummy inserted for alignment purposes.) */
d657 1
@


4.2.1.4
log
@Referenced the README file for an overview of the library.
@
text
@d30 1
a30 1
*   $Id: spc.h,v 4.2.1.3 2007/07/12 08:10:28 cal103 Exp cal103 $
a42 2
*   Refer to the README file provided with WCSLIB for an overview of the
*   library.
d44 2
a45 3
*
*   Summary of the spc* routines
*   ----------------------------
@


4.2.1.5
log
@Switched to LGPL 3.0.
@
text
@d2 29
a30 30

    WCSLIB 4.3 - an implementation of the FITS WCS standard.
    Copyright (C) 1995-2007, Mark Calabretta

    This file is part of WCSLIB.

    WCSLIB is free software: you can redistribute it and/or modify it under
    the terms of the GNU Lesser General Public License as published by the
    Free Software Foundation, either version 3 of the License, or (at your
    option) any later version.

    WCSLIB 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 Lesser General Public License for
    more details.

    You should have received a copy of the GNU Lesser General Public License
    along with WCSLIB.  If not, see <http://www.gnu.org/licenses/>.

    Correspondence concerning WCSLIB may be directed to:
       Internet email: mcalabre@@atnf.csiro.au
       Postal address: Dr. Mark Calabretta
                       Australia Telescope National Facility, CSIRO
                       PO Box 76
                       Epping NSW 1710
                       AUSTRALIA

    Author: Mark Calabretta, Australia Telescope National Facility
    http://www.atnf.csiro.au/~mcalabre/index.html
    $Id: spc.h,v 4.2.1.4 2007/08/08 08:40:48 cal103 Exp cal103 $
@


4.1
log
@WCSLIB 4.1: updated the prologue comments, particularly for spctyp(), also
fixing some errors; changed the function prototype for spctyp(); removed the
extern declarations for spc_ncode and spc_codes; changed #include of WCSLIB
headers from "" to <> form as required for installed header files.
@
text
@d3 1
a3 1
*   WCSLIB 4.1 - an implementation of the FITS WCS standard.
d30 1
a30 1
*   $Id: spc.h,v 4.0 2005/02/04 05:45:39 cal103 Exp cal103 $
d33 1
a33 1
*   WCSLIB 4.1 - C routines that implement the spectral coordinate systems
d602 1
a602 1
#include <spx.h>
@


4.0
log
@WCSLIB 4.0: changed from LGPL to GPL; added new functions: spchek(), spcspx(),
spcxps(), and spctrn(); added a new section to the prologue explaining the
spectral variable types; declare function prototypes directly without using
macros.
@
text
@d3 1
a3 1
*   WCSLIB 4.0 - an implementation of the FITS WCS standard.
d30 1
a30 1
*   $Id: spc.h,v 3.6 2004/08/25 04:21:33 cal103 Exp cal103 $
d33 1
a33 1
*   WCSLIB 4.0 - C routines that implement the spectral coordinate systems
d55 2
a56 2
*   A service routine, spcini(), is provided to initialize the spcprm struct
*   with default values, and another, spcprt(), to print its contents.
d86 2
a87 1
*   spcini() sets all members of a spcprm struct to default values.
d144 2
a145 1
*      sx,sspec int      Vector strides, see below.
d150 1
a150 1
*      spec     double[] Spectral coordinate, in SI units.
d175 2
a176 2
*      sspec    int
*      sx       int      Vector strides, see below.
d178 1
a178 1
*                        Spectral coordinate, in SI units.
d198 7
a204 2
*   and if so return information derived from it relating to the associated
*   S-, P-, and X-type spectral variables (explained below).
d212 10
a221 1
*      cname    char[]   Descriptive name of the S-type spectral variable.
d232 2
a233 1
*                        grisms in vacuo and air respectively.
d253 2
a254 1
*                           2: Invalid spectral parameters.
d260 1
a260 1
*   values and return information about the associated X-type spectral
d278 2
a279 2
*                        'VELO-F2V' -> 'ZOPT-F2W', but not required for
*                        'FREQ'     -> 'ZOPT-F2W'.
d329 2
a330 2
*                        'VELO-F2V' -> 'ZOPT-F2W', but not required for
*                        'FREQ'     -> 'ZOPT-F2W'.
d346 2
a347 2
*                        point, SI units.  Multiply the pixel spacing in the
*                        X-type spectral coordinate by this to get the CDELTia
d369 3
a371 1
*                        be reset).
d381 2
a382 2
*                        'VELO-F2V' -> 'ZOPT-F2W', but not required for
*                        'FREQ'     -> 'ZOPT-F2W'.
d398 3
d405 1
a405 1
*      cdeltS1  double   Increment of the new S-type spectral variable at the
d449 2
a450 1
*              quantities.
d511 3
a513 4
*                        which need be given, the other should be set to zero.
*                        Neither are required if the X and S spectral
*                        variables are both wave-characteristic, or both
*                        velocity-characteristic, types.
d602 1
a602 1
#include "spx.h"
a615 3
extern const int  spc_ncode;
extern const char spc_codes[15][4];

d668 2
a669 1
int spctyp(const char[], char[], char[], char *, char *, int *);
@


3.6
log
@WCSLIB 3.6: "error status/code/number" is now referred to consistently as the
"status return value"; removed support for K&R C.
@
text
@d3 2
a4 2
*   WCSLIB 3.6 - an implementation of the FITS WCS convention.
*   Copyright (C) 1995-2004, Mark Calabretta
d6 13
a18 13
*   This library is free software; you can redistribute it and/or modify it
*   under the terms of the GNU Library General Public License as published
*   by the Free Software Foundation; either version 2 of the License, or (at
*   your option) any later version.
*
*   This library 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 Library
*   General Public License for more details.
*
*   You should have received a copy of the GNU Library General Public License
*   along with this library; if not, write to the Free Software Foundation,
*   Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
d30 1
a30 1
*   $Id: spc.h,v 3.5 2004/06/28 01:48:38 mcalabre Exp mcalabre $
d33 2
a34 2
*   WCSLIB 3.6 - C routines that implement the spectral coordinate systems
*   recognized by the FITS World Coordinate System (WCS) convention.  Refer to
d40 1
a40 1
*      Greisen, E.W., Valdes, F.G., Calabretta, M.R., & Allen, S.L. 2004, A&A,
d46 41
a86 16
*   These routines are provided as drivers for the lower level spectral
*   transformation routines.  Separate routines, spcx2s() and spcs2x(),
*   perform the transformation in either direction.
*
*   An initialization routine, spcset(), computes intermediate values from
*   the transformation parameters but need not be called explicitly - see the
*   explanation of spc.flag below.
*
*   A service routine, spcini(), is provided to initialize the spcprm struct,
*   and another, spcprt(), to print its contents.
*
*
*   Initialization routine for the spcprm struct; spcini()
*   ------------------------------------------------------
*   This service routine may be used to set the members of a spcprm struct to
*   default values.
d100 1
a100 1
*   This service routine may be used to print the members of a spcprm struct.
d112 4
a115 4
*   Initialization routine; spcset()
*   --------------------------------
*   Initializes a spcprm data structure according to information supplied
*   within it (see "Spectral transformation parameters" below).
d118 2
a119 2
*   spcx2s() and spcs2x() if the "flag" structure member is anything other
*   than a predefined magic value.
d134 2
a135 1
*   Transform intermediate world coordinates to spectral coordinates.
d164 2
a165 1
*   Transforms spectral world coordinates to intermediate world coordinates.
d193 270
d470 1
a470 1
*         structure members are set or changed: code, type, crval, restfrq,
d475 1
a475 1
*         Four-letter spectral coordinate type, e.g "ZOPT" for
d485 6
a490 5
*      double restfrq
*         Rest frequency, Hz.
*
*      double restwav
*         Rest wavelength, m.
d508 3
a510 2
*            1: CRVALX (SI units).
*            2: CDELTX (SI units).
d516 2
a517 2
*      int (*spxx2q)(SPX_ARGS)
*      int (*spxq2s)(SPX_ARGS)
d519 1
a519 1
*         chain X -> Q -> S in the pixel-to-spectral direction.
d521 2
a522 2
*      int (*spxs2q)(SPX_ARGS)
*      int (*spxq2x)(SPX_ARGS)
d524 1
a524 1
*         chain S -> Q -> X in the spectral-to-pixel direction.
d527 2
a528 2
*   Vector length and strides
*   -------------------------
d604 1
a604 1
   char   type[8];		/* Four-letter spectral coordinate type.    */
d625 1
a625 1
				/*   2: CDELTX/CDELTia = dX/dw (SI units).  */
d630 2
a631 2
   int (*spxx2q)(SPX_ARGS);	/* Pointers to the transformation functions */
   int (*spxq2s)(SPX_ARGS);	/* in the two-step algorithm chain in the   */
d634 2
a635 2
   int (*spxs2q)(SPX_ARGS);	/* Pointers to the transformation functions */
   int (*spxq2x)(SPX_ARGS);	/* in the two-step algorithm chain in the   */
d643 12
a654 32
/* Use the preprocessor to define function prototypes. */
#ifdef SPCINI
#undef SPCINI
#endif

#ifdef SPCPRT
#undef SPCPRT
#endif

#ifdef SPCSET
#undef SPCSET
#endif

#ifdef SPCX2S
#undef SPCX2S
#endif

#ifdef SPCS2X
#undef SPCS2X
#endif

#define SPCINI struct spcprm *
#define SPCPRT const struct spcprm *
#define SPCSET struct spcprm *
#define SPCX2S struct spcprm *, int, int, int, const double[], double[], int[]
#define SPCS2X struct spcprm *, int, int, int, const double[], double[], int[]

int spcini(SPCINI);
int spcprt(SPCPRT);
int spcset(SPCSET);
int spcx2s(SPCX2S);
int spcs2x(SPCS2X);
@


3.5
log
@WCSLIB 3.5: renamed C-preprocessor macros INI, PRT, SET, X2S and S2X to
SPCINI, SPCPRT, SPCSET, SPCX2S and SPCS2X to reduce the likelihood of
namespace clashes; added the alternate version code to FITS WCS keywords
mentioned in comments.
@
text
@d3 1
a3 1
*   WCSLIB 3.5 - an implementation of the FITS WCS convention.
d30 1
a30 1
*   $Id: spc.h,v 3.4 2004/02/11 00:15:03 mcalabre Exp mcalabre $
d33 1
a33 1
*   WCSLIB 3.5 - C routines that implement the spectral coordinate systems
d68 1
a68 1
*               int      Error status
d82 1
a82 1
*               int      Error status
d101 1
a101 1
*               int      Error status
d123 1
a123 1
*      stat     int[]    Error status for each vector element:
d128 1
a128 1
*               int      Error status
d153 1
a153 1
*      stat     int[]    Error status for each vector element:
d158 1
a158 1
*               int      Error status
d252 3
a254 3
*   Error codes
*   -----------
*   Error messages to match the error codes returned from each function are
a285 6
#if !defined(__STDC__) && !defined(__cplusplus)
#ifndef const
#define const
#endif
#endif

a364 1
#if __STDC__ || defined(__cplusplus)
a369 7
#else
#define SPCINI
#define SPCPRT
#define SPCSET
#define SPCX2S
#define SPCS2X
#endif
d376 1
@


3.4
log
@WCSLIB 3.4: incremented the date of Paper III.
@
text
@d3 1
a3 1
*   WCSLIB 3.4 - an implementation of the FITS WCS convention.
d28 3
d33 1
a33 1
*   WCSLIB 3.4 - C routines that implement the spectral coordinate systems
d179 1
a179 1
*         CTYPEk = "ZOPT-F2W".  (Declared as char[8] for alignment reasons.)
d183 1
a183 1
*         CTYPEk = "ZOPT-F2W".
d186 1
a186 1
*         Reference value (CRVALk), SI units.
a274 3
*
*   Author: Mark Calabretta, Australia Telescope National Facility
*   $Id: spc.h,v 3.3 2003/10/21 08:51:00 mcalabre Exp mcalabre $
d314 1
a314 1
   double crval;		/* Reference value (CRVALk), SI units.      */
d332 1
a332 1
				/*   2: CDELTX/CDELTi = dX/dw (SI units).   */
d351 2
a352 2
#ifdef INI
#undef INI
d355 2
a356 2
#ifdef PRT
#undef PRT
d359 2
a360 2
#ifdef SET
#undef SET
d363 2
a364 2
#ifdef X2S
#undef X2S
d367 2
a368 2
#ifdef S2X
#undef S2X
d372 5
a376 5
#define INI struct spcprm *
#define PRT const struct spcprm *
#define SET struct spcprm *
#define X2S struct spcprm *, int, int, int, const double[], double[], int[]
#define S2X struct spcprm *, int, int, int, const double[], double[], int[]
d378 5
a382 5
#define INI
#define PRT
#define SET
#define X2S
#define S2X
d385 5
a389 5
int spcini(INI);
int spcprt(PRT);
int spcset(SET);
int spcx2s(X2S);
int spcs2x(S2X);
@


3.3
log
@WCSLIB 3.3
@
text
@d3 2
a4 2
*   WCSLIB 3.3 - an implementation of the FITS WCS convention.
*   Copyright (C) 1995-2003, Mark Calabretta
d30 1
a30 1
*   WCSLIB 3.3 - C routines that implement the spectral coordinate systems
d37 1
a37 1
*      Greisen, E.W., Valdes, F.G., Calabretta, M.R., & Allen, S.L. 2003, A&A,
d274 1
a274 1
*   $Id: spc.h,v 3.2 2003/09/09 04:04:04 mcalabre Exp mcalabre $
@


3.2
log
@WCSLIB 3.2: rationalized function return codes and messages.
@
text
@d3 1
a3 1
*   WCSLIB 3.2 - an implementation of the FITS WCS convention.
d30 1
a30 1
*   WCSLIB 3.2 - C routines that implement the spectral coordinate systems
d274 1
a274 1
*   $Id: spc.h,v 3.1 2003/04/28 03:50:41 mcalabre Exp mcalabre $
@


3.1
log
@WCSLIB 3.1
Added macro definition of SPCLEN.
@
text
@d3 1
a3 1
*   WCSLIB 3.1 - an implementation of the FITS WCS convention.
d30 1
a30 1
*   WCSLIB 3.1 - C routines that implement the spectral coordinate systems
d60 1
a60 1
*   Returned:
d67 1
d81 1
d100 2
a101 1
*                           1: Invalid spectral parameters.
d122 1
a122 1
*                           1: Invalid intermediate world coordinate.
d127 4
a130 3
*                           1: Invalid spectral parameters.
*                           2: One or more invalid intermediate world
*                              coordinates.
d152 1
a152 1
*                           1: Invalid spectral coordinate.
d157 4
a160 2
*                           1: Invalid spectral parameters.
*                           2: One or more invalid spectral coordinates.
d251 1
a251 1
*   Error messages to match the function return error code for all routines
d274 1
a274 1
*   $Id: spc.h,v 3.0 2003/04/01 04:03:42 mcalabre Exp mcalabre $
d293 6
a298 3
extern const char *spcset_errmsg[];
extern const char *spcx2s_errmsg[];
extern const char *spcs2x_errmsg[];
d344 1
a344 1
   int    padding;		/* (Dummy inserted for alignment purposes.) */
@


3.0
log
@WCSLIB 3.0
@
text
@d3 1
a3 1
*   WCSLIB 3.0 - an implementation of the FITS WCS convention.
d30 1
a30 1
*   WCSLIB 3.0 - C routines that implement the spectral coordinate systems
d268 1
a268 1
*   $Id$
d337 2
@
