Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: scripted interface - set rest frequency? #150

Open
keflavich opened this issue May 28, 2022 · 3 comments
Open

Question: scripted interface - set rest frequency? #150

keflavich opened this issue May 28, 2022 · 3 comments
Labels
question Further information is requested

Comments

@keflavich
Copy link

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
Copy link

veggiesaurus commented May 30, 2022

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
Copy link

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
Copy link
Author

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.

@kswang1029 kswang1029 added the question Further information is requested label Jun 1, 2022
@kswang1029 kswang1029 added this to CARTA Dec 6, 2023
@kswang1029 kswang1029 moved this to New issue in CARTA Dec 6, 2023
@kswang1029 kswang1029 removed this from CARTA Dec 6, 2023
@kswang1029 kswang1029 added this to CARTA Dec 6, 2023
@kswang1029 kswang1029 moved this to New issue in CARTA Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
No open projects
Status: New issues
Development

No branches or pull requests

4 participants