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

Operations as processing instructions don't work in granule list FDML #158

Open
lindholc opened this issue Oct 16, 2020 · 0 comments
Open

Comments

@lindholc
Copy link
Member

For example:

<?xml version="1.0" encoding="UTF-8"?>

<dataset id="nrl2_ssi_prelim_P1D">

  <source>
    <dataset>
      <adapter class="latis.input.FileListAdapter"
               pattern="ssi_v02r01-preliminary_daily_s(2020\d{4})_e\d{8}_c\d{8}.nc$"/>
      <source uri="file:///lisird/lasp/nrl2/v02r01-prelim_ncdc/"/>
      <function>
        <scalar id="time"
                units="yyyyMMdd"
                type="string"
                class="latis.time.Time"/>
        <scalar id="uri" type="string"/>
      </function>
    </dataset>
  </source>

  <adapter class="latis.input.GranuleListAppendAdapter">
    <adapter class="latis.input.NetcdfAdapter"/>
  </adapter>

  <function>
    <tuple>
      <scalar id="time"
              units="days since 1610-01-01"
              type="int"
              class="latis.time.Time"/>
      <scalar id="wavelength" type="double" units="nm"/>
    </tuple>
    <tuple>
      <scalar id="SSI" type="double" units="W/m^2/nm"/>
      <scalar id="SSI_UNC" type="double" units="W/m^2/nm"/>
    </tuple>
  </function>

  <?latis-operation expression="curry(1)"?>
</dataset>

Note that the model is correct when reading the dataset:

scala> FdmlReader.read(new java.net.URI("file:///.../nrl2_ssi_prelim_P1D.fdml"), validate=false)
val res9: latis.dataset.Dataset = nrl2_ssi_prelim_P1D: time -> wavelength -> (SSI, SSI_UNC)

But there's an error when we try to write the dataset:

scala> (new TextEncoder()).encode(res10).compile.toVector.unsafeRunSync()
java.util.NoSuchElementException: empty collection

The stack trace is just IO/Stream internals.

Using the curry operation from the REPL works fine.

Selections didn't work either, but they didn't throw an exception. I wonder if neither operation is being applied to the data, and the reason we only see an error with curry is that curry changes the model and a selection does not.

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