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

Question: scripted interface - set rest frequency? #150

Open keflavich opened 2 years ago

keflavich commented 2 years ago

Is there a way to set the rest frequency in the scripted interface? e.g.

await app.appendFile("file.fits")
await app.setRestFrequency('150GHz')

I didn't find any documentation on this; I'd be perfectly happy to be pointed at appropriate documentation if it exists.

veggiesaurus commented 2 years ago

Just looking at the code for the rest frequency section (I didn't write it, so perhaps @YuHsuan-Hwang has more insight):

const frame = await app.appendFile("file.fits");
frame.restFreqStore.setCustomUnit("GHz");
frame.restFreqStore.setCustomVal(150);

I'm looking at the rest frequency store code here

YuHsuan-Hwang commented 2 years ago

Just looking at the code for the rest frequency section (I didn't write it, so perhaps @YuHsuan-Hwang has more insight):

const frame = await app.appendFile("file.fits");
frame.restFreqStore.setCustomUnit("GHz");
frame.restFreqStore.setCustomVal(150);

I'm looking at the rest frequency store code here

Yes, this should work

keflavich commented 2 years ago

Thanks! This is really helpful. I think this would be a great example to add to the docs somewhere.

I think for those accustomed to using the console, this also shows how one would discover more editable attributes - I didn't know that you could store the result of app.appendFile in a frame variable, for example.