CARTAvis / carta

To CARTA users, this repo holds the CARTA release packages. Please use this repo to log bugs and feature requests. These will be triaged by the development team and prioritised as necessary in the development cycles.
19 stars 0 forks source link

Feature Request: Scripted or Bulk Image Export #173

Open d3v-null opened 1 year ago

d3v-null commented 1 year ago

Hey there, I use Carta to make this animation of MWA Phase II compact data.

ezgif-3-fecfb7811f (1)

unfortunately, the only way I could figure out how to export the images involves navigating to each image, and manually exporting, then using a different program to turn it in to a gif.

I would like to apply the same process to a batch of thousands of images, so this won't be possible without automation.

I tried to use use the scripting interface, but when I try and export the image, I get the same image over and over, even though a different filename is logged to the console each time.

for (const frame of app.frames) {
  frame.setTitleCustomText(frame.filename);
  await app.setActiveFrame(frame);
  console.log(app.activeFrame.filename);
  await app.exportImage(1);
};

image

Any ideas?

Thanks

d3v-null commented 1 year ago

edit: I had some success with

var i = 0
for (const frame of app.frames) {
  frame.setTitleCustomText(frame.filename);
  await app.setActiveFrameByIndex(i);
  await new Promise(r => setTimeout(r, 1000));
  console.log(app.activeFrame.filename);
  await app.exportImage(1);
  i+=1;
};

but I don't have a lot of confidence that this solution will scale well.

Hopefully someone can point me towards a more optimal way of doing this.

kswang1029 commented 7 months ago

This should be straightforward with the python scripting interface (under development).