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

local variable 'primary_state' referenced before assignment #46

Open
MziyandaAstro opened this issue Feb 2, 2022 · 6 comments
Open

Comments

@MziyandaAstro
Copy link

Some of the measurementsets ( cfp2020_2a.ms and cfp2020_2b.ms) do not have a primary calibrator and the oxkat 1GC run returns this error:

[2022-02-02 05:43:09]: Examining cfp_2a_1024ch.ms
[2022-02-02 05:43:09]: Please wait...
[2022-02-02 05:43:09]: MS has 1024 channels
Traceback (most recent call last):
File "/data/mziyanda/sarao/MERGHERS/cfp2020_2a/oxkat/oxkat/1GC_00_setup.py", line 535, in
main()
File "/data/mziyanda/sarao/MERGHERS/cfp2020_2a/oxkat/oxkat/1GC_00_setup.py", line 379, in main
CAL_1GC_TARGET_INTENT)
File "/data/mziyanda/sarao/MERGHERS/cfp2020_2a/oxkat/oxkat/1GC_00_setup.py", line 165, in get_states
return primary_state, secondary_state, target_state, unknown_state
UnboundLocalError: local variable 'primary_state' referenced before assignment
****ELAPSED 43 SETUPcfp

Now, how do you get around this hurdle?

@IanHeywood
Copy link
Owner

I'd try to find and make use of a primary scan from a nearby observation somehow, although this might be tricky using the archive since it could belong to a project that you don't have permission to access. The SARAO ops team might be able to help. But this is a scheduling error not a bug, oxkat assumes all the necessary calibrators are present in the MS.

@IanHeywood
Copy link
Owner

Actually could you please post the msinfo*log output? It could be that a suitable primary is present, but hasn't been tagged with the correct intent. In which case the observation is more easily salvageable.

@MziyandaAstro
Copy link
Author

@IanHeywood I tried to diplay things nicely as you did, I didn't win. Hopefully this helps.
casa-20220202-141708.log

@IanHeywood
Copy link
Owner

Hi @MziyandaAstro, your source J0137+3309 is also known as 3C48, which should be known to CASA as a standard primary calibrator. It is presently tagged with an UNKNOWN intent. I would try changing this line in the config:

https://github.com/IanHeywood/oxkat/blob/master/oxkat/config.py#L178

to

CAL_1GC_PRIMARY_INTENT = 'UNKNOWN'

and running it again. Sources with unknown intents are actually picked up as potential primary calibrators, but oxkat also assumes that there is are scans with the standard CALIBRATE_BANDPASS intent present in addition. I'll reopen this, there might be some mileage in not bailing out if there are only scans with unknown intents.

For the MS info, if you're using the dev branch (which was actually merged into master yesterday) then the setup stage should produce a log file that captures what CASA's listobs does, e.g. msinfo_1641380698_sdp_l0_1024ch.ms.log.

@IanHeywood IanHeywood reopened this Feb 2, 2022
@ywjlee
Copy link

ywjlee commented Feb 29, 2024

Hi Ian, I ran into a similar issue when running submit_info_job with my data. I tried to change CAL_1GC_TARGET_INTENT to
CAL_1GC_TARGET_INTENT = 'UNKNOWN
or
CAL_1GC_TARGET_INTENT = 'None
as you mentioned above but it didn't solve the issue. Do you have any suggestion for me? Here is the log file for your reference.
slurm_INFO_045.log

@IanHeywood
Copy link
Owner

@ywjlee

This Measurement Set only has one scan in it, and it's of the primrary calibrator J1939. Was this intended?

29/02/2024 07:33:09  |       SCAN  SOURCE_ID  NAME                  LENGTH[s]         INTS        INTENT
29/02/2024 07:33:09  |       1     0          J1939-6342            142.0             71          None

If so then oxkat won't be able to process it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants