8000 Add maude_kwargs by jeanconn · Pull Request #89 · sot/chandra_aca · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add maude_kwargs #89

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

Closed
wants to merge 2 commits into from
Closed

Add maude_kwargs #89

wants to merge 2 commits into from

Conversation

jeanconn
Copy link
Contributor

Add maude_kwargs

@jeanconn
8000
Copy link
Contributor Author

Needs tests.

@jeanconn
Copy link
Contributor Author

My first go at using this to get ASVT data in the range for the test bits failed as it looks like IMGTYPE=3. @mbaski is IMGTYPE=3 expected in the test data?

In [3]: ap = chandra_aca.maude_decom.get_aca_packets('2020:008:23:30:00.000', '2020:008:23:31:00.000', channel='ASVT')
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-3-65792ffbcad1> in <module>()
----> 1 ap = chandra_aca.maude_decom.get_aca_packets('2020:008:23:30:00.000', '2020:008:23:31:00.000', channel='ASVT')

/proj/sot/ska/jeanproj/git/chandra_aca/chandra_aca/maude_decom.py in get_aca_packets(start, stop, level0, combine, adjust_time, calibrate, **maude_kwargs)
    723         packets = _get_aca_packets(
    724             raw_aca_packets, t1, t2,
--> 725             combine=combine, adjust_time=adjust_time, calibrate=calibrate
    726         )
    727         aca_packets.append(packets)

/proj/sot/ska/jeanproj/git/chandra_aca/chandra_aca/maude_decom.py in _get_aca_packets(aca_packets, start, stop, combine, adjust_time, calibrate)
    753                            for p in aca_packets], [])
    754     else:
--> 755         aca_packets = [_combine_aca_packets([row]) for slot in aca_packets for row in slot]
    756     table = _aca_packets_to_table(aca_packets)
    757

/proj/sot/ska/jeanproj/git/chandra_aca/chandra_aca/maude_decom.py in <listcomp>(.0)
    753                            for p in aca_packets], [])
    754     else:
--> 755         aca_packets = [_combine_aca_packets([row]) for slot in aca_packets for row in slot]
    756     table = _aca_packets_to_table(aca_packets)
    757

/proj/sot/ska/jeanproj/git/chandra_aca/chandra_aca/maude_decom.py in _combine_aca_packets(aca_packets)
    396     pixels.data[:] = np.nan
    397     for f in aca_packets:
--> 398         pixels[_IMG_INDICES[f['IMGTYPE']][0], _IMG_INDICES[f['IMGTYPE']][1]] = f['pixels']
    399
    400     for f in aca_packets:

IndexError: list index out of range

@jeanconn jeanconn mentioned this pull request Jan 28, 2020
@jeanconn
Copy link
Contributor Author

@javierggt Do you agree the issue here a) that this is IMGTYPE=3 data and b) that doesn't index into IMG_INDICES? Also, how do you think that should be handled? Null pixel data or? The unhandled exception probably not the right thing.

@mbaski
Copy link
mbaski commented Jan 28, 2020

My first go at using this to get ASVT data in the range for the test bits failed as it looks like IMGTYPE=3. @mbaski is IMGTYPE=3 expected in the test data?

Not sure what IMGTYPE represents but AAPIXTLM only has values of 0, 1, and 2 in the data:

>> tlm = data_source_telemetry;
>> tlm.tlm_server_url = [fileparts(tlm.tlm_server_url) '/ASVT'];
>> tlm.time_start = time('2020:008:23:30');
>> tlm.time_end = time('2020:009:00:45');
>> [d,t] = tlm.get_data_by_name('AACAINT0');
>> bin = dec2bin(unique(d),16)

bin =

0000000001101010
0010000001101010
0110000001101010
1010000001101010

>> bin2dec(bin(:,1:2))

ans =

     0
     0
     1
     2

@jeanconn
Copy link
Contributor Author
jeanconn commented Jan 28, 2020

Thanks Mark. Sorry, I confused this issue. I was trying to look at the those header bits, but the decom we have in this module also tries to organize the pixel data. IMGTYPE is what we are calling the later word that is supposed to indicate for each slot if we are getting a 4x4, part of 6x6, or part of an 8x8. It also has a type=3 that indicates "memory download". That type=3 is unhandled in this decom code as far as I can tell and threw an exception. But, I suppose at this point I don't know if that is a problem with my first go at using the ASVT channel, if that is expected the way you are using the PEA, or if there could be another problem with this decom or my changes.

DS reports a little diff in the data with the dat file:

This is just an FYI - It looks like our code is matching the expected results except in one place. 38572 and 39736 don't FLAT for BGDTYP column I'm getting DYNB.

so simultaneous to double-checking that I figured I'd look at getting this decom code in order

@jeanconn
Copy link
Contributor Author

Sorry for the noise @mbaski, this IMGTYPE=3 was due to a bug I introduced; the decom code was getting some information from FLIGHT and some from ASVT and making a mess of it.

@mbaski
Copy link
mbaski commented Jan 28, 2020

No worries, glad you're making progress!

@javierggt
Copy link
Contributor

This seems fine to me. Nothing controversial. I would normally just call it kwargs because that is just the standard. If you ever decided to use any argument in there before passing it to maude, they will cease to be "maude kwargs" and would just be "kwargs."

Still, whatever the name I am ok with it.

@jeanconn
Copy link
Contributor Author
jeanconn commented Feb 7, 2020

Thanks @javierggt. I'm also fine with maude_kwargs or kwargs; went with maude_kwargs because that was @taldcroft 's suggestion and because all the (not specified) kwargs are going to maude at this point.

@jeanconn
Copy link
Contributor Author

Superseded by #90

@jeanconn jeanconn closed this Feb 13, 2020
@javierggt javierggt deleted the asvt branch February 27, 2023 14:29
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

Successfully merging this pull request may close these issues.

3 participants
0