From ceea60abca65e22e5673560131a43423f0f5f86d Mon Sep 17 00:00:00 2001 From: matvii Date: Mon, 12 Sep 2016 15:22:14 +0300 Subject: [PATCH] Some minor tweaks --- 135_1.ini | 8 +++++--- 135_oct.ini | 9 +++++---- README.md | 2 +- adam.ini | 1 + fit_oct_model_to_LC_AO.c | 26 ++++++++++++++++---------- fit_subdiv_model_to_LC_AO.c | 25 ++++++++++++++++--------- globals.h | 1 + parse_ini.c | 7 +++++++ utils.c | 19 +++++++++++++++++++ utils.h | 1 + 10 files changed, 72 insertions(+), 27 deletions(-) diff --git a/135_1.ini b/135_1.ini index 5023145..fc6f483 100644 --- a/135_1.ini +++ b/135_1.ini @@ -64,7 +64,9 @@ EphFile=Hertha/ephm.dat #This file contains the ephemeris information c # as AO1 and A01) E0=[E0x E0y E0z] is the asteroid->Sun vector and E=[Ex Ey Ez] is asteroid->Earth vector [Output] -ShapeFile=/tmp/outshape.txt #Write the final shape to this file, in the usual format. -AnglesFile=/tmp/param_1 #Writes the final angles to this file. -LCOutputFile=/tmp/lcout.txt #Writes the final lightcurves to this file. +ShapeFile=Hertha_shape.txt #Write the final shape to this file, in the usual format. +ShapeObjFile=Hertha_shape.obj +StateFile=Hertha_state.txt +AnglesFile=Hertha_angles.txt #Writes the final angles to this file. +LCOutputFile=Hertha_lcout.txt #Writes the final lightcurves to this file. diff --git a/135_oct.ini b/135_oct.ini index d5cc5d7..8d1f502 100644 --- a/135_oct.ini +++ b/135_oct.ini @@ -64,7 +64,8 @@ EphFile=Hertha/ephm.dat #This file contains the ephemeris information c # as AO1 and A01) E0=[E0x E0y E0z] is the asteroid->Sun vector and E=[Ex Ey Ez] is asteroid->Earth vector [Output] -ShapeFile=/tmp/outshape.txt #Write the final shape to this file, in the usual format. -AnglesFile=/tmp/param_1 #Writes the final angles to this file. -LCOutputFile=/tmp/lcout.txt #Writes the final lightcurves to this file. -StateFile=/tmp/state.txt +ShapeFile=Hertha_shape.txt #Write the final shape to this file, in the usual format. +ShapeObjFile=Hertha_shape.obj #Shape file, in obj format +StateFile=Hertha_state.txt +AnglesFile=Hertha_angles.txt #Writes the final angles to this file. +LCOutputFile=Hertha_lcout.txt #Writes the final lightcurves to this file. diff --git a/README.md b/README.md index 089c767..3610f1d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ #ADAM: All-Data Asteroid Modelling -ADAM is a program for 3D shape reconstruction of asteroids from disk-resolved observations. Current version supports lightcurves, albedo variegation, adaptive optics, occultations, and range-Doppler radar images. Raw images are used directly, boundary extraction is not needed. Source code for thermal modelling is also included, but not currently integrated into main program due to lack of available observations (Juno is currently the only one). +ADAM is a program for 3D shape reconstruction of asteroids from disk-resolved observations. Current version supports lightcurves, albedo variegation, adaptive optics, occultations, and range-Doppler radar images. Raw images are used directly, boundary extraction is not required. Source code for thermal modelling is also included, but not currently integrated into main program. ##Required libraries - KissFFT (https://sourceforge.net/projects/kissfft) diff --git a/adam.ini b/adam.ini index 69ef241..9303553 100644 --- a/adam.ini +++ b/adam.ini @@ -90,5 +90,6 @@ ShapeFile=/tmp/OutputShape.txt #Write the final shape to this file, in the AnglesFile=/tmp/Angles.txt #Writes the final angles to this file. LCOutputFile=/tmp/lcout.txt #Writes the final lightcurves to this file. ShapeParamFile=/tmp/Pshape.txt #Parameters used for shape +ShapeObjFile=/tmp/state.obj #Write the final shape to this file, in obj format #RDOffsetFile=/tmp/RDoffset.txt #range-Doppler offset output file StateFile=/tmp/state.txt #Write all final parameters to this file diff --git a/fit_oct_model_to_LC_AO.c b/fit_oct_model_to_LC_AO.c index cb77b6e..a3e53c1 100644 --- a/fit_oct_model_to_LC_AO.c +++ b/fit_oct_model_to_LC_AO.c @@ -658,7 +658,13 @@ void fit_oct_model_to_LC_AO(LCstruct *LC,AOstruct *AO,OCstruct *OC,RDstruct *RD) } // printf("Offsets: %f %f %f %f\n",offset[0],offset[1],offset[2],offset[3]); + printf("Writing shape information to %s\n",OUT_SHAPE_FILE); write_shape_file(OUT_SHAPE_FILE,tlist,vlist,nfac,nvert); + if( OUT_OBJSHAPE_FILE!=NULL) + { + printf("Writing obj shape to: %s\n",OUT_OBJSHAPE_FILE); + write_obj_file(OUT_OBJSHAPE_FILE,tlist,vlist,nfac,nvert); + } FILE* fid=fopen(OUT_PARAM_FILE,"w"); FILE* fidlc=fopen(OUT_LC_FILE,"w"); if(fidlc!=NULL) @@ -692,7 +698,7 @@ void fit_oct_model_to_LC_AO(LCstruct *LC,AOstruct *AO,OCstruct *OC,RDstruct *RD) write_matrix_file(OUT_SHAPE_PARAM_FILE,a,1,alength); if(INI_WRITE_STATE_FILE!=NULL) { - printf("Writing state file:\n"); + printf("Writing state file %s:\n",INI_WRITE_STATE_FILE); FILE *fp; fp=fopen(INI_WRITE_STATE_FILE,"w"); if(fp==NULL) @@ -710,7 +716,7 @@ void fit_oct_model_to_LC_AO(LCstruct *LC,AOstruct *AO,OCstruct *OC,RDstruct *RD) } if(INI_FIT_ALBEDO==1) { - fprintf(fp,"#Albedo:\n"); + fprintf(fp,"#Albedo: %d\n",nfac); for(int j=0;j #include"structs.h" #include"wcstools-3.9.2/libwcs/fitsfile.h" +void write_obj_file(char *file,int *tlist,double *vlist,int nfac,int nvert); void AdjFacet(int *tlist,double *vlist,int nfac,int nvert,int *A); void localsmooth(int *tlist,double *vlist,int nfac,int nvert,double *ealb,double *Alim,double *res,double *drda); int parse_vector(char *string,double *vec,int maxlength);