[PIPE2D-365] Interpolate between model templates Created: 20/Feb/19  Updated: 20/Dec/21  Resolved: 20/Dec/21

Status: Done
Project: DRP 2-D Pipeline
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Story Priority: Normal
Reporter: hassan Assignee: Takuji Yamashita
Resolution: Done Votes: 0
Labels: flux-calibration, model-templates
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File 1d_normal_results_4cases_example_wreference.png     PNG File 1d_normal_results_4cases_example_wreference_w390-410nm.png     PNG File 1d_normal_Teff_flux_L392.5_example.png     PNG File 1d_rbf_results_residual_7cases_example_epsilon2000_380-410.png     PNG File 1d_rbf_results_residual_7cases_example_epsilon2000.png     PNG File Linear3D_interpolation_residual_380-420.png     PNG File Linear3D_interpolation_residual.png     PNG File RBF3D_interpolation_MQepsilon2000_residual_380-420.png     PNG File RBF3D_interpolation_MQepsilon2000_residual.png     PNG File RBF3D_interpolation_MQepsilon2000_residual_yzoom.png     PNG File RBF3D_Teffd1000_original.png     PNG File RBF4D_interpolation_MQepsilon1000_residual.png     PNG File residual_SBS_RBF.png     PNG File SBS_Teff_logg_400nm.png    
Issue Links:
Blocks
blocks PIPE2D-461 Determine parameter resolutions of in... Done
is blocked by PIPE2D-511 Parameter interpolation of model temp... Done
is blocked by PIPE2D-364 Extrapolate the AMBRE library to 1260 nm Done
is blocked by PIPE2D-460 Evaluate the interpolations between m... Done
is blocked by PIPE2D-510 Evaluate the 2D RBF interpolation res... Done
is blocked by PIPE2D-537 Make a code to generate an RBF model,... Done
Story Points: 4
Sprint: 2DDRP-2019 E, 2DDRP-2019 F, 2DDRP-2019 G, 2DDRP-2019 H, 2DDRP-2019 I, 2DDRP-2019 J, 2DDRP-2019 K, 2DDRP-2020 A
Reviewers: hassan

 Description   

Provide a means of interpolating the AMBRE-derived model template data such that accurate model spectra for the candidate F-stars are determined.

The source code for the interpolation, along with documentation, should be provided under GitHub.



 Comments   
Comment by Takuji Yamashita [ 11/Jul/19 ]

I tried interpolations using some methods (1D, 3D Linear, 1D RBF, 3D RBF, 4D RBF) and compared the results with a reference model. The interpolations were done at a parameter point where we have a model.

 

1D

Results of 1D interpolation in the direction of the effective temperature (Teff).  The cubic spline interpolation is the best among the test cases. The accuracies are low around 400nm for all the cases.

 

3D Linear

A result of the interpolation with 3 parameters (Teff, log(g), and metallicity). The residual is 0.4 % (standard dev) for the full wavelength. The accuracy around 400nm still remains low (1.4% at 390-400nm).

 
I have not yet done the spline interpolations with >3 parameters because no module for higher dimensions is available. Now I am trying to do that by separating interpolations into each one parameter.
 

1D RBF

The radial basis function interpolation (scipy.interpolate.Rbf). Multiquadric, Inverse multiquadric, Gaussian, Thin plate reproduce the reference model well.

3D RBF

RBF interpolation with 3 parameters (Teff, log(g) and metallicity) using the multiquadric kernels as a test. The standard deviation of the residual is 0.2 % for the full wavelength and 1.2% at 390-400nm. This is better than the 3D linear interpolation. 

 

4D RBF

It is under investigation but a current RBF interpolation with 4 parameters including [alpha/Fe] is not good.

 
 
 
 

Comment by Takuji Yamashita [ 08/Aug/19 ]

Step-by-step interpolation

I tried a 2D interpolation in a step-by-step manner (SBS). First, a spectrum is interpolated only along Teff, and then it is interpolated along log(g). This method increases an amount of computation increase significantly, but I expected I would get a steady interpolation up to the fourth dimensions ([alpha/Fe]). 
 
This is an example of the result with SBS.  
The logg-Teff diagram shows model fluxes (circles) and fluxes of interpolated spectra (squares for the first interpolation along Teff, and a star for the final interpolation) at a fixed wavelength. 
The second figure shows the flux residual between interpolations of the SBS method and the RBF method along wavelengths. We can find the residual is significantly larger than that between RBF and a reference model. We cannot expect we get a better result of 3D interpolation with SBS. I switch back to the  RBF interpolation. 


 

3D RBF with Teff/1000

I am aware of a problem that the parameter step of Teff is remarkably larger than the others in the current RBF interpolation, although the RBFs are axisymmetric functions. As a test, I divide Teff by 1000 to roughly match its step with those of the others, and then I make an interpolation with 3D RBF (Teff, log(g), Z). The figures are flux residuals between the RBF interpolations and a reference model. The top panel is for a new RBF with the scaled-down Teff and the bottom is for the previous 3D RBF with the original Teff step. We got a better interpolation with a higher accuracy (stddev=0.015%). 

 

Comment by hassan [ 19/Sep/19 ]

From Takuji Yamashita: I decided to use 4D RBF interpolation. This works very well but takes much time (~100min/spectrum). Now I am trying to speed up while I am facing some technical problems. It needs more several days. I will close the ticket after finishing coding it.

Comment by Takuji Yamashita [ 20/Sep/19 ]

I pushed codes for this tickets to Git. The codes make an interpolated spectrum with 4D RBF interpolation (`scipy.interpolate.Rbf`) and `multiprocessing` module. The process takes ~60min/spectrum in a machine I use.

The bottleneck is a large number of pixels. Current models have a pixel scale of 0.01 nm. Because input templates can be smoothed with Gaussian Kernel of FWHM ~ 0.2 nm, we can use a larger pixel scale of 0.04 nm, for example. In this case, I expect the time is ~ 15min/spectrum.

The evaluation of the created interpolation spectra will be done in another ticket.

Comment by Takuji Yamashita [ 03/Oct/19 ]

Now the computing time was reduced to ~15min/spectrum using a new high-speed computer we recently purchased. I think it is reasonable.

I made two small tickets of PIPE2D-460 and PIPE2D-461 which block this ticket (PIPE2D-365). hassan, could you move these two tickets to the current sprint?

Comment by rhl [ 04/Oct/19 ]

Can you clarify whether this 15 min/spectrum is the time to fit the RBF to the models and interpolate to a set of parameters, or the time to interpolate to a new set of parameters once the interpolation schema is determined? In other words, how long does it take to interpolate 10 spectra if you do them all at once?

Comment by Takuji Yamashita [ 04/Oct/19 ]

The former. 

The RBF is fitted at a local parameter space, and therefore if I have 10 scattered sets of parameters, it takes 15min * 10; if I have 10 clustered sets (I can use the identical RBF for them), I think the time is shorter (but I have not yet tried that).

I am now trying to adjust a number of neighbor models to be used for interpolation. Processing time of the RBF fit is subject to it.

Comment by Takuji Yamashita [ 11/Oct/19 ]

Now, the processing time including RBF fit and interpolation is ~3min/spectrum on average. I reduced a number of neighbor spectra for an interpolation from ~250 to ~100 at the small expense of accuracy. The details will be provided in PIPE2D-460. I started the process for the evaluation.

Comment by Takuji Yamashita [ 17/Jan/20 ]

We were using 4D RBF interpolation. But I realized that we do not need 4D interpolation. We only need 2D, because we do not make small parameter steps along both metallicity and alpha elements. These original steps are small enough (the study of PIPE2D-461 ). 

I changed the code from 4D to 2D (only for temperature and surface gravity). The 2D interpolation is simpler and faster (~9 sec for an interpolation at a grid point). The mass process of the 2D interpolation has been done. Now I am re-calculating the accuracies. 

Comment by Takuji Yamashita [ 17/Jan/20 ]

I will report a result of the accuracies of 2D RBF in another ticket. Should I make a new ticket for that or use the closed ticket for 4D RBF (PIPE2D-460)?

Comment by Takuji Yamashita [ 20/Dec/21 ]

We can close this ticket to study the parameter interpolation of model templates because we have studied it and evaluated the results in PIEP2D-460. 

Generated at Sat Feb 10 15:52:07 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.