Skip to content

Commit d4d218b

Browse files
authored
Merge pull request #27 from sfarrens/mr1d
mr1d
2 parents 11044ce + 484256a commit d4d218b

15 files changed

+5494
-17
lines changed

.travis.yml

+5-15
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,24 @@ addons:
1212
- cmake
1313
- pkgconfig
1414
- cfitsio
15+
update: true
1516

1617
matrix:
1718
include:
1819
- os: linux
1920
- os: osx
2021
name: "macOS with GCC"
21-
osx_image: xcode10.1
22+
osx_image: xcode10.2
2223
env:
2324
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
2425
addons:
2526
homebrew:
2627
packages:
2728
- gcc@7
2829
- *macos_packages
29-
- os: osx
30-
name: "macOS with vanilla Clang"
31-
osx_image: xcode10.1
32-
env:
33-
- MATRIX_EVAL="CC=/usr/local/opt/llvm/bin/clang && CXX=/usr/local/opt/llvm/bin/clang++"
34-
addons:
35-
homebrew:
36-
packages:
37-
- llvm
38-
- libomp
39-
- *macos_packages
4030
- os: osx
4131
name: "macOS with AppleClang"
42-
osx_image: xcode10.1
32+
osx_image: xcode10.2
4333
addons:
4434
homebrew:
4535
packages:
@@ -53,12 +43,12 @@ before_install:
5343
install:
5444
- mkdir build
5545
- cd build
56-
- cmake ..
46+
- cmake .. -DRUN_TESTS=OFF
5747

5848
# build package and install
5949
script:
6050
- make install
61-
- make test
51+
# - make test
6252

6353
# notification settings
6454
notification:

CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ project(sparse2d)
2323
endif()
2424
message(STATUS "Installing to: ${CMAKE_INSTALL_PREFIX}")
2525

26-
# Find OpenMP
2726
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
2827
set(OpenMP_INCLUDE_PATH "/usr/local/include")
2928
set(OpenMP_LIB_PATH "/usr/local/lib")
@@ -144,7 +143,9 @@ ${FFTW_FLAGS}"
144143

145144
# Compile and link executables
146145
set(BINMR2D mr_transform mr_recons mr_filter mr_deconv mr_info cur_contrast
147-
cur_deconv cur_filter cur_stat cur_trans)
146+
cur_deconv cur_filter cur_stat cur_trans im1d_convert im1d_info im1d_stf
147+
im1d_tfreq mr1d_detect mr1d_trans im1d_der_loggamma im1d_period im1d_tend
148+
mr1d_filter)
148149
if(SPARSE3D)
149150
set(BINMR2D ${BINMR2D} mr3d_trans mr3d_filter mr3d_recons mr3d_stat
150151
mr2d1d_trans)

src/im1d_convert.cc

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/******************************************************************************
2+
** Copyright (C) 1998 by CEA
3+
*******************************************************************************
4+
**
5+
** UNIT
6+
**
7+
** Version: 1.0
8+
**
9+
** Author: Jean-Luc Starck
10+
**
11+
** Date: 21/09/98
12+
**
13+
** File: im1d_convert.cc
14+
**
15+
*******************************************************************************
16+
**
17+
** DESCRIPTION
18+
** -----------
19+
**
20+
**
21+
**
22+
******************************************************************************/
23+
24+
25+
#include "Array.h"
26+
#include "IM_Obj.h"
27+
#include "IM1D_IO.h"
28+
29+
char Name_Imag_In[256];
30+
char Name_Imag_Out[256];
31+
32+
extern int OptInd;
33+
extern char *OptArg;
34+
35+
extern int GetOpt(int argc, char *const*argv, char *opts);
36+
37+
int NSkip=0;
38+
39+
/****************************************************************************/
40+
41+
static void usage(char *argv[])
42+
{
43+
44+
fprintf(stdout, "Usage: %s options image output\n\n", argv[0]);
45+
fprintf(stdout, " FITS format (.fits) \n");
46+
fprintf(stdout, " ACII format (.dat) \n");
47+
fprintf(stdout, " EXEL format (.csv) \n");
48+
49+
fprintf(stdout, " where options = \n");
50+
51+
fprintf(stdout, " [-s line_number_to_skip]\n");
52+
fprintf(stdout, " Skip the s first lines of the input file.\n");
53+
54+
fprintf(stdout, "\n");
55+
56+
exit(-1);
57+
}
58+
59+
/*********************************************************************/
60+
61+
/* GET COMMAND LINE ARGUMENTS */
62+
63+
static void transinit(int argc, char *argv[])
64+
{
65+
int c;
66+
67+
/* get options */
68+
while ((c = GetOpt(argc,argv,"s:")) != -1)
69+
{
70+
switch (c)
71+
{
72+
case 's':
73+
if (sscanf(OptArg,"%d",&NSkip) != 1)
74+
{
75+
fprintf(stdout, "bad number of lines: %s\n", OptArg);
76+
usage(argv);
77+
}
78+
break;
79+
case '?':
80+
usage(argv);
81+
}
82+
}
83+
84+
/* get optional input file names from trailing
85+
parameters and open files */
86+
if (OptInd < argc) strcpy(Name_Imag_In, argv[OptInd++]);
87+
else usage(argv);
88+
89+
if (OptInd < argc) strcpy(Name_Imag_Out, argv[OptInd++]);
90+
else usage(argv);
91+
92+
/* make sure there are not too many parameters */
93+
if (OptInd < argc)
94+
{
95+
fprintf(stdout, "Too many parameters: %s ...\n", argv[OptInd]);
96+
usage(argv);
97+
}
98+
}
99+
100+
101+
/****************************************************************************/
102+
103+
104+
int main(int argc, char *argv[])
105+
{
106+
fltarray Dat;
107+
fltarray Mallat;
108+
/* Get command line arguments, open input file(s) if necessary */
109+
transinit(argc, argv);
110+
111+
// Dat.fits_read(Name_Imag_In);
112+
io_1d_read_data (Name_Imag_In, Dat, NSkip);
113+
cout << endl << endl;
114+
115+
cerr << "CONVERT " << String1DFormat(io_detect_1dformat(Name_Imag_In));
116+
cerr << " to " << String1DFormat(io_detect_1dformat(Name_Imag_Out)) << endl;
117+
118+
io_1d_set_format(Name_Imag_Out);
119+
io_1d_write_data (Name_Imag_Out, Dat);
120+
121+
exit(0);
122+
}
123+

0 commit comments

Comments
 (0)