OGGM / oggm

Open Global Glacier Model
http://oggm.org
BSD 3-Clause "New" or "Revised" License
215 stars 104 forks source link

problem passing a reference t_star list to find_inversion_calving() #916

Open bearecinos opened 4 years ago

bearecinos commented 4 years ago

I just realise that if I want to use a reference t_star list in the calving module. I wont be able to pass that to the find_inversion_calving() function. I need to pass the argument ref_df to local_t_star() in order to instruct oggm to dont use the default list.

am I wrong here or we need to add a few things to the calving function?

matthiasdusch commented 4 years ago

If you run compute_ref_tstar on your reference glaciers it will write a 'ref_tstars.csv' to your working directory. This will then be used within local_t_star to derive the t_stars for your none-reference glaciers.

You have to set cfg.PARAMS['run_mb_calibration'] = True though

matthiasdusch commented 4 years ago

After some off-github discussion I'll extent my previous statement:

If you run the t_star calibration for the reference glaciers in the same instance with the calving simulations it should be fine to use the ref_tstars.csv from the working directory.

If you want to reuse the ref_tstars.csv in later runs without doing the calibration again, you could copy the file to the working directory. But the cleaner solution would be to load the csv-file as DataFrame and pass it to the local_t_star function within your calving function. Therefore you either need to load the file within the calving function or pass it as argument. Either way you are right, this would need a small addition to your function.

bearecinos commented 4 years ago

Thanks @matthiasdusch .. I am already running things by copying ref_tstars.csv to the working directory ... this ref_tstars.csv that I copy during every job are the result of the calibration using the ArcticDEM. For now the solution is fine, but I think that if in the future someone wants to use the calving function and needs to make a calibration they should be able to pass the result of such calibration to the module... I will modify things and make a pull request ... see what @fmaussion thinks...