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

Formatting Errors in NRS .pcf Files? #284

Open
Witchblade101 opened this issue Nov 17, 2022 · 3 comments
Open

Formatting Errors in NRS .pcf Files? #284

Witchblade101 opened this issue Nov 17, 2022 · 3 comments
Assignees

Comments

@Witchblade101
Copy link
Collaborator

In preparing the 0.19 release we ran into a problem reading .pcf files in generate_nirspec.py. @tonysohn discovered it was due to the coefficients being given one per line, instead of the expected 21 (There's a carriage return after each value instead of a space).

We need to correct the formatting of those lines in the pcf files and then verify the resulting generated products match what is included in PRDOPSSOC-059.

@Witchblade101 Witchblade101 self-assigned this Nov 17, 2022
@Witchblade101
Copy link
Collaborator Author

Tracked in JWSTSIAF-259

@Witchblade101
Copy link
Collaborator Author

Almost, but not quite. I'm sure I did something obviously wrong, but it's been a long day. After reformatting all of the coefficient lines in the pcf files I get the following error:

/Users/dlong/pysiaf/pysiaf/source_data/NIRSpec/delivery/delivery_SCA491toGWA.pcf
2022-06-09T07:22:36

Order 5 21  terms
Traceback (most recent call last):
  File "/Users/dlong/pysiaf/generate/generate_nirspec.py", line 703, in <module>
    pcf_data[field]['A'], pcf_data[field]['B'], pcf_data[field]['C'], pcf_data[field]['D'] = reorder(os.path.join(source_data_dir, pcf_file_mapping[field]), verbose=True)
  File "/Users/dlong/pysiaf/generate/generate_nirspec.py", line 384, in reorder
    xForward.append(float(text))  # f[k]
ValueError: could not convert string to float: '-0.13390975933434573 -1.5709931144966661e-06 -2.6516278899572355e-10 4.644617133484853e-14 -1.0320704138731455e-17 1.7502555480461746e-22 6.3703567076635e-05 7.0925284630839e-10 1.131975121490725e-13 -1.0143459108757772e-17 2.2968461937227943e-21 -5.030514031516839e-10 2.1476893011402986e-14 -1.630218218032348e-18 -1.5399978200293427e-22 3.8791365157221346e-14 -3.268835627552774e-18 1.1461092970650141e-22 1.4155988955092523e-17 1.2008665702134426e-22 -1.3340864454863128e-21\n'

@Witchblade101
Copy link
Collaborator Author

delivery_xxx.pcf files need one coefficient per line. Fore_xxx.pcf and OTE.pcf need all coefficients on a single line.

mfixstsci added a commit that referenced this issue Nov 22, 2022
PCF Reformatting for Issue #284 and JWSTSIAF-259
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

1 participant