Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SophyaExtLibs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab has been updated. More info
here
.
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
SOPHYA
SophyaExtLibs
Commits
c718542d
Commit
c718542d
authored
23 years ago
by
cmv
Browse files
Options
Downloads
Patches
Plain Diff
prog de test de xastropack cmv 29/11/01
parent
4eb101c2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
XAstroPack/Maketest
+18
-0
18 additions, 0 deletions
XAstroPack/Maketest
XAstroPack/exclude
+1
-0
1 addition, 0 deletions
XAstroPack/exclude
XAstroPack/tstxastro.cc
+117
-0
117 additions, 0 deletions
XAstroPack/tstxastro.cc
with
136 additions
and
0 deletions
XAstroPack/Maketest
0 → 100644
+
18
−
0
View file @
c718542d
MODULECXXREPNAME := CmvTests
MODULEDECCXXFLAGS := -msg_quiet
include $(DPCBASEREP)/Include/MakefileUser.h
LIBNEED := -L$(SLB) -lsophya -L$(LIB) -lFitsIOServer -L$(EXTLIBPATH) -lcfitsio
all: tstxastro
clean:
rm -f tstxastro
rm -f *.o
##############################################################################
tstxastro: tstxastro.o xastropack.o
$(LINK.cc) $^ -o $@ $(LOADLIBES) $(LIBS) $(LDLIBS)
tstxastro.o: tstxastro.cc
xastropack.o: xastropack.cc
##############################################################################
This diff is collapsed.
Click to expand it.
XAstroPack/exclude
+
1
−
0
View file @
c718542d
tstxastro.cc
This diff is collapsed.
Click to expand it.
XAstroPack/tstxastro.cc
0 → 100644
+
117
−
0
View file @
c718542d
// Test des possibilites de xastropack
#include
<stdio.h>
#include
<stdlib.h>
#include
<iostream.h>
#include
<string.h>
#include
<math.h>
#include
"xastropack.h"
/*==========================================================================*/
#if 0
// Test de InRange InRangeCoLat InRangeLat
int main(int narg, char *arg[])
{
if(narg<3) {
cout<<"usage: tstxastro range,vmax val,u"<<endl
<<" u = unite de val (h,d,r def=r)"<<endl;
return -1;
}
double range,vmax=-12345.6789;
sscanf(arg[1],"%lf,%lf",&range,&vmax);
if(vmax==-12345.6789) vmax = range/2.;
double val0,val; char unite='r';
sscanf(arg[2],"%lf,%c",&val0,&unite);
val = val0; InRange(&val,range);
printf("InRange(%.9f, %.2f) = %.9f\n",val0,range,val);
val = val0; InRange(&val,range,vmax);
printf("InRange(%.9f, %.2f, %.2f) = %.9f\n",val0,range,vmax,val);
unsigned long un;
if(unite=='h') un = TypUniteH;
else if(unite=='d') un = TypUniteD;
else un = TypUniteR;
val = val0; InRangeCoLat(&val,un);
printf("InRangeCoLat(%.9f %c) = %.9f\n",val0,unite,val);
val = val0; InRangeLat(&val,un);
printf("InRangeLat(%.9f %c) = %.9f\n",val0,unite,val);
return 0;
}
#endif
/*==========================================================================*/
#if 0
// Test de DecodeTypAstro
int main(int narg, char *arg[])
{
if(narg<2) {
cout<<"usage: tstxastro ctype"<<endl;
return -1;
}
cout<<"ctype = "<<arg[1]<<endl;
unsigned long typ = DecodeTypAstro(arg[1]);
string s = DecodeTypAstro(typ);
cout<<"typ = "<<typ<<" from "<<s<<endl;
cout<<"...TypCoordEq "<<(typ&TypCoordEq)<<endl;
cout<<"...TypCoordGal "<<(typ&TypCoordGal)<<endl;
cout<<"...TypCoordHor "<<(typ&TypCoordHor)<<endl;
cout<<"...TypCoordEcl "<<(typ&TypCoordEcl)<<endl;
cout<<"...TypCoord1H "<<(typ&TypCoord1H)<<endl;
cout<<"...TypCoord1D "<<(typ&TypCoord1D)<<endl;
cout<<"...TypCoord1R "<<(typ&TypCoord1R)<<endl;
cout<<"...TypCoord1C "<<(typ&TypCoord1C)<<endl;
cout<<"...TypCoord1L "<<(typ&TypCoord1L)<<endl;
cout<<"...TypCoord2H "<<(typ&TypCoord2H)<<endl;
cout<<"...TypCoord2D "<<(typ&TypCoord2D)<<endl;
cout<<"...TypCoord2R "<<(typ&TypCoord2R)<<endl;
cout<<"...TypCoord2C "<<(typ&TypCoord2C)<<endl;
cout<<"...TypCoord2L "<<(typ&TypCoord2L)<<endl;
unsigned long typu1 = GetCoordUnit(1,typ);
cout<<"\ntypu1 = "<<typu1<<endl;
cout<<"...TypCoordH "<<(typu1&TypUniteH)<<endl;
cout<<"...TypCoordD "<<(typu1&TypUniteD)<<endl;
cout<<"...TypCoordR "<<(typu1&TypUniteR)<<endl;
unsigned long typu2 = GetCoordUnit(2,typ);
cout<<"\ntypu2 = "<<typu2<<endl;
cout<<"...TypCoordH "<<(typu2&TypUniteH)<<endl;
cout<<"...TypCoordD "<<(typu2&TypUniteD)<<endl;
cout<<"...TypCoordR "<<(typu2&TypUniteR)<<endl;
return 0;
}
#endif
/*==========================================================================*/
#if 0
// Test de CoordConvertToStd
int main(int narg, char *arg[])
{
if(narg<2) {cout<<"usage: tstxastro ctype A,B"<<endl;return -1;}
double coord1_ini=0., coord2_ini=0.;
if(narg>2) sscanf(arg[2],"%lf,%lf",&coord1_ini,&coord2_ini);
printf("ctype = %s\n",arg[1]);
unsigned long typ = DecodeTypAstro(arg[1]);
string str = DecodeTypAstro(typ);
double coord1 = coord1_ini, coord2 = coord2_ini;
unsigned long newtyp = CoordConvertToStd(typ,&coord1,&coord2);
string newstr = DecodeTypAstro(newtyp);
printf("typ = %lo %s ==> newtyp = %lo %s\n"
,typ,str.c_str(),newtyp,newstr.c_str());
printf("coord1 %.6f ==> %.6f\n",coord1_ini,coord1);
printf("coord2 %.6f ==> %.6f\n",coord2_ini,coord2);
return 0;
}
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment