Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for SNAPHU v2.0.6 #728

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

comma-never-coma
Copy link

@comma-never-coma comma-never-coma commented May 31, 2023

I just replaced the source code from snaphu-v2.0.6 and made a few modifications based on the compilation format of snaphu-v1.4.2 to ensure that it can be successfully compiled. I haven't added any new parameters for snaphu-v2.0.6 yet.
I would be immensely grateful if someone could help with improvements or corrections.

@forrestfwilliams
Copy link
Contributor

Hey @comma-never-coma, which changes here are due to replacing the SNAPHU source code, and which are to ensure you can successfully compile? Are the changes in the include directory the compilation changes?

@comma-never-coma
Copy link
Author

comma-never-coma commented May 31, 2023

OK. First, obtain the source code for SNAPHU, which contains 8 *.c files and 2 *.h files in the src folder. Just replace them in the corresponding src and include folders of ISCE2. Next, u only need to modify snaphu.c – mainly replacing the main function located in line 69 with snaphu function reference to ISCE2, as shown below.

/***************************/
/* main program for snaphu */
/***************************/

int snaphu(infileT *infiles,outfileT *outfiles, paramT *params,long linelen) {

  /* variable declarations
  infileT infiles[1];
  outfileT outfiles[1];
  paramT params[1];
  time_t tstart;
  double cputimestart;
  long linelen, nlines;*/
	long nlines;


  /* get current wall clock and CPU time
  StartTimers(&tstart,&cputimestart);*/

  /* set output stream pointers (may be reset after inputs parsed) */
  SetStreamPointers();

  /* print greeting */
  fprintf(sp1,"\n%s v%s\n",PROGRAMNAME,VERSION);

  /* set default parameters */
  /*SetDefaults(infiles,outfiles,params);
  ReadConfigFile(DEF_SYSCONFFILE,infiles,outfiles,&linelen,params);*/

  /* parse the command line inputs */
  /*ProcessArgs(argc,argv,infiles,outfiles,&linelen,params);*/

  /* set verbose output if specified */
  SetVerboseOut(params);

  /* set names of dump files if necessary */
  SetDumpAll(outfiles,params);

  /* get number of lines in file */
  nlines=GetNLines(infiles,linelen,params);

  /* check validity of parameters */
  CheckParams(infiles,outfiles,linelen,nlines,params);

  /* log the runtime parameters */
  /*WriteConfigLogFile(argc,argv,infiles,outfiles,linelen,params);*/

  /* unwrap, forming tiles and reassembling if necessary */
  Unwrap(infiles,outfiles,params,linelen,nlines);

  /* finish up
  fprintf(sp1,"Program %s done\n",PROGRAMNAME);
  DisplayElapsedTime(tstart,cputimestart);
  exit(NORMAL_EXIT);*/

  return EXIT_SUCCESS;

} /* end of main() */

@yuankailiu
Copy link
Contributor

Hi, is this still under review/development? I wonder if there are any updates. Thanks.

@comma-never-coma
Copy link
Author

I apologize, but due to a change in my research focus, I have not been following this line of work for over half a year now.

@hfattahi
Copy link
Collaborator

hfattahi commented Apr 8, 2024

Sorry for getting to this so late. In the meantime we have a stand alone thin Snaphu wrapper here developed by @gmgunter which one could call in different isce2 workflows. I'm wondering if the better approach at this point will be to add dependency to snaphu_py and with a thin wrapper inside isce2, transform to latest snpahu? @rtburns-jpl @gmgunter what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants